/* =====================================================================
   luminarelaw.com 공통 틀 (site.css)
   - 머리글 header.shd / 바닥글 footer.sft / 휴대폰 메뉴
   - 이야기 글 부품: nav.toc, details.statute-box, .author-box, section.footer-cta (apply-article-parts.ps1)
   - 머리글·바닥글 HTML 원본: luminarelaw-tools/partials/ (apply-layout.ps1이 넣음)
   - 페이지마다 남아 있는 옛 header/nav/footer 규칙보다 우선하도록
     선택자를 한 단계 구체적으로 쓰고, 덮어써지기 쉬운 속성은 직접 지정함.
   - 사이트는 밝은 화면 하나로 통일 (어두운 화면 모드 없음).
   ===================================================================== */

:root {
  --site-brand: #1a2c4d;
  --site-brand-light: #3e5c8c;
  --site-amber: #e2a24f;
  --site-amber-soft: #f3cf9a;
  --site-amber-deep: #c9853a;
  --site-night: #0b1424;
  --site-night-2: #111f37;
  --site-ink: #1d2433;
  --site-soft: #3d4557;
  --site-mute: #757d8d;
  --site-line: #e9e4da;
  --site-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* ── 머리글 ─────────────────────────────────────────────── */
header.shd {
  position: sticky; top: 0; z-index: 100;
  margin: 0; padding: 0;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 0; border-bottom: 1px solid var(--site-line);
  box-shadow: none; transition: none;
  font-family: var(--site-font);
  line-height: 1.75; letter-spacing: -0.01em; word-break: keep-all;
}
header.shd * { box-sizing: border-box; }
.shd-in {
  /* 본문 칸(.container: min(1100px, 92%))과 같은 폭, 안쪽 여백 없음 → 로고가 본문 왼쪽 끝과 맞음 */
  width: min(1100px, 92%); max-width: none; height: 66px; margin: 0 auto; padding: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
header.shd a.shd-brand {
  display: flex; align-items: center; gap: 10px; flex: none;
  color: var(--site-ink); text-decoration: none; transform: none;
}
.shd-mark {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--site-brand), var(--site-night));
  color: var(--site-amber-soft); font-weight: 900; font-size: 15px; line-height: 1;
  box-shadow: none;
}
.shd-name { display: flex; flex-direction: column; line-height: 1.2; }
.shd-name b { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; color: var(--site-ink); }
.shd-name small { display: block; margin-top: 3px; font-size: .72rem; font-weight: 500; color: var(--site-mute); }

header.shd nav.shd-nav {
  position: static; display: flex; flex-direction: row; flex-wrap: nowrap;
  align-items: center; gap: 2px;
  width: auto; margin: 0; padding: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none; animation: none;
}
header.shd nav.shd-nav a {
  position: relative; display: block;
  margin: 0; padding: 8px 12px; border-radius: 8px;
  font-size: .93rem; font-weight: 500; line-height: 1.5; white-space: nowrap;
  color: var(--site-soft); text-decoration: none;
  background: none; box-shadow: none; transform: none;
  transition: background-color .15s, color .15s;
}
header.shd nav.shd-nav a::before,
header.shd nav.shd-nav a::after { content: none; display: none; }
header.shd nav.shd-nav a:hover { background-color: #f2eee6; color: var(--site-ink); }
header.shd nav.shd-nav a[aria-current="page"] {
  color: var(--site-brand); font-weight: 700;
  background-image: linear-gradient(var(--site-amber), var(--site-amber));
  background-repeat: no-repeat;
  background-size: calc(100% - 24px) 2px;
  background-position: 50% calc(100% - 3px);
}
header.shd nav.shd-nav a.shd-cta {
  margin-left: 8px; padding: 9px 18px; border-radius: 99px;
  background: var(--site-night); color: #fff; font-weight: 600;
}
header.shd nav.shd-nav a.shd-cta:hover { background: var(--site-brand); color: #fff; }
header.shd nav.shd-nav a.shd-cta[aria-current="page"] { background: var(--site-brand); color: #fff; box-shadow: inset 0 0 0 2px var(--site-amber); }

header.shd .shd-menu {
  display: none; place-items: center;
  width: 42px; height: 42px; margin: 0 -8px 0 0; padding: 0;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 1.45rem; line-height: 1; color: var(--site-ink);
}
header.shd .shd-menu:hover { background: #f2eee6; }

header.shd a:focus-visible,
header.shd button:focus-visible,
footer.sft a:focus-visible { outline: 2px solid var(--site-amber); outline-offset: 2px; }

@media (max-width: 900px) {
  header.shd nav.shd-nav {
    display: none; position: fixed; top: 66px; left: 0; right: 0; bottom: auto;
    flex-direction: column; align-items: stretch; gap: 2px;
    width: auto; max-height: calc(100vh - 66px); overflow-y: auto;
    padding: 10px 16px 18px;
    background: #fff; border-top: 1px solid var(--site-line); border-bottom: 1px solid var(--site-line);
    box-shadow: 0 14px 28px rgba(11, 20, 36, .10);
  }
  header.shd nav.shd-nav.open { display: flex; }
  header.shd nav.shd-nav a { padding: 12px 14px; font-size: 1rem; }
  header.shd nav.shd-nav a[aria-current="page"] {
    background-image: none; background-color: #f7f3ea;
    box-shadow: inset 3px 0 0 var(--site-amber);
  }
  header.shd nav.shd-nav a.shd-cta { margin: 8px 0 0; text-align: center; }
  header.shd nav.shd-nav a.shd-cta[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--site-amber); }
  header.shd .shd-menu { display: grid; }
}
@media (max-width: 360px) {
  .shd-name b { font-size: 1rem; }
}

/* ── 바닥글 (index.html 바닥글 .ft와 같은 모양) ─────────────── */
footer.sft {
  display: block; margin: 64px 0 0; padding: 38px 0 46px;
  background: #080f1c; color: #8b95a7; border: 0;
  font-family: var(--site-font); font-size: .84rem; line-height: 2;
  text-align: left; letter-spacing: -0.01em; word-break: keep-all;
}
footer.sft * { box-sizing: border-box; }
.sft-in {
  width: min(1100px, 92%); max-width: none; margin: 0 auto; padding: 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
footer.sft .sft-info { margin: 0; padding: 0; opacity: 1; color: #8b95a7; }
footer.sft .sft-info a { color: #c3ccdb; text-decoration: underline; text-underline-offset: 3px; }
footer.sft .sft-info a:hover { color: #fff; }
.sft-sns { display: flex; gap: 10px; flex: none; }
footer.sft .sft-sns a {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #131e31; color: #c3ccdb; text-decoration: none;
  transition: background-color .15s, color .15s;
}
footer.sft .sft-sns a:hover { background: var(--site-brand); color: var(--site-amber-soft); }
footer.sft .sft-sns svg { display: block; width: 17px; height: 17px; }
@media (max-width: 600px) {
  footer.sft { padding: 32px 0 40px; font-size: .82rem; }
  .sft-in { flex-direction: column; gap: 18px; }
}

/* =====================================================================
   이야기 글 부품 (luminarelaw-tools/apply-article-parts.ps1이 HTML을 넣음)
   ===================================================================== */

/* 목차: 법률칼럼 중 소제목(h2) 5개 이상인 글, '한눈에 보기' 바로 뒤
   <nav class="toc" aria-label="목차"><p class="toc-title">목차</p><ol><li><a href="#sec-1">…</a></li></ol></nav>
   소제목 글자에 이미 "1." 번호가 있어 목록 번호는 따로 붙이지 않음 */
nav.toc {
  margin: 28px 0 40px; padding: 18px 22px 14px;
  background: #fff; border: 1px solid #e5e7eb; border-left: 3px solid var(--site-amber); border-radius: 0 12px 12px 0;
  font-family: var(--site-font); word-break: keep-all;
}
nav.toc .toc-title { margin: 0 0 6px; font-size: .82rem; font-weight: 800; letter-spacing: .12em; color: var(--site-brand); }
nav.toc ol { list-style: none; margin: 0; padding: 0; }
nav.toc li { margin: 0; padding: 0; border-top: 1px dashed #e5e7eb; font-size: .95rem; line-height: 1.55; }
nav.toc li:first-child { border-top: 0; }
nav.toc li::before { content: none; }
nav.toc a { display: block; padding: 8px 0; color: #334155; text-decoration: none; }
nav.toc a:hover { color: var(--site-brand-light); }
nav.toc a:focus-visible { outline: 2px solid var(--site-amber); outline-offset: 2px; border-radius: 4px; }
.article-content h2[id] { scroll-margin-top: 84px; }

/* 근거 법령 접기: <details class="statute-box"><summary>근거 법령·판례 보기</summary><div class="statute">…</div></details>
   처음엔 접힌 상태. 안의 .statute는 상자 모양만 빼고 그대로 둠 */
details.statute-box {
  margin: 28px 0; background: #f8fafc;
  border: 1px solid #e5e7eb; border-left: 4px solid var(--site-brand); border-radius: 0 10px 10px 0;
  font-family: var(--site-font);
}
details.statute-box > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; list-style: none; padding: 13px 18px 13px 20px;
  font-size: .94rem; font-weight: 700; line-height: 1.5; color: var(--site-brand);
}
details.statute-box > summary::-webkit-details-marker { display: none; }
details.statute-box > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--site-amber-deep); border-bottom: 2px solid var(--site-amber-deep);
  transform: rotate(45deg); transition: transform .15s;
}
details.statute-box[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
details.statute-box > summary:hover { background: #f1f5f9; }
details.statute-box > summary:focus-visible { outline: 2px solid var(--site-amber); outline-offset: 2px; }
details.statute-box > .statute {
  margin: 0; padding: 14px 20px 18px; background: none; border: 0; border-radius: 0;
  border-top: 1px solid #e5e7eb; font-size: .94rem;
}

/* 글쓴이: 법률칼럼·성공사례의 글 끝 상담 상자 바로 앞 (partials/author-box.html) */
.author-box {
  display: flex; align-items: flex-start; gap: 20px;
  margin: 40px 0 0; padding: 22px 24px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  font-family: var(--site-font); line-height: 1.6; word-break: keep-all;
}
.author-box .ab-photo {
  flex: none; width: 76px; height: 76px; border-radius: 50%;
  object-fit: cover; object-position: 50% 18%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #e5e7eb;
}
.author-box .ab-body { flex: 1; min-width: 0; }
.author-box p.ab-name { margin: 2px 0 2px; font-size: 1.05rem; font-weight: 800; color: var(--site-ink); }
.author-box p.ab-bio { margin: 0; font-size: .9rem; color: #475569; }
.author-box p.ab-bio span { white-space: nowrap; }
.author-box a.ab-book {
  display: flex; align-items: center; gap: 12px;
  width: fit-content; max-width: 100%;
  margin: 14px 0 0; padding: 10px 16px 10px 12px;
  background: #f8fafc; border: 1px solid #eef0f3; border-radius: 10px;
  color: var(--site-ink); text-decoration: none; font-size: .9rem; line-height: 1.5;
}
.author-box a.ab-book:hover { border-color: #e2d6c2; background: #fbf8f2; }
.author-box a.ab-book img { flex: none; width: 34px; height: auto; border-radius: 2px; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
.author-box a.ab-book small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--site-amber-deep); }
.author-box a.ab-book em { display: block; font-style: normal; font-size: .8rem; color: #64748b; }
.author-box a.ab-more {
  display: inline-block; margin: 10px 0 0;
  font-size: .88rem; font-weight: 700; color: var(--site-brand); text-decoration: none;
}
.author-box a.ab-more:hover { color: var(--site-brand-light); text-decoration: underline; text-underline-offset: 3px; }
.author-box a:focus-visible { outline: 2px solid var(--site-amber); outline-offset: 2px; }
@media (max-width: 480px) {
  .author-box {
    display: grid; grid-template-columns: 58px 1fr; column-gap: 14px; row-gap: 0; align-items: center;
    padding: 18px 16px;
  }
  .author-box .ab-body { display: contents; }
  .author-box .ab-photo { grid-row: 1 / span 2; width: 58px; height: 58px; }
  .author-box p.ab-name { grid-column: 2; align-self: end; margin: 0; }
  .author-box p.ab-bio { grid-column: 2; align-self: start; font-size: .86rem; }
  .author-box a.ab-book, .author-box a.ab-more { grid-column: 1 / -1; }
  .author-box a.ab-more { justify-self: start; }
}

/* 글 끝 상담 안내 (모든 이야기 글 공통, 네이비+앰버)
   <section class="footer-cta"><h3>…</h3><p>…</p><div class="fc-btns">
     <a class="fc-btn fc-btn--primary" href="consultation.html">온라인 상담 신청</a>
     <a class="fc-btn fc-btn--ghost" href="tel:010-2931-8462"><svg…>010-2931-8462</a></div></section> */
section.footer-cta {
  margin: 40px 0 0; padding: 34px 28px;
  background: radial-gradient(700px 300px at 85% 0%, rgba(226, 162, 79, .20), transparent 60%), linear-gradient(160deg, var(--site-night), var(--site-brand));
  border: 0; border-radius: 16px; text-align: center; color: #fff;
  font-family: var(--site-font); line-height: 1.7; word-break: keep-all;
}
.author-box + section.footer-cta { margin-top: 20px; }
section.footer-cta h3 { margin: 0 0 10px; font-size: 1.22rem; font-weight: 800; line-height: 1.5; color: #fff; }
section.footer-cta p { margin: 0 0 22px; font-size: .95rem; color: #b9c3d4; }
section.footer-cta .fc-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
section.footer-cta .fc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 99px; border: 0;
  font-size: 1rem; font-weight: 700; line-height: 1.4; text-decoration: none;
  box-shadow: none; transform: none; transition: filter .15s, background-color .15s;
}
section.footer-cta .fc-btn svg { flex: none; width: 17px; height: 17px; }
section.footer-cta .fc-btn--primary { background: linear-gradient(135deg, var(--site-amber), var(--site-amber-deep)); color: #241503; }
section.footer-cta .fc-btn--primary:hover { filter: brightness(1.06); }
section.footer-cta .fc-btn--ghost { background: #fff; color: var(--site-brand); }
section.footer-cta .fc-btn--ghost:hover { background: #f3efe6; }
section.footer-cta .fc-btn:focus-visible { outline: 2px solid var(--site-amber-soft); outline-offset: 3px; }
@media (max-width: 600px) {
  section.footer-cta { padding: 28px 18px; }
  section.footer-cta h3 { font-size: 1.12rem; }
  section.footer-cta .fc-btns { flex-direction: column; }
  section.footer-cta .fc-btn { width: 100%; }
}

/* =====================================================================
   글 제목의 부제와 글 끝 여백
   ===================================================================== */

/* 제목과 부제: <h1>제목<span class="subtitle">부제</span></h1>
   (stories-data.json의 title / subtitle과 같은 글자. 대시 없이 두 줄로 보임) */
h1 .subtitle {
  display: block; margin-top: 10px;
  font-size: .55em; font-weight: 600; line-height: 1.55; letter-spacing: -0.01em;
  color: var(--muted, #475569); word-break: keep-all;
}
/* 부제 줄바꿈: 두 줄 길이를 고르게 맞춰, 한 줄이 가운뎃점(·)으로 시작하거나
   마지막 줄에 한두 낱말만 남는 일을 줄임(이야기 목록 카드에도 적용) */
h1 .subtitle, .story-card .card-subtitle { text-wrap: balance; }

/* 이야기 목록 카드: 한 줄의 카드 높이는 같은데 "N분 분량 / 읽어보기" 줄이
   부제 유무에 따라 높낮이가 달라 보이던 것을 카드 맨 아래로 맞춤 */
.stories-grid .story-card { display: flex; flex-direction: column; }
.stories-grid .story-card[hidden] { display: none; }
.stories-grid .story-card .story-footer { margin-top: auto; }
.stories-grid .story-card .story-excerpt { margin-bottom: 16px; }

/* 이야기 글: 글 끝 상자(글쓴이·상담·면책 상자)와 바닥글 사이를 40px 안팎으로.
   글 페이지의 article 아래 여백(60px)과 바닥글 위 여백(64px)이 겹쳐 120px 넘게 비던 것을 줄임.
   이야기 글은 <body> 바로 아래 article 또는 div.container > article 구조 */
body > article, body > div.container > article { padding-bottom: 0; }
body > article ~ footer.sft,
body > div.container ~ footer.sft { margin-top: 40px; }
