/* cyberdesk.africa — shared styles for every page.
   "Broadsheet" newsprint design: Source Serif 4, paper and ink, cyan as the single spot colour.
   Light by default; dark ("Night edition") follows the system setting or the header toggle. */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  color-scheme: light;
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --ink: #201e1d;
  --accent: #0088b0;
  --link: #006786;
  --link-hover: #004961;
  --muted: #605d5d;
  --faint: #9b9797;
  --tint: #e9f8ff;

  --font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius-sm: 1px;
}

/* Night edition: light cyan on warm charcoal. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: oklch(0.2 0.01 60);
    --surface: oklch(0.235 0.01 60);
    --ink: oklch(0.94 0.008 80);
    --accent: oklch(0.78 0.12 210);
    --link: oklch(0.8 0.11 210);
    --link-hover: oklch(0.9 0.07 210);
    --muted: oklch(0.72 0.01 80);
    --faint: oklch(0.55 0.01 80);
    --tint: oklch(0.32 0.04 210);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.2 0.01 60);
  --surface: oklch(0.235 0.01 60);
  --ink: oklch(0.94 0.008 80);
  --accent: oklch(0.78 0.12 210);
  --link: oklch(0.8 0.11 210);
  --link-hover: oklch(0.9 0.07 210);
  --muted: oklch(0.72 0.01 80);
  --faint: oklch(0.55 0.01 80);
  --tint: oklch(0.32 0.04 210);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.5;
  transition: background 0.2s, color 0.2s;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ── three columns: ad rails either side, the paper in the middle ── */
.layout { display: grid; grid-template-columns: minmax(160px, 10%) minmax(0, 1fr) minmax(160px, 10%); min-height: 100vh; }
.rail { padding: 40px 0; background: var(--surface); }
.rail .ad { position: sticky; top: 24px; }
.center {
  min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 56px) 48px;
  display: flex; flex-direction: column; gap: 48px;
}

/* Ad banners: swap the placeholder for an <img> inside the <a> (see the comment in the template). */
.ad { display: block; text-align: center; text-decoration: none; }
.ad-label {
  display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 6px; color: var(--faint);
}
.ad img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.ad-placeholder {
  width: 140px; height: 600px; max-width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--faint); border-radius: var(--radius-sm);
  color: var(--faint); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; padding: 8px;
}
.ad-placeholder.wide { width: 100%; max-width: 320px; height: 100px; }
.mobile-ad { display: none; }

/* ── masthead ── */
.masthead { display: flex; flex-direction: column; gap: 8px; }
.masthead-top { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.mark { flex: none; }
.mark-bg { fill: var(--ink); }
.mark-c { font-family: var(--font); font-weight: 700; font-size: 26px; fill: var(--bg); }
.mark-dot { fill: var(--accent); }
.wordmark { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.wordmark .tld { font-style: italic; font-weight: 400; color: var(--link); }
.menu { display: flex; gap: 8px 28px; font-size: 17px; align-items: center; flex-wrap: wrap; }
.menu a { color: var(--ink); text-decoration: none; text-underline-offset: 6px; }
.menu a:hover { color: var(--link); }
.menu a[aria-current="page"] { text-decoration: underline; }
.theme-toggle {
  font: inherit; font-size: 15px; background: transparent; color: var(--ink);
  border: 1px solid var(--faint); border-radius: var(--radius-sm);
  padding: 6px 14px; cursor: pointer; display: flex; gap: 8px; align-items: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--link); }
.theme-icon {
  width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.rule-thick { height: 4px; background: var(--ink); margin-top: 16px; }
.rule-thin { height: 1px; background: var(--ink); }
.dateline {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  font-size: 14px; padding: 6px 0; color: var(--muted);
}
.dateline .tagline { font-style: italic; font-size: inherit; font-weight: 400; margin: 0; }

main { display: flex; flex-direction: column; gap: 56px; }

/* ── page heading on country, topic and index pages ── */
.page-head { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.page-head h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.08; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { margin: 0; font-size: 18px; color: var(--muted); }

/* ── stories ── */
.meta { font-size: 13px; color: var(--muted); }
.meta .country { color: var(--link); text-decoration: none; }
.meta a.country:hover { text-decoration: underline; }
.meta a.topic { color: inherit; text-decoration: none; }
.meta a.topic:hover { color: var(--link); text-decoration: underline; }
.pill {
  display: inline-block; background: var(--tint); color: var(--link);
  padding: 2px 10px; border-radius: var(--radius-sm); text-decoration: none;
}
a.pill:hover { text-decoration: underline; }
.story a.headline { color: inherit; text-decoration: none; }
.story a.headline:hover { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; }

.front { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 56px 64px; }
.lead { display: flex; flex-direction: column; gap: 16px; }
.lead .meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.lead h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; margin: 0; font-weight: 700; }
.lead p { margin: 0; font-size: 20px; line-height: 1.5; max-width: 640px; }
.lead .read { font-size: 16px; }
.side-list { display: flex; flex-direction: column; gap: 32px; }
.side-story { display: flex; flex-direction: column; gap: 8px; }
.side-story h3 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 600; }

.earlier { display: flex; flex-direction: column; gap: 32px; max-width: 1000px; }
.section-label { font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0; font-weight: 400; }
.earlier-story { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 24px; }
.earlier-story .date { font-size: 14px; color: var(--muted); padding-top: 6px; }
.earlier-story .body { display: flex; flex-direction: column; gap: 6px; }
.earlier-story h3 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 600; }
.earlier-story p { margin: 0; font-size: 17px; line-height: 1.5; }
.empty { color: var(--muted); font-style: italic; }

/* ── countries / topics index ── */
.index-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 32px 48px; }
.index-list li { display: flex; flex-direction: column; gap: 6px; }
.index-list .name { font-size: 26px; font-weight: 700; line-height: 1.15; }
.index-list .name a { color: var(--ink); text-decoration: none; }
.index-list .name a:hover { color: var(--link); text-decoration: underline; }

/* ── plain text pages (About, Advertise) ── */
.prose { max-width: 680px; display: flex; flex-direction: column; gap: 18px; font-size: 19px; }
.prose p, .prose h2 { margin: 0; }
.prose h2 { font-size: 26px; font-weight: 700; }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.prose th { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; color: var(--muted); }

/* ── footer ── */
.site-foot { margin-top: auto; padding-top: 16px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.site-foot p { margin: 0; }

/* Phones & small tablets: hide the rails, show one banner under the masthead. */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .center { padding-top: 24px; gap: 36px; }
  .mobile-ad { display: flex; justify-content: center; }
  .menu { gap: 8px 20px; font-size: 16px; }
}
@media (max-width: 560px) {
  .menu { gap: 6px 14px; font-size: 15px; }
  .theme-toggle { padding: 4px 10px; font-size: 14px; }
  .dateline { font-size: 13px; }
  .earlier-story { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .earlier-story .date { padding-top: 0; }
  .lead p { font-size: 18px; }
  .side-story h3, .earlier-story h3 { font-size: 21px; }
}
