/* Planet Briefing — green and white, built for students. No JavaScript. */

:root {
  --bg: #f6faf7;
  --surface: #ffffff;
  --tint: #eef6f0;
  --text: #15211a;
  --muted: #56665b;
  --line: #dbe8de;
  --green: #15803d;
  --green-ink: #116632;
  --green-dark: #0d4a25;
  --green-soft: #dcf0e2;
  --on-green: #ffffff;
  --shadow: 0 1px 2px rgba(16, 40, 24, .06), 0 4px 14px rgba(16, 40, 24, .06);
  --radius: 14px;

  /* Topic colours (tags, dots and photo placeholders) */
  --t-politics: #2563eb;
  --t-economics: #b45309;
  --t-environment: #15803d;
  --t-science-technology: #7c3aed;
  --t-conflict: #b91c1c;
  --t-culture: #db2777;
  --t-sport: #ea580c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c140f;
    --surface: #131d16;
    --tint: #18261c;
    --text: #e7f0e9;
    --muted: #9db0a2;
    --line: #26372b;
    --green: #4ade80;
    --green-ink: #6ee7a0;
    --green-dark: #0a3a1c;
    --green-soft: #1b3324;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --t-politics: #7aa2ff;
    --t-economics: #f2b45a;
    --t-environment: #4ade80;
    --t-science-technology: #b794ff;
    --t-conflict: #ff8080;
    --t-culture: #ff8cc6;
    --t-sport: #ffa35c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--green-ink); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; border-radius: 8px; }

/* Topic colour helpers */
.t-politics { --c: var(--t-politics); }
.t-economics { --c: var(--t-economics); }
.t-environment { --c: var(--t-environment); }
.t-science-technology { --c: var(--t-science-technology); }
.t-conflict { --c: var(--t-conflict); }
.t-culture { --c: var(--t-culture); }
.t-sport { --c: var(--t-sport); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--green)); margin-right: 8px; flex: none; }

/* ---------- Header ---------- */
.masthead { background: linear-gradient(135deg, #0d4a25, #15803d); color: var(--on-green); }
.masthead-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding-top: 18px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--on-green); text-decoration: none; }
.logo {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #bbf7d0, #22c55e 55%, #14532d);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .85);
}
.brand-name { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.brand-tag { display: block; font-size: 0.82rem; opacity: .85; }
.updated { margin: 0; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; opacity: .9; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #86efac; box-shadow: 0 0 0 4px rgba(134, 239, 172, .25); }

.nav {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: none; font-size: 0.95rem;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; display: inline-flex; align-items: center; padding: 7px 13px; border-radius: 999px;
  color: var(--on-green); text-decoration: none; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .15); }
.nav a[aria-current="page"] { background: #ffffff; color: #0d4a25; font-weight: 700; }
.nav-topics { font-size: 0.88rem; padding-bottom: 14px; }
.nav-topics a { background: rgba(255, 255, 255, .08); }
.nav-topics .dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }

/* ---------- Hero ---------- */
main { padding-top: 8px; padding-bottom: 40px; outline: none; }
.hero { padding: 28px 0 8px; }
.eyebrow { margin: 0; color: var(--green-ink); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15; margin: 4px 0 8px; letter-spacing: -0.025em; }
.hero p { color: var(--muted); margin: 0 0 8px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.hero-stats strong { color: var(--text); font-size: 1.15rem; }
.hero-small { padding-bottom: 0; }
.crumb { margin: 0 0 6px !important; font-size: .95rem; }

.howto {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 18px; box-shadow: var(--shadow);
}
.howto summary { cursor: pointer; font-weight: 700; padding: 10px 0; color: var(--green-ink); }
.howto ol { margin: 0 0 14px; padding-left: 22px; }
.howto li { margin: 6px 0; }

/* ---------- Continent tiles ---------- */
.continents { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 22px 0 8px; }
.continent {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.continent:hover { transform: translateY(-2px); border-color: var(--green); }
.continent-icon { font-size: 1.6rem; line-height: 1; }
.continent-name { font-weight: 700; margin-top: 6px; }
.continent-count { font-size: .85rem; color: var(--muted); }

/* ---------- Section titles ---------- */
.section-title {
  display: flex; align-items: center; gap: 8px; font-size: 1.35rem; margin: 36px 0 14px; letter-spacing: -0.01em;
}
.section-title.around { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Pictures ---------- */
.pic {
  position: relative; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--green)) 22%, var(--surface)),
                                      color-mix(in srgb, var(--c, var(--green)) 45%, var(--surface)));
}
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic-icon { font-size: 2.2rem; opacity: .9; }
.pic-wide { aspect-ratio: 16 / 9; }
.pic-thumb { width: 92px; height: 66px; border-radius: 10px; flex: none; }
.pic-thumb .pic-icon { font-size: 1.4rem; }

/* ---------- Story cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.story {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.story:target { outline: 3px solid var(--green); outline-offset: 2px; }
.story-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.story h4 { margin: 0; font-size: 1.12rem; line-height: 1.35; letter-spacing: -0.005em; }
.feature-wrap { margin-bottom: 16px; }
.story.feature h4 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
@media (min-width: 760px) {
  .story.feature { display: grid; grid-template-columns: 1.15fr 1fr; }
  .story.feature .pic-wide { aspect-ratio: auto; min-height: 100%; }
  .story.feature .story-body { padding: 22px 24px; }
}

.tags { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-decoration: none;
  padding: 3px 9px; border-radius: 999px;
  color: var(--c, var(--green-ink)); background: color-mix(in srgb, var(--c, var(--green)) 13%, transparent);
}
.tag:hover { text-decoration: underline; }
.tag-region { color: var(--muted); background: var(--tint); }
.rank {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%;
  background: var(--green); color: var(--surface); font-weight: 800; font-size: .8rem;
}

.why {
  margin: 0; padding: 8px 12px; border-radius: 10px; font-size: .95rem;
  background: var(--green-soft); color: var(--text);
}
.why strong { color: var(--green-ink); }
.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin: 3px 0; }
.bullets li::marker { color: var(--green); }
.excerpt { margin: 0; padding: 0 0 0 12px; border-left: 3px solid var(--line); color: var(--text); font-size: .97rem; }
.excerpt cite { font-style: normal; font-size: .82rem; color: var(--muted); white-space: nowrap; }

.meta { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); padding-top: 4px; }
.sources { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.read {
  align-self: flex-start; font-weight: 700; text-decoration: none; padding: 7px 12px; border-radius: 10px;
  background: var(--green-soft); color: var(--green-ink);
}
.read:hover { background: var(--green); color: var(--surface); }

/* ---------- Continents with topic subheadings ---------- */
.region {
  margin-top: 28px; padding: 18px 18px 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.region-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  border-bottom: 3px solid var(--green); padding-bottom: 10px;
}
.region-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.button {
  font-size: .9rem; font-weight: 700; text-decoration: none; padding: 7px 14px; border-radius: 999px;
  background: var(--green); color: var(--surface);
}
.button:hover { filter: brightness(1.1); }

.topic h3 {
  display: flex; align-items: center; gap: 2px; margin: 20px 0 10px; font-size: .9rem;
  text-transform: uppercase; letter-spacing: .07em; color: var(--c, var(--green-ink));
}

.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.row a {
  display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px;
  text-decoration: none; color: var(--text); background: var(--tint); height: 100%;
}
.row a:hover { background: var(--green-soft); }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-weight: 600; line-height: 1.35; font-size: .97rem; }
.row-meta { font-size: .8rem; color: var(--muted); }
.more { margin: 8px 0 0; font-size: .9rem; }
.more a { font-weight: 700; text-decoration: none; }
.to-top { text-align: right; font-size: .85rem; margin: 14px 0 10px; }
.to-top a { color: var(--muted); }

.count {
  font-size: .72rem; font-weight: 700; color: var(--green-ink); letter-spacing: 0; text-transform: none;
  background: var(--green-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}

/* ---------- Jump links, archive ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; font-size: .92rem; }
.jump a {
  display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
}
.jump a:hover { border-color: var(--green); }
.block { margin-top: 8px; }

.archive-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; }
.archive-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.archive-list a:hover { border-color: var(--green); }

.muted, .empty { color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 4px solid var(--green); margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 40px; padding-top: 20px; padding-bottom: 32px; font-size: .9rem; color: var(--muted); }
.footer h2 { font-size: 1rem; color: var(--text); margin: 0 0 8px; }
.footer ul { margin: 0; padding-left: 18px; }
.footer li, .footer p { margin: 4px 0; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .region { padding: 14px 12px 4px; }
  .grid, .rows { grid-template-columns: 1fr; }
}

/* ---------- Printing (for class handouts) ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #ccc; --shadow: none; }
  .masthead .nav, .skip, .howto, .continents, .jump, .to-top, .button, .more, .pic { display: none !important; }
  .masthead { background: none; color: #000; border-bottom: 2px solid #000; }
  .brand, .updated { color: #000; }
  .story, .region { break-inside: avoid; box-shadow: none; }
  .grid, .rows { grid-template-columns: 1fr 1fr; }
  .read::after { content: " (" attr(href) ")"; font-weight: 400; font-size: .75rem; word-break: break-all; }
}
