/* =========================================================
   BallEdge — site styles
   Palette: Carbon Black + BallEdge Gold (from the logo)
   ========================================================= */
:root {
  --carbon: #1b1b1b;
  --carbon-2: #242424;
  --carbon-3: #2f2f2f;
  --gold: #f0cf00;
  --gold-deep: #c9ad00;
  --gold-ink: #8a7500;      /* gold dark enough to read on paper */
  --paper: #faf9f6;
  --white: #ffffff;
  --ink: #1b1b1b;
  --ink-2: #4a4a48;
  --muted: #7a7974;
  --rule: #e4e1d8;
  --rule-strong: #cfcabb;

  --serif-display: 'Playfair Display', 'Didot', 'Bodoni 72', Georgia, serif;
  --serif-text: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --wrap: 1280px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--carbon); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 48px 0; }
.dot { color: var(--rule-strong); margin: 0 4px; }

/* ---------------- Masthead ---------------- */
.masthead { background: var(--carbon); color: var(--white); position: relative; z-index: 30; }
.masthead-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px; height: 84px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.mh-left { position: relative; justify-self: start; }
.mh-right { justify-self: end; }
.mh-date { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #b9b6ad; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 52px; height: 52px; }
.brand-name { height: 38px; width: auto; }

.menu-btn {
  display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--white);
  cursor: pointer; padding: 10px 4px; letter-spacing: .16em; font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.burger { display: grid; gap: 5px; width: 22px; }
.burger i { display: block; height: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
.menu-btn[aria-expanded="true"] .burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-btn:hover .menu-word { color: var(--gold); }

.site-menu {
  position: absolute; top: calc(100% + 22px); left: -24px; width: 280px;
  background: var(--carbon); border-top: 3px solid var(--gold);
  box-shadow: 0 18px 40px rgba(0,0,0,.28); padding: 10px 0 14px;
  animation: drop .18s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.site-menu ul { list-style: none; margin: 0; padding: 0; }
.site-menu li a, .site-menu .linklike {
  display: block; width: 100%; text-align: left; padding: 11px 28px;
  font-family: var(--serif-display); font-size: 20px; font-weight: 500; color: var(--white);
  background: none; border: 0; cursor: pointer; border-left: 3px solid transparent;
}
.site-menu li a:hover, .site-menu .linklike:hover { color: var(--gold); border-left-color: var(--gold); background: var(--carbon-2); }
.site-menu .menu-label {
  margin: 12px 28px 4px; padding-top: 14px; border-top: 1px solid var(--carbon-3);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
}
.site-menu .menu-signin { margin-top: 8px; border-top: 1px solid var(--carbon-3); padding-top: 6px; }
.site-menu .menu-signin a { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #a9a59a; }
.site-menu form { margin: 0; }

.gold-rule { height: 4px; background: var(--gold); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-sm { padding: 7px 12px; font-size: 11.5px; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--carbon); }
.btn-gold:hover { background: #ffdf1a; }
.btn-dark { background: var(--carbon); color: var(--white); }
.btn-dark:hover { background: #000; color: var(--gold); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--carbon); }
.btn-ghost.danger:hover { border-color: #a32020; color: #a32020; }
.btn-light { background: rgba(255,255,255,.92); color: var(--carbon); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------------- Shared type ---------------- */
.page { max-width: var(--wrap); margin: 0 auto; padding: 32px 24px 64px; min-height: 60vh; }
.display { font-family: var(--serif-display); font-weight: 700; font-size: clamp(34px, 5vw, 52px); line-height: 1.08; margin: 0; letter-spacing: -.01em; }
.display.small { font-size: 30px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
.page-head { border-bottom: 1px solid var(--carbon); padding-bottom: 18px; margin-bottom: 28px; }
.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.kicker {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--carbon); padding-bottom: 2px; border-bottom: 2px solid var(--gold); margin-bottom: 8px;
}
.kicker:hover { color: var(--gold-ink); }
.ago { display: block; font-size: 12px; color: var(--muted); letter-spacing: .02em; margin-top: 6px; }
.ago.inline { display: inline; margin: 0; }
.ago::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: 1px; }
.ago.inline::before, .meta .ago::before { display: none; }
.meta { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.meta .ago { display: inline; }

.img-fallback { aspect-ratio: 16/9; background: var(--carbon); display: grid; place-items: center; }
.img-fallback img { width: 30%; max-width: 140px; opacity: .9; }

/* ---------------- Front page (Fox-style) ---------------- */
.front {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0;
  border-bottom: 1px solid var(--carbon); padding-bottom: 32px;
}
.front.solo { grid-template-columns: minmax(0, 1fr); }
.front.solo .lead { padding: 0; max-width: 980px; margin: 0 auto; }
.front-right { padding-left: 30px; border-left: 1px solid var(--rule); display: grid; gap: 24px; align-content: start; }
.lead { padding: 0 32px 0 0; }

.rail-title {
  font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700;
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 3px solid var(--carbon); position: relative;
}
.rail-title::after { content: ''; position: absolute; left: 0; bottom: -3px; width: 44px; height: 3px; background: var(--gold); }

.story-title a:hover, .lead-title a:hover, .rail-list a:hover { color: var(--gold-ink); }

.lead-media { display: block; overflow: hidden; background: var(--carbon); }
.lead-media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform .6s ease; }
.lead-media:hover img { transform: scale(1.02); }
.lead-text { padding-top: 18px; text-align: center; }
.lead-title { font-family: var(--serif-display); font-weight: 800; font-size: clamp(32px, 3.6vw, 50px); line-height: 1.06; margin: 2px 0 12px; letter-spacing: -.015em; }
.lead-dek { font-family: var(--serif-text); font-size: 19px; line-height: 1.5; color: var(--ink-2); margin: 0 auto; max-width: 640px; }

.story .story-media { display: block; overflow: hidden; background: var(--carbon); }
.story .story-media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform .5s ease; }
.story .story-media:hover img { transform: scale(1.03); }
.story-text { padding-top: 12px; }
.story-title { font-family: var(--serif-display); font-weight: 700; font-size: 21px; line-height: 1.2; margin: 0; }
.story-dek { font-family: var(--serif-text); color: var(--ink-2); font-size: 15.5px; line-height: 1.5; margin: 8px 0 0; }
.story.stack .story-title { font-size: 20px; }
.story.stack + .story.stack { border-top: 1px solid var(--rule); padding-top: 22px; }

.section-block { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-top: 3px solid var(--carbon); padding-top: 12px; margin-bottom: 22px; }
.section-head h2 { font-family: var(--serif-display); font-size: 30px; font-weight: 700; margin: 0; }
.section-head h2 a:hover { color: var(--gold-ink); }
.section-more { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.section-more:hover { color: var(--gold-ink); }

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 26px; }
.card-grid .story-title { font-size: 19px; }

.two-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.mini-list { display: grid; gap: 18px; }
.story.mini { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.story.mini .story-text { padding-top: 0; }
.story.mini .story-title { font-size: 18px; }
.story.mini .kicker { display: none; }

.list-stream { display: grid; gap: 0; }
.story.row { display: grid; grid-template-columns: 300px 1fr; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.story.row .story-text { padding-top: 0; }
.story.row .story-title { font-size: 28px; }

.empty-state { text-align: center; max-width: 560px; margin: 60px auto; }
.empty-state p { font-family: var(--serif-text); font-size: 19px; color: var(--ink-2); }
.empty-logo { width: 120px; margin: 0 auto 18px; }

/* ---------------- Article page (ESPN-style) ---------------- */
.article-top { max-width: 1120px; margin: 0 auto; }
.article-head { max-width: 860px; padding-top: 8px; }
.article-title { font-family: var(--serif-display); font-weight: 800; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; margin: 4px 0 14px; letter-spacing: -.015em; }
.article-dek { font-family: var(--serif-text); font-size: 22px; line-height: 1.45; color: var(--ink-2); margin: 0 0 22px; }

.byline { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.byline-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--carbon); padding: 5px; }
.byline-text { display: grid; gap: 2px; flex: 1; }
.byline-name { font-weight: 700; font-size: 15px; }
.byline-date { font-size: 13px; color: var(--muted); }
.share-wrap { position: relative; }
.share-main {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--carbon); color: var(--white); border: 1px solid var(--carbon);
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  transition: background .15s, color .15s;
}
.share-main svg { color: var(--gold); }
.share-main:hover, .share-main[aria-expanded="true"] { background: var(--gold); color: var(--carbon); border-color: var(--gold); }
.share-main:hover svg, .share-main[aria-expanded="true"] svg { color: var(--carbon); }
.share-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; min-width: 220px;
  background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--gold);
  box-shadow: 0 14px 34px rgba(0,0,0,.16); padding: 6px 0; animation: drop .15s ease-out;
}
.share-pop a, .share-pop button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; background: none; border: 0;
  font-family: var(--sans); font-size: 14px; color: var(--ink); cursor: pointer; text-align: left;
}
.share-pop a:hover, .share-pop button:hover { background: #f3f1ea; }
.share-pop .si {
  width: 26px; height: 26px; border-radius: 50%; background: var(--carbon); color: var(--white);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.share-pop a:hover .si, .share-pop button:hover .si { background: var(--gold); color: var(--carbon); }
.author-tools { margin-top: 10px; font-size: 13px; }
.author-tools a { color: var(--gold-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.article-hero { margin: 26px 0 0; }
.article-hero img { width: 100%; max-height: 720px; object-fit: cover; background: var(--carbon); }
.article-hero figcaption { font-size: 13px; color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--rule); }

.article-wrap { max-width: 1120px; margin: 34px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; }
.article-main { max-width: 720px; }
.article-end { margin: 36px 0 0; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-end img { width: 34px; }
.article-end-share { display: flex; align-items: center; gap: 14px; }
.article-end-share > span { font-family: var(--serif-display); font-style: italic; font-size: 17px; color: var(--ink-2); }
.article-end .share-pop { top: auto; bottom: calc(100% + 8px); }
.article-rail { position: sticky; top: 24px; align-self: start; }
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.rail-list a { font-family: var(--serif-display); font-weight: 600; font-size: 17px; line-height: 1.3; display: block; }

.draft-banner { background: var(--gold); color: var(--carbon); text-align: center; padding: 10px; font-size: 14px; font-weight: 600; margin: -32px -24px 28px; }
.draft-banner a { text-decoration: underline; }

/* Article body typography (also used inside the editor) */
.article-body { font-family: var(--serif-text); font-size: 19.5px; line-height: 1.72; color: #222; }
.article-body::after { content: ''; display: table; clear: both; }
.article-body p { margin: 0 0 1.25em; }
.article-body h2 { font-family: var(--serif-display); font-size: 30px; line-height: 1.2; margin: 1.6em 0 .55em; font-weight: 700; }
.article-body h3 { font-family: var(--sans); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; margin: 1.8em 0 .6em; font-weight: 700; }
.article-body a { color: var(--carbon); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article-body a:hover { background: rgba(240,207,0,.25); }
.article-body ul, .article-body ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body li::marker { color: var(--gold-deep); font-weight: 700; }
.article-body blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 26px; border-left: 4px solid var(--gold);
  font-family: var(--serif-display); font-style: italic; font-size: 27px; line-height: 1.35; color: var(--carbon);
}
.article-body blockquote p { margin: 0; }
.article-body hr { border: 0; height: 1px; background: var(--rule-strong); margin: 2em 0; }
.article-body figure { margin: 1.8em 0; }
.article-body figure img { width: 100%; height: auto; }
.article-body figcaption { font-family: var(--sans); font-size: 13px; color: var(--muted); padding-top: 9px; line-height: 1.45; }
.article-body figure.fig-inset { float: right; width: 46%; margin: .35em 0 1em 30px; }
.article-body table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; margin: 1.5em 0; }
.article-body th { text-align: left; background: var(--carbon); color: var(--white); padding: 8px 12px; font-weight: 600; }
.article-body td { padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.article-body > :first-child { margin-top: 0; }

/* Code boxes — show the work */
.code-box { margin: 1.8em 0; background: #141414; border-radius: 3px; overflow: hidden; border: 1px solid #000; clear: both; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #0c0c0c; border-bottom: 2px solid var(--gold); }
.code-lang { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.code-copy { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; background: transparent; color: #bdb9ae; border: 1px solid #3a3a3a; border-radius: 2px; padding: 4px 10px; cursor: pointer; }
.code-copy:hover { color: var(--carbon); background: var(--gold); border-color: var(--gold); }
.code-box pre { margin: 0; padding: 18px 20px; overflow-x: auto; }
.code-box code { font-family: var(--mono); font-size: 14.5px; line-height: 1.65; color: #e9e6dc; white-space: pre; tab-size: 4; font-variant-ligatures: none; font-feature-settings: 'calt' 0, 'liga' 0; }
/* syntax colors — gold-forward theme */
.hljs-keyword, .hljs-built_in, .hljs-selector-tag { color: var(--gold); font-weight: 600; }
.hljs-string, .hljs-regexp { color: #a8d38a; }
.hljs-number, .hljs-literal { color: #f4a261; }
.hljs-comment { color: #7d7a72; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-function { color: #82b8ff; }
.hljs-type, .hljs-params, .hljs-variable, .hljs-attr { color: #e9e6dc; }
.hljs-operator, .hljs-punctuation { color: #c9c5b9; }
.hljs-meta { color: #c79bff; }

/* ---------------- About ---------------- */
.about { max-width: 760px; margin: 0 auto; }
.about-photo { margin: 0 0 30px; }
.about-photo img { width: 100%; max-height: 520px; object-fit: cover; }

/* ---------------- Forms / auth ---------------- */
.auth-page .page { display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--gold); padding: 36px 34px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.05); }
.auth-logo { width: 64px; margin: 0 auto 14px; }
.stack-form { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(240,207,0,.35); }
.form-error { background: #fbeaea; color: #8c1d1d; padding: 10px 12px; font-size: 14px; border-left: 3px solid #b42318; text-align: left; }
.form-ok { color: #1e6b33; font-weight: 600; }

/* ---------------- Dashboard ---------------- */
.table-wrap { overflow-x: auto; }
.dash { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--rule); }
.dash th { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 2px solid var(--carbon); }
.dash td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.dash-thumb { width: 110px; }
.dash-thumb img { width: 96px; aspect-ratio: 16/9; object-fit: cover; }
.dash-title { font-family: var(--serif-display); font-weight: 700; font-size: 18px; }
.dash-title:hover { color: var(--gold-ink); }
.dash .ago { display: inline; margin: 0; }
.dash .ago::before { display: none; }
.dash-actions { white-space: nowrap; text-align: right; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 20px; }
.badge.published { background: var(--carbon); color: var(--gold); }
.badge.draft { background: #ece9e0; color: var(--ink-2); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--carbon); color: #b9b6ad; border-top: 4px solid var(--gold); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 44px 24px 34px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.footer-brand img { height: 30px; width: auto; }
.footer-tag { margin: 0; font-family: var(--serif-display); font-style: italic; font-size: 17px; color: #ddd9cd; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.footer-links a { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { font-size: 12px; margin: 10px 0 0; color: #77746c; }

/* ---------------- Toast ---------------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--carbon); color: var(--white); padding: 12px 20px; border-left: 4px solid var(--gold); font-size: 14px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.error { border-left-color: #e5484d; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .front { grid-template-columns: minmax(0, 1fr) 290px; }
  .lead { padding: 0 26px 0 0; }
  .front-right { padding-left: 24px; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-wrap { gap: 40px; grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 820px) {
  .masthead-inner { height: 68px; padding: 0 16px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { height: 22px; }
  .mh-date { display: none; }
  .menu-word { display: none; }
  .site-menu { left: -16px; top: calc(100% + 18px); width: min(300px, 100vw); }
  .page { padding: 22px 16px 48px; }
  .front { grid-template-columns: 1fr; }
  .lead { padding: 0; }
  .lead-text { text-align: left; }
  .front-right { border: 0; padding: 26px 0 0; grid-template-columns: 1fr 1fr; gap: 18px; }
  .story.stack + .story.stack { border: 0; padding: 0; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
  .two-sections { grid-template-columns: 1fr; }
  .story.row { grid-template-columns: 1fr; gap: 12px; }
  .story.row .story-title { font-size: 24px; }
  .article-wrap { grid-template-columns: minmax(0, 1fr); }
  .article-rail { position: static; }
  .article-body { font-size: 18px; }
  .article-body figure.fig-inset { float: none; width: 100%; margin: 1.5em 0; }
  .article-hero { margin-left: -16px; margin-right: -16px; }
  .article-hero figcaption { padding-left: 16px; padding-right: 16px; }
  .byline { flex-wrap: wrap; }
  .byline .share-wrap { width: 100%; padding-left: 60px; }
  .byline .share-pop { left: 60px; right: auto; }
  .article-end-share > span { display: none; }
  .draft-banner { margin: -22px -16px 22px; }
  .dash-thumb { display: none; }
}
@media (max-width: 520px) {
  .brand { gap: 8px; }
  .brand-name { height: 19px; }
  .mh-right .btn { padding: 6px 9px; font-size: 10.5px; }
  .front-right, .card-grid { grid-template-columns: 1fr; }
  .story.mini { grid-template-columns: 110px 1fr; }
  .auth-card { padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =========================================================
   Editor
   ========================================================= */
.editor-page .page { max-width: 980px; padding-top: 0; }
.editor-bar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(250,249,246,.96); backdrop-filter: blur(6px); padding: 14px 0; border-bottom: 1px solid var(--rule); margin-bottom: 26px;
}
.editor-bar-left { display: flex; align-items: center; gap: 18px; }
.editor-bar-right { display: flex; gap: 8px; }
.back-link { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.back-link:hover { color: var(--carbon); }
.save-state { font-size: 13px; color: var(--muted); }
.editor-main { max-width: 760px; margin: 0 auto; }
.meta-row { display: flex; gap: 16px; margin-bottom: 14px; }
.cat-field { width: 180px; }
.cat-field select { padding: 8px 10px; font-size: 14px; }
.title-input, .dek-input, .caption-input {
  width: 100%; border: 0; background: transparent; resize: none; overflow: hidden; color: var(--ink); padding: 4px 0;
}
.title-input:focus, .dek-input:focus, .caption-input:focus { outline: none; }
textarea.title-input { font-family: var(--serif-display); font-weight: 800; font-size: 46px; line-height: 1.1; letter-spacing: -.015em; }
.field .title-input { font-family: var(--serif-display); font-weight: 700; font-size: 32px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 18px; }
.dek-input { font-family: var(--serif-text); font-size: 21px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 20px; }
.title-input::placeholder, .dek-input::placeholder { color: #bdb9ae; }
.caption-input { font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--rule); padding: 10px 0; margin-bottom: 26px; }

.hero-upload {
  position: relative; border: 2px dashed var(--rule-strong); background: #f3f1ea; aspect-ratio: 16/8; display: grid; place-items: center;
  cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; margin-bottom: 4px;
}
.hero-upload:hover, .hero-upload.drag { border-color: var(--carbon); background: #efece2; }
.hero-upload.drag { box-shadow: inset 0 0 0 4px var(--gold); }
.hero-empty { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--ink-2); padding: 20px; }
.hero-empty strong { font-family: var(--serif-display); font-size: 22px; color: var(--carbon); }
.hero-empty span { font-size: 13px; color: var(--muted); max-width: 360px; }
.hero-upload img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-upload.has-image { border-style: solid; border-color: transparent; cursor: default; }
.hero-upload.has-image img { display: block; }
.hero-upload.has-image .hero-empty { display: none; }
.hero-actions { display: none; position: absolute; right: 12px; bottom: 12px; gap: 8px; }
.hero-upload.has-image .hero-actions { display: flex; }
.hero-upload.uploading::after { content: 'Uploading…'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(27,27,27,.65); color: var(--gold); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.about .hero-upload, .editor-page .field + .hero-upload { aspect-ratio: 16/7; margin-bottom: 22px; }

.toolbar {
  position: sticky; top: 64px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: var(--carbon); padding: 7px 8px; border-radius: 3px; margin-bottom: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.toolbar button, .toolbar select {
  background: transparent; color: #e9e6dc; border: 0; border-radius: 2px; padding: 7px 10px; font-size: 13.5px; cursor: pointer; font-family: var(--sans);
}
.toolbar select { background: var(--carbon-2); border: 1px solid var(--carbon-3); }
.toolbar button:hover { background: var(--carbon-3); color: var(--white); }
.toolbar button.on { background: var(--gold); color: var(--carbon); }
.toolbar .tb-insert { color: var(--gold); font-weight: 600; }
.toolbar .tb-insert:hover { background: var(--gold); color: var(--carbon); }
.tb-sep { width: 1px; height: 22px; background: var(--carbon-3); margin: 0 4px; }

.editor-body { min-height: 420px; padding: 6px 2px 40px; outline: none; caret-color: var(--carbon); }
.editor-body { position: relative; }
.editor-body.is-empty::before { content: attr(data-placeholder); color: #bdb9ae; pointer-events: none; position: absolute; top: 6px; left: 2px; }
.editor-hint { font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; }

/* widgets inside the editor */
.w { margin: 1.4em 0; border: 1px solid var(--rule-strong); background: var(--white); user-select: none; font-family: var(--sans); clear: both; }
.w-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #f0eee7; border-bottom: 1px solid var(--rule); font-size: 12px; flex-wrap: wrap; }
.w-label { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 10.5px; color: var(--ink-2); padding: 0 4px; }
.w-spacer { flex: 1; }
.w-btn { background: var(--white); border: 1px solid var(--rule-strong); border-radius: 2px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.w-btn:hover { border-color: var(--carbon); }
.w-btn.danger:hover { color: #a32020; border-color: #a32020; }
.w-head select { font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--rule-strong); background: var(--white); border-radius: 2px; }
.w-seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 2px; overflow: hidden; }
.w-seg button { border: 0; background: var(--white); padding: 4px 9px; font-size: 12px; cursor: pointer; }
.w-seg button + button { border-left: 1px solid var(--rule-strong); }
.w-seg button.on { background: var(--carbon); color: var(--gold); }

.w-code { background: #141414; border-color: #000; }
.w-code .w-head { background: #0c0c0c; border-bottom: 2px solid var(--gold); }
.w-code .w-label { color: var(--gold); }
.w-code textarea {
  display: block; width: 100%; min-height: 110px; border: 0; resize: vertical; background: #141414; color: #e9e6dc;
  font-family: var(--mono); font-size: 14px; line-height: 1.6; padding: 14px 16px; white-space: pre; overflow-x: auto; tab-size: 4; user-select: text; font-variant-ligatures: none; font-feature-settings: 'calt' 0, 'liga' 0;
}
.w-code textarea:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(240,207,0,.4); }
.w-code textarea::placeholder { color: #6e6b63; }

.w-img-frame { position: relative; background: #f3f1ea; }
.w-img-frame img { width: 100%; max-height: 520px; object-fit: contain; }
.w-loading { display: none; position: absolute; inset: 0; place-items: center; background: rgba(27,27,27,.55); color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.w-img.loading .w-loading { display: grid; }
.w-caption { width: 100%; border: 0; border-top: 1px solid var(--rule); padding: 9px 12px; font-size: 13.5px; color: var(--ink-2); user-select: text; }
.w-caption:focus { outline: none; background: #fffdf0; }
.w-img.fig-inset { float: right; width: 48%; margin: .3em 0 1em 24px; clear: none; }
.w-img.fig-inset .w-head { gap: 4px; }
.w-img.fig-inset .w-label { display: none; }

@media (max-width: 820px) {
  .editor-bar { padding: 10px 0; }
  .editor-bar-right { width: 100%; }
  .editor-bar-right .btn { flex: 1; padding: 10px 8px; }
  textarea.title-input { font-size: 34px; }
  .toolbar { top: 108px; }
  .w-img.fig-inset { float: none; width: 100%; margin: 1.4em 0; }
}

/* ---------- Email signup ---------- */
.signup { width: 100%; max-width: 460px; display: grid; gap: 8px; text-align: center; }
.signup-head { font-family: var(--serif-display); font-weight: 700; font-size: 19px; }
.signup-sub { margin: 0; font-size: 14px; }
.signup-row { display: flex; gap: 8px; }
.signup-row input { flex: 1; min-width: 0; padding: 11px 12px; font: inherit; font-size: 15px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); color: var(--ink); }
.signup-row input:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(240,207,0,.35); }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup-footer { margin: 14px 0 6px; }
.signup-footer .signup-head { color: #ddd9cd; font-size: 15px; font-family: var(--sans); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.signup-footer .signup-row input { border-color: #3a3935; background: #262624; color: #f1eee6; }
.signup-article { max-width: none; margin: 28px 0 0; padding: 24px; background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--gold); }
.signup-article .signup-sub { color: var(--muted); }
@media (max-width: 520px) { .signup-row { flex-direction: column; } }
