/*
Theme Name: Know It All News — Seeker Edition
Theme URI: https://theseeker.ca/
Author: The Seeker Newsmagazine
Author URI: https://theseeker.ca/
Description: A fast, modern WordPress theme for The Know It All News, the bi-weekly community paper of South Stormont, Ontario, published as a division of The Seeker. Includes a PDF edition archive, an advertiser wall, a one-click importer for the old Wix site, and full Elementor support with five custom widgets plus Theme Builder locations.
Version: 1.2.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: knowitall-seeker
Tags: news, blog, custom-logo, custom-colors, two-columns, editor-style
*/

/* ============================================================
   1. TOKENS
   ------------------------------------------------------------
   Palette is drawn from the Seaway: river slate, lock-gate teal,
   press red, and the warm newsprint the paper is actually
   printed on. Colours marked --brand-* are overridden inline
   by the Customizer (see inc/customizer.php).
   ============================================================ */

:root {
  --ink: #14202b;
  --ink-soft: #43535f;
  --ink-faint: #7c8a94;
  --paper: #fbf9f4;
  --paper-2: #f2eee3;
  --rule: #ddd6c6;
  --rule-strong: #c3b9a3;
  --brand: #d5232c;
  --brand-dark: #a5171f;
  --teal: #0e6e6b;
  --teal-wash: #e4efee;
  --white: #ffffff;

  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1.02rem, 0.98rem + 0.2vw, 1.13rem);
  --step-1: clamp(1.22rem, 1.13rem + 0.42vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.9vw, 2.1rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 3rem);
  --step-4: clamp(2.4rem, 1.7rem + 3.4vw, 4.6rem);

  --wrap: 1200px;
  --wrap-narrow: 720px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 3px;
  --shadow: 0 1px 2px rgba(20, 32, 43, 0.06), 0 8px 24px -12px rgba(20, 32, 43, 0.22);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.wrap { width: min(var(--wrap), 100% - (var(--gutter) * 2)); margin-inline: auto; }
.wrap-narrow { width: min(var(--wrap-narrow), 100% - (var(--gutter) * 2)); margin-inline: auto; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--white);
  padding: 0.7rem 1.2rem; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ============================================================
   3. SHARED PIECES
   ============================================================ */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 0.95rem 1.5rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--brand); border-color: var(--brand); color: var(--white); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

.btn-brand { background: var(--brand); border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { padding-top: 0; }
.section-tint { background: var(--paper-2); border-block: 1px solid var(--rule); }
.section-tint + .section { padding-top: clamp(3rem, 7vw, 5.5rem); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-head h2 { font-size: var(--step-2); margin: 0; }
.section-head .more { font-weight: 600; font-size: var(--step--1); white-space: nowrap; }

/* ============================================================
   4. PARENT BAR + MASTHEAD
   ============================================================ */

.parent-bar {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.parent-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  min-height: 40px;
  padding-block: 0.4rem;
}
.parent-bar a { color: var(--white); text-decoration: none; font-weight: 600; }
.parent-bar a:hover { text-decoration: underline; }
.parent-bar .parent-mark {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.parent-bar .parent-contact { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.masthead-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-block: clamp(1.4rem, 3vw, 2.4rem);
}
.masthead-side { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.5; }
.masthead-side.right { text-align: right; }
.masthead-side strong { color: var(--ink); font-weight: 500; display: block; }

.flag { text-align: center; text-decoration: none; color: var(--ink); display: block; }
.flag-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-4);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0;
}
.flag-title .the { display: block; font-size: 0.28em; letter-spacing: 0.42em; font-weight: 600; margin-bottom: 0.35em; text-indent: 0.42em; color: var(--brand); }
.flag-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
}
.flag img { margin-inline: auto; max-height: 88px; width: auto; }

/* rule under the flag: thick / thin, the way a broadsheet folio sits */
.masthead::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--brand);
}

/* Nav */
.site-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 60;
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.6rem;
  margin: 0;
  padding: 0;
}
.site-nav li { position: relative; }
.site-nav a {
  display: block;
  padding: 0.9rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.site-nav a:hover::after,
.site-nav .current-menu-item > a::after { transform: scaleX(1); }
.site-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 210px;
  background: var(--white);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 0.4rem 1rem;
  flex-direction: column;
  gap: 0;
  z-index: 5;
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { display: flex; }

.nav-cta { flex-shrink: 0; padding: 0.6rem 1.1rem; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  font: 600 0.9rem/1 var(--font-body);
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 900px) {
  .masthead-inner { grid-template-columns: 1fr; text-align: center; }
  .masthead-side { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav .wrap { flex-wrap: wrap; padding-block: 0.7rem; }
  .site-nav ul {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--rule);
    margin-top: 0.6rem;
  }
  .site-nav ul.is-open { display: flex; }
  .site-nav li { border-bottom: 1px solid var(--rule); }
  .site-nav .sub-menu { position: static; border: 0; box-shadow: none; padding: 0 0 0.5rem 1rem; }
  .site-nav a::after { display: none; }
}

/* ============================================================
   5. HERO — CURRENT EDITION
   ============================================================ */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid var(--rule);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) 1.15fr;
  gap: clamp(1.8rem, 5vw, 4rem);
  align-items: center;
}
.hero-cover {
  position: relative;
  background: var(--white);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow);
  aspect-ratio: 8.5 / 11;
  overflow: hidden;
  transition: transform 0.25s ease;
}
.hero-cover:hover { transform: translateY(-4px) rotate(-0.4deg); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-cover-fallback {
  display: grid;
  place-content: center;
  gap: 0.4rem;
  height: 100%;
  text-align: center;
  padding: 1.5rem;
  background: repeating-linear-gradient(45deg, var(--paper-2) 0 12px, var(--paper) 12px 24px);
}
.hero-cover-fallback .num {
  font-family: var(--font-mono);
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.hero-cover-fallback .lbl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero-flash {
  position: absolute;
  top: 0; left: 0;
  background: var(--brand);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
}
.hero h1 { font-size: var(--step-3); margin-bottom: 0.6rem; }
.hero-dek { font-size: var(--step-1); color: var(--ink-soft); max-width: 46ch; margin-bottom: 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.8rem; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  border-top: 1px solid var(--rule-strong);
  padding-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero-meta strong { display: block; color: var(--ink); font-weight: 500; font-size: 0.86rem; letter-spacing: 0.04em; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cover { max-width: 300px; margin-inline: auto; }
}

/* ============================================================
   6. STORY CARDS
   ============================================================ */

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.story {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.story:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--rule-strong); }
.story-thumb { aspect-ratio: 16 / 10; background: var(--paper-2); overflow: hidden; }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.story-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.6rem;
}
.story h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.story h3 a { color: inherit; text-decoration: none; }
.story h3 a:hover { color: var(--brand-dark); }
.story p { font-size: 0.97rem; color: var(--ink-soft); margin-bottom: 1rem; }
.story-foot {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ============================================================
   7. THE LEDGER — the signature element.
   Every edition since 2015, numbered, in one continuous run.
   ============================================================ */

.ledger { border-top: 2px solid var(--ink); }

.ledger-year {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding-block: 1.6rem;
}
.ledger-year > h3 {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin: 0;
  position: sticky;
  top: 90px;
  align-self: start;
}
.ledger-year > h3 span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-top: 0.3rem;
}

.ledger-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 0.15rem 1.5rem; }

.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem 0.5rem 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius);
  transition: background 0.14s ease, padding-left 0.14s ease;
}
.ledger-row:hover, .ledger-row:focus-visible {
  background: var(--teal-wash);
  padding-left: 0.6rem;
  color: var(--ink);
}
.ledger-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  min-width: 3.2ch;
}
.ledger-date { font-size: 0.95rem; font-weight: 600; }
.ledger-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (max-width: 700px) {
  .ledger-year { grid-template-columns: 1fr; gap: 0.8rem; }
  .ledger-year > h3 { position: static; }
}

/* ============================================================
   8. SPONSOR WALL
   ============================================================ */

.sponsor-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.sponsor {
  background: var(--white);
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--ink-soft);
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  transition: background 0.15s ease;
}
.sponsor:hover { background: var(--paper-2); color: var(--ink); }
.sponsor img { max-height: 100%; width: auto; object-fit: contain; mix-blend-mode: multiply; }

/* ============================================================
   9. ADVERTISE BAND
   ============================================================ */

.advertise {
  background: var(--ink);
  color: var(--white);
  padding-block: clamp(3rem, 7vw, 5rem);
}
.advertise .eyebrow { color: rgba(255, 255, 255, 0.55); }
.advertise .eyebrow::after { background: rgba(255, 255, 255, 0.2); }
.advertise h2 { font-size: var(--step-3); color: var(--white); max-width: 16ch; }
.advertise-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.advertise p { color: rgba(255, 255, 255, 0.78); max-width: 46ch; }
.advertise .btn { background: var(--brand); border-color: var(--brand); }
.advertise .btn:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.advertise-lines { display: grid; gap: 1px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.16); }
.advertise-line { background: var(--ink); padding: 1.15rem 1.4rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.advertise-line .k { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.advertise-line .v { font-size: 1.15rem; font-weight: 600; text-align: right; }
.advertise-line .v a { color: var(--white); text-decoration: none; }
.advertise-line .v a:hover { text-decoration: underline; }

@media (max-width: 800px) { .advertise-grid { grid-template-columns: 1fr; } }

/* ============================================================
   10. ARTICLE / PAGE CONTENT
   ============================================================ */

.page-head { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2.2rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: var(--step-3); margin-bottom: 0.4rem; }
.page-head .dek { font-size: var(--step-1); color: var(--ink-soft); max-width: 58ch; }
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 1rem;
}
.byline .sep { color: var(--rule-strong); }

.entry { padding-block: clamp(2rem, 5vw, 3.5rem); font-size: 1.08rem; line-height: 1.75; }
.entry > * { margin-inline: auto; width: min(var(--wrap-narrow), 100% - (var(--gutter) * 2)); }
.entry h2 { font-size: var(--step-2); margin-top: 2em; }
.entry h3 { font-size: var(--step-1); margin-top: 1.8em; }
.entry img, .entry figure, .entry .wp-block-image { margin-block: 2rem; }
.entry .alignwide { width: min(var(--wrap), 100% - (var(--gutter) * 2)); }
.entry .alignfull { width: 100%; max-width: 100%; }
.entry blockquote {
  border-left: 3px solid var(--brand);
  padding-left: 1.4rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: normal;
  color: var(--ink);
}
.entry ul, .entry ol { padding-left: 1.4rem; }
.entry li { margin-bottom: 0.4em; }
.entry figcaption { font-size: 0.85rem; color: var(--ink-faint); font-family: var(--font-mono); letter-spacing: 0.02em; }

/* PDF reader */
.pdf-frame {
  width: 100%;
  height: min(88vh, 1180px);
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.pdf-fallback { padding: 2.5rem; text-align: center; background: var(--paper-2); border: 1px solid var(--rule); }

.pager {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 2.5rem;
}
.pager a { font-weight: 600; text-decoration: none; display: grid; gap: 0.2rem; }
.pager .lbl { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.pager .next { text-align: right; }

/* ============================================================
   11. NOTICES & EMPTY STATES
   ============================================================ */

.empty {
  border: 1px dashed var(--rule-strong);
  background: var(--white);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border-radius: var(--radius);
  text-align: center;
}
.empty h3 { font-size: var(--step-1); }
.empty p { color: var(--ink-soft); max-width: 52ch; margin-inline: auto; }

/* ============================================================
   12. FOOTER
   ============================================================ */

.site-footer { background: var(--paper-2); border-top: 3px solid var(--brand); padding-block: clamp(2.5rem, 6vw, 4rem) 2rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(1.8rem, 4vw, 3.5rem); }
.footer-flag { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1; margin-bottom: 0.8rem; }
.site-footer h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-footer a:hover { color: var(--brand-dark); text-decoration: underline; }
.coverage { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.7; }
.colophon {
  margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.5rem;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--ink-faint);
}
.colophon a { font-size: inherit; font-family: inherit; color: var(--ink-soft); }

@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   13. LAYOUT SHELL
   ============================================================ */

body { display: flex; flex-direction: column; min-height: 100vh; }
#content { flex: 1; }

/* WP core alignment/caption classes */
.alignleft { float: left; margin: 0.4rem 1.6rem 1rem 0; }
.alignright { float: right; margin: 0.4rem 0 1rem 1.6rem; }
.aligncenter { margin-inline: auto; }
.wp-caption-text { font-size: 0.85rem; color: var(--ink-faint); }
.sticky .story-kicker::before { content: "Pinned · "; }

/* Pagination */
.nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 3rem; }
.nav-links .page-numbers {
  display: grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding-inline: 0.6rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.85rem; text-decoration: none; color: var(--ink); background: var(--white);
}
.nav-links .page-numbers:hover { background: var(--paper-2); }
.nav-links .current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Search form */
.search-form { display: flex; gap: 0.5rem; max-width: 420px; }
.search-form input[type="search"] {
  flex: 1; padding: 0.8rem 1rem; font: inherit; font-size: 1rem;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.search-form input[type="search"]:focus { border-color: var(--teal); outline: none; }

/* ============================================================
   14. ELEMENTOR COMPATIBILITY
   ------------------------------------------------------------
   Two jobs. First, get the theme's narrow reading column out of
   the way on pages built in the builder — Elementor handles its
   own widths and the two constraints fight otherwise. Second,
   make the theme's sections behave when dropped inside an
   Elementor container that already centres and pads them.
   ============================================================ */

/* A page built in Elementor owns its own layout. */
.entry-builder { padding-block: 0; }
.entry-builder > * { width: 100%; max-width: none; margin-inline: 0; }
.entry > .elementor { width: 100%; max-width: none; }

/* Elementor's own alignment classes inside theme content. */
.entry .elementor-widget-container > * { width: 100%; }

/* Theme sections dropped into a builder container: the container is already
   padded, so drop the theme's outer container and vertical rhythm. */
.elementor-widget .hero,
.elementor-widget .advertise { padding-block: clamp(2rem, 4vw, 3rem); }
.elementor-widget .hero { border-bottom: 0; background: none; }
.elementor-widget .section-head { margin-bottom: 1.5rem; }

/* Full-bleed sections need to escape the container when the theme container
   switch is on inside a boxed Elementor section. */
.elementor-widget-kia-advertise-band .advertise { border-radius: var(--radius); }

/* Elementor resets heading margins to zero; the theme relies on them. */
.elementor-widget-kia-latest-edition h1,
.elementor-widget-kia-edition-ledger h2,
.elementor-widget-kia-story-grid h2,
.elementor-widget-kia-advertiser-wall h2,
.elementor-widget-kia-advertise-band h2 { margin-bottom: 0.5em; }

/* Elementor Pro header templates replace the theme masthead; the sticky
   offset for the ledger year labels then no longer applies. */
.elementor-location-header ~ #content .ledger-year > h3 { top: 1rem; }

/* Keep the theme's buttons from being flattened by Elementor's global button
   styling, which targets bare a.elementor-button only — this is defensive. */
.elementor .btn { text-decoration: none; }

/* Elementor Canvas template: no theme chrome at all, so restore body flow. */
.elementor-template-canvas .site-footer,
.elementor-template-canvas .masthead,
.elementor-template-canvas .parent-bar,
.elementor-template-canvas .site-nav { display: none; }

/* ============================================================
   15. AD SLOTS
   ------------------------------------------------------------
   Every slot carries a visible "Advertisement" label. That is
   both a standards expectation for news publishers and the
   thing that keeps reader trust intact.
   ============================================================ */

.ad-slot { margin-block: clamp(1.5rem, 3vw, 2.5rem); text-align: center; }

.ad-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}

.ad-creative { display: block; line-height: 0; }
.ad-creative img { margin-inline: auto; width: auto; max-width: 100%; }
a.ad-creative { transition: opacity 0.15s ease; }
a.ad-creative:hover { opacity: 0.9; }

/* Wide banner slots */
.ad-leaderboard,
.ad-hero-below,
.ad-edition,
.ad-article { border-block: 1px solid var(--rule); padding-block: 1.1rem; }
.ad-leaderboard .ad-creative img,
.ad-hero-below .ad-creative img,
.ad-edition .ad-creative img,
.ad-article .ad-creative img { max-height: 160px; }

/* The in-feed unit is a card, so it sits in the story grid without
   pretending to be a story. */
.ad-in-feed {
  grid-column: span 1;
  margin: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Up to three side by side above the footer */
.ad-row .ad-creative { display: inline-block; }
.ad-pre-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: center;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}
.ad-pre-footer .ad-label { grid-column: 1 / -1; margin-bottom: 0; }

/* Empty inventory, shown only to logged-in staff */
.ad-empty {
  border: 1px dashed var(--rule-strong);
  background: var(--paper-2);
  padding: 1.2rem;
  border-radius: var(--radius);
}
.ad-empty-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}
.ad-empty-note { font-size: 0.85rem; color: var(--ink-faint); margin: 0; }
