/* ncircular — editorial redesign (2026-09-07)
   Replaces the old Flex theme (static/theme/stylesheet/style.min.css, kept
   in the repo but no longer linked from templates/base.html). Rollback:
   `git checkout pre-redesign-2026-09-07 -- templates static/theme static/img config.yml`
   See README.md "Design" section. */

:root {
  --ink: #1c1a17;
  --ink-soft: #55504a;
  --paper: #fbf7f1;
  --paper-raised: #ffffff;
  --line: #e7e0d6;
  --accent: #D9411E;
  --accent-light: #FF5A09;
  --navy: #1B2A4A;
  --radius: 10px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans Pro', 'Roboto', 'Open Sans', 'Helvetica', 'Arial', sans-serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html, body { width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05em;
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 2.4em; }
h2 { font-size: 1.6em; }
h3 { font-size: 1.25em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

img { max-width: 100%; display: block; }

.wrap, main, .footer-grid, .masthead__inner, .footer-bottom {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute; top: -60px; left: 1rem; z-index: 1000;
  background: var(--ink); color: #fff; padding: .8rem 1.2rem;
  border-radius: var(--radius); font-weight: 700; transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* -- masthead ------------------------------------------------------------- */

.masthead {
  background: var(--paper-raised);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: .8rem;
  padding-bottom: .8rem;
}

.masthead__brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  flex-shrink: 0;
}

.masthead__brand img { border-radius: 6px; }

.masthead__title {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3em;
  letter-spacing: .01em;
}

.masthead__subtitle {
  display: block;
  font-size: .72em;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nav-toggle {
  margin-left: auto;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ink);
  padding: .4rem;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 1.6rem;
}

.nav-links a {
  color: var(--ink);
  font-weight: 600;
  font-size: .95em;
}
.nav-links a:hover { color: var(--accent); }

/* -- eyebrow / category badge ----------------------------------------------- */

/* A solid-color pill rather than plain colored text — the color itself
   comes from the category_color filter (inline style, per-category), so
   Politics/Sport/Business/etc. each read as a distinct, punchy badge
   instead of every category sharing one accent color. */
.eyebrow, .eyebrow:hover, .eyebrow:visited, .eyebrow:link {
  display: inline-block;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff !important;
  background: var(--accent);
  border-radius: 999px;
  padding: .3rem .8rem;
  margin-bottom: .7rem;
  transition: opacity .15s ease;
}
.eyebrow:hover { opacity: .85; }

/* -- hero ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2rem 0 3rem;
}
.hero__media { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 8/5; }

/* small "here's roughly where" marker over a country/region scene image,
   position set inline per category via the category_marker filter */
.card__pin {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 0 0 7px rgba(255,255,255,.16);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero__media .card__pin { width: 13px; height: 13px; box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 0 0 10px rgba(255,255,255,.16); }
.article-banner .card__pin { width: 13px; height: 13px; box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 0 0 10px rgba(255,255,255,.16); }
.hero__title { font-size: 2.1em; font-weight: 700; margin-bottom: .6rem; }
.hero__title a { color: var(--ink); }
.hero__title a:hover { color: var(--accent); }
.hero__excerpt { color: var(--ink-soft); font-size: 1.05em; margin-bottom: .8rem; }

/* a quiet section label, not a colour pill (that's the category eyebrow's
   job) — mainly earns its keep once the hero collapses to one column on
   mobile and would otherwise look identical in shape to an ordinary card
   below it, with nothing marking it as the lead story. */
.hero__label {
  display: block;
  font-size: .75em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}

/* -- card grid -------------------------------------------------------------- */

/* flexbox + flex-grow rather than grid, so a trailing partial row (e.g. a
   category page with 4 or 7 posts) stretches to fill the row instead of
   leaving an empty gap where grid's fixed column template would put one —
   same technique already used for the /wire subsite's card grids. */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 1rem 0 3rem;
}

.card {
  flex: 1 1 300px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--accent); }

.card__media { position: relative; display: block; overflow: hidden; }
.card__media img { width: 100%; aspect-ratio: 400/260; object-fit: cover; }

.card__body { padding: 1.1rem 1.2rem 1.3rem; }

.card__title { font-size: 1.2em; font-weight: 700; margin-bottom: .5rem; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--accent); }

.card__excerpt { color: var(--ink-soft); font-size: .92em; margin: 0 0 .6rem; }

.card__meta { color: var(--ink-soft); font-size: .8em; margin: 0; text-transform: uppercase; letter-spacing: .04em; }

/* a normal-case descriptive sentence under a page h1 (unlike .card__meta,
   which is for short uppercase byline-style labels like "Posted on ...") */
.page-lede { color: var(--ink-soft); font-size: 1.05rem; margin: .5rem 0 0; }

/* -- live news strip --------------------------------------------------------- */

.news-strip {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.8rem 2rem 2rem;
  margin: 0 0 3rem;
}

.news-strip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.news-strip__head h2 { color: #fff; margin: 0; font-size: 1.3em; }
.news-strip__head a { color: #ffd9c9; font-size: .85em; font-weight: 600; }

.news-strip__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.news-card {
  display: block;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: .9rem 1rem;
  color: #fff;
}
.news-card:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.news-card__source {
  display: block;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: .35rem;
}
.news-card__title { display: block; font-family: var(--serif); font-weight: 600; line-height: 1.3; }
.news-card__time { display: block; font-size: .75em; color: rgba(255, 255, 255, 0.6); margin-top: .4rem; }

/* -- single article ----------------------------------------------------------- */

article.single { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* breadcrumb trail, article pages only (Home / Category) — orientation
   for anyone landing deep via search/social rather than the homepage */
.breadcrumbs {
  font-size: .85em;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.breadcrumbs a { color: var(--ink-soft); font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--line); }

.article-banner { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; border: 1px solid var(--line); }
.article-banner img { width: 100%; aspect-ratio: 1200/360; object-fit: cover; }

article.single header h1 { font-size: 2em; }

/* -- in-this-issue jump box --------------------------------------------------- */

/* A scannable table of contents for anything with 2+ ## sections (mainly the
   Daily/Weekly Circular digests, which otherwise open straight into several
   screens of dense prose with no preview of what's ahead). Built from
   page.toc, which ssg.py populates by walking the rendered <h2>s — see
   inject_heading_ids() in ssg.py. */
.toc {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.2rem 1.1rem;
  margin: 1.5rem 0 2rem;
}
.toc__label {
  font-size: .72em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem .6rem; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .9rem .35rem .6rem; font-size: .88em; font-weight: 600; color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.toc a::before {
  content: counter(toc);
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.3em; height: 1.3em; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .78em; font-weight: 700;
}
.toc a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.toc a:hover::before { background: #fff; color: var(--accent); }

.article-body { font-size: 1.08em; }
.article-body p { margin: 0 0 1.2em; }
.article-body > p:first-of-type { font-size: 1.2em; font-weight: 500; color: var(--ink); }
.article-body img { border-radius: 8px; margin: 1rem 0; }
.article-body figure { margin: 1.5rem 0; }
.article-body figcaption { font-size: .8em; color: var(--ink-soft); margin-top: .4rem; }
.article-body h2 { margin-top: 2rem; padding-top: .3rem; border-top: 3px solid var(--accent); display: inline-block; }
.article-body blockquote {
  position: relative;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--paper-raised);
  border-radius: 0 10px 10px 0;
  margin: 1.8rem 0; padding: 1rem 1.2rem 1rem 1.4rem;
  color: var(--ink); font-style: italic; font-family: var(--serif); font-size: 1.1em;
}
.article-body pre { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; overflow-x: auto; }

/* Some older posts embed YouTube/Datawrapper iframes with a fixed pixel
   width (e.g. width="440"), which overflows the article column on mobile —
   img already gets max-width:100% from the rule above, iframe doesn't. */
.article-body iframe {
  max-width: 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

/* -- reading progress + share (article.html) ------------------------------ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 30; /* above .masthead's sticky z-index: 20 */
  transition: width .1s linear;
}

.share-fab {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 25;
}

.share-fab__toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.share-fab__toggle svg { width: 20px; height: 20px; }
.share-fab__toggle:hover { color: var(--accent); }

.share-fab__menu {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + .6rem);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  padding: .4rem;
  min-width: 140px;
}
.share-fab.open .share-fab__menu { display: flex; flex-direction: column; gap: .2rem; }

.share-fab__menu button {
  width: 100%;
  text-align: left;
  padding: .5rem .7rem;
  border: none;
  background: none;
  color: var(--ink);
  font-size: .92em;
  border-radius: 6px;
  cursor: pointer;
}
.share-fab__menu button:hover { background: var(--paper); color: var(--accent); }

@media (max-width: 640px) {
  .share-fab { right: .8rem; bottom: .8rem; }
}

table { display: block; overflow-x: auto; max-width: 100%; }

.tag-cloud { margin-top: 2rem; }
.tag-cloud a {
  display: inline-block;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .9rem;
  margin: 0 .4rem .4rem 0;
  font-size: .82em;
  color: var(--ink-soft);
}
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent); }

/* -- related posts ("read next"), end of article ----------------------------- */

.related-posts { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.related-posts__heading {
  font-size: 1.1em;
  padding-top: .3rem;
  border-top: 3px solid var(--accent);
  display: inline-block;
  margin-bottom: 1.2rem;
}
/* narrower gap than the full-width .card-grid, and only 2 cards fit the
   article column comfortably at this width before wrapping to 1 */
.card-grid--related { gap: 1.2rem; margin: 0; }
.card-grid--related .card { flex-basis: 220px; }

/* .card's own flex:1 1 300px stretches a single related post out to
   nearly the full 760px article column - a lonely oversized card instead
   of a normal-width "read next" suggestion. Cap it back to its natural
   width and let it sit at the start of the row instead of filling it. */
.card-grid--related-single .card { flex-grow: 0; max-width: 340px; }

/* -- directory / archive pages (categories, tags, authors, archives) --------- */

main > article.single { padding-top: 2.5rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  border-bottom: 1px solid var(--line);
  padding: .7rem 0;
  display: flex;
  justify-content: space-between;
}
.list li a { color: var(--ink); font-weight: 600; }
.list li a:hover { color: var(--accent); }

dl { margin: 0; }
dt { font-family: var(--serif); font-weight: 600; margin-top: 1.6rem; color: var(--ink-soft); text-transform: uppercase; font-size: .8em; letter-spacing: .06em; }
dd { margin: .4rem 0; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
dd a { color: var(--ink); font-weight: 600; }
dd a:hover { color: var(--accent); }

/* -- topics cloud ------------------------------------------------------------ */

.topics-section { margin-top: 2.5rem; }
.topics-section:first-of-type { margin-top: 1.5rem; }
.topics-section h2 { margin-bottom: 1.2rem; }

.cloud { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; }

.cloud__item {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem 1rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.cloud__item:hover { border-color: var(--accent); color: var(--accent); background: var(--paper); }

.cloud__count { font-size: .7em; font-weight: 700; color: var(--ink-soft); }
.cloud__item:hover .cloud__count { color: var(--accent-light); }

.cloud-xl { font-size: 1.5em; font-weight: 700; }
.cloud-lg { font-size: 1.2em; font-weight: 700; }
.cloud-md { font-size: 1.05em; }
.cloud-sm { font-size: .92em; }
.cloud-xs { font-size: .8em; color: var(--ink-soft); border-style: dashed; }
.cloud-xs:hover { color: var(--accent); }

@media (max-width: 640px) {
  .cloud__item { padding: .25rem .8rem; }
}

/* -- pagination / buttons ------------------------------------------------------ */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .6rem 1.3rem;
  font-weight: 700;
  font-size: .9em;
}
.btn:hover { background: var(--accent-light); color: #fff; }

.pagination { display: flex; justify-content: space-between; margin: 1rem 0 3rem; }
.pagination .float-left { margin-right: auto; }
.pagination .float-right { margin-left: auto; }
.pagination__arrow { width: .8em; height: .8em; vertical-align: -.05em; }

/* -- ads --------------------------------------------------------------------- */

.ad-slot { margin: 2rem 0; text-align: center; max-width: 100%; overflow: hidden; }
.ads-responsive, .ads-aside, .adsbygoogle { display: block; max-width: 100%; }

/* -- footer -------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: #d8d3cc;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2.5rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.footer-about p { color: #a8a29a; font-size: .92em; }
.footer-about .masthead__brand { color: #fff; margin-bottom: .8rem; }
.footer-about .masthead__title { font-size: 1.15em; }

.footer-col h4 { color: #fff; font-size: .85em; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .8rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: #d8d3cc; }
.footer-col a:hover { color: var(--accent-light); }

.social { list-style: none; display: flex; gap: .6rem; margin: 0; padding: 0; }
.social a {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); color: #fff;
}
.social .sc-facebook:hover { background: #3e5b98; }
.social .sc-twitter:hover { background: #4da7de; }
.social .sc-rss:hover { background: #f26109; }
.social__icon { width: 16px; height: 16px; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  font-size: .8em;
  color: #a8a29a;
}
.footer-bottom a { color: #a8a29a; text-decoration: underline; }

/* -- responsive ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .news-strip__grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  /* Below 900px the hero collapses to the same single-column shape as an
     ordinary card, with nothing else marking it as the lead story other
     than .hero__label; giving the body its own raised-paper treatment
     (the same visual language .card already uses) keeps it reading as a
     distinct, featured unit rather than a plain, unstyled block of text
     sitting above the card grid. */
  .hero__body {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem 1.4rem;
    margin-top: -.5rem;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 1.9em; }
  .nav-toggle { display: flex; }
  /* The tagline ("News that matters across Africa") is long enough that,
     with .masthead__brand's flex-shrink: 0, it pushes the hamburger button
     past the masthead's right edge on phone widths — clipped invisibly by
     html/body's overflow-x: hidden rather than scrolling. Drop it once the
     hamburger takes over; the brand name alone is plenty at this width. */
  .masthead__subtitle { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: .5rem 1.5rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .card { flex-basis: 100%; }
  .news-strip__grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; padding-top: 2rem; }
  .list li { flex-direction: column; gap: .2rem; }
}
