/* =====================================================================
   WORLD NEWS WIRE — stylesheet
   Refined editorial (digital newspaper) system.
   Mobile-first, vanilla CSS, no frameworks. Accessible contrast.
   ===================================================================== */

:root {
  --paper: #faf8f4;          /* warm newsprint */
  --card-bg: #ffffff;
  --ink: #171512;            /* headline ink (15:1 on paper) */
  --ink-soft: #2e2a24;       /* body text (12:1 on paper) */
  --muted: #6e6759;          /* secondary text (5.9:1 on paper) */
  --red: #9c1f2e;            /* editorial red (7.3:1 on paper) — the single accent */
  --red-deep: #7c1623;
  --line: #ddd4c2;           /* hairline rules */
  --line-soft: #e9e2d3;
  --header-h: 96px;          /* approx sticky header height for offsets */
  --radius: 3px;
  --radius-card: 20px;        /* story cards: large soft corners */
  --radius-tile: 16px;        /* category tiles + small cards */
  --radius-pill: 999px;       /* pill buttons/chips */
  --shadow-card: 0 12px 30px rgba(23, 21, 18, .07);        /* soft diffused card shadow */
  --shadow-card-hover: 0 18px 38px rgba(23, 21, 18, .11);
  /* Pastel tints — reserved ONLY for the secondary category tiles */
  --pastel-world: #ede0d2;
  --pastel-business: #dde3d5;
  --pastel-technology: #dce6ea;
  --pastel-sports: #eadbd9;
  --pastel-science: #e2e0e9;
  --muted-light: #b6ad9a;     /* muted text on dark surfaces */
  --max-width: 1120px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 64px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-soft);
  background: var(--paper);
  line-height: 1.6;
  font-size: 1rem;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--red-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; color: var(--paper); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Dateline strip ---------- */
.dateline-bar {
  background: var(--ink);
  color: #d8d2c2;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
}
.dateline-bar .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .45rem;
  padding-bottom: .45rem;
}
.dateline-edition { color: var(--muted-light); }

/* ---------- Masthead header ---------- */
.site-header {
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1.25rem;
}
.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover, .brand:focus { color: var(--ink); }
.brand img { width: 34px; height: 34px; align-self: center; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-name .wire { color: var(--red); font-style: italic; font-weight: 400; }
.brand-tagline {
  display: none;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: .8rem;
  margin-left: .2rem;
}

.main-nav { margin-left: auto; }
.nav-toggle {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: .45rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-list {
  display: none;
  list-style: none;
  margin: 0;
  padding: .4rem 0;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(23,21,18,.12);
}
.nav-list.open { display: block; }
.nav-list li { margin: 0; }
.nav-list a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: .7rem 1.25rem;
  font-weight: 600;
  font-size: .95rem;
}
.nav-list a:hover, .nav-list a:focus { background: var(--line-soft); color: var(--ink); }
.nav-list a[aria-current="page"] { color: var(--red); box-shadow: inset 3px 0 0 var(--red); }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .nav-list {
    display: flex;
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: .25rem;
  }
  .nav-list a {
    padding: .5rem .7rem;
    font-size: .88rem;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .nav-list a:hover, .nav-list a:focus { background: transparent; color: var(--red); text-decoration: underline; text-underline-offset: 4px; }
  .nav-list a[aria-current="page"] { box-shadow: none; color: var(--red); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
  .brand-tagline { display: block; }
}

/* ---------- Edition hero (front-page header) ---------- */
.hero { padding: 4rem 0 3rem; border-bottom: 1px solid var(--line); }
.edition-kicker {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 .9rem;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 .8rem;
  color: var(--ink);
  max-width: 20ch;
}
.hero h1 .wire { color: var(--red); font-style: italic; font-weight: 400; }
.hero p.lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 44rem;
  margin: 0 0 1.1rem;
  line-height: 1.55;
}
/* Quiet byline: no box, just the label and date — the label keeps the red accent. */
.updated-stamp {
  display: inline-block;
  margin: 0;
  font-size: .9rem;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .45rem 1rem;
}
.updated-stamp strong { color: var(--red); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; }

/* ---------- Top stories: above-the-fold jump list in the hero ---------- */
.top-stories { margin: 0 0 1.1rem; max-width: 46rem; }
.top-stories-title {
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 .55rem;
}
.top-stories ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.top-stories a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .98rem; }
.top-stories a::before { content: "\25B8  "; color: var(--red); }
.top-stories a:hover, .top-stories a:focus { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Related stories: cross-links at the end of each section ---------- */
.related-stories { margin-top: 1.75rem; border-top: 1px solid var(--line-soft); padding-top: 1rem; }
.related-stories h3 {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .6rem;
}
.related-stories ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.related-stories a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.related-stories a::before { content: "\2192  "; color: var(--red); }
.related-stories a:hover, .related-stories a:focus { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Category filter chips (sticky) ---------- */
.category-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--header-h);
  z-index: 40;
}
.category-nav .container { padding-top: .65rem; padding-bottom: .65rem; }
.category-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.category-nav li { flex: 0 0 auto; }
.category-nav a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .42rem 1rem;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.category-nav a:hover, .category-nav a:focus { border-color: var(--red); color: var(--red); }
.category-nav a[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.category-nav a[aria-pressed="true"]:hover, .category-nav a[aria-pressed="true"]:focus { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Layout with sidebar ---------- */
.layout { padding: 3.5rem 0 4.5rem; }
@media (min-width: 960px) {
  .layout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
}

/* ---------- Editorial note ---------- */
.editorial-note {
  background: var(--card-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 46rem;
}
.editorial-note strong { font-style: normal; color: var(--red); letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; font-family: var(--font-sans); }

/* ---------- Category tiles (editorial dashboard: 5 pastel tiles) ---------- */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
  margin: 0 0 3.25rem;
}
@media (min-width: 720px) {
  .category-tiles { grid-template-columns: repeat(5, 1fr); }
}
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .7rem;
  min-height: 6.5rem;
  text-decoration: none;
  border-radius: var(--radius-tile);
  border: 1px solid rgba(23, 21, 18, .06);
  box-shadow: var(--shadow-card);
  padding: 1.2rem 1.25rem;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover, .tile:focus { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); color: var(--ink); }
.tile-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.tile-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.tile-count {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);   /* AA-safe on the pastel tiles (~10:1) */
}
.tile-arrow { color: var(--red); font-weight: 700; line-height: 1; }
/* Pastels live only on these secondary tiles — everything else stays neutral + red. */
.tile-world { background: var(--pastel-world); }
.tile-business { background: var(--pastel-business); }
.tile-technology { background: var(--pastel-technology); }
.tile-sports { background: var(--pastel-sports); }
.tile-science { background: var(--pastel-science); }

/* ---------- Category sections ---------- */
.category-section { margin-bottom: 4.5rem; scroll-margin-top: calc(var(--header-h) + 64px); counter-increment: section; }
.category-section.is-hidden { display: none; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding-bottom: .75rem;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: .7rem;
}
.section-head h2::before {
  content: counter(section, decimal-leading-zero);
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--red);
}
.section-head .section-count {
  margin-left: auto;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Article cards ---------- */
.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }

/* Lead story: hero card treatment — larger radius, generous padding,
   bold display headline with tight line-height. */
.cards > .card:first-child {
  grid-column: 1 / -1;
  border-radius: 24px;
  padding: 2rem 1.6rem;
}
.cards > .card:first-child h3 {
  font-size: clamp(1.65rem, 3.8vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 28ch;
}
.cards > .card:first-child p.summary { font-size: 1.03rem; max-width: 44rem; }
.cards > .card:first-child p.summary::first-letter {
  font-family: var(--font-serif);
  font-size: 3.1em;
  float: left;
  line-height: .85;
  padding: .06em .12em 0 0;
  color: var(--red);
  font-weight: 700;
}

@media (min-width: 620px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .cards > .card:first-child { padding: 2.5rem; }
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards > .card:first-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    align-items: start;
  }
  .cards > .card:first-child .kicker { grid-column: 1 / -1; }
  .cards > .card:first-child h3 { grid-column: 1; }
  .cards > .card:first-child p.summary { grid-column: 2; margin-top: .2rem; }
  .cards > .card:first-child .meta { grid-column: 1; }
  .cards > .card:first-child .read-more { grid-column: 1; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line-soft);
  scroll-margin-top: calc(var(--header-h) + 64px); /* anchor offset under sticky header */
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
@media (min-width: 620px) {
  .card { padding: 2rem; }
}
.card .kicker {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 .55rem;
}
.card h3 {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 .6rem;
  color: var(--ink);
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover, .card h3 a:focus { color: var(--red); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.card p.summary { color: var(--ink-soft); font-size: .96rem; margin: 0 0 1rem; flex: 1; line-height: 1.6; }
.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  align-items: baseline;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.card .meta .source {
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--ink);
}
.card .read-more {
  align-self: flex-start;
  display: inline-block;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius-pill);
  padding: .6rem 1.3rem;
  margin-top: .9rem;
  transition: background .15s ease, color .15s ease;
}
.card .read-more:hover, .card .read-more:focus { background: var(--red); color: #fff; text-decoration: none; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 1.75rem; margin-top: 2.5rem; }
@media (min-width: 960px) { .sidebar { margin-top: 0; position: sticky; top: calc(var(--header-h) + 64px); } }
.widget {
  background: var(--card-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.6rem;
}
.widget h2, .widget h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 .7rem;
  color: var(--ink);
}
.widget ul { margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: .93rem; }
.widget li { margin-bottom: .6rem; padding-left: 1.1rem; position: relative; }
.widget li::before { content: "▪"; color: var(--red); position: absolute; left: 0; font-size: .8em; top: .15em; }

/* AdSense positions are marked by invisible HTML comments only
   (header leaderboard, in-content, sidebar). Paste the AdSense
   <script>/<ins> code at those comments — no redesign needed, and
   no empty box ever shows to visitors. */

/* ---------- Keep reading (next reads) ---------- */
.next-reads { border-top: 1px solid var(--line); padding-top: 1.5rem; margin: 0 0 1rem; max-width: 46rem; }
.next-reads h2 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--ink); margin: 0 0 .4rem; }
.next-reads > p { font-size: .9rem; color: var(--muted); margin: 0 0 .9rem; }
.next-reads ul { list-style: none; margin: 0; padding: 0; }
.next-reads li { border-top: 1px solid var(--line-soft); padding: .85rem 0; font-size: .95rem; display: flex; gap: .75rem; align-items: baseline; }
.next-reads .nr-tag {
  flex: 0 0 auto;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  min-width: 5.5rem;
}
.next-reads a { text-decoration: none; color: var(--ink); font-weight: 600; font-family: var(--font-serif); }
.next-reads a:hover, .next-reads a:focus { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfc8b8; padding: 4rem 0 2rem; margin-top: 1rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--paper);
  margin: 0 0 .7rem;
}
.site-footer h3 {
  color: var(--paper);
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0 0 .8rem;
  border-bottom: 1px solid rgba(250,248,244,.25);
  padding-bottom: .5rem;
}
.site-footer p { font-size: .93rem; max-width: 34rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: #e8e1d3; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  border-top: 1px solid rgba(250,248,244,.22);
  margin-top: 2rem;
  padding-top: 1.1rem;
  font-size: .82rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
}

/* ---------- Static pages ---------- */
.page-hero { padding: 3.5rem 0 2.75rem; border-bottom: 1px solid var(--line); }
.page-hero .edition-kicker { margin-bottom: .7rem; }
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
  color: var(--ink);
}
.page-hero h1 .wire { color: var(--red); font-style: italic; font-weight: 400; }
.page-body { max-width: 46rem; padding: 3rem 0 4rem; }
.page-body h2 { color: var(--ink); font-family: var(--font-serif); font-size: 1.4rem; margin-top: 2.2rem; }
.page-body p, .page-body li { color: var(--ink-soft); }
.policy-list { padding-left: 1.25rem; }
.policy-list li { margin-bottom: .6rem; }
.effective-date { color: var(--muted); font-size: .9rem; }

/* ---------- Contact form ---------- */
.contact-form {
  background: var(--card-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 2rem;
}
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  border: 1px solid var(--line);
  padding: .7rem 1.1rem;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.form-row input, .form-row select { border-radius: var(--radius-pill); }
.form-row textarea { border-radius: var(--radius-tile); }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--red); outline: 2px solid var(--red); outline-offset: 1px; }
.form-row textarea { min-height: 130px; resize: vertical; }
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: .75rem 1.6rem;
  font: inherit;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .88rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover, .btn:focus { background: var(--red-deep); color: #fff; }
.form-note { font-size: .85rem; color: var(--muted); margin-top: .85rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
