/* ============================================================
   (주)대도 홈페이지 — 디자인 토큰 & 전역
   모바일 우선. 768px / 1024px 미디어쿼리로 확장.
   ============================================================ */
:root {
  --navy: #16365f;
  --navy-dark: #102a4a;
  --blue: #2e6bb0;
  --amber: #e8a33d;
  --amber-dark: #d18f2c;
  --bg: #f5f7fa;
  --white: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --danger: #c0392b;
  --ok: #1e7e4f;
  --shadow: 0 4px 16px rgba(22, 54, 95, 0.08);
  --radius: 10px;
  --header-h: 60px;
  --container: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--navy);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 8px 8px;
  z-index: 300;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ============================================================
   헤더 / 내비게이션
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(22, 54, 95, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 12px;
}

.logo img { width: 130px; height: auto; }

.gnb { display: none; }

.gnb > ul { display: flex; gap: 4px; }

.gnb > ul > li { position: relative; }

.gnb > ul > li > a {
  display: block;
  padding: 10px 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.gnb > ul > li > a:hover { color: var(--navy); background: var(--bg); text-decoration: none; }
.gnb > ul > li.active > a { color: var(--navy); font-weight: 700; }

/* 하위 메뉴 화살표 표시 */
.gnb > ul > li.has-sub > a::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s;
}
.gnb > ul > li.has-sub:hover > a::after,
.gnb > ul > li.has-sub.open > a::after {
  transform: translateY(2px) rotate(225deg);
}

/* 호버 이동 시 하위 메뉴가 닫히지 않도록 다리 영역 */
.gnb > ul > li.has-sub::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
}

.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(22, 54, 95, 0.16);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.submenu::before {
  /* 상단 화살표 장식 */
  content: "";
  position: absolute;
  top: -5px;
  left: 26px;
  width: 10px;
  height: 10px;
  background: var(--white);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu,
.has-sub.open > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.submenu a {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  border-radius: 6px;
  font-size: 15px;
  transition: background 0.12s, color 0.12s, padding-left 0.15s;
}
.submenu a:hover {
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  padding-left: 16px;
}
/* 서브메뉴 항목이 순차적으로 나타나는 애니메이션 */
.has-sub:hover > .submenu a,
.has-sub.open > .submenu a {
  animation: submenu-in 0.25s ease both;
}
.has-sub:hover > .submenu a:nth-child(1), .has-sub.open > .submenu a:nth-child(1) { animation-delay: 0.02s; }
.has-sub:hover > .submenu a:nth-child(2), .has-sub.open > .submenu a:nth-child(2) { animation-delay: 0.06s; }
.has-sub:hover > .submenu a:nth-child(3), .has-sub.open > .submenu a:nth-child(3) { animation-delay: 0.10s; }
.has-sub:hover > .submenu a:nth-child(4), .has-sub.open > .submenu a:nth-child(4) { animation-delay: 0.14s; }
.has-sub:hover > .submenu a:nth-child(5), .has-sub.open > .submenu a:nth-child(5) { animation-delay: 0.18s; }
@keyframes submenu-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- 3단계 서브메뉴 (예: 사업분야 > 계량포장자동화 > 제품) ---------- */
.submenu li { position: relative; }
.submenu .has-sub2 > a { padding-right: 30px; }
.submenu .has-sub2 > a::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.15s;
}
.submenu .has-sub2:hover > a::after,
.submenu .has-sub2:focus-within > a::after {
  transform: translateY(-50%) rotate(135deg);
}
.sub-submenu {
  position: absolute;
  left: calc(100% + 6px);
  top: -8px;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(22, 54, 95, 0.16);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.has-sub2:hover > .sub-submenu,
.has-sub2:focus-within > .sub-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
/* 화면 오른쪽 끝에서는 3단계 메뉴가 왼쪽으로 열림 */
.submenu li:nth-last-child(-n+2) .sub-submenu {
  left: auto;
  right: calc(100% + 6px);
}
.sub-submenu a {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.sub-submenu a:hover { background: var(--navy); color: #fff; text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 모바일 드로어 메뉴 */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--white);
  overflow-y: auto;
  z-index: 190;
  padding: 8px 16px 40px;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1);
  box-shadow: -12px 0 30px rgba(16, 42, 74, 0.12);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu[hidden] { display: none; }

.mobile-menu .mm-title {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .mm-title::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 400;
}
.mobile-menu .mm-title[aria-expanded="true"]::after { content: "−"; }

.mobile-menu li ul { display: none; padding: 4px 0 12px 8px; }
.mobile-menu li ul.open { display: block; }
.mobile-menu li ul a {
  display: block;
  padding: 10px 8px;
  color: var(--text);
  border-radius: 6px;
}
.mobile-menu li ul a:hover { background: var(--bg); color: var(--navy); text-decoration: none; }

.mm-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.mm-links a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  font-size: 14px;
}
.mm-links a:hover { border-color: var(--navy); text-decoration: none; }

/* ============================================================
   버튼 / 배지
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #26598f; color: #fff; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover { background: var(--amber-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--bg); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.badge-blue { background: #e3edf8; color: var(--blue); }
.badge-amber { background: #fdf3e2; color: var(--amber-dark); }
.badge-ok { background: #e4f3ea; color: var(--ok); }
.badge-danger { background: #f9e7e5; color: var(--danger); }

/* ============================================================
   서브페이지 타이틀 바
   ============================================================ */
.page-title {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 44px 0 40px;
}
.page-title h1 { font-size: 26px; font-weight: 700; }
.page-title .crumb { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.page-title .crumb a { color: rgba(255, 255, 255, 0.75); }
.page-title .crumb a:hover { color: #fff; }

.page-body { padding: 40px 0 72px; }

/* ============================================================
   섹션 공통
   ============================================================ */
.section { padding: 56px 0; }
.section.bg-gray { background: var(--bg); }

.section-head { text-align: center; margin-bottom: 32px; }
.section-head .kicker {
  display: inline-block;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-head h2 { font-size: 26px; color: var(--navy); margin-top: 4px; }
.section-head p { color: var(--muted); margin-top: 8px; font-size: 15px; }

.prose { max-width: 860px; margin: 0 auto; }
.prose h2 {
  font-size: 22px;
  color: var(--navy);
  margin: 40px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--amber);
}
.prose h3 { font-size: 18px; color: var(--navy); margin: 28px 0 8px; }
.prose p { margin: 10px 0; }
.prose ul.checks { margin: 12px 0 12px 4px; }
.prose ul.checks li {
  position: relative;
  padding-left: 26px;
  margin: 8px 0;
}
.prose ul.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 14px;
  height: 7px;
  border-left: 2px solid var(--amber);
  border-bottom: 2px solid var(--amber);
  transform: rotate(-45deg);
}
.prose .note {
  background: #fdf3e2;
  border-left: 4px solid var(--amber);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  font-size: 15px;
}
.prose img.rounded { border-radius: var(--radius); box-shadow: var(--shadow); }

/* 카드 */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(22, 54, 95, 0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-img { aspect-ratio: 4 / 3; background: var(--bg); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; }
.card-body h3 { font-size: 17px; color: var(--navy); }
.card-body p { font-size: 14px; color: var(--muted); margin-top: 6px; }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* 테이블 (스펙표) — 모바일에서 가로 스크롤 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0; }
table.spec {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
}
table.spec th, table.spec td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
table.spec thead th { background: var(--navy); color: #fff; font-weight: 500; }
table.spec tbody th { background: #eef2f7; color: var(--navy); width: 160px; font-weight: 500; }

/* 연혁 타임라인 */
.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.timeline-item { position: relative; padding: 0 0 26px 18px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--amber);
}
.timeline-year {
  display: inline-block;
  font-weight: 700;
  color: var(--navy);
  font-size: 17px;
  margin-bottom: 2px;
}
.timeline-item p { color: var(--text); font-size: 15px; }

/* ============================================================
   메인 페이지
   ============================================================ */
.hero { position: relative; height: 380px; overflow: hidden; background: var(--navy); }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  background-size: cover;
  background-position: center;
}
.hero-slide.active {
  opacity: 1;
  animation: kenburns 7.5s ease-out forwards;
}
/* 동영상 슬라이드는 확대 효과 제외 (data-video 속성이 있는 슬라이드) */
.hero-slide.active[data-video] {
  animation: none;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 42, 74, 0.75) 0%, rgba(16, 42, 74, 0.25) 60%, transparent 100%);
}
.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56px;
  color: #fff;
  z-index: 2;
}
.hero-slide.active .hero-caption h2 { animation: hero-title-in 0.7s 0.25s ease both; }
.hero-slide.active .hero-caption p { animation: hero-title-in 0.7s 0.45s ease both; }
@keyframes hero-title-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-caption h2 { font-size: 28px; line-height: 1.35; }
.hero-caption p { margin-top: 8px; font-size: 15px; color: rgba(255, 255, 255, 0.85); }

/* 히어로 배경 동영상: 박스를 꽉 채우도록 확대 (비율 유지, object-fit: cover 효과)
   정확한 크기·위치(top/center/bottom)는 main.js의 fitHeroVideo()가 계산 */
.hero-video {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  background: #000 url("../img/main/hero2.jpg") center / cover no-repeat;  /* 영상 시작 전 포스터 이미지 */
}
.hero-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;               /* 기본값: 박스 전체 (JS가 로드되면 cover 비율로 정밀 조정) */
  height: 100%;
  border: 0;
  pointer-events: none;      /* 동영상 조작 막고 캡션 클릭 보장 */
  opacity: 0;                /* 로딩 중 유튜브 재생 버튼 가림 → JS가 재생 시작 후 표시 */
  transition: opacity 0.6s ease;
}
.hero-video.playing iframe { opacity: 1; }

/* 동영상 어둡게 하는 덮개 (config.HERO_VIDEO.overlay) */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* 히어로 우측 하단 텍스트 (설치업체 등 — config.HERO_VIDEO.credit) */
.hero-credit {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.hero-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.hero-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  padding: 0;
}
.hero-dots button.active { background: var(--amber); width: 24px; border-radius: 6px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: -36px;
  position: relative;
  z-index: 3;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 12px;
  text-align: center;
  border-top: 3px solid var(--amber);
}
.stat-card strong { display: block; font-size: 26px; color: var(--navy); }
.stat-card span { font-size: 14px; color: var(--muted); }

/* ---------- 기존 사이트 스타일 카운터 밴드 ---------- */
.stat-band {
  position: relative;
  margin-top: 56px;
  padding: 64px 0;
  background: var(--navy) url("../img/main/counter_back.jpg") center / cover no-repeat;
}
.stat-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 74, 0.85);
}
.stat-band .stat-row {
  position: relative;
  z-index: 1;
  margin-top: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-band .stat-card {
  background: transparent;
  box-shadow: none;
  border-top: none;
  padding: 8px 12px;
}
.stat-band .stat-card + .stat-card { border-left: 1px solid rgba(255, 255, 255, 0.25); }
.stat-band .stat-card strong {
  color: #fff;
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.stat-band .stat-card span { color: var(--amber); font-size: 17px; letter-spacing: 0.08em; }
.stat-band .stat-card p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.6;
}
.stat-go {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 16px;
  border: 1px solid rgba(232, 163, 61, 0.65);
  border-radius: 999px;
  color: var(--amber);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.stat-go:hover { background: var(--amber); color: #fff; text-decoration: none; }
@media (min-width: 768px) {
  .stat-band .stat-card strong { font-size: 62px; }
  .stat-band .stat-card span { font-size: 19px; }
}

/* ---------- 우측 플로팅 빠른 상담 (스크롤 따라다님) ---------- */
.quick-float {
  position: fixed;
  right: 14px;
  bottom: 130px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.quick-float.show { opacity: 1; visibility: visible; transform: translateY(0); }
.qf-btn {
  width: 58px;
  height: 58px;
  border-radius: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(16, 42, 74, 0.25);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: width 0.25s ease, background 0.2s, transform 0.15s;
}
/* 호버: 라벨 펼쳐지며 버튼 확장 */
.qf-icon { flex: none; }
.qf-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.25s ease, opacity 0.2s ease;
}
.qf-btn:hover {
  text-decoration: none;
  animation: none;
  transform: translateX(-2px);
}
.qf-btn:hover .qf-label { max-width: 130px; opacity: 1; }
.qf-kakao { background: #fee500; color: #3c1e1e; }
.qf-kakao:hover { width: 170px; }
.qf-naver { background: #03c75a; }
.qf-naver:hover { width: 140px; }
.qf-call { background: var(--navy); }
.qf-call:hover { width: 122px; }
.qf-top { background: rgba(16, 42, 74, 0.88); }
.qf-top:hover { width: 112px; }
@keyframes qf-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(16, 42, 74, 0.25), 0 0 0 0 rgba(254, 229, 0, 0.55); }
  50% { box-shadow: 0 6px 18px rgba(16, 42, 74, 0.25), 0 0 0 12px rgba(254, 229, 0, 0); }
}
.quick-float.show .qf-kakao { animation: qf-pulse 2.2s ease-out infinite; }

/* ---------- 제품 아코디언 (누르면 내용 표시) ---------- */
.product-acc {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(22, 54, 95, 0.06);
  margin-bottom: 18px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.product-acc[open] { border-color: var(--blue); box-shadow: var(--shadow); }
.product-acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  user-select: none;
}
.product-acc summary::-webkit-details-marker { display: none; }
.product-acc summary::after {
  content: "+";
  flex: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--blue);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.product-acc[open] summary::after {
  content: "−"; /* 열림 상태: 접기 아이콘 */
  background: var(--navy);
  color: #fff;
}
.product-acc[open] summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 20px; }
.product-acc[open] .acc-body { animation: acc-in 0.3s ease; }
@keyframes acc-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   메인 이미지 메뉴 (호버 시 하위 메뉴 오버레이)
   ============================================================ */
.menu-section { padding-top: 40px; }
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.menu-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
  cursor: pointer;
}
/* 카드 배경 이미지 줌 효과 */
.menu-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.menu-card:hover::before { transform: scale(1.08); }

.menu-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, transparent 30%, rgba(16, 42, 74, 0.82) 100%);
  z-index: 1;
  transition: opacity 0.25s ease;
}
.menu-card-content h3 { color: #fff; font-size: 20px; font-weight: 700; }
.menu-card-content p { color: rgba(255, 255, 255, 0.75); font-size: 13px; margin-top: 2px; }

/* 호버 시 나타나는 하위 메뉴 오버레이 */
.menu-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 42, 74, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.menu-card:hover .menu-card-overlay,
.menu-card:focus-within .menu-card-overlay,
.menu-card.tap-open .menu-card-overlay {
  opacity: 1;
  visibility: visible;
}
.menu-card-overlay ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  padding: 8px;
}
.menu-card-overlay a {
  display: block;
  color: #fff;
  padding: 8px 14px;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.menu-card-overlay a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}
/* 오버레이 링크 순차 등장 */
.menu-card:hover .menu-card-overlay a,
.menu-card.tap-open .menu-card-overlay a {
  animation: submenu-in 0.28s ease both;
}
.menu-card:hover .menu-card-overlay a:nth-child(1), .menu-card.tap-open .menu-card-overlay a:nth-child(1) { animation-delay: 0.03s; }
.menu-card:hover .menu-card-overlay a:nth-child(2), .menu-card.tap-open .menu-card-overlay a:nth-child(2) { animation-delay: 0.08s; }
.menu-card:hover .menu-card-overlay a:nth-child(3), .menu-card.tap-open .menu-card-overlay a:nth-child(3) { animation-delay: 0.13s; }
.menu-card:hover .menu-card-overlay a:nth-child(4), .menu-card.tap-open .menu-card-overlay a:nth-child(4) { animation-delay: 0.18s; }
.menu-card:hover .menu-card-overlay a:nth-child(5), .menu-card.tap-open .menu-card-overlay a:nth-child(5) { animation-delay: 0.23s; }

/* 터치 기기: 호버 대신 탭으로 오버레이 열기 */
.menu-card-overlay { cursor: default; }

/* ============================================================
   스크롤 리빌 애니메이션
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
/* 그리드 안 항목은 살짝 순차로 (JS가 지연값 부여) */
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-slide.active, .hero-slide.active .hero-caption h2,
  .hero-slide.active .hero-caption p, .has-sub:hover > .submenu a {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 카드 이미지 줌 (공통) */
.card-img img { transition: transform 0.45s ease; }
.card:hover .card-img img { transform: scale(1.06); }

.partner-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
}
.partner-list a { filter: grayscale(1); opacity: 0.75; transition: all 0.2s; }
.partner-list a:hover { filter: none; opacity: 1; }
.partner-list img { height: 34px; width: auto; }

/* ============================================================
   게시판 (목록/상세)
   ============================================================ */
.board-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.tabs a:hover { text-decoration: none; border-color: var(--blue); color: var(--blue); }
.tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery-card { display: block; color: inherit; }
.gallery-card:hover { text-decoration: none; }
.gallery-card .card-img { aspect-ratio: 3 / 4; }
.gallery-card .card-body { padding: 12px; }
.gallery-card h3 { font-size: 15px; }

.video-card { position: relative; display: block; color: inherit; }
.video-card:hover { text-decoration: none; }
.video-card .card-img { aspect-ratio: 16 / 9; position: relative; }
.video-card .card-img::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #fff;
  background: rgba(16, 42, 74, 0.25);
  opacity: 0;
  transition: opacity 0.15s;
}
.video-card:hover .card-img::after { opacity: 1; }

.board-detail { max-width: 900px; margin: 0 auto; }
.board-detail h1 { font-size: 24px; color: var(--navy); margin-bottom: 10px; }
.board-meta { color: var(--muted); font-size: 14px; margin-bottom: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

.cert-viewer img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 16px;
  cursor: zoom-in;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 24px;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.board-empty { text-align: center; padding: 64px 0; color: var(--muted); }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination .page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.pagination a:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.pagination .page-current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }

/* ============================================================
   폼
   ============================================================ */
.form-box { max-width: 680px; margin: 0 auto; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 15px; }
.form-row label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 107, 176, 0.15);
}
.textarea { min-height: 160px; resize: vertical; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

.form-note { font-size: 13px; color: var(--muted); margin-top: 4px; }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
}
.radio-group input[type="radio"] { accent-color: var(--blue); width: 17px; height: 17px; }

.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; }
.check-row input[type="checkbox"] { accent-color: var(--blue); width: 17px; height: 17px; margin-top: 4px; }

.file-input {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
}
.file-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-family: inherit;
  cursor: pointer;
}

/* 봇만 채우는 숨김 필드 */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ============================================================
   라이트박스 (인증서 이미지 확대)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, 0.92);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 6px;
  cursor: default;
}
.lightbox .lb-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

/* ============================================================
   플래시 메시지
   ============================================================ */
.flash-list { max-width: var(--container); margin: 16px auto 0; padding: 0 16px; }
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 15px;
}
.flash.ok { background: #e4f3ea; color: var(--ok); border: 1px solid #b9e0c9; }
.flash.error { background: #f9e7e5; color: var(--danger); border: 1px solid #efc9c4; }

/* ============================================================
   관리자
   ============================================================ */
.admin-login {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px 16px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  width: 100%;
  max-width: 400px;
}
.login-card h1 { font-size: 22px; color: var(--navy); text-align: center; margin-bottom: 24px; }

.admin-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 16px auto 24px;
  max-width: var(--container);
  padding: 0 16px;
}
.admin-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  background: var(--white);
  border: 1px solid var(--line);
}
.admin-nav a:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.admin-nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-tile strong { display: block; font-size: 30px; color: var(--navy); }
.stat-tile span { color: var(--muted); font-size: 14px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--white); }
.admin-table th, .admin-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}
.admin-table thead th { background: #eef2f7; color: var(--navy); white-space: nowrap; }
.admin-table .thumb-cell img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table .actions form { display: inline; }

.admin-actions { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 16px; }

/* ============================================================
   에러 페이지
   ============================================================ */
.error-page { text-align: center; padding: 100px 16px; }
.error-page h1 { font-size: 64px; color: var(--navy); }
.error-page p { color: var(--muted); margin: 12px 0 28px; }

/* ============================================================
   푸터
   ============================================================ */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  padding: 44px 0 0;
}
.footer-top { display: grid; gap: 32px; padding-bottom: 28px; }
.footer-logo { display: block; color: #fff; font-size: 20px; margin-bottom: 10px; }
.footer-info p { margin: 6px 0; }
.footer-info a { color: rgba(255, 255, 255, 0.9); }
.footer-hours { color: var(--amber); }

.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.footer-links a { color: rgba(255, 255, 255, 0.75); }
.footer-links a:hover { color: #fff; }
.footer-links li { margin: 4px 0; }
.footer-external a { color: rgba(255, 255, 255, 0.55); font-size: 13px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-policy { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-policy a { color: rgba(255, 255, 255, 0.75); }
.footer-policy a:hover { color: #fff; }
.copyright { color: rgba(255, 255, 255, 0.45); font-size: 13px; }

/* ============================================================
   반응형 확장
   ============================================================ */
@media (min-width: 768px) {
  :root { --header-h: 68px; }
  .container { padding: 0 24px; }
  .logo img { width: 150px; }
  .page-title { padding: 56px 0 52px; }
  .page-title h1 { font-size: 32px; }
  .section { padding: 72px 0; }
  .section-head h2 { font-size: 30px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .stat-tiles { grid-template-columns: repeat(4, 1fr); }
  .hero { height: 460px; }
  .hero-caption h2 { font-size: 36px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-card-content h3 { font-size: 22px; }
  .footer-top { grid-template-columns: 1.2fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 1024px) {
  .gnb { display: block; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
  .card-grid { grid-template-columns: repeat(4, 1fr); }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .menu-card { aspect-ratio: 16 / 9; }
  .hero { height: 520px; }
  .hero-caption h2 { font-size: 42px; }
  .page-body { padding: 56px 0 88px; }
  .prose h2 { font-size: 24px; }
}
