/* =========================================================================
   지슬영 독서논술 — styles.css
   "잉크 & 종이(Ink & Paper)" 팔레트 / 모바일 우선 / 그림책 정서
   ========================================================================= */

/* ── 폰트: Pretendard (본문) ─────────────────────────────────────────── */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* ── 디자인 토큰 ─────────────────────────────────────────────────────── */
:root {
  /* 컬러 — 종이 60 / 잉크 20 / 코랄 10 / 그린 10 */
  --paper: #faf6ee;        /* 배경(종이) */
  --paper-2: #f3ecdd;      /* 살짝 진한 종이(섹션 교차) */
  --ink: #1f3a5f;          /* 메인(잉크) 딥 네이비 */
  --ink-soft: #2f4d72;
  --coral: #e8794a;        /* 강조(포인트) 따뜻한 코랄 */
  --coral-deep: #cf6234;   /* 코랄 위 텍스트/호버용 (대비 확보) */
  --green: #3e7c59;        /* 보조 숲 그린 */
  --text: #2b2b2b;         /* 본문 텍스트 잉크 그레이 */
  --text-soft: #5a564f;
  --line: #e4dccb;         /* 종이 위 경계선 */
  --white: #fffdf8;

  /* 타이포 */
  --font-body: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-head: "Nanum Myeongjo", "Pretendard", serif;
  --font-hand: "Gaegu", "Nanum Myeongjo", cursive;

  /* 레이아웃 */
  --maxw: 1080px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 10px 30px rgba(31, 58, 95, 0.08);
  --shadow-soft: 0 4px 14px rgba(31, 58, 95, 0.06);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 리셋 ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--ink);          /* 오버스크롤(고무줄) 여백에 허연색 대신 잉크색이 보이도록 */
  overscroll-behavior: none;       /* 모바일 바운스/스크롤 체이닝/당겨서 새로고침 차단 */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior: none;  /* html과 함께 오버스크롤 차단(엔진별 호환) */
  word-break: keep-all;       /* 한국어 단어가 중간에서 잘리지 않도록 */
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.3; font-weight: 800; }
ul { margin: 0; padding: 0; list-style: none; }

/* 포커스 가시성(키보드 내비) */
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }

/* 화면낭독기 전용 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ── 공통 레이아웃 ───────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(56px, 9vw, 104px); }
.section--alt { background: var(--paper-2); }
.section__eyebrow {
  font-family: var(--font-hand); color: var(--coral-deep); font-weight: 700;
  font-size: 1.15rem; letter-spacing: 0.02em; margin: 0 0 6px;
}
.section__title { font-size: clamp(1.6rem, 4.2vw, 2.4rem); margin: 0 0 14px; }
.section__lead { color: var(--text-soft); max-width: 60ch; margin: 0 0 36px; font-size: 1.05rem; }

/* ── 버튼 ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(232,121,74,0.32); }
.btn--primary:hover { background: var(--coral-deep); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-soft); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--lg { padding: 16px 28px; font-size: 1.08rem; }
.btn .ico { width: 1.1em; height: 1.1em; flex: none; }

/* ── 헤더 ───────────────────────────────────────────────────────────── */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: rgba(250, 246, 238, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-soft); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 1.16rem; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__sub { font-family: var(--font-body); font-weight: 600; font-size: 0.72rem; color: var(--coral-deep); display: block; letter-spacing: 0.02em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link { padding: 8px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 0.98rem; }
.nav__link:hover { background: rgba(31,58,95,0.07); text-decoration: none; }
.header__cta { margin-left: 8px; }
.header__cta .num { font-variant-numeric: tabular-nums; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  border-radius: 10px; align-items: center; justify-content: center;
}
.nav-toggle:hover { background: rgba(31,58,95,0.07); }
.nav-toggle .bar { display: block; width: 22px; height: 2.4px; background: var(--ink); border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.2s; }
.nav-toggle .bar + .bar { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7.4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7.4px) rotate(-45deg); }

/* ── HERO ───────────────────────────────────────────────────────────── */
.hero { padding-top: calc(var(--header-h) + clamp(28px, 6vw, 64px)); padding-bottom: clamp(40px, 7vw, 80px); position: relative; }
.hero__grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
.hero__eyebrow {
  display: inline-block; font-family: var(--font-hand); font-size: 1.2rem; font-weight: 700;
  color: var(--green); background: rgba(62,124,89,0.1); padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero__title { font-size: clamp(2rem, 6.4vw, 3.3rem); margin: 0 0 18px; line-height: 1.25; }
.hero__title .accent { color: var(--coral-deep); }
.hero__sub { font-size: clamp(1.02rem, 2.4vw, 1.18rem); color: var(--text-soft); margin: 0 0 28px; max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-soft); font-size: 0.95rem; }
.hero__meta li { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); flex: none; }
.hero__art { position: relative; }
.hero__art img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.hero__badge {
  position: absolute; left: -10px; bottom: -16px; background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow);
  font-size: 0.86rem; font-weight: 700; max-width: 220px; line-height: 1.4;
}
.hero__badge b { color: var(--coral-deep); }

/* ── 선생님 소개 ─────────────────────────────────────────────────────── */
.teacher__grid { display: grid; gap: clamp(28px, 5vw, 52px); align-items: start; }
.teacher__art img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.teacher__quote {
  font-family: var(--font-head); font-style: italic; font-size: 1.15rem; color: var(--ink);
  border-left: 4px solid var(--coral); padding: 6px 0 6px 18px; margin: 22px 0;
}
.awards { display: grid; gap: 12px; margin: 24px 0; }
.award {
  display: flex; gap: 14px; align-items: flex-start; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.award__medal { font-size: 1.5rem; line-height: 1.4; flex: none; }
.award__y { color: var(--coral-deep); font-weight: 800; font-size: 0.9rem; }
.award__t { font-weight: 700; margin: 2px 0; }
.award__d { color: var(--text-soft); font-size: 0.92rem; margin: 0; }

.note-inline { font-size: 0.85rem; color: var(--text-soft); margin-top: 8px; }

/* ── 카드 그리드 (왜 여기인가) ──────────────────────────────────────── */
.cards { display: grid; gap: 18px; grid-template-columns: 1fr; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 24px; transition: transform 0.18s var(--ease), box-shadow 0.25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon { width: 76px; height: 76px; margin-bottom: 12px; }
.card__icon img { width: 100%; }
.card__title { font-size: 1.18rem; margin: 0 0 8px; }
.card__text { color: var(--text-soft); margin: 0; font-size: 0.98rem; }
.card__title .em { color: var(--coral-deep); }

/* ── 수업 안내 ───────────────────────────────────────────────────────── */
.classes__grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 24px; min-width: 0; }
.panel h3 { font-size: 1.22rem; margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.panel h3 .tag { font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--green); padding: 3px 9px; border-radius: 999px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.dl dt { font-weight: 700; color: var(--ink); }
.dl dd { margin: 0; color: var(--text-soft); }
.plan { counter-reset: step; display: grid; gap: 12px; margin-top: 8px; list-style: none; padding: 0; }
.plan li {
  position: relative; padding: 14px 16px 14px 56px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px;
}
.plan li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; background: var(--coral); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-family: var(--font-head);
}
.plan b { color: var(--ink); }
.muted-note { font-size: 0.84rem; color: var(--text-soft); margin-top: 14px; }

/* ── 성과 ───────────────────────────────────────────────────────────── */
.results__grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.result {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px;
  border-top: 4px solid var(--coral);
}
.result .y { color: var(--coral-deep); font-weight: 800; font-size: 0.86rem; }
.result h3 { font-size: 1.12rem; margin: 4px 0 8px; }
.result p { margin: 0; color: var(--text-soft); font-size: 0.96rem; }
.result blockquote { margin: 10px 0 0; padding: 10px 14px; background: var(--paper); border-radius: 12px; font-size: 0.92rem; color: var(--text); border-left: 3px solid var(--green); }
.privacy-note {
  margin-top: 22px; font-size: 0.88rem; color: var(--text-soft);
  background: rgba(62,124,89,0.08); border: 1px solid rgba(62,124,89,0.25); border-radius: 14px; padding: 14px 18px;
}

/* ── 오시는 길 ───────────────────────────────────────────────────────── */
.directions__grid { display: grid; gap: clamp(24px, 4vw, 44px); align-items: start; }
.map-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-soft); background: var(--paper-2); }
.map-wrap iframe { width: 100%; height: 340px; border: 0; display: block; }
.map-bigger { display: block; text-align: center; padding: 11px; background: var(--white); border-top: 1px solid var(--line); font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.map-bigger:hover { background: var(--paper); text-decoration: none; color: var(--coral-deep); }
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 24px; }
.contact-card .dl dt { white-space: nowrap; }
.map-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.directions__deco { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); }
.directions__deco img { width: 88px; flex: none; border-radius: 12px; }
.directions__deco p { margin: 0; font-size: 0.92rem; color: var(--text-soft); }

/* ── 문의 CTA ───────────────────────────────────────────────────────── */
.cta {
  background:
    radial-gradient(900px 300px at 80% -10%, rgba(232,121,74,0.16), transparent 60%),
    var(--ink);
  color: #fdf3e7;
}
.cta .section__title { color: #fff; }
.cta .section__lead { color: #d9e2ee; }
.cta__actions { display: flex; flex-direction: column; gap: 12px; }
.cta__phone { font-family: var(--font-head); font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; color: #fff; display: inline-flex; align-items: center; gap: 12px; }
.cta__phone:hover { text-decoration: none; color: var(--coral); }
.cta__hint { color: #c7d2e0; font-size: 0.92rem; margin: 4px 0 0; }
.cta__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cta__links .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.cta__links .btn--ghost:hover { background: #fff; color: var(--ink); }

/* ── 푸터 ───────────────────────────────────────────────────────────── */
.footer { background: var(--paper-2); border-top: 1px solid var(--line); padding-block: 40px; }
.footer__grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.footer .brand { font-size: 1.05rem; margin-bottom: 6px; }
.footer p, .footer li { color: var(--text-soft); font-size: 0.92rem; margin: 3px 0; }
.footer a { color: var(--ink); }
.footer__links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer__bottom { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--text-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
/* 개발·운용 크레딧 — 일반 푸터 글씨 색, 우측 정렬. `.footer p` 보다 우선하도록 명시도 ↑ */
.footer p.footer__credit { margin: 16px 0 0; text-align: right; font-size: 0.82rem; color: var(--text-soft); }

/* 떠있는 모바일 전화 버튼 */
.fab-call {
  position: fixed; right: 16px; bottom: 16px; z-index: 90; display: none;
  background: var(--coral); color: #fff; border-radius: 999px; padding: 14px 20px; font-weight: 800;
  box-shadow: 0 10px 26px rgba(232,121,74,0.45); align-items: center; gap: 8px;
}
.fab-call:hover { text-decoration: none; background: var(--coral-deep); transform: translateY(-2px); }

/* 등장 애니메이션 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ── 책 표지 갤러리 (선생님 소개) ─────────────────────────────── */
.books-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 24px 0 14px; }
.books-head h3 { font-size: 1.12rem; margin: 0; }
.books-all { font-size: 0.9rem; font-weight: 700; color: var(--coral-deep); white-space: nowrap; }
.book-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.bookcard { position: relative; display: block; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 10px; transition: transform 0.15s var(--ease), box-shadow 0.2s, border-color 0.2s; }
.bookcard:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--coral); }
.bookcard img { width: 100%; border-radius: 8px; display: block; box-shadow: 0 3px 12px rgba(31, 58, 95, 0.18); }
.bookcard__t { display: block; font-weight: 700; font-size: 0.92rem; color: var(--ink); margin-top: 9px; line-height: 1.35; }
.bookcard__p { display: block; font-size: 0.8rem; color: var(--text-soft); margin-top: 2px; }
.bookcard__ribbon { position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--coral); color: #fff; font-size: 0.7rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; box-shadow: var(--shadow-soft); }
.bookcard__ribbon.ribbon--ink { background: var(--ink); }

/* ── 단계별 커리큘럼 ─────────────────────────────────────────── */
.subhead { font-size: 1.25rem; margin: 32px 0 16px; }
.curriculum { display: grid; gap: 16px; grid-template-columns: 1fr; }
.curri { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius-lg); padding: 22px 20px; }
.curri__lv { display: inline-block; font-family: var(--font-body); font-weight: 800; font-size: 0.78rem; color: #fff; background: var(--green); padding: 4px 11px; border-radius: 999px; }
.curri h4 { font-family: var(--font-head); font-size: 1.08rem; color: var(--ink); margin: 12px 0 10px; }
.curri ul { display: grid; gap: 7px; }
.curri li { position: relative; padding-left: 15px; font-size: 0.92rem; color: var(--text-soft); }
.curri li::before { content: ""; position: absolute; left: 3px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.curri b { color: var(--ink); }

/* ── 표 (수업 구성·수업료) ──────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-soft); -webkit-overflow-scrolling: touch; }
.schedule { width: 100%; border-collapse: collapse; }
.schedule th, .schedule td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.95rem; vertical-align: middle; }
.schedule thead th { background: var(--ink); color: #fff; font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; border-bottom: 0; }
.schedule tbody th { font-weight: 800; color: var(--ink); white-space: nowrap; }
.schedule tbody tr:last-child td, .schedule tbody tr:last-child th { border-bottom: 0; }
.schedule tbody tr:hover { background: var(--paper); }

/* ── 반응형 ─────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .results__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .book-gallery { grid-template-columns: repeat(4, 1fr); }
  .curriculum { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; }
  .teacher__grid { grid-template-columns: 0.85fr 1.15fr; }
  .classes__grid { grid-template-columns: 1fr 1fr; }
  .directions__grid { grid-template-columns: 1.15fr 0.85fr; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .curriculum { grid-template-columns: repeat(4, 1fr); }
}

/* 모바일 내비 */
@media (max-width: 859px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 20px 16px;
    box-shadow: var(--shadow); transform: translateY(-130%); transition: transform 0.3s var(--ease);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); }
  .nav__link { padding: 13px 8px; border-radius: 10px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav__link:last-of-type { border-bottom: 0; }
  .header__cta { margin: 12px 0 0; }
  .header__cta .btn { width: 100%; justify-content: center; }
  .fab-call { display: inline-flex; }
  .hero__badge { position: static; max-width: none; margin-top: 14px; }
}

/* 좁은 폰 화면: 표(수업 구성·수업료) 셀 여백 축소로 줄바꿈 완화 */
@media (max-width: 560px) {
  .panel { padding: 22px 16px; }
  .schedule th, .schedule td { padding: 11px 9px; font-size: 0.9rem; }
  .schedule thead th { font-size: 0.84rem; }
}
