@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  /* ── 컬러 팔레트 ── */
  --ink:        #1a1a1a;          /* 기본 텍스트 (거의 검정) */
  --ink-soft:   #48545a;          /* 보조 본문 텍스트 (흰 배경 기준 7.80:1) */
  --paper:      #ffffff;          /* 기본 배경 (흰색) */
  --paper-deep: #f5f5f5;          /* 심화 배경 (연한 회색) */
  --brand:      #1e3a5f;          /* 브랜드 주색 (진한 네이비) */
  --brand-dark: #0f1f33;          /* 브랜드 어두운 색 (더 진한 네이비) */
  --signal:     #c0392b;          /* 강조/포인트 색 (붉은 강조, 흰 배경 기준 5.44:1) */
  --rule:       #dddddd;          /* 장식 구분선 (흰 배경 기준 1.36:1, 장식 전용) */
  --rule-strong: #767d85;         /* 의미를 가진 경계선 (흰 배경 기준 4.16:1) */
  --muted:      #666666;          /* 보조 텍스트 (중간 회색, 흰 배경 기준 5.74:1) */

  /* ── 브랜드 배경 위 텍스트 ── */
  --on-brand:         #ffffff;   /* 브랜드 배경 위 본문 */
  --on-brand-soft:    #dce7e9;   /* 브랜드 어두운 배경 위 보조 텍스트 (13.17:1) */
  --on-brand-muted:   #9fb0b7;   /* 브랜드 어두운 배경 위 약한 텍스트 (7.41:1) */
  --on-brand-line:    rgb(255 255 255 / .25);  /* 브랜드 배경 위 구분선 */
  --on-brand-line-soft: rgb(255 255 255 / .2);
  --shadow-brand:     rgb(0 0 0 / .25);        /* 떠 있는 패널 그림자 */

  /* ── 레이아웃 ── */
  --content-max: 1320px;          /* 최대 콘텐츠 폭 */
  --article-max: 740px;           /* 기사 본문 최대 폭 */

  /* ── 구분선 굵기 ── */
  --hairline:      1px;           /* 기본 구분선 */
  --rule-thick:    2px;           /* 입력 필드 경계 */
  --rule-accent:   3px;           /* 소제목 구분선 */
  --rule-lead:     4px;           /* 주요 내비게이션 강조선 */
  --rule-display:  7px;           /* 인용/푸터 강조선 */
  --rule-hero:     9px;           /* 섹션 상단 강조선 */

  /* ── 타이포그래피 ── */
  --display: "Pretendard Variable", Pretendard, sans-serif;  /* 헤드라인 폰트 */
  --sans:    "Pretendard Variable", Pretendard, sans-serif;  /* 본문 폰트 */

  /*
   * ── 커스터마이징 가이드 ──
   *
   * 색상 변경:
   *   --brand를 원하는 브랜드 색으로 교체 (예: #2563eb 블루, #16a34a 그린)
   *   --signal을 포인트 색으로 교체 (예: #f59e0b 앰버, #7c3aed 퍼플)
   *
   * 다크 테마:
   *   --ink: #e8e8e8; --paper: #121212; --paper-deep: #1e1e1e;
   *   --on-brand-* 계열도 함께 어두운 배경에 맞게 조정할 것.
   *
   * 폰트 변경:
   *   구글 폰트 사용 예:
   *   @import url("https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;700&display=swap");
   *   --display: 'Noto Serif KR', serif;
   */
}

/* ── 기본 리셋 ── */
*, *::before, *::after { box-sizing: border-box; }
html  { scroll-behavior: smooth; overflow-x: hidden; }
body  { margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); font-family: var(--sans); }
a     { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .16em; }
img   { display: block; width: 100%; max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ── 레이아웃 유틸리티 ── */
.shell   { width: min(calc(100% - 40px), var(--content-max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── 스킵 링크 (접근성) ── */
.skip-link { position: fixed; z-index: 99; top: 8px; left: 8px; padding: 10px 14px; background: var(--on-brand); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 헤더 영역
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.site-header { background: var(--paper); }
.utility-bar   { color: var(--on-brand-soft); background: var(--brand-dark); font-size: .73rem; letter-spacing: .04em; }
.utility-inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; }
.utility-search { display: flex; }
.utility-search input, .mobile-panel input { min-width: 180px; padding: 7px 10px; border: 0; background: var(--on-brand); font: inherit; color: var(--ink); }
.utility-search input::placeholder, .mobile-panel input::placeholder { color: var(--muted); opacity: 1; }
.utility-search button, .mobile-panel button { border: 0; padding: 7px 12px; color: var(--on-brand); background: var(--signal); font-weight: 700; }
.utility-search button:focus-visible, .mobile-panel button:focus-visible { outline-color: var(--on-brand); }

.masthead { min-height: 132px; display: flex; align-items: flex-end; justify-content: space-between; padding-block: 34px 22px; }
.wordmark { color: var(--brand); font-family: var(--display); font-size: clamp(2.2rem, 6vw, 4.6rem); font-weight: 700; line-height: .88; letter-spacing: -.06em; text-decoration: none; }
.wordmark-logo { display: block; width: auto; max-width: 320px; height: auto; }
.wordmark-kicker { display: block; margin-bottom: 10px; color: var(--signal); font: 800 .65rem/1 var(--sans); letter-spacing: .24em; }
.masthead-note { max-width: 190px; margin: 0 0 4px; color: var(--muted); text-align: right; font-family: var(--display); }

.primary-nav { color: var(--on-brand); background: var(--brand); border-bottom: var(--rule-lead) solid var(--signal); }
.nav-inner { display: flex; align-items: stretch; }
.nav-inner > a { padding: 14px 24px; border-right: var(--hairline) solid var(--on-brand-line); font-weight: 700; text-decoration: none; }
.nav-inner > a:hover, .nav-inner > a:focus-visible { background: var(--signal); }
.nav-inner > a:focus-visible { outline-color: var(--on-brand); }

.mobile-menu { display: none; position: relative; margin-left: auto; }
.mobile-menu summary { cursor: pointer; padding: 14px; font-weight: 700; }
.mobile-panel { position: absolute; z-index: 10; right: 0; width: min(88vw, 340px); padding: 18px; background: var(--brand-dark); box-shadow: 0 18px 40px var(--shadow-brand); }
.mobile-panel a { display: block; padding: 12px 0; border-bottom: var(--hairline) solid var(--on-brand-line-soft); text-decoration: none; }
.mobile-panel form { display: flex; margin-top: 18px; }

.topic-nav { border-bottom: var(--hairline) solid var(--rule); background: var(--paper-deep); }
.topic-inner { display: flex; gap: 22px; overflow-x: auto; padding-block: 10px; white-space: nowrap; font-size: .78rem; }
.topic-inner span { color: var(--signal); font-weight: 900; }
.topic-inner a { text-decoration: none; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 홈 / 섹션 레이아웃
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.news-home, .section-page, .search-page { padding-block: clamp(36px, 7vw, 82px); }
.editorial-container { border-top: var(--rule-hero) solid var(--brand); }
.editorial-container + .editorial-container { margin-top: clamp(36px, 6vw, 72px); }
.container-header { display: flex; align-items: end; justify-content: space-between; padding: 14px 0 18px; border-bottom: var(--hairline) solid var(--ink); }
.container-header > div { display: flex; gap: 14px; align-items: baseline; }
.container-header span, .page-heading > span { color: var(--signal); font-weight: 900; font-size: .72rem; letter-spacing: .16em; }
.container-header h1, .container-header h2 { margin: 0; font-family: var(--display); font-size: clamp(1.7rem, 4vw, 2.8rem); letter-spacing: -.03em; }
.container-header p { margin: 0; color: var(--muted); font-family: var(--display); }

.lead-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.lead-layout--0 { grid-template-columns: 1fr; }
.lead-slot { grid-row: span 3; border-right: var(--hairline) solid var(--rule); }
.lead-layout--0 .lead-slot { grid-row: auto; border-right: 0; }
.lead-layout--1 .lead-slot { grid-row: span 1; }
.lead-layout--2 .lead-slot { grid-row: span 2; }
.support-slot { border-bottom: var(--hairline) solid var(--rule); }
.lead-layout--0 .support-slot { border-bottom: 0; }

.briefs-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
.briefs-list .story-card--text { border-bottom: 0; }
.story-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: var(--hairline) solid var(--ink); }
.section-note { margin: 0; padding: 26px 0; color: var(--muted); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 기사 카드
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.story-card { position: relative; min-width: 0; }
.story-card a { text-decoration: none; }
.story-card h2, .story-card h3 { margin: 0; font-family: var(--display); letter-spacing: -.035em; word-break: keep-all; overflow-wrap: anywhere; }
.story-card a:hover { text-decoration: underline; }
.story-copy { padding: 18px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--signal); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.story-card time { display: block; margin-top: 16px; color: var(--muted); font-size: .7rem; }
.story-media { display: block; overflow: hidden; background: var(--paper-deep); }
.story-media img { aspect-ratio: 16/9; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.story-card:hover .story-media img { transform: scale(1.025); }

.story-card--lead h2 { max-width: 16ch; font-size: clamp(2rem, 4.1vw, 4.5rem); line-height: 1.08; }
.story-card--lead p { max-width: 58ch; margin: 18px 0 0; color: var(--ink-soft); font-family: var(--display); font-size: 1.08rem; line-height: 1.65; }

.story-card--horizontal { min-height: 145px; display: grid; grid-template-columns: 1fr minmax(100px, 34%); }
.story-card--horizontal .story-media img { height: 100%; aspect-ratio: auto; }
.story-card--horizontal h2, .story-card--horizontal h3 { font-size: clamp(1.08rem, 1.8vw, 1.45rem); line-height: 1.28; }

.story-card--standard { border-right: var(--hairline) solid var(--rule); border-bottom: var(--hairline) solid var(--rule); }
.story-card--standard h3 { font-size: 1.3rem; line-height: 1.3; }
.story-card--compact, .story-card--text { padding: 16px; border-bottom: var(--hairline) solid var(--rule); }
.empty-state { padding: 70px 20px; color: var(--muted); text-align: center; background: var(--paper-deep); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 섹션 페이지
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.page-heading { display: flex; gap: 18px; align-items: baseline; padding-bottom: 18px; border-top: var(--rule-hero) solid var(--signal); border-bottom: var(--hairline) solid var(--ink); }
.page-heading h1 { margin: 14px 0 0; font-family: var(--display); font-size: clamp(2.4rem, 7vw, 5rem); }
.section-list { max-width: 920px; }
.section-list .story-card--horizontal { grid-template-columns: 1fr minmax(180px, 32%); border-bottom: var(--hairline) solid var(--rule); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 기사 페이지
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.article-page { padding-bottom: 90px; }
.article-header { padding-top: clamp(42px, 8vw, 96px); }
.article-section { color: var(--signal); font-size: .82rem; font-weight: 900; }
.article-header h1 { max-width: 1020px; margin: 16px 0 24px; font-family: var(--display); font-size: clamp(2.7rem, 7.5vw, 6.5rem); line-height: 1.08; letter-spacing: -.055em; word-break: keep-all; overflow-wrap: anywhere; }
.standfirst { max-width: 820px; color: var(--ink-soft); font-family: var(--display); font-size: clamp(1.15rem, 2.1vw, 1.55rem); line-height: 1.65; word-break: keep-all; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 32px; padding-top: 14px; border-top: var(--hairline) solid var(--rule); color: var(--muted); font-size: .75rem; }
.article-hero { width: min(calc(100% - 40px), var(--article-max)); margin: 42px auto 0; } /* 대표 이미지 최대 폭 = 본문 폭 */
.article-hero img { max-height: 760px; object-fit: cover; }
.article-hero figcaption { padding-top: 9px; color: var(--muted); font-size: .72rem; }
.article-hero figcaption span { float: right; }
.article-body { width: min(calc(100% - 40px), var(--article-max)); margin: 58px auto 0; font-family: var(--display); font-size: 1.12rem; line-height: 1.95; word-break: keep-all; overflow-wrap: anywhere; }
.article-body p { margin: 0 0 1.65em; }
.article-body h2, .article-body h3 { margin: 2.2em 0 .7em; line-height: 1.35; }
.article-body blockquote { margin: 2em -60px; padding: 16px 0 16px 28px; border-left: var(--rule-display) solid var(--signal); color: var(--brand); font-size: 1.35rem; }
.article-footer { width: min(calc(100% - 40px), var(--article-max)); margin: 48px auto 0; padding-top: 20px; border-top: var(--rule-accent) solid var(--brand); }
.article-footer span { display: inline-block; margin: 0 8px 8px 0; padding: 7px 10px; background: var(--paper-deep); font-size: .78rem; }

.related-stories { padding-block: clamp(36px, 6vw, 64px); border-top: var(--rule-accent) solid var(--brand); }
.related-stories h2 { margin: 0 0 22px; font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.03em; }
.related-stories .story-grid { border-top: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 사이트 푸터
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.site-footer { margin-top: 70px; padding: 48px 0; color: var(--on-brand-soft); background: var(--brand-dark); border-top: var(--rule-display) solid var(--signal); }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; }
.footer-grid strong { color: var(--on-brand); font: 700 1.5rem var(--display); }
.footer-grid p { color: var(--on-brand-muted); }
.footer-grid nav { display: flex; gap: 22px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 검색 페이지
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.search-form { display: flex; gap: 8px; margin: 24px 0; }
.search-form input { flex: 1; padding: 12px 16px; border: var(--rule-thick) solid var(--rule-strong); font: inherit; font-size: 1rem; }
.search-form button { padding: 12px 24px; background: var(--brand); color: var(--on-brand); border: 0; font-weight: 700; cursor: pointer; }
.search-summary { margin: 0 0 24px; color: var(--muted); }
.search-results { border-top: var(--hairline) solid var(--rule); }
.search-results .story-card--horizontal { border-bottom: var(--hairline) solid var(--rule); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 반응형
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 1023px) {
  .lead-layout { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .lead-layout--0 { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .briefs-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-card--lead h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
}
@media (max-width: 639px) {
  .shell { width: min(calc(100% - 24px), var(--content-max)); }
  .utility-search, .masthead-note, .nav-inner > a, .topic-inner span { display: none; }
  .utility-inner { justify-content: flex-end; }
  .masthead { min-height: 105px; padding-block: 24px 17px; }
  .wordmark { font-size: clamp(2.05rem, 12vw, 3rem); }
  .mobile-menu { display: block; }
  .topic-inner { gap: 18px; }
  .news-home, .section-page, .search-page { padding-block: 34px; }
  .container-header { align-items: flex-start; }
  .container-header p { display: none; }
  .lead-layout { display: block; }
  .lead-slot { border-right: 0; border-bottom: var(--rule-lead) solid var(--brand); }
  .lead-layout--0 .lead-slot { border-bottom: var(--rule-lead) solid var(--brand); }
  .story-card--lead .story-copy { padding-inline: 4px; }
  .story-card--lead h2 { font-size: 2.35rem; }
  .story-card--lead p { font-size: 1rem; }
  .story-card--horizontal { min-height: 128px; grid-template-columns: 1fr minmax(105px, 34%); }
  .story-card--horizontal .story-copy { padding-left: 4px; }
  .story-grid { grid-template-columns: 1fr; }
  .briefs-list { grid-template-columns: 1fr; }
  .story-card--standard { display: grid; grid-template-columns: minmax(115px, 35%) 1fr; border-right: 0; }
  .story-card--standard .story-copy { order: -1; padding-left: 4px; }
  .article-header h1 { font-size: clamp(2.55rem, 13vw, 4rem); line-height: 1.12; }
  .standfirst { font-size: 1.08rem; line-height: 1.7; }
  .article-hero { width: calc(100% - 32px); }
  .article-body { width: calc(100% - 32px); margin-top: 42px; font-size: 1.04rem; line-height: 1.9; }
  .article-body blockquote { margin-inline: 0; }
  .footer-grid { display: block; }
  .footer-grid nav { margin-top: 30px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-media img { transition: none; }
}
