/* ==========================================================================
   THE MERIDIAN POST — Broadsheet-style news landing page
   Mobile-First responsive · Pure static, no build step
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --paper: #f9f8f4;        /* paper white */
  --ink: #1a1a1a;          /* ink black */
  --gray: #666666;         /* newsprint gray */
  --line: #d9d7d0;         /* hairline gray */
  --breaking: #a01111;     /* breaking-news red */
  --serif: Georgia, "Times New Roman", "Times", serif;
  --column: 680px;         /* article measure */
  --wide: 960px;           /* wide blocks / figures */
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--ink);
}

ul {
  list-style: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Reading progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--breaking);
  z-index: 100;
}

/* ---------- Top strip ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.topbar-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.topbar-edition {
  display: none;
}

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 0;
  background-color: var(--paper);
  z-index: 50;
}

.masthead-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 3px double var(--ink);
}

.brand {
  text-decoration: none;
  text-align: center;
  line-height: 1.1;
}

.brand-en {
  display: block;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.02em;
}

/* Subscribe button: ≥44px touch target */
.subscribe-btn {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background-color: var(--ink);
  color: var(--paper);
}

.subscribe-btn:hover {
  background-color: var(--paper);
  color: var(--ink);
}

/* ---------- Hamburger (≤768px) ---------- */
.hamburger {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Navigation ---------- */
.site-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.site-nav.is-open {
  max-height: 340px;
}

.nav-list {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 4px 16px 8px;
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.nav-list li:last-child a {
  border-bottom: none;
}

.nav-list a:hover {
  color: var(--breaking);
}

/* ---------- Article frame ---------- */
.article {
  max-width: var(--column);
  margin: 0 auto;
  padding: 24px 20px 0;
}

.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--breaking);
  border: 1px solid var(--breaking);
  padding: 3px 10px;
  margin-bottom: 16px;
}

.headline {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.standfirst {
  font-size: 18px;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 20px;
}

.byline {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  margin-bottom: 24px;
}

.byline-author,
.byline-meta {
  display: block;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.byline-author {
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Figures ---------- */
.hero-figure {
  margin: 0 -20px 24px;
}

.inline-figure {
  margin: 28px 0;
}

.caption {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray);
  text-align: right;
  padding: 8px 4px 0;
}

.hero-figure .caption {
  padding-right: 20px;
  padding-left: 20px;
}

/* ---------- Key takeaways ---------- */
.key-points {
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 16px 0 16px;
  margin-bottom: 28px;
}

.key-points-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.key-points li {
  position: relative;
  font-size: 15px;
  line-height: 1.7;
  padding-left: 18px;
  margin-bottom: 10px;
}

.key-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 6px;
  height: 6px;
  background-color: var(--breaking);
}

/* ---------- Body copy ---------- */
.article-body p {
  margin-bottom: 20px;
  text-align: justify;
  hyphens: auto;
}

.article-body .lead {
  font-size: 17px;
  line-height: 1.8;
}

.article-body .lead::first-letter {
  font-size: 3.1em;
  font-weight: 700;
  float: left;
  line-height: 0.82;
  padding: 4px 10px 0 0;
}

.article-body h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  margin: 36px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Pull quote */
.pull-quote {
  margin: 32px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--breaking);
}

.pull-quote p {
  font-size: 19px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 8px;
  text-align: left;
}

.pull-quote cite {
  font-style: normal;
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.04em;
}

/* ---------- Donation chart ---------- */
.donation-chart {
  margin: 32px 0;
  padding: 24px 0 12px;
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--line);
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 28px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 44px;
  height: 300px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 108px;
  height: 100%;
}

.chart-total {
  margin-bottom: 8px;
  text-align: center;
}

.chart-total .chart-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.chart-total .chart-unit {
  font-size: 16px;
  font-weight: 700;
  margin-left: 1px;
}

.chart-total--old {
  color: var(--gray);
}

.chart-total--new {
  color: var(--breaking);
}

.chart-bar {
  width: 100%;
}

.chart-bar--old {
  background-color: #d8d4c8;
}

.chart-bar--stack {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 6px 4px;
}

.seg--recent {
  flex: 276; /* $276M */
  background-color: var(--breaking);
  color: #ffffff;
}

.seg--before {
  flex: 90; /* $90M */
  background-color: #cfc9b8;
  color: var(--ink);
}

.seg-label {
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.seg-num {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
}

.seg-num small {
  font-size: 13px;
  font-weight: 400;
}

.seg-num--sm {
  font-size: 17px;
}

.chart-period {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gray);
}

.chart-source {
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--gray);
  text-align: center;
}

/* ---------- Editor's note ---------- */
.editor-note {
  margin: 32px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background-color: #f1efe8;
}

.editor-note p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray);
  margin-bottom: 0;
  text-align: left;
}

/* ---------- Topic tags ---------- */
.article-tags {
  font-size: 14px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--line);
}

.tag-label {
  color: var(--gray);
  margin-right: 4px;
}

.article-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 12px;
  text-decoration: underline;
  text-decoration-color: var(--line);
}

/* ---------- Related reading ---------- */
.related {
  max-width: var(--wide);
  margin: 40px auto 0;
  padding: 24px 20px 8px;
  border-top: 3px double var(--ink);
}

.related-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.related-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.related-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--breaking);
  margin-bottom: 6px;
}

.related-item h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.related-item h3 a {
  text-decoration: none;
}

.related-item h3 a:hover {
  text-decoration: underline;
}

.related-meta {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 0.04em;
  margin-top: 6px;
}

/* ---------- Subscribe ---------- */
.subscribe {
  max-width: var(--column);
  margin: 40px auto 0;
  padding: 32px 20px 40px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.subscribe-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.subscribe-text {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 20px;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}

.subscribe-form input {
  min-height: 48px;
  padding: 0 14px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background-color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.subscribe-form input:focus {
  outline: 2px solid var(--breaking);
  outline-offset: 1px;
}

.subscribe-form button {
  min-height: 48px;
  padding: 0 20px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  background-color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}

.subscribe-form button:hover {
  background-color: var(--paper);
  color: var(--ink);
}

.subscribe-feedback {
  min-height: 24px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--breaking);
}

/* ---------- Subscribe modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(26, 26, 26, 0.55);
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background-color: var(--paper);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 4px;
  padding: 36px 24px 28px;
  text-align: center;
}

.modal-box:focus {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px; /* ≥44px touch target */
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--ink);
}

.modal-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--breaking);
  margin-bottom: 14px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
}

.modal-text {
  font-size: 15px;
  line-height: 1.7;
  color: #333333;
  margin-bottom: 22px;
  text-align: left;
}

.modal-form {
  margin-bottom: 0;
}

.modal-fine {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 3px double var(--ink);
  margin-top: 20px;
}

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px 20px 36px;
  text-align: center;
}

.footer-brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  text-decoration: none;
  color: var(--gray);
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-copy {
  font-size: 12px;
  line-height: 1.8;
  color: var(--gray);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Tablet ≥ 600px
   ========================================================================== */
@media (min-width: 600px) {
  .topbar-edition {
    display: inline;
  }

  .brand-en {
    font-size: 28px;
  }

  .headline {
    font-size: 36px;
  }

  .hero-figure {
    margin: 0 0 28px;
  }

  .hero-figure .caption {
    padding-right: 4px;
    padding-left: 4px;
  }

  .subscribe-form {
    flex-direction: row;
  }

  .subscribe-form input {
    flex: 1;
  }
}

/* ==========================================================================
   Desktop ≥ 769px (hide hamburger, expand nav)
   ========================================================================== */
@media (min-width: 769px) {
  .hamburger {
    display: none;
  }

  .masthead-inner {
    justify-content: center;
    position: relative;
    padding: 16px;
  }

  .subscribe-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .site-nav {
    max-height: none;
    overflow: visible;
  }

  .nav-list {
    display: flex;
    justify-content: center;
    padding: 0 16px;
  }

  .nav-list a {
    min-height: 44px;
    padding: 0 20px;
    border-bottom: none;
    font-size: 14px;
  }

  .nav-list a:hover {
    text-decoration: underline;
  }

  .article {
    padding-top: 40px;
  }

  .chart-bars {
    height: 360px;
    gap: 64px;
  }

  .chart-col {
    width: 128px;
  }

  .headline {
    font-size: 42px;
  }

  .standfirst {
    font-size: 19px;
  }

  .related-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .related-item {
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding-right: 28px;
  }

  .related-item:last-child {
    border-right: none;
    padding-right: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-nav,
  .hamburger-line {
    transition: none;
  }
}
