/* ===========================================================================
   The Korea Ledger — site styles
   Design thesis: this is a fact-synthesis wire, so provenance is the identity.
   The signature element is the monospace "source ledger" that rides with every
   story. Everything else stays quiet so the ledger reads as the point.
   ===========================================================================*/

:root {
  --paper:    #F1EEE7;  /* brand paper */
  --ink:      #16181B;  /* brand ink   */
  --slate:    #5B6472;  /* secondary text / metadata                         */
  --seal:     #A62318;  /* brand seal-red (the dojang stamp)                 */
  --hairline: #DEDAD0;
  --faint:    #E8E4DA;

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body:    "Newsreader", Georgia, serif;
  --mono:    "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 38rem;        /* readable line length for article body          */
  --gutter:  clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}

a { color: var(--ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--seal); }

img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

/* --- Masthead (centered, newspaper-style) ------------------------------- */
.masthead { border-top: 3px solid var(--seal); }
.masthead__utility { border-bottom: 1px solid var(--hairline); }
.masthead__utility-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.03em; color: var(--slate);
}
.masthead__util-links a { margin-left: 1.1rem; text-decoration: none; color: var(--slate); }
.masthead__util-links a:hover { color: var(--seal); }

/* breaking-news bar */
.breaking { background: var(--seal); color: #fff; }
.breaking__inner { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem var(--gutter); }
.breaking__tag {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; background: #fff; color: var(--seal); padding: 0.15rem 0.45rem;
  border-radius: 3px; flex: 0 0 auto;
}
.breaking__text { color: #fff; font-size: 0.92rem; line-height: 1.35; font-weight: 500; flex: 1 1 auto; }
a.breaking__text { text-decoration: none; }
a.breaking__text:hover { text-decoration: underline; }
.breaking__close {
  flex: 0 0 auto; background: none; border: 0; color: #fff; font-size: 1.2rem; line-height: 1;
  cursor: pointer; padding: 0 0.2rem; opacity: 0.85;
}
.breaking__close:hover { opacity: 1; }

.masthead__brand { text-align: center; padding: 1.4rem 0 1.1rem; }
.masthead__lockup { display: inline-block; text-decoration: none; }
.masthead__logo { display: block; width: clamp(210px, 28vw, 300px); height: auto; }
.masthead__tagline {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--slate); margin: 0.5rem 0 0;
}

.sectionnav { border-top: 1px solid var(--hairline); border-bottom: 2px solid var(--ink); }
.sectionnav__inner {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; padding: 0.7rem 0;
}
.sectionnav a {
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink); text-decoration: none;
}
.sectionnav a:hover { color: var(--seal); }

main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; }
.emptyhome { color: var(--slate); font-size: 1.1rem; padding: 3rem 0; }

/* shared small byline */
.byline-sm { font-family: var(--mono); font-size: 0.72rem; color: var(--slate); margin: 0; }
.kicker, .card__kicker {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--seal); text-decoration: none;
}

/* --- Hero --------------------------------------------------------------- */
.hero { padding-bottom: 1.75rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--hairline); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 2.5rem; }
.kicker { display: inline-block; margin-bottom: 0.5rem; }
.hero__head {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.05; letter-spacing: -0.02em;
  margin: 0.1rem 0 0.6rem;
}
.hero__head a { text-decoration: none; }
.hero__dek { font-size: 1.2rem; line-height: 1.5; color: var(--slate); margin: 0 0 0.7rem; max-width: 36rem; }

/* signature: the ranked "Latest" rail (Korean-portal ranking, reimagined) */
.ranked { border-left: 1px solid var(--hairline); padding-left: 2rem; }
.ranked__label {
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink); margin: 0 0 0.9rem;
  padding-bottom: 0.5rem; border-bottom: 2px solid var(--seal);
}
.ranked__list { list-style: none; margin: 0; padding: 0; }
.ranked__item { display: flex; gap: 0.9rem; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid var(--faint); }
.ranked__item:last-child { border-bottom: 0; }
.ranked__num {
  font-family: var(--display); font-weight: 700; font-size: 1.55rem;
  color: var(--seal); line-height: 1; min-width: 1.3rem; text-align: center; flex: 0 0 auto;
}
.ranked__head { font-family: var(--body); font-weight: 500; font-size: 1.02rem; line-height: 1.25; text-decoration: none; display: block; }
.ranked__meta { display: block; font-family: var(--mono); font-size: 0.66rem; color: var(--slate); margin-top: 0.25rem; }

/* secondary row under the lead */
.hero__secondary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem;
  margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline);
}
.card__kicker { display: block; margin-bottom: 0.35rem; }
.card__head { font-family: var(--display); font-weight: 500; font-size: 1.2rem; line-height: 1.18; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.card__head a { text-decoration: none; }
.card__dek { font-size: 0.98rem; color: var(--slate); margin: 0; }

/* --- Topic bands -------------------------------------------------------- */
.band { margin: 2.75rem 0; }
.band__head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; margin-bottom: 1.3rem; }
.band__title { font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink); margin: 0; }
.band__more { font-family: var(--mono); font-size: 0.72rem; color: var(--slate); text-decoration: none; }
.band__more:hover { color: var(--seal); }
.band__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2.5rem; }
.band__featured-head { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
.band__featured-head a { text-decoration: none; }
.band__featured-dek { font-size: 1.08rem; color: var(--slate); margin: 0 0 0.6rem; }
.band__list { list-style: none; margin: 0; padding: 0; }
.band__list li { padding: 0.7rem 0; border-bottom: 1px solid var(--faint); display: flex; flex-direction: column; gap: 0.25rem; }
.band__list li:first-child { padding-top: 0; }
.band__list a { font-family: var(--body); font-weight: 500; font-size: 1.05rem; line-height: 1.2; text-decoration: none; }
.band__list-meta { font-family: var(--mono); font-size: 0.66rem; color: var(--slate); }

/* --- Section page ------------------------------------------------------- */
.sectionpage__title { font-family: var(--display); font-weight: 600; font-size: 2.4rem; letter-spacing: -0.02em; border-bottom: 2px solid var(--seal); padding-bottom: 0.5rem; margin: 0 0 1.5rem; }
.sectionpage__list { list-style: none; margin: 0; padding: 0; }
.sectionpage__item { padding: 1.5rem 0; border-bottom: 1px solid var(--hairline); }
.sectionpage__head { font-family: var(--display); font-weight: 500; font-size: 1.6rem; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.sectionpage__head a { text-decoration: none; }
.sectionpage__dek { font-size: 1.05rem; color: var(--slate); margin: 0 0 0.4rem; }

/* --- Lead / featured images --------------------------------------------- */
.hero__media, .card__media, .band__media { display: block; }
.hero__media { margin: 0 0 1.05rem; }
.card__media { margin: 0 0 0.6rem; }
.band__media { margin: 0 0 0.8rem; }
.hero__media img, .card__media img, .band__media img,
.sectionpage__media img, .article__lead-media img {
  display: block; width: 100%; object-fit: cover; border-radius: 2px;
}
.hero__media img { aspect-ratio: 3 / 2; }
.card__media img { aspect-ratio: 3 / 2; }
.band__media img { aspect-ratio: 16 / 9; }
.sectionpage__item.has-media { display: flex; gap: 1.4rem; align-items: flex-start; }
.sectionpage__text { min-width: 0; }
.sectionpage__media { flex: 0 0 13rem; }
.sectionpage__media img { aspect-ratio: 3 / 2; }
/* share row */
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0 0; }
.share__label { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate); margin-right: 0.15rem; }
.share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--hairline);
  border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s;
}
.share__btn svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.share__btn:hover { color: var(--seal); border-color: var(--seal); }
.share__copied { font-family: var(--mono); font-size: 0.7rem; color: var(--seal); margin-left: 0.15rem; }

/* background / context explainer */
.context { margin: 1.6rem 0 0; border: 1px solid var(--hairline); border-left: 3px solid var(--seal); border-radius: 4px; background: #fbfaf7; }
.context__summary {
  cursor: pointer; list-style: none; padding: 0.75rem 1rem;
  font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--seal);
  display: flex; align-items: center; gap: 0.5rem;
}
.context__summary::-webkit-details-marker { display: none; }
.context__summary::before { content: "+"; font-size: 1rem; line-height: 1; }
.context[open] .context__summary::before { content: "–"; }
.context__panel { padding: 0 1rem 1rem; }
.context__note { font-family: var(--body); font-size: 1rem; line-height: 1.6; }
.context__note p { margin: 0 0 0.8rem; }
.context__timeline-label { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate); margin: 0.6rem 0 0.5rem; }
.context__timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hairline); }
.context__timeline li { position: relative; padding: 0 0 0.7rem 1rem; }
.context__timeline li::before { content: ""; position: absolute; left: -4px; top: 0.45rem; width: 7px; height: 7px; border-radius: 50%; background: var(--seal); }
.context__date { font-family: var(--mono); font-size: 0.72rem; color: var(--slate); display: block; }
.context__timeline a { font-family: var(--body); }

.article__lead-media { margin: 1.5rem 0 0; }
.article__lead-media img { aspect-ratio: 3 / 2; }
.article__lead-media figcaption {
  font-family: var(--mono); font-size: 0.74rem; line-height: 1.4;
  color: var(--slate); margin-top: 0.5rem;
}

@media (max-width: 60rem) {
  .hero__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .ranked { border-left: 0; padding-left: 0; border-top: 1px solid var(--hairline); padding-top: 1.5rem; }
  .band__grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .hero__secondary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 40rem) {
  .hero__secondary { grid-template-columns: 1fr; }
  .sectionnav__inner { gap: 0.9rem; }
  .masthead__util-links a { margin-left: 0.7rem; }
  .sectionpage__item.has-media { flex-direction: column; gap: 0.8rem; }
  .sectionpage__media { flex-basis: auto; width: 100%; }
}

/* --- Article page ------------------------------------------------------- */
.article { max-width: var(--measure); margin: 0 auto; }
.article__kicker {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--seal); margin: 0 0 0.6rem;
}
.article__head {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.07;
  letter-spacing: -0.02em; margin: 0 0 1rem;
}
.byline {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em;
  color: var(--slate); margin: 0 0 1.75rem;
  padding-bottom: 1.25rem; border-bottom: 1px solid var(--hairline);
}
.article__body { margin-top: 1.5rem; }
.article__body p { margin: 0 0 1.15rem; }
.article__body p:first-of-type::first-letter {
  font-family: var(--display); font-weight: 600;
  font-size: 3.1rem; line-height: 0.8; float: left;
  padding: 0.1rem 0.5rem 0 0; color: var(--ink);
}
.article__body a { color: var(--seal); text-decoration: underline; }
.article__body img { display: block; max-width: 100%; height: auto; margin: 1.6rem auto; border-radius: 2px; }
.article__body h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.01em; margin: 2rem 0 0.8rem; }
.article__body h3 { font-family: var(--display); font-weight: 500; font-size: 1.3rem; margin: 1.8rem 0 0.6rem; }
.article__body blockquote {
  margin: 1.6rem 0; padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 3px solid var(--seal); color: var(--slate); font-style: italic;
}
.article__body ul, .article__body ol { margin: 0 0 1.15rem 1.4rem; padding: 0; }
.article__body li { margin: 0 0 0.4rem; }
.article__body figure { margin: 1.6rem 0; }
.article__body figcaption { font-family: var(--mono); font-size: 0.74rem; color: var(--slate); text-align: center; margin-top: 0.5rem; }
/* honour alignment chosen in the editor */
.article__body .ql-align-center { text-align: center; }
.article__body .ql-align-right { text-align: right; }
.article__body .ql-align-justify { text-align: justify; }

/* provenance strip that sits between headline and body */
.provenance {
  font-family: var(--mono); font-size: 0.74rem; line-height: 1.5;
  color: var(--slate);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 0.8rem 0;
  display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem;
}
.provenance dt { color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.provenance dd { margin: 0; }

/* sources ledger at article foot */
.sources { margin-top: 2.5rem; border-top: 3px solid var(--seal); padding-top: 1rem; }
.sources__label {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--slate); margin: 0 0 0.6rem;
}
.sources__list { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 0.82rem; }
.sources__list li { padding: 0.35rem 0; border-bottom: 1px solid var(--faint); display: flex; gap: 0.6rem; }
.sources__outlet { color: var(--ink); min-width: 10rem; }
.sources__link { color: var(--slate); word-break: break-all; }

/* standing corrections / removal note on every piece */
.standing-note {
  margin-top: 2rem; font-family: var(--mono); font-size: 0.72rem;
  color: var(--slate); line-height: 1.6;
}
.standing-note a { color: var(--slate); }

/* --- Archive ------------------------------------------------------------ */
.archive__day { margin: 0 0 1.8rem; }
.archive__date { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--seal); text-transform: uppercase; margin: 0 0 0.5rem; }
.archive__links { list-style: none; margin: 0; padding: 0; }
.archive__links li { padding: 0.3rem 0; border-bottom: 1px solid var(--faint); }
.archive__links a { text-decoration: none; }

/* --- Static pages (corrections, about) ---------------------------------- */
.page { max-width: var(--measure); margin: 0 auto; }
.about-mark { display: block; width: 160px; height: auto; margin: 0 auto 1.25rem; }
.page h1 { font-family: var(--display); font-weight: 600; font-size: 2.2rem; letter-spacing: -0.01em; }
.page h2 { font-family: var(--display); font-weight: 500; font-size: 1.4rem; margin-top: 2rem; }
.page h3 { font-family: var(--display); font-weight: 500; font-size: 1.12rem; margin-top: 1.4rem; }
.page ul, .page ol { margin: 0 0 1rem 1.3rem; padding: 0; }
.page li { margin-bottom: 0.4rem; line-height: 1.55; }
.placeholder-note { color: var(--seal); font-style: italic; }

/* --- Footer ------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.72rem; color: var(--slate);
}
.foot__inner {
  padding: 2rem 0 3rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; width: 100%;
}
.foot a { color: var(--slate); }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
.foot__links a:hover { color: var(--seal); }
.foot__tagline { white-space: nowrap; }

/* --- Accessibility / motion -------------------------------------------- */
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 34rem) {
  body { font-size: 1.06rem; }
  .provenance { grid-template-columns: 1fr; }
  .sources__list li { flex-direction: column; gap: 0.1rem; }
  .sources__outlet { min-width: 0; }
}
