/* 새암 홈페이지 v0.2.0 — 색·글꼴·간격은 ../brand/tokens.css 토큰만 쓴다 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-base); line-height: var(--lh-body);
  word-break: keep-all; overflow-wrap: break-word;
  transition: background-color .5s ease, color .5s ease;
}
img, svg, canvas { display: block; max-width: 100%; }
picture { display: contents; }
.nowrap { white-space: nowrap; }
main:focus { outline: none; }
figure { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; font-family: var(--font-serif); font-weight: 700; line-height: var(--lh-tight); margin: 0 0 var(--space-4); }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--content-width) + 64px); margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

/* ---------- 버튼·배지 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 0 24px; border-radius: var(--radius-pill); border: 2px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font: 600 var(--fs-base)/1 var(--font-sans);
  text-decoration: none; cursor: pointer; transition: transform .2s, background-color .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: var(--fs-sm); }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
}
.badge--soon { color: var(--accent-2); border-color: var(--accent-2); background: transparent; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); transition: background-color .5s;
}
.site-header .container { display: flex; align-items: center; gap: var(--space-4); min-height: 68px; }
.brand-link { display: inline-flex; align-items: center; margin-right: auto; }
.brand-link img { height: 30px; width: auto; }
.logo-day { display: none; } [data-theme="day"] .logo-day { display: block; } [data-theme="day"] .logo-night { display: none; }
.nav-list { display: none; gap: var(--space-4); }
.nav-list a { color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; padding: 8px 2px; border-bottom: 2px solid transparent; }
.nav-list a:hover, .nav-list a[aria-current] { border-bottom-color: var(--accent); }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-pill);
  font: 600 var(--fs-sm)/1 var(--font-sans); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .ico-sun { display: none; } [data-theme="night"] .theme-toggle .ico-sun { display: block; } [data-theme="night"] .theme-toggle .ico-moon { display: none; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .ico-close { display: none; } .nav-toggle[aria-expanded="true"] .ico-close { display: block; } .nav-toggle[aria-expanded="true"] .ico-menu { display: none; }

/* 모바일 메뉴 */
.nav-panel { display: none; border-top: 1px solid var(--line); background: var(--bg); }
.nav-panel.is-open { display: block; }
.nav-panel ul { padding: var(--space-3) 20px var(--space-5); }
.nav-panel a { display: block; padding: 14px 4px; color: var(--text); text-decoration: none; font-size: var(--fs-lg); font-family: var(--font-serif); border-bottom: 1px solid var(--line); }
@media (min-width: 1100px) {
  .nav-list { display: flex; margin-right: var(--space-3); }
  .nav-toggle, .nav-panel { display: none !important; }
}

/* ---------- 히어로(사진·영상) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: var(--text);
  min-height: clamp(560px, 88vh, 780px); display: flex; align-items: center; background: #060F1C;
}
[data-theme="day"] .hero { background: #E9EED2; }
.hero-media { position: absolute; inset: 0; z-index: -3; }
.hero-media--day { display: none; }
[data-theme="day"] .hero-media--day { display: block; } [data-theme="day"] .hero-media--night { display: none; }
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: 0; transition: opacity .9s ease; pointer-events: none; }
.hero-video.is-playing { opacity: 1; }
/* 글자가 읽히도록 사진 위에 덮개를 깐다(밤: 남색, 낮: 크림). 대비는 덮개가 가장 옅은 곳에서도 글자 쪽이 4.5:1 이상 */
.hero-shade { position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,15,28,.9) 0%, rgba(6,15,28,.72) 42%, rgba(6,15,28,.2) 100%), linear-gradient(0deg, rgba(10,22,40,.95) 0%, rgba(10,22,40,0) 30%); }
[data-theme="day"] .hero-shade { background: linear-gradient(90deg, rgba(251,247,234,.95) 0%, rgba(251,247,234,.82) 42%, rgba(251,247,234,.25) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(251,247,234,0) 28%); }
@media (max-width: 719px) {
  .hero-shade { background: linear-gradient(180deg, rgba(6,15,28,.55) 0%, rgba(6,15,28,.82) 55%, rgba(10,22,40,.96) 100%); }
  [data-theme="day"] .hero-shade { background: linear-gradient(180deg, rgba(251,247,234,.62) 0%, rgba(251,247,234,.86) 55%, var(--bg) 100%); }
}
.hero-inner { padding-top: var(--space-8); padding-bottom: clamp(96px, 12vw, 140px); }
.hero-bar { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.hero-credit { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); max-width: 62ch; }
.hero-ctl { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; flex: none; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 78%, transparent); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-pill); font: 600 var(--fs-sm)/1 var(--font-sans); backdrop-filter: blur(6px); }
.hero-ctl:hover { border-color: var(--accent); }
.hero-ctl svg { width: 18px; height: 18px; }
.hero-ctl .ico-play { display: none; } .hero-ctl[data-playing="false"] .ico-play { display: block; } .hero-ctl[data-playing="false"] .ico-pause { display: none; }
.eyebrow { font-size: var(--fs-sm); font-weight: 600; letter-spacing: .02em; color: var(--accent); margin: 0 0 var(--space-3); }
[data-theme="day"] .eyebrow { color: var(--accent-2); }
.hero h1 { font-size: clamp(2.1rem, 6.4vw, var(--fs-4xl)); letter-spacing: -0.02em; margin-bottom: var(--space-4); max-width: 14em; }
.hero-sub { font-size: clamp(1.05rem, 2.4vw, var(--fs-lg)); color: var(--text); opacity: .9; max-width: 30em; margin-bottom: var(--space-6); }
.when-day { display: none; } [data-theme="day"] .when-day { display: inline; } [data-theme="day"] .when-night { display: none; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero h1 .accent { color: var(--accent); }
[data-theme="day"] .hero h1 .accent { color: var(--accent-2); }

/* ---------- 섹션 공통 ---------- */
.section { padding: var(--space-8) 0; }
@media (min-width: 720px) { .section { padding: var(--space-9) 0; } }
.section--alt { background: var(--surface); }
.section-head { max-width: 760px; margin-bottom: var(--space-7); }
.section-head h2 { font-size: clamp(1.7rem, 4.4vw, var(--fs-3xl)); margin-bottom: var(--space-3); }
.section-head .lead { font-size: var(--fs-lg); color: var(--text-muted); margin: 0; }
.note { font-size: var(--fs-sm); color: var(--text-muted); }

.grid { display: grid; gap: var(--space-5); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid--5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
@media (min-width: 1000px) {
  .grid--5 { grid-template-columns: repeat(6, 1fr); }
  .grid--5 > li { grid-column: span 2; }
  .grid--5 > li:nth-child(n+4) { grid-column: span 3; }
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2);
  transition: transform .25s, border-color .25s, background-color .5s;
}
.section--alt .card { background: var(--bg); }
.card .text-link { position: relative; z-index: 1; font-size: var(--fs-sm); }
/* 링크가 있는 카드만 들리고, 그 카드는 어디를 눌러도 링크로 이동한다 */
.card { position: relative; } /* :has() 미지원 브라우저에서도 늘임 링크(.more::after)가 카드 안에 머문다 */
html .card:has(.more):hover { transform: translateY(-3px); border-color: var(--accent); }
.card .more::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
@supports selector(:has(a)) {
  .card:has(.more:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
  .card .more:focus-visible { outline: none; }
}
.card h3 { font-size: var(--fs-xl); margin: 0; }
.card p { margin: 0; color: var(--text-muted); }
.card .badge { align-self: flex-start; }
.card .more { margin-top: auto; padding-top: var(--space-3); font-weight: 600; }
.card-ico { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--accent); display: grid; place-items: center; margin-bottom: var(--space-2); }
.card-ico svg { width: 28px; height: 28px; }
.section--alt .card-ico { background: var(--surface-2); }

/* 이미지 자리(사진 연결 전·후 공통) */
.ph {
  position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-muted); font-size: var(--fs-sm);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph--wide { aspect-ratio: 21 / 9; }
.ph--tall { aspect-ratio: 4 / 5; }
@media (max-width: 899px) { .prog-detail .ph--tall { aspect-ratio: 16 / 9; } }
.photo-note { margin-top: var(--space-5); }
.ph figcaption, .ph .ph-label { position: relative; z-index: 1; }

/* ---------- 우리는 ---------- */
.principles { counter-reset: p; }
.principle { position: relative; padding-top: var(--space-5); border-top: 3px solid var(--accent); }
.principle::before { counter-increment: p; content: "0" counter(p); font-family: var(--font-serif); font-size: var(--fs-sm); color: var(--text-muted); display: block; margin-bottom: var(--space-2); }
.principle h3 { font-size: var(--fs-xl); }
.principle p { color: var(--text-muted); }
.definition { font-family: var(--font-serif); font-size: clamp(1.25rem, 3vw, var(--fs-xl)); line-height: 1.6; max-width: 26em; margin-bottom: var(--space-7); }
.definition strong { color: var(--accent); font-weight: 700; }
[data-theme="day"] .definition strong { color: var(--accent-2); }

/* ---------- 반딧불이 이야기 ---------- */
.life { display: grid; gap: var(--space-5); grid-template-columns: 1fr; counter-reset: s; }
@media (min-width: 760px) { .life { grid-template-columns: repeat(4, 1fr); } }
.life li { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.life-ico { width: 56px; height: 56px; color: var(--accent); margin-bottom: var(--space-3); }
.life h3 { font-size: var(--fs-lg); margin-bottom: var(--space-2); }
.life h3 small { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; margin-left: 6px; }
.life p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.story-cols { display: grid; gap: var(--space-7); margin-top: var(--space-8); }
@media (min-width: 900px) { .story-cols { grid-template-columns: 1fr 1fr; } }
.story-cols h3 { font-size: var(--fs-xl); }
.season { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: var(--space-4) 0; }
.season th, .season td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.season thead th { color: var(--text-muted); font-weight: 600; }
.season tbody th { text-align: left; font-weight: 600; padding-left: 0; }
.season td.on { background: color-mix(in srgb, var(--accent) 28%, transparent); position: relative; }
.season td.on::after { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.rules { display: grid; gap: var(--space-3); }
.rules li { display: grid; grid-template-columns: 36px 1fr; gap: var(--space-3); align-items: start; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.rules li b { display: block; }
.rules li span { color: var(--text-muted); font-size: var(--fs-sm); }
.rules .rule-no { color: var(--on-accent); width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }

/* ---------- 프로그램 ---------- */
.program { display: flex; flex-direction: column; gap: var(--space-3); }
.card .ph { margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border: 0; border-bottom: 1px solid var(--line); aspect-ratio: 16 / 9; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 장터 ---------- */
.market { gap: var(--space-3); }
.fruit { width: 64px; height: 64px; }
.market .season-note { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- 복원 일지 ---------- */
.journal { display: grid; gap: var(--space-5); }
@media (min-width: 760px) { .journal { grid-template-columns: repeat(4, 1fr); } }
.journal-slot { border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: var(--space-5); min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); background: transparent; }
.journal-slot .when { font-family: var(--font-serif); font-size: var(--fs-lg); }
.journal-slot p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.journal-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.journal-note { margin-top: var(--space-5); }

/* ---------- 함께하기 ---------- */
.join { background: var(--surface-2); }
.join .card { background: var(--bg); }

/* ---------- 푸터 ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: var(--space-8) 0 var(--space-6); font-size: var(--fs-sm); color: var(--text-muted); }
.footer-grid { display: grid; gap: var(--space-6); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.1fr .7fr 1.4fr; } }
.site-footer h2 { font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text); margin-bottom: var(--space-3); }
.site-footer ul li { margin-bottom: 6px; }
.site-footer a { color: var(--text); }
.footer-logo img { height: 112px; width: auto; max-width: 100%; margin-bottom: var(--space-3); }
.footer-bottom { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; }
.fill { background: var(--surface-2); border-radius: 4px; padding: 0 6px; color: var(--text); }

/* ---------- 서브페이지 ---------- */
.page-hero { padding: var(--space-8) 0 var(--space-6); background: linear-gradient(180deg, var(--surface-2), var(--bg)); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.9rem, 5vw, var(--fs-3xl)); margin-bottom: var(--space-3); }
.page-hero .eyebrow { color: var(--accent); font-size: var(--fs-sm); margin: 0 0 var(--space-3); }
[data-theme="day"] .page-hero .eyebrow { color: var(--accent-2); }
.page-hero p { color: var(--text-muted); max-width: var(--text-width); font-size: var(--fs-lg); margin: 0; }
.prog-detail { display: grid; gap: var(--space-6); padding: var(--space-8) 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .prog-detail { grid-template-columns: 5fr 7fr; gap: var(--space-8); } }
.prog-detail h2 { font-size: var(--fs-2xl); }
.prog-detail .tag { margin-bottom: var(--space-3); }
.timeline { border-left: 2px solid var(--line); margin: var(--space-4) 0; padding-left: var(--space-5); }
.timeline li { position: relative; padding-bottom: var(--space-4); }
.timeline li::before { content: ""; position: absolute; left: calc(var(--space-5) * -1 - 7px); top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline b { font-variant-numeric: tabular-nums; margin-right: 8px; color: var(--accent); }
[data-theme="day"] .timeline b { color: var(--accent-2); }
.def-list { display: grid; gap: var(--space-2); margin: var(--space-4) 0; }
.def-list li { padding-left: 1.4em; position: relative; }
.def-list li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.callout { border: 1px solid var(--accent-2); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); background: color-mix(in srgb, var(--accent-2) 10%, transparent); font-size: var(--fs-sm); }

/* ---------- 폼 ---------- */
.form-wrap { display: grid; gap: var(--space-7); padding: var(--space-8) 0; }
@media (min-width: 900px) { .form-wrap { grid-template-columns: 7fr 5fr; } }
.form { display: grid; gap: var(--space-5); }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.field .req { color: var(--accent-2); margin-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--text-muted); border-radius: var(--radius-md);
}
.field textarea { min-height: 160px; resize: vertical; }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); margin: 4px 0 0; }
.field .err { color: var(--accent-2); font-size: var(--fs-sm); margin: 4px 0 0; font-weight: 600; }
.field [aria-invalid="true"] { border-color: var(--accent-2); border-width: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 24px; height: 24px; min-height: 0; margin-top: 3px; accent-color: var(--accent); flex: none; }
.check label { font-weight: 500; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.panel h2, .panel h3 { font-size: var(--fs-xl); }
.panel details { margin-top: var(--space-3); }
.panel summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.err-summary { margin: 0; font-weight: 600; color: var(--accent-2); } .err-summary:empty { display: none; }
.status { margin-top: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.status[hidden] { display: none; }
.status pre { white-space: pre-wrap; font: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3); margin: var(--space-3) 0; }

/* ---------- 출처 ---------- */
.credit-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.credit-table th, .credit-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: keep-all; overflow-wrap: break-word; }
.credit-table .en { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
.credit-table .fname, .credit-table .orig-title { word-break: break-all; }
.table-scroll { overflow-x: auto; }
@media (max-width: 899px) { /* 좁은 화면: 사진 한 장당 카드 하나 */
  .table-scroll { overflow: visible; }
  .credit-table, .credit-table tbody, .credit-table tr, .credit-table th, .credit-table td { display: block; }
  .credit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .credit-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
  .credit-table th, .credit-table td { border: 0; padding: 6px 0; }
  .credit-table tbody th { font-size: var(--fs-base); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .credit-table td::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
}

/* ---------- 나타나기 ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* ---------- 반디아재 칼럼 (v0.2.0) ---------- */
.breadcrumb { margin-bottom: var(--space-4); font-size: var(--fs-xs); color: var(--text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; opacity: .6; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb [aria-current] { color: var(--text); }

.chips-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.chips-nav a { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; background: var(--surface); }
.chips-nav a:hover { border-color: var(--accent); }
.chips-nav a[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chips-nav .count { font-size: var(--fs-xs); opacity: .75; }

.post-grid { display: grid; gap: var(--space-6) var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.post-card article { height: 100%; display: flex; flex-direction: column; gap: var(--space-2); }
.post-card-img { display: block; }
.post-card-img .ph { display: block; aspect-ratio: 3 / 2; border-radius: var(--radius-md); }
.post-card-cat { margin: var(--space-2) 0 0; font-size: var(--fs-xs); font-weight: 600; }
.post-card-cat a { color: var(--accent); }
[data-theme="day"] .post-card-cat a { color: var(--accent-2); }
.post-card h2, .post-card h3 { font-size: var(--fs-lg); margin: 0; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.post-card-sum { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.post-meta { margin: 0; color: var(--text-muted); font-size: var(--fs-xs); }
.post-card .post-meta { margin-top: auto; }
.empty { padding: var(--space-7) 0; color: var(--text-muted); }
.more-link { margin-top: var(--space-6); font-weight: 600; }
.more-link .sep { color: var(--text-muted); margin: 0 6px; }
.column-rss { margin-top: var(--space-7); }
.pager ul { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-7); }
.pager a { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
.pager a[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* 글 페이지: 긴 글 가독성(행폭 65~75자, 줄간격 1.85) */
.post-hero { padding: var(--space-8) 0 var(--space-5); background: linear-gradient(180deg, var(--surface-2), var(--bg)); border-bottom: 1px solid var(--line); }
.post-hero h1 { font-size: clamp(1.8rem, 5vw, var(--fs-3xl)); margin-bottom: var(--space-3); }
.post-hero .eyebrow a { color: inherit; }
.post-narrow { max-width: 760px; }
.post-cover { margin: var(--space-6) 0; }
.post-cover img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-lg); }
.post-cover figcaption, .post-figure figcaption { margin-top: var(--space-2); font-size: var(--fs-xs); color: var(--text-muted); }
.credit { margin-left: 4px; }
.toc { margin: var(--space-5) 0 var(--space-6); padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.toc h2 { font-family: var(--font-sans); font-size: var(--fs-sm); margin-bottom: var(--space-2); }
.toc ol { list-style: decimal; padding-left: 1.4em; display: grid; gap: 4px; font-size: var(--fs-sm); }
.toc a { color: var(--text); }
.prose { font-size: 1.125rem; line-height: 1.85; max-width: 38em; }
.prose > * + * { margin-top: var(--space-4); }
.prose p { margin: 0; }
.prose p.lead-answer { font-size: 1.25rem; font-weight: 600; line-height: 1.7; padding-left: var(--space-4); border-left: 4px solid var(--accent); }
.prose h2 { font-size: var(--fs-xl); margin: var(--space-7) 0 0; scroll-margin-top: 90px; }
.prose h3 { font-size: var(--fs-lg); margin: var(--space-5) 0 0; }
.prose ul, .prose ol { padding-left: 1.4em; display: grid; gap: var(--space-2); }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose blockquote.callout { margin: 0 0 var(--space-5); font-size: var(--fs-sm); line-height: 1.6; }
.prose blockquote.callout p { margin: 0; }
.prose a { overflow-wrap: anywhere; }
.prose .data-table { display: block; overflow-x: auto; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.6; max-width: 100%;
  /* 좁은 화면에서 옆으로 밀 수 있다는 단서: 끝이 잘린 쪽에 그림자(밀면 사라짐) */
  background: linear-gradient(to right, var(--bg) 30%, transparent) 0 0 / 2.5em 100% no-repeat local, linear-gradient(to left, var(--bg) 30%, transparent) 100% 0 / 2.5em 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, .22), transparent) 0 0 / .9em 100% no-repeat scroll, linear-gradient(to left, rgba(0, 0, 0, .22), transparent) 100% 0 / .9em 100% no-repeat scroll; }
.prose .data-table th, .prose .data-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; min-width: 8em; }
.prose .data-table th { background: var(--surface); }
.post-figure { margin: var(--space-5) 0; }
.post-figure img { width: 100%; height: auto; border-radius: var(--radius-md); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-7) 0 var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.share[hidden], .share [hidden] { display: none; }
.share-label { font-weight: 600; font-size: var(--fs-sm); margin-right: var(--space-2); }
.share-msg { font-size: var(--fs-xs); color: var(--text-muted); }
.author-box { margin: var(--space-5) 0; padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); font-size: var(--fs-sm); }
.author-box p { margin: 0; color: var(--text-muted); }
.author-name { color: var(--text) !important; margin-bottom: var(--space-2) !important; }
.author-name span { font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.prev-next ul { display: grid; gap: var(--space-3); margin: var(--space-6) 0 var(--space-8); }
@media (min-width: 640px) { .prev-next ul { grid-template-columns: 1fr 1fr; } .prev-next .next { text-align: right; grid-column: 2; } .prev-next .prev:only-child { grid-column: 1; } }
.prev-next a { display: block; padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; color: var(--text); background: var(--surface); }
.prev-next a:hover { border-color: var(--accent); }
.pn-label { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.pn-title { display: block; font-family: var(--font-serif); font-weight: 700; }
.related h2 { font-size: var(--fs-xl); margin-bottom: var(--space-5); }

/* 메인: 공지·질문과 답·장터 보강 */
.notices { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.notices ul { display: grid; gap: var(--space-3); padding: var(--space-4) 0; }
.notice { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); }
.notice h3 { font-size: var(--fs-base); margin: 0; font-family: var(--font-sans); }
.notice-body { font-size: var(--fs-sm); color: var(--text-muted); }
.notice-body p { margin: 0; }
.notice .more { font-weight: 600; font-size: var(--fs-sm); }
.faq { display: grid; gap: var(--space-4); max-width: var(--text-width); }
.faq-item { padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.faq-item h3 { font-family: var(--font-sans); font-size: var(--fs-base); margin-bottom: var(--space-2); }
.faq-item h3::before { content: "Q. "; color: var(--accent); }
[data-theme="day"] .faq-item h3::before { color: var(--accent-2); }
.faq-item p { margin: 0; color: var(--text-muted); }
.market .price { font-weight: 700; color: var(--text) !important; }
.market .prod-desc { font-size: var(--fs-sm); color: var(--text-muted); }
.market .prod-desc p { margin: 0; }
.market .ph { margin-top: calc(var(--space-6) * -1); }
.draft-mark { white-space: nowrap; }

/* ---------- 사진 중심 구조(2026-11, 새암 자체 촬영) ---------- */
.ph--43 { aspect-ratio: 4 / 3; } .ph--34 { aspect-ratio: 3 / 4; } .ph--wide-16x9 { aspect-ratio: 16 / 9; }
.ph--16x9 { aspect-ratio: 16 / 9; }
.ph img { background: var(--surface-2); }
.cap { font-size: var(--fs-xs); color: var(--text-muted); }

/* 한살이 사진 카드(반딧불이 4단계·나비 5단계) */
.life--photo { gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 520px) { .life--photo { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .life--photo { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); } .life--5 { grid-template-columns: repeat(5, 1fr); gap: var(--space-4); } }
.life--photo li { padding: 0; overflow: hidden; display: flex; flex-direction: column; gap: 0; }
.life--photo .ph { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
.life--photo h3 { padding: var(--space-4) var(--space-4) var(--space-2); margin: 0; }
.life--photo p { padding: 0 var(--space-4); }
.life--photo .cap { padding-bottom: var(--space-4); margin-top: auto; padding-top: var(--space-3); }
.life--photo li > p:not(.cap) { margin-bottom: 0; }
.life--5 h3 { font-size: var(--fs-base); }
.life--5 p { font-size: var(--fs-xs); }

/* 빛 사진 + 한 줄 설명 */
.light-feature { display: grid; gap: var(--space-6); align-items: center; margin-top: var(--space-8); }
@media (min-width: 900px) { .light-feature { grid-template-columns: 7fr 5fr; gap: var(--space-8); } }
.light-feature figure .ph { border-radius: var(--radius-lg); }
.light-feature figcaption, .gallery figcaption, .media-video figcaption { margin-top: var(--space-2); font-size: var(--fs-xs); color: var(--text-muted); }
.light-feature h3 { font-size: var(--fs-xl); }

/* 관찰 시기 표(월을 앞·뒤 절반으로) */
.table-scroll { overflow-x: auto; }
.season--half { table-layout: fixed; min-width: 330px; }
.season--half th, .season--half td { padding: 8px 1px; font-size: var(--fs-xs); }
.season--half thead th[colspan] { padding-bottom: 2px; border-bottom: 0; }
.season--half thead .half { font-weight: 400; font-size: 11px; padding-top: 0; }
.season--half thead th:first-child { width: 8.2em; text-align: left; vertical-align: bottom; padding-left: 0; }
.season--half tbody th { padding-right: 8px; line-height: 1.35; }
.season--half tbody th small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.season--half td.on::after { width: 7px; height: 7px; box-shadow: 0 0 8px 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.season--half td { border-left: 1px solid var(--line); } .season--half td:nth-child(odd) { border-left: 0; }

/* 현장 기록·나비 갤러리 */
.field-group + .field-group { margin-top: var(--space-8); }
.field-group h3 { font-size: var(--fs-xl); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-3); margin-bottom: var(--space-2); }
.field-group h3 small { font: 500 var(--fs-sm)/1.2 var(--font-sans); color: var(--text-muted); }
.field-group > p { color: var(--text-muted); max-width: var(--text-width); }
.gallery { display: grid; gap: var(--space-4) var(--space-3); grid-template-columns: repeat(2, 1fr); margin-top: var(--space-4); }
.gallery li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.gallery figure .ph { border-radius: var(--radius-md); }
@media (min-width: 900px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: var(--space-5) var(--space-4); }
  .gallery li:last-child:nth-child(odd) { grid-column: auto; }
  .gallery--2 { grid-template-columns: repeat(2, 1fr); }
  .gallery--4 { grid-template-columns: repeat(4, 1fr); }
}
.gallery--adults { margin-top: var(--space-7); }
@media (min-width: 900px) { .gallery--adults { grid-template-columns: 1fr 1fr 1.6fr; align-items: end; } }

.video-pair { display: grid; gap: var(--space-5); margin-top: var(--space-7); }
@media (min-width: 760px) { .video-pair { grid-template-columns: 1fr 1fr; } }
.media-video .video-box { border-radius: var(--radius-lg); overflow: hidden; background: #0b0f0a; border: 1px solid var(--line); }
.media-video video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* 활동과 소식 */
.news-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.news-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.news-thumb { display: block; position: relative; }
.news-thumb .ph { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); aspect-ratio: 16 / 11; display: block; }
.news-thumb .ph img { object-position: 50% 0; }
.news-thumb:hover .ph img { filter: brightness(1.06); }
.news-body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.news-body h3 { font-size: var(--fs-lg); margin: 0; }
.news-body p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.news-body .news-date { color: var(--text); font-weight: 600; }
.news-body .news-date time { color: var(--accent); } [data-theme="day"] .news-body .news-date time { color: var(--accent-2); }

@media (prefers-reduced-motion: reduce) { .hero-video { transition: none; } }
.life--photo + .note { margin-top: var(--space-4); }
.life + .gallery { margin-top: var(--space-6); }

/* 첫 화면 밖 구역은 화면에 가까워질 때 그린다(스타일·배치 계산을 미뤄 모바일 LCP·TBT 를 줄임) */
main > .section { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.site-footer { content-visibility: auto; contain-intrinsic-size: auto 500px; }
/* 멈춤 단추는 JS 가 켜지만 자리는 미리 잡아 둔다(레이아웃 이동 방지) */
.hero-bar { min-height: 44px; }
.hero-ctl[hidden] { display: inline-flex; visibility: hidden; }
