/* 기사 페이지(/news/*) 스타일 — 홈페이지 기사 보기 창의 색·배치를 옮겨 왔다. */
:root {
  --primary: #1a6fd4;
  --primary-hover: #1456a8;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --accent: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
.brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

a {
  color: #93c5fd;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
}

/* ── 머리글 ── */
.site-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 0 10px;
  margin-bottom: 28px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 1.35rem;
  color: #fff;
  text-decoration: none;
}

.brand span {
  color: var(--primary);
}

.nav-link {
  font-size: 0.9rem;
  text-decoration: none;
}

.lang-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lang-btn {
  font-size: 0.75rem;
  color: var(--text-sub);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.lang-btn:hover,
.lang-btn.active {
  color: #fff;
  border-color: var(--primary);
}

/* ── 기사 상단 ── */
.print-btn-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}

.print-btn {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.print-btn:hover {
  background-color: var(--primary-hover);
}

.print-header,
.qr-container {
  display: none;
}

.top-layout {
  margin-bottom: 30px;
}

.top-layout.has-video {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .top-layout.has-video {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.article-title {
  font-size: 1.6rem;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 8px;
}

.article-subtitle {
  font-size: 0.95rem;
  color: var(--text-sub);
}

.pub-date {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin: 8px 0 12px;
}

.intro {
  background-color: rgba(255, 255, 255, 0.03);
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  padding: 16px;
  font-size: 0.95rem;
  color: var(--text-sub);
}

.intro audio {
  display: block;
  width: 100%;
  margin-top: 12px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── 오디오 ── */
.audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 16px;
}

.audio-bar audio {
  flex: 1 1 260px;
  min-width: 0;
}

.voice-toggle {
  display: flex;
  gap: 6px;
}

.voice-btn {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.voice-btn.active {
  color: #fff;
  border-color: var(--primary);
  background: rgba(26, 111, 212, 0.18);
}

/* ── 문장·대사 행 ── */
.sentence-row {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 35px;
  padding: 6px 8px;
  border-radius: 6px;
}

.sentence-row.single-col {
  grid-template-columns: 1fr;
}

.sentence-row.seg {
  cursor: pointer;
}

.sentence-row.seg:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sentence-row.playing {
  background: rgba(26, 111, 212, 0.16);
}

@media (max-width: 768px) {
  .sentence-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 8px;
  }
}

.news-english {
  color: #f8fafc;
  font-weight: 500;
  line-height: 1.35;
  font-size: 1.05rem;
}

.news-translation {
  color: var(--text-sub);
  font-size: 0.85rem;
  line-height: 1.35;
}

.news-translation .explain {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  color: #64748b;
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.dialog-section {
  margin-top: 35px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 25px;
}

.dialog-title {
  color: #93c5fd;
}

.dialog-english {
  color: #e2e8f0;
  line-height: 1.35;
  font-size: 1.05rem;
}

.dialog-translation {
  color: #38bdf8;
  font-size: 0.8rem;
  line-height: 1.35;
}

.dialog-english strong,
.dialog-translation strong {
  color: #93c5fd;
  margin-right: 6px;
}

/* ── 퀴즈 ── */
.quiz-section {
  margin-top: 25px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}

.quiz-title {
  color: var(--accent);
}

.quiz-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.quiz-question {
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 8px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
}

.quiz-option {
  color: #cbd5e1;
  font-size: 0.9rem;
  display: flex;
  gap: 8px;
}

.quiz-bullet {
  font-weight: 700;
  color: var(--accent);
}

.quiz-answer {
  margin-top: 8px;
  font-size: 0.88rem;
}

.quiz-answer summary {
  cursor: pointer;
  color: #93c5fd;
}

.quiz-answer .answer {
  color: #fff;
  font-weight: 600;
  margin-top: 6px;
}

.answer-explain {
  color: var(--text-sub);
  margin-top: 4px;
}

/* ── 광고·앱 안내 ── */
.ad-slot {
  margin: 28px 0;
}

/* 채울 광고가 없으면 AdSense가 unfilled로 표시한다 — 빈 칸을 남기지 않는다. */
ins.adsbygoogle[data-ad-status='unfilled'] {
  display: none !important;
}

.app-cta {
  margin: 40px 0 10px;
  padding: 20px;
  border-radius: 12px;
  background: var(--bg-card);
  text-align: center;
}

/* 홈페이지(index.html) 다운로드 배지와 같은 값 — 한쪽을 바꾸면 함께 맞춘다. */
.download-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}

.badge-btn {
  display: inline-flex;
  align-items: center;
  background-color: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 16px;
  color: white;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;
}

.badge-btn:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.badge-btn svg {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  fill: currentColor;
}

.badge-btn .btn-label {
  font-size: 0.65rem;
  color: var(--text-sub);
  text-transform: uppercase;
  display: block;
  line-height: 1.1;
}

.badge-btn .btn-text {
  font-size: 0.9rem;
  font-weight: 700;
  display: block;
}

/* ── 목록 ── */
.archive-title {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease;
}

.news-card:hover {
  transform: translateY(-3px);
}

.news-card img,
.news-card .img-ph {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #334155;
}

.news-card-body {
  padding: 14px 16px 16px;
}

.news-card h2 {
  font-size: 1.02rem;
  color: #fff;
  line-height: 1.35;
}

.news-card p {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.news-card time {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 8px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: var(--text-sub);
}

.pager a {
  text-decoration: none;
  font-size: 1.2rem;
}

.not-found {
  text-align: center;
  padding: 80px 0;
}

/* ── 바닥글 ── */
.site-footer {
  margin-top: 50px;
  padding: 24px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.footer-links a {
  color: var(--text-sub);
  text-decoration: none;
}

/* ── 인쇄: 본문·퀴즈·대화만 흑백으로(기사 보기 창의 인쇄 배치를 유지) ── */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .site-header,
  .site-footer,
  .print-btn-row,
  .top-layout,
  .audio-bar,
  .ad-slot,
  .app-cta,
  .quiz-answer {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .print-header {
    display: grid !important;
    grid-template-columns: 7.2fr 2.8fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
  }

  .print-header > div:last-child {
    display: flex;
    justify-content: flex-end;
  }

  .print-url {
    font-size: 9pt;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .print-title {
    font-size: 16pt;
    font-weight: bold;
    line-height: 1.3;
  }

  .print-subtitle {
    font-size: 10pt;
    color: #555;
  }

  .sentence-row {
    grid-template-columns: 6fr 4fr !important;
    gap: 20px;
    padding: 3px 0;
    page-break-inside: avoid;
    background: none !important;
  }

  .sentence-row.single-col {
    grid-template-columns: 1fr !important;
  }

  .news-english,
  .dialog-english,
  .quiz-question {
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.15;
  }

  .news-translation,
  .dialog-translation,
  .quiz-option,
  .news-translation .explain {
    color: #4b5563 !important;
    font-size: 9.5pt;
    line-height: 1.15;
  }

  .dialog-english strong,
  .dialog-translation strong,
  .quiz-bullet,
  .section-title {
    color: #000 !important;
  }

  .dialog-section {
    border-top: none;
    break-before: page;
  }

  .quiz-section {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    margin-top: 22px;
    padding: 9px 10px;
    border-radius: 5px;
    page-break-inside: avoid;
  }

  .quiz-title {
    font-size: 10.5pt;
    margin: 0 0 7px;
  }

  .quiz-body {
    display: grid;
    grid-template-columns: 29% 34% 37%;
  }

  .quiz-item {
    min-width: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 2px 10px;
  }

  .quiz-item:first-child {
    padding-left: 0;
  }

  .quiz-item + .quiz-item {
    border-left: 1px solid #d1d5db;
  }

  .quiz-question {
    font-size: 9pt;
    margin: 0 0 4px;
  }

  .quiz-options {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .quiz-option {
    font-size: 8pt;
    overflow-wrap: anywhere;
  }

  .qr-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ddd;
    padding: 6px;
    border-radius: 6px;
    width: 100px;
  }

  .qr-image {
    width: 80px;
    height: 80px;
  }

  .qr-label {
    font-size: 7pt;
    color: #555;
    margin-top: 4px;
    font-weight: 600;
  }
}
