/* Meridian17 — Editorial redesign
   Monochrome ink/paper with a single terracotta accent.
   Typography: Heebo throughout.
*/

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Brand palette (from colors_and_type.css) ---- */
  --m17-dark-green:    #024203;
  --m17-mid-green:     #026203;
  --m17-bright-green:  #028203;
  --m17-accent-green:  #a8d5a2;
  --m17-soft-green:    #6aad6a;
  --m17-tint-green:    #f3f9f3;
  --m17-tint-green-2:  #e6f0e6;
  --m17-near-black:    #171717;
  --m17-white:         #ffffff;
  --m17-off-white:     #ededed;
  --m17-border:        #d8d8d0;
  --m17-body-muted:    #555555;

  /* ---- Aliases to the editorial system used throughout the site ---- */
  --paper:   var(--m17-white);      /* page background */
  --paper-2: var(--m17-tint-green); /* alt section bg (very soft green) */
  --paper-3: var(--m17-off-white);  /* warmer grey alt */
  --ink:     var(--m17-near-black);
  --ink-2:   #2a2a2a;
  --ink-3:   var(--m17-body-muted);
  --ink-4:   #777777;
  --rule:    var(--m17-border);
  --rule-2:  #bcbcb4;
  --accent:      var(--m17-mid-green);
  --accent-2:    var(--m17-dark-green);
  --accent-soft: var(--m17-accent-green);
  --accent-tint: var(--m17-tint-green-2);

  /* Type */
  --font: 'Heebo', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --maxw: 1240px;
  --gutter: 28px;
  --rule-w: 1px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Utility wrapper */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- TOP BAR (slim above header) ---- */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 16px;
}
.topbar .meridian-ref { display: flex; align-items: center; gap: 10px; }
.topbar .meridian-ref::before {
  content: "";
  width: 1px; height: 14px; background: var(--accent);
  display: inline-block;
}
.topbar .topbar-right { display: flex; gap: 22px; }
.topbar a:hover { color: var(--ink); }

/* ---- HEADER ---- */
.site-header {
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 6px;
  font-weight: 800; letter-spacing: -0.02em;
  font-size: 22px;
}
.brand .mark {
  display: inline-block;
  width: 42px; height: 42px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}
.brand .ampersand { color: var(--accent); font-weight: 700; }
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 4px;
}

nav.primary {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
}
nav.primary a {
  color: var(--ink-2);
  position: relative;
  padding: 4px 0;
}
nav.primary a:hover { color: var(--ink); }
nav.primary a.active { color: var(--ink); }
nav.primary a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -26px;
  height: 2px; background: var(--accent);
}

.header-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.01em;
}
.header-cta:hover { background: var(--accent); }

/* Mobile nav (used in small-viewport pages) */
.mobile-nav-toggle { display: none; cursor: pointer; }
.mobile-menu { display: none; }

@media (max-width: 760px) {
  nav.primary, .header-cta { display: none; }
  .topbar-right .hide-sm { display: none; }
  .mobile-nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.1em; text-transform: uppercase;
    background: none; border: 1px solid var(--ink); color: var(--ink);
    padding: 7px 12px; cursor: pointer;
  }
  .mobile-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--ink);
    flex-direction: column; gap: 0;
    padding: 16px var(--gutter);
    z-index: 40;
  }
  .mobile-menu.open {
    display: flex;
  }
  .mobile-menu a {
    padding: 12px 0; border-bottom: 1px solid var(--rule);
    font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  }
  .mobile-menu a:last-child { border-bottom: none; }
  .mobile-menu a:hover { color: var(--ink); }
  .mobile-menu a.active { color: var(--ink); }
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 96px;
}
.site-footer .wrap { position: relative; }
.site-footer .footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(244,240,233,0.12);
}
.site-footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,240,233,0.55);
  margin: 0 0 20px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.site-footer a { color: var(--paper); font-size: 15px; }
.site-footer a:hover { color: var(--accent-soft); }
.site-footer .brand-block p {
  max-width: 360px; color: rgba(244,240,233,0.7);
  font-size: 14px; line-height: 1.6;
}
.site-footer .brand {
  color: var(--paper);
  font-size: 26px; margin-bottom: 18px;
  display: block;
}
.site-footer .footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(244,240,233,0.55);
  flex-wrap: wrap; gap: 16px;
}
.site-footer .footer-bottom .legal { display: flex; gap: 24px; }
@media (max-width: 760px) {
  .site-footer .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .site-footer .brand-block { grid-column: 1/-1; }
}

/* ---- NEWSLETTER BLOCK ---- */
.newsletter {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
  padding: 72px 0;
  position: relative;
}
.newsletter::before {
  content: "";
  position: absolute; top: 0; bottom: 0;
  left: 50%; width: 1px; background: var(--accent); opacity: 0.35;
}
.newsletter-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: end;
}
.newsletter .label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.newsletter h2 {
  font-size: 46px; line-height: 1.05; letter-spacing: -0.025em;
  font-weight: 700; margin: 0 0 16px; max-width: 11ch;
}
.newsletter h2 em { font-style: italic; color: var(--accent); font-weight: 600; }
.newsletter p { margin: 0; color: var(--ink-3); font-size: 16px; max-width: 44ch; }
.newsletter form {
  display: flex; border: 1px solid var(--ink); background: var(--paper);
}
.newsletter input {
  flex: 1; border: 0; background: transparent; padding: 18px 20px;
  font-family: var(--font); font-size: 15px; color: var(--ink);
  outline: none;
}
.newsletter button {
  border: 0; background: var(--ink); color: var(--paper);
  font-family: var(--font); font-weight: 500; font-size: 14px;
  padding: 0 26px; cursor: pointer;
  letter-spacing: 0.02em;
}
.newsletter button:hover { background: var(--accent); }
.newsletter .fine {
  margin-top: 14px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4);
}
@media (max-width: 760px) {
  .newsletter-inner { grid-template-columns: 1fr; gap: 32px; }
  .newsletter h2 { font-size: 34px; }
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -0.02em; font-weight: 700; }
.display {
  font-size: clamp(44px, 6.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0;
}
.display em { font-style: italic; font-weight: 500; color: var(--accent); }
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before {
  content: "";
  width: 28px; height: 1px; background: var(--accent);
  display: inline-block;
}
.section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.lead {
  font-size: 21px; line-height: 1.5; color: var(--ink-2);
  font-weight: 300; letter-spacing: -0.005em;
}
.h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin: 0;}
.h2 { font-size: clamp(30px, 3.5vw, 46px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 700; margin: 0;}
.h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; margin: 0;}
.h4 { font-size: 17px; line-height: 1.25; font-weight: 600; margin: 0;}
.small { font-size: 13px; color: var(--ink-3); }

/* Rule with label */
.rule-label {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
  padding: 22px 0;
  border-top: 1px solid var(--ink);
}
.rule-label .rule-num { color: var(--accent); font-weight: 500; }
.rule-label .spacer { flex: 1; }

/* ---- LINK STYLES ---- */
.arrow-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 14.5px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}
.arrow-link:hover { color: var(--accent); border-color: var(--accent); }
.arrow-link .arrow { transition: transform .2s; }
.arrow-link:hover .arrow { transform: translateX(3px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-size: 14.5px; font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---- PLACEHOLDERS ---- */
.ph {
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(20,20,19,0.05) 8px 9px),
    var(--paper-2);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  aspect-ratio: 4/5;
  position: relative; overflow: hidden;
}
.ph--dark {
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(244,240,233,0.04) 8px 9px),
    var(--ink);
  border-color: var(--ink-2);
  color: rgba(244,240,233,0.55);
}
.ph .caption { padding: 8px 12px; text-align: center; }
.ph-4x3 { aspect-ratio: 4/3; }
.ph-16x9 { aspect-ratio: 16/9; }
.ph-1x1 { aspect-ratio: 1/1; }
.ph-3x4 { aspect-ratio: 3/4; }

/* ---- PAGE HEADERS (subpages) ---- */
.page-head {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
}
.page-head .eyebrow {
  display: flex; gap: 18px; align-items: center;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 24px;
}
.page-head .crumb { color: var(--accent); }
.page-head h1 {
  font-size: clamp(44px, 6vw, 84px); line-height: 1;
  letter-spacing: -0.035em; font-weight: 700; margin: 0;
  max-width: 18ch;
}
.page-head .lead { margin-top: 28px; max-width: 60ch; }

/* ---- DECORATION: meridian line ---- */
.meridian-line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--accent); opacity: 0.25;
  pointer-events: none;
}
.page-head .meridian-line {
  left: 75% !important;
}

/* ---- CARDS ---- */
.card {
  border-top: 1px solid var(--ink);
  padding: 28px 0;
  display: grid; gap: 14px;
}
.card .tag {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.card h3 { font-size: 26px; line-height: 1.12; letter-spacing: -0.018em; font-weight: 700; }
.card p { color: var(--ink-3); margin: 0; }

/* ---- GRID HELPERS ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (max-width: 600px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; gap: 24px; }
}

/* ---- STAT BLOCKS ---- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.stat {
  padding: 32px 24px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat .num {
  font-size: clamp(40px, 4.5vw, 64px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  color: var(--ink);
}
.stat .num em { color: var(--accent); font-style: normal; font-weight: 500; }
.stat .lbl {
  margin-top: 12px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--rule); }
  .stat:nth-child(odd) { border-right: 1px solid var(--rule); }
  .stat:nth-child(even) { border-right: 0; }
}

/* ---- UTIL ---- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; } .mt-96 { margin-top: 96px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-48 { margin-bottom: 48px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.divider { height: 1px; background: var(--ink); border: 0; margin: 0; }
.soft-divider { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---- TABLE / LIST of articles ---- */
.article-list { border-top: 1px solid var(--ink); }
.article-list .row {
  display: grid; grid-template-columns: 120px 1fr 200px 40px;
  gap: 24px; align-items: baseline;
  padding: 28px 0; border-bottom: 1px solid var(--rule);
  transition: background .2s;
}
.article-list .row:hover { background: rgba(178,70,42,0.04); }
.article-list .row .date {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.article-list .row .title {
  font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 600;
}
.article-list .row .meta {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.article-list .row .go { text-align: right; color: var(--accent); }
@media (max-width: 760px) {
  .article-list .row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .article-list .row .title { font-size: 19px; order: 1;}
}

/* ---- MOBILE (≤540px) ---- */
@media (max-width: 540px) {
  /* Universal 2-column to 1-column collapse */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* Hide all images in layouts */
  .ph { display: none !important; }
  [style*="grid-template-columns"] > img { display: none !important; }
  [style*="grid-template-columns"] > figure { display: none !important; }
  /* Reset card padding to left-align on mobile */
  .card { padding: 40px 32px !important; border-right: none !important; }
}

/* Selection */
::selection { background: var(--ink); color: var(--paper); }
