/**
 * KWAVE M Korean editorial typography.
 */

:root {
  --kmag-news-serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  --kmag-news-sans: "Noto Sans KR", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --kmag-paper-warm: #fffdf9;
  --kmag-news-line: #dedbd4;
}

html[lang^="ja"] {
  --kmag-serif: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --kmag-sans: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

html[lang^="ko"] {
  --kmag-serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --kmag-sans: "Noto Sans KR", Pretendard, "Apple SD Gothic Neo", sans-serif;
}

body {
  background: var(--kmag-paper-warm);
  font-family: var(--kmag-sans);
  letter-spacing: -.012em;
  font-kerning: normal;
}

html[lang^="ja"] body {
  font-feature-settings: "palt" 1, "kern" 1;
  line-break: strict;
}

/* Korean layouts use keep-all heavily; Japanese needs native CJK line breaks. */
html[lang^="ja"] .publication-desk__copy h2,
html[lang^="ja"] .publication-desk__copy > p,
html[lang^="ja"] .reader-voices__heading h2,
html[lang^="ja"] .reader-voices__heading > p,
html[lang^="ja"] .inside-newsroom__copy h2,
html[lang^="ja"] .inside-newsroom__copy > p,
html[lang^="ja"] .inside-newsroom__copy li,
html[lang^="ja"] .single-header h1,
html[lang^="ja"] .comments-title,
html[lang^="ja"] .comments-guidance,
html[lang^="ja"] .community-guidelines__body li span,
html[lang^="ja"] .information-page h1,
html[lang^="ja"] .information-page h2,
html[lang^="ja"] .information-page h3,
html[lang^="ja"] .information-page p,
html[lang^="ja"] .information-page summary {
  overflow-wrap: anywhere;
  word-break: normal;
}

html[lang^="ko"] body { word-break: keep-all; }

.editorial-heading,
.publication-desk__copy h2,
.inside-newsroom__copy h2,
.publication-footer-desk__statement h2,
.article-trust__heading h2,
.kmag-v4-article-brief__label h2 {
  font-family: var(--kmag-serif);
  font-weight: 600;
}

.editorial-heading {
  letter-spacing: -.035em;
  text-transform: none;
}

/* Story cards read like a newspaper index rather than a generic app grid. */
.vertical-card h3,
.horizontal-card h3,
.ranking-card h3,
.hero-sub-card h2,
.photo-card h3,
.reader-voice-card strong {
  font-family: var(--kmag-sans);
  font-weight: 650;
  letter-spacing: -.025em;
}

.entry-card-meta,
.single-meta,
.publication-article-date,
.article-trust__details,
.article-publisher {
  font-variant-numeric: tabular-nums;
}

/* Long-form news layout. */
.single-layout {
  grid-template-columns: minmax(0, 820px) 300px;
  gap: 48px;
}

.single-header {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  padding-top: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--kmag-news-line);
}

.single-header h1 {
  max-width: none;
  color: #171511;
  font-family: var(--kmag-serif);
  font-size: clamp(3.5rem, 4.1vw, 5.3rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.34;
}

html[lang^="ja"] .single-header h1 {
  letter-spacing: -.035em;
  line-height: 1.48;
}

.single-excerpt {
  margin-top: 22px;
  color: #54514c;
  font-size: 1.65rem;
  font-weight: 450;
  letter-spacing: -.02em;
  line-height: 1.9;
}

.single-category {
  margin-bottom: 18px;
  border-bottom-width: 1px;
  font-family: var(--kmag-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .11em;
}

.single-meta {
  margin-top: 24px;
  padding-top: 18px;
  color: #77746e;
  font-family: var(--kmag-sans);
  font-size: 1.02rem;
}

.single-featured-image,
.article-secondary-visual,
.article-publisher,
.article-share,
.article-topics,
.kmag-v4-article-brief,
.article-trust {
  width: min(100%, 680px);
}

.single-featured-image { margin-top: 30px; }

.entry-content {
  width: min(100%, 680px);
  padding-top: 42px;
  color: #24211d;
  font-family: var(--kmag-serif);
  font-size: 1.76rem;
  font-weight: 400;
  letter-spacing: -.012em;
  line-height: 2.08;
}

html[lang^="ja"] .entry-content {
  font-size: 1.7rem;
  letter-spacing: .005em;
  line-break: strict;
  line-height: 2.16;
  overflow-wrap: anywhere;
  word-break: normal;
}

html[lang^="ko"] .entry-content {
  line-height: 2.06;
  word-break: keep-all;
}

.entry-content p { margin-bottom: 2em; }

.entry-content h2 {
  margin-top: 2.65em;
  padding: .7em 0 .68em;
  border-top: 3px solid #1b1916;
  border-bottom: 1px solid var(--kmag-news-line);
  color: #171511;
  font-family: var(--kmag-sans);
  font-size: 2.45rem;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.55;
}

.entry-content h3 {
  font-family: var(--kmag-sans);
  font-weight: 700;
}

.entry-content blockquote {
  position: relative;
  margin: 2.6em 0;
  padding: 30px 34px 30px 42px;
  border: 0;
  border-top: 1px solid #b9b4aa;
  border-bottom: 1px solid #b9b4aa;
  background: transparent;
  color: #403b35;
  font-family: var(--kmag-serif);
  font-size: 1.9rem;
  line-height: 1.95;
}

.entry-content blockquote::before {
  position: absolute;
  top: 21px;
  left: 7px;
  color: var(--kmag-accent);
  content: "“";
  font-family: Georgia, serif;
  font-size: 4.8rem;
  line-height: 1;
}

.entry-content .kmag-reporter-note {
  padding: 18px 20px;
  border-left: 3px solid var(--kmag-accent);
  background: #f6f3ed;
  color: #625e57;
  font-family: var(--kmag-sans);
  font-size: 1.18rem;
  line-height: 1.85;
}

.kmag-v4-article-brief {
  margin-top: 34px;
  padding: 27px 29px;
  border-top-color: #171511;
  background: #f4f1eb;
}

.kmag-v4-article-brief > p {
  color: #3d3934;
  font-family: var(--kmag-serif);
  font-size: 1.33rem;
  line-height: 1.95;
}

.article-trust { border-color: var(--kmag-news-line); }
.article-trust__heading { background: #191714; }
.article-trust__details { background: #fffefa; }

/* The language itself changes typographic rhythm without changing layout. */
.language-switcher a,
.kmag-language-switcher a,
.kmag-language-switch a {
  font-family: var(--kmag-sans);
  font-feature-settings: normal;
}

@media (max-width: 1100px) {
  .single-layout { grid-template-columns: minmax(0, 1fr) 286px; gap: 30px; }
}

@media (max-width: 900px) {
  .single-layout { display: block; }
  .single-header { padding-top: 24px; }
}

@media (max-width: 767px) {
  .single-header {
    padding: 20px 6px 22px;
  }

  .single-header h1 {
    font-size: 3.15rem;
    letter-spacing: -.04em;
    line-height: 1.42;
  }

  html[lang^="ja"] .single-header h1 {
    font-size: 2.9rem;
    line-height: 1.52;
  }

  .single-excerpt { font-size: 1.42rem; line-height: 1.85; }
  .single-meta { align-items: flex-start; justify-content: flex-start; }

  .entry-content {
    padding-top: 34px;
    font-size: 1.62rem;
    line-height: 2;
  }

  html[lang^="ja"] .entry-content { font-size: 1.57rem; line-height: 2.08; }
  .entry-content h2 { font-size: 2.1rem; }
  .entry-content blockquote { padding: 25px 20px 25px 32px; font-size: 1.68rem; }
  .entry-content blockquote::before { left: 2px; font-size: 3.9rem; }

  .kmag-v4-article-brief {
    margin-top: 24px;
    padding: 21px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
