/* ============================================================
   데일리 뉴스 - 스타일시트
   색상·글꼴을 바꾸려면 아래 :root 값만 수정하면 됩니다.
   ============================================================ */

:root {
  --accent: #0b57d0;          /* 포인트 색(파랑) */
  --accent-dark: #083f9c;
  --ink: #16181d;             /* 기본 글자색 */
  --ink-2: #454a54;
  --muted: #7a8089;           /* 날짜·기자명 등 */
  --line: #e4e7eb;            /* 구분선 */
  --line-strong: #c9cdd4;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --max: 1200px;              /* 본문 최대 폭 */
  --radius: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- 상단 얇은 바 ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 34px;
}
.topbar-links { display: flex; gap: 14px; }

/* ---------- 헤더 ---------- */
.masthead { border-bottom: 1px solid var(--line); }
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 18px; padding-bottom: 18px;
}
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-mark {
  font-size: 30px; font-weight: 900; letter-spacing: -1.2px;
  color: var(--accent);
}
.logo-tagline { font-size: 13px; color: var(--muted); }

.searchbox { display: flex; align-items: center; gap: 0; }
.searchbox input {
  width: 200px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.searchbox input:focus { border-color: var(--accent); }
.searchbox button {
  height: 36px; padding: 0 16px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; font-family: inherit;
}
.searchbox button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ---------- 카테고리 내비 ---------- */
.nav {
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 50; background: var(--bg);
}
.nav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.nav .wrap::-webkit-scrollbar { height: 0; }
.nav a {
  padding: 13px 16px; font-size: 16px; font-weight: 700;
  white-space: nowrap; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.nav a:hover { color: var(--accent); }
.nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- 속보 띠 ---------- */
.ticker {
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px;
}
.ticker-label {
  flex: none; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 2px;
}
.ticker-item { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 썸네일 ---------- */
.thumb {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft);
  border-radius: var(--radius);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
a:hover .thumb img { transform: scale(1.03); }
.thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.92); font-weight: 800; letter-spacing: 2px;
  font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* ---------- 공통 메타 ---------- */
.meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meta .dot::before { content: "·"; }
.cat-tag {
  display: inline-block; font-size: 12px; font-weight: 800;
  color: var(--accent); letter-spacing: .3px;
}

/* ---------- 섹션 제목 ---------- */
.section { margin: 38px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 18px;
}
.section-head h2 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.5px; }
.section-head a { font-size: 13px; color: var(--muted); }

/* ---------- 홈 상단(톱기사 + 헤드라인) ---------- */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; margin: 28px 0 10px; }
.hero-main .thumb { aspect-ratio: 16 / 9; margin-bottom: 14px; }
.hero-main h1 {
  margin: 8px 0 10px; font-size: 34px; line-height: 1.28;
  font-weight: 900; letter-spacing: -1px;
}
.hero-main p { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; }

.hero-side { display: flex; flex-direction: column; }
.hero-side h3 {
  margin: 0 0 12px; font-size: 15px; font-weight: 900;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px;
}
.headline-list { list-style: none; margin: 0; padding: 0; }
.headline-list li { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.headline-list li:last-child { border-bottom: 0; }
.headline-list .t { font-size: 16px; font-weight: 700; line-height: 1.4; display: block; margin-bottom: 5px; }

/* ---------- 카드 그리드 ---------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card .thumb { margin-bottom: 11px; }
.card h3 { margin: 6px 0 7px; font-size: 17px; line-height: 1.42; font-weight: 700; letter-spacing: -.3px; }
.card p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 본문 + 사이드바 레이아웃 ---------- */
.with-side { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }

.side-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; }
.side-box h3 { margin: 0 0 14px; font-size: 16px; font-weight: 900; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank-list li { display: flex; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.rank-list li:first-child { border-top: 0; padding-top: 0; }
.rank-num {
  flex: none; width: 21px; height: 21px; border-radius: 2px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.rank-list li:nth-child(-n+3) .rank-num { background: var(--accent); }
.rank-list .t { font-size: 14.5px; line-height: 1.45; font-weight: 600; }

/* ---------- 리스트형(카테고리·검색) ---------- */
.list-item {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.list-item:first-child { padding-top: 0; }
.list-item h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.38; font-weight: 800; letter-spacing: -.4px; }
.list-item p { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 기사 상세 ---------- */
.article { max-width: 100%; }
.crumb { font-size: 13px; color: var(--muted); margin: 22px 0 14px; }
.crumb a { color: var(--muted); }
.article-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.article-head h1 {
  margin: 10px 0 14px; font-size: 32px; line-height: 1.34;
  font-weight: 900; letter-spacing: -1px;
}
.article-head .lead { margin: 0 0 16px; font-size: 17px; color: var(--ink-2); line-height: 1.62; }
.byline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }

.article-body { font-size: 17.5px; line-height: 1.85; color: #22252b; }
.article-body p { margin: 0 0 22px; }
.article-body h2 {
  margin: 36px 0 14px; font-size: 21px; font-weight: 900; letter-spacing: -.5px;
  padding-left: 12px; border-left: 4px solid var(--accent);
}
.article-body blockquote {
  margin: 28px 0; padding: 18px 22px; background: var(--bg-soft);
  border-left: 3px solid var(--accent); font-size: 17px; color: var(--ink-2);
}
.article-body figure { margin: 28px 0; }
.article-body figure img {
  border-radius: var(--radius);
  max-height: 78vh;        /* 세로로 긴 사진이 화면을 다 차지하지 않도록 */
  width: auto;
  margin: 0 auto;
}
.article-body figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.article-body .sample-note {
  margin-top: 32px; font-size: 13px; color: var(--muted);
  border-top: 1px dashed var(--line); padding-top: 14px;
}
.article-hero { margin: 0 0 26px; }
.article-hero .thumb { aspect-ratio: 16 / 9; }
.article-hero figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0; }
.tag {
  font-size: 13px; color: var(--ink-2); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 99px; padding: 5px 13px;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 30px 0; }
.prevnext a {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.prevnext a:hover { border-color: var(--accent); }
.prevnext .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.prevnext .t { font-size: 15px; font-weight: 700; line-height: 1.4; }
.prevnext .next { text-align: right; }

/* ---------- 푸터 ---------- */
.footer { margin-top: 56px; border-top: 3px solid var(--ink); background: var(--bg-soft); }
.footer .wrap { padding-top: 28px; padding-bottom: 34px; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.footer-logo { font-size: 22px; font-weight: 900; color: var(--accent); letter-spacing: -1px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.footer-info { font-size: 12.5px; color: var(--muted); line-height: 1.8; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- 빈 상태 ---------- */
.empty { padding: 70px 0; text-align: center; color: var(--muted); }
.empty strong { display: block; font-size: 18px; color: var(--ink); margin-bottom: 8px; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .hero-main h1 { font-size: 27px; }
  .with-side { grid-template-columns: 1fr; gap: 10px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .article-head h1 { font-size: 26px; }
  .article-body { font-size: 16.5px; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .masthead .wrap { flex-direction: column; align-items: flex-start; gap: 12px; }
  .searchbox { width: 100%; }
  .searchbox input { flex: 1; width: auto; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .list-item { grid-template-columns: 120px 1fr; gap: 14px; }
  .list-item h3 { font-size: 16px; }
  .list-item p { display: none; }
  .hero-main h1 { font-size: 23px; }
  .prevnext { grid-template-columns: 1fr; }
  .topbar-links { display: none; }
}
