/* ============================================================
   공통 컴포넌트: Header / Footer / Subpage Banner
   partials/header.html, partials/footer.html, partials/subpage-banner.html 와 짝을 이룸.
   ============================================================ */

/* ---------------- 6단계 문제 해결 과정 타임라인 (programs/index.html, join/index.html 공용) ---------------- */
.step-track {
  position: relative; max-width: var(--container-max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2,1fr); gap: 28px 20px;
}
@media (min-width: 640px) { .step-track { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 1080px) { .step-track { grid-template-columns: repeat(6,1fr); column-gap: 16px; } }
@media (min-width: 1080px) {
  .step-track::before {
    content: ''; position: absolute; top: 36px; left: 64px; right: 64px; height: 2px;
    background: var(--hair); z-index: 0;
  }
}
.step-item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.step-item__badge { width: 56px; height: 56px; flex-shrink: 0; }
@media (min-width: 1080px) { .step-item__badge { width: 72px; height: 72px; } }
.step-item__badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.step-item__title { font-size: 15px; font-weight: 800; color: var(--ink); }
@media (min-width: 768px) { .step-item__title { font-size: 16px; } }
.step-item__desc { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); max-width: 210px; }

/* STEP 1 배지 바로 위에 오도록, step-track과 완전히 같은 grid(2/3/6열)를 공유해 1번째 칸에만 내용을 배치 */
.process-pre-step {
  max-width: var(--container-max); margin: 0 auto 4px;
  display: grid; grid-template-columns: repeat(2,1fr); gap: 28px 20px;
}
@media (min-width: 640px) { .process-pre-step { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 1080px) { .process-pre-step { grid-template-columns: repeat(6,1fr); column-gap: 16px; } }
.process-pre-step__label {
  grid-column: 1; font-weight: 800; font-size: 15px; color: var(--ink);
}
.process-pre-step__label b { color: var(--teal); font-weight: 800; }
.process-pre-step__desc {
  grid-column: 1; font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin-top: 2px;
}
.process-pre-step__arrow {
  grid-column: 1; text-align: center; font-size: 30px; font-weight: 900; line-height: 1; color: var(--teal); margin-top: 4px;
}

/* ---------------- Header ---------------- */
.top-bar {
  height: 32px;
  background: var(--blue);
  display: flex;
  justify-content: flex-end;
}
@media (min-width: 768px) { .top-bar { height: 38px; } }

.top-bar__icons {
  height: 100%;
  background: var(--coral);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
@media (min-width: 768px) { .top-bar__icons { gap: 14px; padding: 0 20px; } }

.top-bar__link {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: var(--paper); opacity: 0.92;
}
@media (min-width: 768px) { .top-bar__link { width: 28px; height: 28px; } }
.top-bar__link:hover { opacity: 1; background: oklch(98.5% 0.004 90 / 0.16); }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--hair);
  position: relative;
  z-index: 40;
}
.site-header__inner {
  max-width: var(--container-max-wide);
  margin: 0 auto;
  padding: 12px var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
@media (min-width: 768px) { .site-header__inner { padding: 16px var(--container-pad); } }

.site-header__logo img { height: 54px; width: auto; }
@media (min-width: 768px) { .site-header__logo img { height: 72px; } }

.site-nav {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 18px;
}
@media (min-width: 1080px) { .site-nav { display: flex; gap: 36px; } }

.site-nav__item { position: relative; }
.site-nav__link {
  font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap;
  padding: 8px 0;
  display: inline-block;
}
.site-nav__dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 4px;
  background: var(--paper); border: 1px solid var(--hair); border-radius: 4px;
  box-shadow: 0 12px 28px oklch(20% 0.05 255 / 0.14);
  padding: 8px; display: none; flex-direction: column; min-width: 180px; z-index: 50;
}
.site-nav__item.is-open .site-nav__dropdown { display: flex; }
.site-nav__dropdown a {
  font-size: 14px; font-weight: 600; color: var(--blue);
  padding: 10px 14px; border-radius: 3px; white-space: nowrap;
}
.site-nav__dropdown a:hover { background: var(--surface-soft); }

.site-header__cta {
  display: none;
  background: var(--blue); color: var(--paper); font-size: 13px; font-weight: 700;
  padding: 10px 18px; border-radius: 2px; text-align: center; line-height: 1.5; white-space: nowrap;
}
@media (min-width: 1080px) { .site-header__cta { display: block; } }
.site-header__cta small { display: block; font-size: 12px; font-weight: 500; opacity: 0.9; }

.site-header__menu-btn {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 8px; cursor: pointer;
}
@media (min-width: 1080px) { .site-header__menu-btn { display: none; } }
.site-header__menu-btn span { width: 22px; height: 2px; background: var(--ink); display: block; }

.mobile-menu {
  display: none;
  flex-direction: column; gap: 2px;
  padding: 8px 20px 24px; border-top: 1px solid var(--hair); background: var(--paper);
}
.mobile-menu.is-open { display: flex; }
@media (min-width: 1080px) { .mobile-menu { display: none !important; } }
.mobile-menu__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding: 14px 4px 4px; }
.mobile-menu__link {
  font-size: 15px; font-weight: 600; color: var(--blue);
  padding: 10px 16px; border-bottom: 1px solid var(--hair);
}
.mobile-menu__cta {
  margin-top: 12px; background: var(--blue); color: var(--paper); text-align: center;
  font-size: 14px; font-weight: 700; padding: 14px; border-radius: 2px; line-height: 1.5;
}

/* ---------------- Footer ---------------- */
.site-footer { background: var(--blue-deep); padding: 48px var(--container-pad) 24px; }
@media (min-width: 768px) { .site-footer { padding: 72px var(--container-pad) 24px; } }

.site-footer__top {
  max-width: var(--container-max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 36px; padding-bottom: 32px;
}
@media (min-width: 1080px) { .site-footer__top { grid-template-columns: 1.3fr 1fr; gap: 48px; } }

.site-footer__brand {
  display: flex; flex-direction: column; gap: 24px; align-items: center;
}
@media (min-width: 1080px) { .site-footer__brand { flex-direction: row; align-items: flex-start; } }
.site-footer__seal { width: 140px; height: 140px; flex-shrink: 0; object-fit: contain; }
.site-footer__brand-text { color: #fff; font-size: 13px; line-height: 1.7; }

.site-footer__contact { display: flex; flex-direction: column; gap: 14px; }
.site-footer__contact-title {
  font-size: 20px; font-weight: 800; color: var(--paper);
  border-bottom: 2px solid var(--amber); padding-bottom: 8px; width: fit-content;
}
.site-footer__contact p { font-size: 13.5px; line-height: 1.8; color: oklch(72% 0.02 255); }
.site-footer__contact p a { color: inherit; text-decoration: none; }
.site-footer__contact p a:hover { text-decoration: underline; }

.site-footer__bottom {
  max-width: var(--container-max); margin: 0 auto;
  display: flex; flex-direction: column; gap: 10px; justify-content: space-between;
  font-size: 12px; color: oklch(60% 0.02 255); padding-top: 20px; border-top: 1px solid oklch(35% 0.05 255);
}
@media (min-width: 768px) { .site-footer__bottom { flex-direction: row; } }
.site-footer__bottom a { color: oklch(70% 0.02 255); text-decoration: underline; }

.site-footer__disclaimer {
  max-width: var(--container-max); margin: 18px auto 0;
  font-size: 11.5px; line-height: 1.7; color: oklch(50% 0.02 255);
}

/* Terms modal */
.terms-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  z-index: 1000; align-items: center; justify-content: center; padding: 16px;
}
.terms-modal-overlay.is-open { display: flex; }
@media (min-width: 768px) { .terms-modal-overlay { padding: 32px; } }
.terms-modal {
  background: #fff; width: 100%; max-width: 860px; max-height: 85vh;
  display: flex; flex-direction: column; border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25); overflow: hidden;
}
.terms-modal__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 16px; border-bottom: 1px solid oklch(90% 0.01 255); flex-shrink: 0;
}
@media (min-width: 768px) { .terms-modal__header { padding: 28px 32px 20px; } }
.terms-modal__title { font-size: 19px; font-weight: 800; color: var(--blue-deep); }
@media (min-width: 768px) { .terms-modal__title { font-size: 22px; } }
.terms-modal__subtitle { font-size: 12.5px; color: oklch(55% 0.02 255); margin-top: 4px; }
.terms-modal__close { background: none; border: none; font-size: 26px; line-height: 1; color: oklch(45% 0.02 255); cursor: pointer; padding: 4px 8px; }
.terms-modal__body { padding: 20px; overflow-y: auto; }
@media (min-width: 768px) { .terms-modal__body { padding: 28px 32px 36px; } }
.terms-modal__intro { font-size: 14px; line-height: 1.75; color: oklch(35% 0.02 255); margin: 0 0 24px; }
.terms-modal__section { margin-bottom: 22px; }
.terms-modal__section-title { font-size: 15px; font-weight: 700; color: var(--blue-deep); margin-bottom: 8px; }
.terms-modal__section p { font-size: 13.5px; line-height: 1.75; color: oklch(35% 0.02 255); margin: 0 0 8px; }
.terms-modal__section ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.terms-modal__section li { font-size: 13.5px; line-height: 1.75; color: oklch(35% 0.02 255); }

/* ---------------- 개인정보 처리방침 등 단순 텍스트 페이지 ---------------- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 48px var(--container-pad) 80px; }
.legal-page__title { font-size: 26px; font-weight: 800; color: var(--ink); margin: 0 0 20px; }
@media (min-width: 768px) { .legal-page__title { font-size: 30px; } }
.legal-page .terms-modal__section a { color: var(--blue); }

/* ---------------- Subpage Banner ---------------- */
.subpage-banner {
  position: relative; width: 100%; height: 160px; overflow: hidden;
  display: flex; align-items: flex-end;
}
@media (min-width: 768px) { .subpage-banner { height: 220px; } }
.subpage-banner__bg { position: absolute; inset: 0; }
.subpage-banner__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(var(--banner-rgb), 0.68) 0%, rgba(var(--banner-rgb), 0.55) 100%);
  pointer-events: none;
}
.subpage-banner__title {
  position: relative; z-index: 1; color: var(--paper);
  font-size: 26px; font-weight: 800; margin: 0; word-break: keep-all; white-space: nowrap;
  padding: 20px var(--container-pad);
}
@media (min-width: 768px) { .subpage-banner__title { font-size: 38px; padding: 28px var(--container-pad); } }

.subpage-banner--about { --banner-rgb: var(--section-about); }
.subpage-banner--program { --banner-rgb: var(--section-program); }
.subpage-banner--ic { --banner-rgb: var(--section-ic); }
.subpage-banner--join { --banner-rgb: var(--section-join); }
.subpage-banner--community { --banner-rgb: var(--section-community); }

/* ---------------- 프로그램 카드 (2-1 개요 등에서 재사용) ---------------- */
.program-card {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--hair); border-radius: 6px; padding: 24px; background: var(--paper);
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.program-card:hover { box-shadow: 0 10px 24px oklch(20% 0.05 255 / 0.1); transform: translateY(-2px); }
.program-card__title-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.program-card__icon { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; }
.program-card__title { font-size: 17px; font-weight: 800; color: var(--ink); }
.program-card__desc { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.program-card__link { font-size: 13px; font-weight: 700; color: var(--blue); margin-top: 4px; }

.program-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 768px) { .program-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1080px) { .program-grid { grid-template-columns: repeat(3,1fr); } }

/* ---------------- 카카오톡 채널 상담 플로팅 버튼 (모든 페이지 우측 하단 고정, footer.html 포함) ---------------- */
.kakao-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  background: #FEE500; color: #391B1B;
  padding: 12px 18px 12px 12px; border-radius: 999px;
  box-shadow: 0 8px 20px oklch(20% 0.05 255 / 0.25);
  text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease;
}
.kakao-float:hover { transform: translateY(-2px); box-shadow: 0 12px 26px oklch(20% 0.05 255 / 0.32); }
.kakao-float__icon { width: 26px; height: 26px; flex-shrink: 0; }
.kakao-float__label { font-size: 14px; font-weight: 800; white-space: nowrap; }
@media (max-width: 480px) {
  .kakao-float { padding: 12px; }
  .kakao-float__label { display: none; }
}
