:root {
  --brand: #1A9A6B;
  --text: #333;
  --muted: #5b6b77;
  --line: #e6edf3;
  --bg-light: #F7F9F8;
  --footer-bg: #2c3e50;
  --menu-grid-width: 580px;
  --menu-grid-gap: 40px; 
  --menu-grid-cols: 1fr 1fr 1fr;
}
*{box-sizing:border-box} html,body{margin:0;padding:0}
body::before { content: ''; display: block; height: 4px; background-color: var(--brand); }
body{font:16px/1.6 system-ui,sans-serif;color:var(--text);background:#fff}
a{color:var(--brand);text-decoration:none} a:hover{text-decoration:underline}
img{max-width:100%;height:auto;display:block}
.container{max-width:1080px;margin:0 auto;padding:20px}
.skip-link { display: none; }

/* --- HEADER (최종 수정) --- */

.topbar{
  position:sticky; top:0; z-index:10; background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.util-bar {
    /* 3. 최대 너비 제한 및 중앙 정렬 */
    max-width: 1080px;
    margin: 0 auto;
    padding: 4px 20px;
    display: flex;
    justify-content: flex-end;
}
.util-nav { font-size: 0.8em; }
.util-nav a { color: var(--text); margin-left: 15px; }

.main-header-row {
    /* 2. 최대 너비 제한 및 중앙 정렬 */
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr; /* 로고와 메뉴 영역 분리 */
    align-items: center;
    gap: 80px; /* 1. 로고와 메뉴 간격 넓힘 */
    padding: 10px 20px;
    position: relative;
}
.logo { 
    display:flex;align-items:center;gap:12px;font-weight:700; font-size: 1.1rem;
}
.logo img{ width:50px; height:50px; }

.nav-container {
    justify-self: center; /* 메뉴 그룹을 할당된 공간 중앙에 배치 */
    position: relative;
}
.main-nav > ul {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    width: var(--menu-grid-width);
    grid-template-columns: var(--menu-grid-cols);
    gap: var(--menu-grid-gap);
}
.main-nav > ul > li > a {
    display: block; padding: 10px 0; font-weight: 700; font-size: 17px; color: var(--text);
    white-space: nowrap; text-align: left;
}
.nav-container:hover .main-nav a { 
    color: var(--brand);
}
.main-nav > ul > li > a.active { 
    color: var(--brand); box-shadow: 0 2px 0 var(--brand);
}


.submenu-panel {
    position: absolute; 
    top: 100%;
    left: 46%;
    transform: translateX(-50%);
    padding-top: 15px;
    opacity: 0; visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-container:hover .submenu-panel { 
    opacity: 1; visibility: visible; 
    transform: translate(-50%, 0); 
    pointer-events: auto; 
}
.submenu-wrapper {
    display: grid;
    width: var(--menu-grid-width) + 20px;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 85px;
    padding: 20px; /* 세로너비 */
    background-color: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 16px rgba(0,0,0,0.07);
    border-radius: 8px;
}
.submenu { list-style: none; padding: 0; margin: 0; }
.submenu a { display: block; padding: 6px 0; font-size: 0.95rem; color: var(--muted); white-space: nowrap; }
.submenu a:hover { color: var(--brand); }

/* 햄버거 메뉴 추가 */
.hamburger-btn {
    display: none; /* 평소에는 숨김 */
    background: none; border: none; cursor: pointer; padding: 10px; z-index: 1001;
}
.hamburger-btn span {
    display: block; width: 25px; height: 3px; background-color: var(--text);
    margin: 5px 0; transition: all 0.3s;
}

/* --- PAGE SPECIFIC STYLES --- */
/* greeting.html - 대표 인사말 페이지 전용 스타일 */
.greeting-card {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
}
.ceo-banner-photo {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin: 20px 0;
}
.section{padding:28px 0}
.card{border:1px solid var(--line);border-radius:12px;padding:16px;background:#fff; transition: transform 0.2s ease, box-shadow 0.2s ease;}
.card:hover {transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.07);}
.btn{display:inline-block;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:#fff; color: var(--text);}
.btn.primary{background:var(--brand);color:#fff;border-color:transparent}
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.service-grid .card { text-align: center; }
.icon-wrapper {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.service-icon-rect, .service-icon-square { max-height: 100%; }
.service-icon-rect { height: 48px; width: auto; }
.service-icon-square { width: 58px; height: 58px; }
/* --- HERO SLIDER (높이 오류 수정) --- */
/* styles.css 파일의 HERO SLIDER 섹션 */

.hero-slider{ 
    position:relative; 
    overflow:hidden; 
    min-height: 42vh; 
    width: 100%;
    max-width: 1080px; /* 3. 최대 너비 제한 추가 */
    margin: 0 auto;   /* 중앙 정렬 */
}

/* (이하 .hero-slider 관련 다른 스타일들은 그대로 유지) */
.hero-slider .hs-track{ 
    position: absolute;
    inset: 0;
    display:flex; 
    transition: transform 0.5s ease-in-out; 
}
.hero-slider .hs-item{ 
    flex:0 0 100%; 
    position:relative;
    height: 100%;
}
.hero-slider .hs-bg{ 
    position:absolute; 
    inset:0; 
    background-size:cover; 
    background-position:center; 
    z-index:1; 
}
.hero-slider .hs-bg::before {
    content: ''; 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)); 
    z-index: 2;
}
.hero-slider .hs-content{ 
    position:absolute; 
    z-index:3; 
    color:#fff; 
    text-shadow:0 2px 8px rgba(0,0,0,.35); 
    padding:20px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}
.hero-slider .hs-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    background: rgba(255,255,255,0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
}
.hero-slider .prev { left: 20px; }
.hero-slider .next { right: 20px; }

.site-footer { 
    background-color: var(--footer-bg); 
    color: #bdc3c7; 
    padding: 40px 20px; 
    font-size: 0.9rem; 
}
.site-footer .footer-inner { max-width: 1080px; margin: 0 auto; text-align: left; }
.site-footer .footer-info { margin-bottom: 8px; }
.site-footer .footer-links { margin-bottom: 20px; }
.site-footer .footer-copy { 
    text-align: center; margin-top: 30px; 
    padding-top: 20px; border-top: 1px solid #4a4a4a; font-size: 0.85rem; 
}
.site-footer a { 
    color: inherit; /* 링크 색상을 부모(회색)와 동일하게 통일 */
    text-decoration: none; 
}
.site-footer a:hover { 
    color: #fff; /* 마우스 올렸을 때만 밝게 표시 */
    text-decoration: underline; 
}
.site-footer .sep { color: #7f8c8d; margin: 0 10px;}
/* 데스크톱 기본: 완전 숨김 */
.mobile-nav-panel { 
  display: none;
}

@media (max-width: 1080px) {
  .nav-container { 
    display: none;
  }
  .hamburger-btn {
    display: block;
    grid-column: 3;
    justify-self: end;
  }
  .main-header-row {
    grid-template-columns: auto 1fr auto;
  }

  /* 모바일 메뉴 패널: 기본은 숨김 + 화면 밖 대기 */
  .mobile-nav-panel {
    /* display: block;  <-- 이 줄 삭제 */
    display: none;                /* 기본 숨김 */
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    padding: 80px 30px;
    transition: right 0.4s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  /* 열렸을 때만 보이게 */
  .mobile-nav-panel.is-open {
    display: block;
    right: 0;
  }

  .mobile-nav-panel ul { list-style: none; padding: 0; }
  .mobile-nav-panel > ul > li { margin-bottom: 20px; }
  .mobile-nav-panel > ul > li > a { font-weight: bold; font-size: 1.3rem; }
  .mobile-nav-panel .submenu { padding: 10px 0 0 15px; }
  .mobile-nav-panel .submenu a { color: var(--muted); font-size: 1rem; line-height: 2; }
}

/* cert.html - 인증서 갤러리 */
.cert-page-title { text-align: center; }
.cert-page-subtitle { font-size: 0.9rem; text-align: center; }
.cert-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0px;
}
.cert-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 4px; /* ← 기존 12px → 4px로 축소 */
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cert-item:hover {
    transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,.07);
}
.cert-item img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  margin: 0 auto 4px; /* ← 기존 10px → 4px로 축소 */
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
  cursor: pointer;
}
/* .cert-item figcaption {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
} */
.cert-item .cert-name { display: block; font-size: .9rem; font-weight: bold;
white-space: nowrap; /* 줄바꿈 방지 */
}
.cert-item .cert-meta { margin-top: 4px; font-size: .85rem; color: var(--muted);
white-space: nowrap; /* 줄바꿈 방지 */
}
/* 라이트박스 */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}
#lightbox.open { display: block; }
.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
}
.lb-inner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    max-width: min(90vw, 1100px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#lb-img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
}
#lb-cap {
    text-align: center;
    font-size: .9rem;
    color: #444;
}
.lb-close {
    position: absolute;
    right: -15px;
    top: -15px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 36px;
    box-shadow: 0 1px 6px rgba(0,0,0,.2);
}
/* cert.html 전용 컨테이너 조정 */
.container--wide  { max-width: 1240px; }           /* 가로 작업 여유 ↑ */
.container--tight { padding-left: 10px; padding-right: 10px; } /* 좌우 여백 ↓ */

/* 타일 내부 패딩만 살짝 축소해 이미지 폭 확보 (겉모습은 유지) */
.cert-item    { padding: 6px; }    /* 기존 12px → 6px */
.cert-item img{ margin-bottom: 6px; } /* 기존 10px → 6px */

/* 데스크톱에서 타일 자체가 더 넓어지도록 최소폭 상향 (gap은 그대로) */
@media (min-width: 1081px) {
  .cert-gallery { 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    /* 기존 250px → 260px : 칼럼 수는 유지하면서 각 칼럼 폭을 키움 */
  }
}
