/* ============================================================
   THE RANIA POST — Washington Post–style broadsheet
   Light + dark mode. One stylesheet for the whole site.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=UnifrakturCook:wght@700&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Libre+Franklin:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --bg:        #ffffff;
  --surface:   #ffffff;
  --ink:       #121212;
  --ink-soft:  #2b2b2b;
  --muted:     #6b6b6b;
  --rule:      #d6d6d6;
  --rule-bold: #121212;
  --accent:    #1455a0;   /* WaPo link blue */
  --kicker:    #c8102e;   /* section red */
  --tag:       #444;
  --maxw:      1180px;
  --serif:     Georgia, 'Times New Roman', serif;
  --display:   'Playfair Display', Georgia, serif;
  --label:     'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --black:     'UnifrakturCook', Georgia, serif;
}

[data-theme="dark"] {
  --bg:        #0d0e10;
  --surface:   #15171a;
  --ink:       #ededed;
  --ink-soft:  #d2d2d2;
  --muted:     #9aa0a6;
  --rule:      #2c2f33;
  --rule-bold: #ededed;
  --accent:    #6fa8ff;
  --kicker:    #ff6470;
  --tag:       #9aa0a6;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
  transition: background .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

/* ---------- Top utility bar ---------- */
.util {
  border-bottom: 1px solid var(--rule);
  font-family: var(--label);
  font-size: 12px;
  letter-spacing: .04em;
}
.util .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px;
}
.util .date { color: var(--muted); text-transform: uppercase; }
.util .right { display: flex; align-items: center; gap: 18px; }
.util .subscribe {
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--rule-bold); padding: 6px 12px; border-radius: 2px;
}
.util .subscribe:hover { background: var(--ink); color: var(--bg); text-decoration: none; }

/* theme toggle */
.toggle {
  cursor: pointer; background: none; border: 1px solid var(--rule);
  color: var(--ink); border-radius: 999px; padding: 5px 12px;
  font-family: var(--label); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; letter-spacing:.03em;
}
.toggle:hover { border-color: var(--ink); }
.toggle .moon { display: none; }
[data-theme="dark"] .toggle .sun { display: none; }
[data-theme="dark"] .toggle .moon { display: inline; }

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding: 22px 0 10px; }
.masthead .nameplate {
  font-family: var(--black);
  font-weight: 700;
  font-size: clamp(40px, 8vw, 86px);
  line-height: .95;
  letter-spacing: .01em;
  color: var(--ink);
  display: inline-block;
}
.masthead .nameplate a:hover { text-decoration: none; }
.masthead .tagline {
  font-family: var(--label);
  font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin-top: 12px;
}
.masthead .estd {
  font-family: var(--label); font-size: 11px; letter-spacing:.12em;
  text-transform: uppercase; color: var(--muted);
  display:flex; align-items:center; justify-content:center; gap:14px; margin-top:6px;
}
.masthead .estd:before, .masthead .estd:after{
  content:""; height:1px; width:46px; background:var(--rule);
}

/* ---------- Section nav ---------- */
nav.sections {
  border-top: 2px solid var(--rule-bold);
  border-bottom: 1px solid var(--rule-bold);
  font-family: var(--label);
}
nav.sections ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0;
}
nav.sections li { position: relative; }
nav.sections a {
  display: block; padding: 11px 18px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
nav.sections a:hover { color: var(--accent); text-decoration: none; }
nav.sections li + li:before {
  content:""; position:absolute; left:0; top:50%; transform:translateY(-50%);
  height:14px; width:1px; background:var(--rule);
}
nav.sections a.active { color: var(--kicker); }

/* ---------- Front page grid ---------- */
.front { display: grid; grid-template-columns: 2.1fr 1.2fr 1fr; gap: 0; margin-top: 26px; }
.front > * { padding: 0 26px; }
.front > *:first-child { padding-left: 0; }
.front > *:last-child  { padding-right: 0; }
.col-rule { border-left: 1px solid var(--rule); }

.kicker {
  font-family: var(--label); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; color: var(--kicker);
  margin: 0 0 8px;
}
.kicker.muted { color: var(--muted); }

.lead h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02;
  margin: 4px 0 12px; letter-spacing: -.01em;
}
.lead .deck {
  font-family: var(--serif); font-size: 19px; line-height: 1.45;
  color: var(--ink-soft); margin: 0 0 14px;
}
.lead img, .story img { width: 100%; height: auto; display: block; filter: saturate(.92); }
figure { margin: 0 0 14px; }

/* image wrapper + round inset portrait (white edges) */
.img-wrap { position: relative; line-height: 0; }
.img-wrap .hero-portrait {
  position: absolute; left: 16px; bottom: 16px;
  width: 104px; height: 104px; border-radius: 50%;
  object-fit: cover; filter: none;
  border: 5px solid #fff;
  box-shadow: 0 3px 12px rgba(0,0,0,.4);
}
.article .img-wrap .hero-portrait { width: 150px; height: 150px; left: 22px; bottom: 22px; border-width: 6px; }
[data-theme="dark"] .hero-portrait { box-shadow: 0 3px 14px rgba(0,0,0,.7); }

/* two round faces on a poster */
.poster-faces { position: absolute; left: 18px; bottom: 18px; display: flex; gap: 12px; }
.poster-faces figure { margin: 0; text-align: center; }
.poster-faces img {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover; filter: none;
  border: 5px solid #fff; box-shadow: 0 3px 12px rgba(0,0,0,.45); display: block;
}
.poster-faces .nm {
  font-family: var(--label); font-size: 11px; font-weight: 700; color: #fff;
  margin-top: 6px; text-shadow: 0 1px 4px rgba(0,0,0,.9); letter-spacing: .02em;
}
/* poster hero shows in full */
.article .img-wrap.poster > img { width: 100%; height: auto; display: block; }
figcaption {
  font-family: var(--label); font-size: 11.5px; color: var(--muted);
  margin-top: 6px; line-height: 1.35;
}

.byline {
  font-family: var(--label); font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 0;
}
.byline b { color: var(--ink); font-weight: 700; }

/* story blocks */
.story { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.story:last-child { border-bottom: 0; margin-bottom: 0; }
.story h2 {
  font-family: var(--display); font-weight: 700;
  font-size: 23px; line-height: 1.08; margin: 4px 0 8px;
}
.story h3 {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  line-height: 1.12; margin: 2px 0 6px;
}
.story p { margin: 0 0 8px; font-size: 15.5px; color: var(--ink-soft); }

/* right rail bulletin */
.rail h2.rail-title {
  font-family: var(--label); font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 2px solid var(--rule-bold); padding-bottom: 8px; margin: 0 0 14px;
}
.brief { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.brief:last-child { border-bottom: 0; }
.brief .tag {
  font-family: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
}
.brief h4 { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.12; margin: 4px 0 5px; }
.brief p { margin: 0; font-size: 14px; color: var(--muted); }

/* secondary row */
.row2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; margin: 30px 0 0; border-top: 2px solid var(--rule-bold); padding-top: 22px; }
.row2 > * { padding: 0 26px; }
.row2 > *:first-child { padding-left: 0; }
.row2 > *:last-child  { padding-right: 0; }

/* ---------- Article page ---------- */
.article { max-width: 720px; margin: 34px auto 0; }
.article .kicker { text-align: left; }
.article h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.05; margin: 6px 0 16px;
  letter-spacing: -.01em;
}
.article .standfirst {
  font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--ink-soft);
  margin: 0 0 20px; font-style: italic;
}
.article .meta {
  font-family: var(--label); font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 12px 0; margin: 0 0 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.article .meta b { color: var(--ink); }
.article figure { margin: 0 0 24px; }
.article .body { font-size: 19px; line-height: 1.65; }
.article .body p { margin: 0 0 20px; }
.article .body p.drop:first-letter {
  font-family: var(--display); font-weight: 900; float: left;
  font-size: 76px; line-height: .72; padding: 6px 10px 0 0; color: var(--ink);
}
.article .pull {
  font-family: var(--display); font-weight: 700; font-style: italic;
  font-size: 26px; line-height: 1.25; color: var(--ink);
  border-left: 3px solid var(--kicker); padding: 4px 0 4px 20px; margin: 26px 0;
}
.article .endmark { font-family: var(--label); font-weight: 800; color: var(--muted); letter-spacing:.1em; }
.backlink { font-family: var(--label); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing:.05em; color: var(--accent); display:inline-block; margin: 30px 0; }

/* more-from list under article */
.morefrom { border-top: 2px solid var(--rule-bold); margin-top: 30px; padding-top: 18px; }
.morefrom h3 { font-family: var(--label); font-size: 13px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; margin:0 0 14px; }
.morefrom .grid { display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.morefrom a.card h4 { font-family: var(--display); font-weight:700; font-size:18px; line-height:1.12; margin:0 0 6px; }
.morefrom a.card p { font-family: var(--serif); font-size:14px; color:var(--muted); margin:0; }
.morefrom a.card:hover h4 { color: var(--accent); }

/* ---------- Footer ---------- */
footer.paper {
  border-top: 3px double var(--rule-bold); margin-top: 50px; padding: 34px 0 60px;
  font-family: var(--label);
}
footer.paper .nameplate { font-family: var(--black); font-size: 30px; text-align:center; display:block; margin-bottom: 16px; }
footer.paper .cols { display:flex; flex-wrap:wrap; gap: 40px; justify-content: center; font-size: 13px; }
footer.paper .cols a { color: var(--muted); }
footer.paper .fine { text-align:center; color: var(--muted); font-size: 12px; margin-top: 24px; line-height:1.6; }

/* ---------- Advertisement slots (Washington Post style) ---------- */
.ad { margin: 28px auto; text-align: center; }
.ad .ad-label { font-family: var(--label); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.ad .ad-box {
  background: #f1f1f3; border: 1px solid var(--rule);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  margin: 0 auto; padding: 14px;
}
[data-theme="dark"] .ad .ad-box { background: #16181b; }
.ad .ad-brand { font-family: var(--black); font-size: 22px; color: var(--ink); opacity: .55; line-height: 1; }
.ad .ad-sub { font-family: var(--label); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.ad-leaderboard .ad-box { max-width: 970px; height: 124px; }
.ad-rect .ad-box { max-width: 336px; height: 270px; }
.ad-rail { margin: 22px 0 0; }
.ad-rail .ad-box { max-width: 300px; height: 600px; }

/* ---------- Cookie / privacy consent (Washington Post style) ---------- */
.cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--surface); border-top: 3px solid var(--rule-bold);
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
[data-theme="dark"] .cookie { box-shadow: 0 -10px 40px rgba(0,0,0,.6); }
.cookie .inner { max-width: 1340px; margin: 0 auto; padding: 22px 26px; display: grid; grid-template-columns: 1.05fr 1.05fr 200px; gap: 34px; align-items: start; }
.cookie h2 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 0 0 10px; color: var(--ink); }
.cookie p { font-family: var(--serif); font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 10px; }
.cookie p.fine { font-size: 12px; color: var(--muted); }
.cookie .vendors { font-family: var(--label); font-weight: 700; font-size: 12.5px; color: var(--accent); margin-top: 10px; cursor: pointer; }
.cookie .col3 { display: flex; flex-direction: column; gap: 11px; }
.cookie button {
  font-family: var(--label); font-weight: 700; font-size: 14px; padding: 12px 18px;
  border-radius: 999px; cursor: pointer; border: 1.5px solid var(--ink); transition: opacity .15s ease;
}
.cookie button:hover { opacity: .85; }
.cookie .accept, .cookie .reject { background: var(--ink); color: var(--bg); }
.cookie .purposes { background: transparent; color: var(--ink); }
@media (max-width: 820px) {
  .cookie .inner { grid-template-columns: 1fr; gap: 14px; }
  .cookie .col3 { flex-direction: column; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .front { grid-template-columns: 1fr; }
  .front > * { padding: 0; border-left: 0; }
  .col-rule { border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 4px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .row2 > * { padding: 16px 0; border-bottom: 1px solid var(--rule); }
  .morefrom .grid { grid-template-columns: 1fr; gap: 16px; }
  nav.sections a { padding: 10px 12px; font-size: 12px; }
}
