/* ============================================================================
   Sirius Growth Solutions — blog stylesheet
   ----------------------------------------------------------------------------
   Tokens, type scale and component shapes are copied from site/css/style.css so
   blog.siriusgrowthsolutions.com reads as the same firm: clinical white,
   Plus Jakarta Sans headings, Inter body, JetBrains Mono labels, emerald
   #166534 for actions and links, amber #D97706 only on the draft pill.

   The service serves this file at /static/blog.css; fonts and the mark live
   beside it under /static/fonts and /static/img.
   ========================================================================= */

/* ---------- fonts: self-hosted latin subsets ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fafafa;
  --bg-alt: #f3f4f2;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d4d8d5;
  --text: #1a1f1c;
  --muted: #5b6560;
  --primary: #166534;
  --primary-dark: #14532d;
  --primary-tint: #eef4ef;
  --amber: #d97706;
  --amber-ink: #92400e;
  --amber-tint: #fdf6ec;
  --danger: #b91c1c;
  --radius: 8px;
  --font-head: "Plus Jakarta Sans", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: 1.25rem;
  --measure: 1080px;
  --prose: 70ch;
  --section-y: clamp(2rem, 4.2vw, 3rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -0.02em; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}
[aria-invalid="true"]:focus-visible { outline-color: #9f1239; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -120%);
  background: var(--primary); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 8px 8px; z-index: 40; text-decoration: none; font-size: .9rem;
}
.skip:focus { transform: translate(-50%, 0); color: #fff; }

.mono {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 250, 250, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.masthead-inner {
  max-width: var(--measure); margin: 0 auto;
  padding: .7rem var(--pad);
  display: flex; align-items: center; gap: .9rem;
  min-height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--text); text-decoration: none; min-height: 44px;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; }
.brand-name {
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  letter-spacing: -.01em; white-space: nowrap;
}
.brand-tag {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .18rem .5rem; background: var(--surface);
}
.masthead-nav {
  margin-left: auto; display: flex; align-items: center; gap: .2rem;
}
.masthead-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 .7rem; border-radius: 6px; white-space: nowrap;
  color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500;
}
.masthead-nav a:hover { color: var(--primary); background: var(--primary-tint); }
.masthead-nav a.is-current { color: var(--primary); font-weight: 600; }
.masthead-nav .nav-sep { color: var(--border-strong); padding: 0 .1rem; }

/* ---------- layout ---------- */
.wrap {
  max-width: var(--measure); margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--pad) clamp(2.5rem, 5vw, 4rem);
}
.wrap > * + * { margin-top: 1.5rem; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.page-head .count { margin-left: auto; }

.eyebrow {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary); margin-bottom: .5rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; min-height: 44px; padding: 0 1rem;
  font-family: var(--font-body); font-size: .92rem; font-weight: 600;
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); text-decoration: none;
  cursor: pointer; transition: background-color .15s ease, color .15s ease,
    border-color .15s ease, transform .15s ease, opacity .15s ease;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-primary:hover {
  background: var(--surface); color: var(--primary); border-color: var(--primary);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0); background: var(--primary-tint); color: var(--primary-dark);
}
.btn-danger { border-color: #f0c9c9; color: var(--danger); background: var(--surface); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: #fdf2f2; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; }
.btn-sm { min-height: 44px; padding: 0 .7rem; font-size: .84rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; }
.tag {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: .1rem .55rem; border-radius: 999px;
  background: var(--primary-tint); border: 1px solid #d6e5da;
  color: var(--primary-dark); font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .04em; text-decoration: none;
  white-space: nowrap;
}
a.tag:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.tag-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

/* ---------- index: lead + cards ---------- */
.lead {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: center; padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.lead-media {
  border: 1px solid var(--border); border-radius: 10px; padding: 7px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(26, 31, 28, .04), 0 18px 40px -32px rgba(20, 83, 45, .5);
}
.lead-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.lead-body h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin: .6rem 0 .7rem;
}
.lead-body h2 a { color: var(--text); text-decoration: none; }
.lead-body h2 a:hover { color: var(--primary); }
.lead-dek { color: var(--muted); font-size: 1.02rem; margin-bottom: 1rem; }
.card-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem; list-style: none;
}
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-body h2 { font-size: 1.12rem; }
.card-body h2 a { color: var(--text); text-decoration: none; }
.card-body h2 a:hover { color: var(--primary); }
.card-dek { color: var(--muted); font-size: .94rem; }
.card-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .4rem; }
.meta-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.meta-line .dot { color: var(--border-strong); }

/* ---------- pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.pagination .pages {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.pagination-links { display: flex; gap: .5rem; }
.pagination .spacer { flex: 1; }

/* ---------- post ---------- */
.post-header { max-width: 46rem; }
.post-header h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin-bottom: .7rem; }
.post-dek { color: var(--muted); font-size: 1.08rem; margin-bottom: 1.1rem; }
.post-byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.post-cover { margin-top: 1.75rem; }
.post-cover img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.post-cover figcaption { margin-top: .5rem; font-size: .8rem; color: var(--muted); }

.draft-banner {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  border: 1px solid #f3dcb3; background: var(--amber-tint); color: var(--amber-ink);
  border-radius: var(--radius); padding: .7rem 1rem; font-size: .9rem;
}
.draft-banner strong { font-family: var(--font-head); }

/* ---------- article prose ---------- */
.prose {
  max-width: var(--prose);
  font-size: 1.02rem;
  line-height: 1.72;
  color: #232a26;
}
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: 1.42rem; margin-top: 2em; margin-bottom: .1em;
  padding-top: 1.1em; border-top: 1px solid var(--border);
}
.prose h3 { font-size: 1.16rem; margin-top: 1.7em; }
.prose h4 { font-size: 1rem; margin-top: 1.4em; }
.prose p, .prose ul, .prose ol { max-width: var(--prose); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: .4em; }
.prose li > ul, .prose li > ol { margin-top: .4em; }
.prose blockquote {
  border-left: 3px solid var(--primary);
  background: var(--primary-tint);
  padding: .8rem 1rem; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--primary-dark);
}
.prose blockquote p + p { margin-top: .7em; }
.prose img { border-radius: var(--radius); margin: 1.4em 0; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.prose a { text-decoration: underline; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose code {
  font-family: var(--font-mono); font-size: .86em;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 4px; padding: .1em .35em;
  overflow-wrap: anywhere;
}
.prose pre {
  font-family: var(--font-mono); font-size: .84rem; line-height: 1.6;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem;
  overflow-x: auto; max-width: 100%;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.table-scroll {
  max-width: 100%; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
/* A wide table scrolls inside its own box instead of widening the page. The
   block box wraps the row groups, so cells still wrap on a wide screen and
   only a genuinely narrow viewport sees a scrollbar. */
.prose table {
  display: block; overflow-x: auto; max-width: 100%;
  border-collapse: collapse; width: 100%; font-size: .92rem;
}
.prose th, .prose td {
  text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); background: var(--bg-alt);
  white-space: nowrap;
}
.prose tr:last-child td { border-bottom: 0; }

/* ---------- comments ---------- */
.comments-section {
  margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border);
  max-width: var(--prose);
}
.comments-section h2 {
  font-size: 1.2rem; display: flex; align-items: baseline; gap: .5rem;
}
.comments-section h2 .count {
  font-family: var(--font-mono); font-size: .75rem; color: var(--muted);
  letter-spacing: .05em;
}
.comment-list { list-style: none; margin-top: 1rem; display: grid; gap: .75rem; }
.comment {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem;
}
.comment-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .45rem;
}
.comment-meta .comment-name {
  color: var(--text); font-weight: 600; text-transform: none;
  letter-spacing: 0; font-size: .84rem; font-family: var(--font-body);
}
.comment-role {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em;
  border: 1px solid var(--border); border-radius: 999px;
  padding: .05rem .4rem; color: var(--muted); background: var(--bg-alt);
}
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .96rem; }
.comment-actions { margin-top: .5rem; }
.comment-form { margin-top: 1.5rem; display: grid; gap: .55rem; }
.comment-form label { font-weight: 600; font-size: .9rem; }
.comment-note { color: var(--muted); font-size: .9rem; margin-top: 1rem; }

.notice, .error-note {
  border-radius: var(--radius); padding: .65rem .9rem; font-size: .9rem;
  border: 1px solid #cfe3d6; background: var(--primary-tint); color: var(--primary-dark);
}
.error-note { border-color: #f0c9c9; background: #fdf2f2; color: var(--danger); }

/* ---------- forms ---------- */
.field { display: grid; gap: .35rem; }
.field + .field { margin-top: 1rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .field-error {
  font-size: .82rem; color: var(--danger); font-weight: 500;
}
input[type="text"], input[type="search"], input[type="file"], textarea, select {
  width: 100%; font-family: var(--font-body); font-size: .95rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: .6rem .7rem;
}
input[type="text"], input[type="search"], select { min-height: 44px; }
textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: #dc2626;
}
input[type="file"] { padding: .45rem .5rem; font-size: .86rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.hint { font-size: .8rem; color: var(--muted); }
.markdown-input {
  font-family: var(--font-mono); font-size: .84rem; line-height: 1.6;
  min-height: 380px; tab-size: 2;
}

/* ---------- empty states ---------- */
.empty {
  border: 1px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface); padding: 2rem 1.25rem; text-align: center;
  color: var(--muted);
}
.empty h2 { font-size: 1.1rem; color: var(--text); margin-bottom: .35rem; }

/* ---------- admin list ---------- */
.admin-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.admin-head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.admin-head .btn { margin-left: auto; }
.admin-table-wrap {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.admin-table th {
  text-align: left; padding: .65rem .9rem;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .col-title { width: 45%; }
.admin-table .col-actions {
  text-align: right; white-space: nowrap;
  display: flex; gap: .35rem; justify-content: flex-end; align-items: center;
}
.admin-table .col-actions form { display: inline-flex; }
.admin-table .article-title {
  font-family: var(--font-head); font-weight: 600; color: var(--text);
  text-decoration: none; overflow-wrap: anywhere;
}
.admin-table .article-title:hover { color: var(--primary); }
.admin-table .slug {
  display: block; font-family: var(--font-mono); font-size: .7rem;
  color: var(--muted); margin-top: .15rem; overflow-wrap: anywhere;
}
.status-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em;
  text-transform: uppercase; border-radius: 999px; padding: .18rem .5rem;
  border: 1px solid transparent; white-space: nowrap;
}
.status-pill.is-published {
  background: var(--primary-tint); border-color: #cfe3d6; color: var(--primary-dark);
}
.status-pill.is-draft {
  background: var(--amber-tint); border-color: #f0d9b5; color: var(--amber-ink);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.cell-meta { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.admin-table .btn-sm { min-height: 40px; }

/* ---------- admin editor ---------- */
.editor-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.editor-head h1 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); overflow-wrap: anywhere;
}
.editor-head .btn { margin-left: auto; }
.editor-status { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.editor {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem; align-items: start;
}
.editor-pane {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.1rem; min-width: 0;
}
.editor-pane > h2 {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: .6rem; margin-bottom: .8rem; border-bottom: 1px solid var(--border);
}
.editor-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.editor-actions .spacer { flex: 1; }
.cover-preview {
  margin-top: .5rem; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px; background: var(--bg-alt); display: inline-block; max-width: 100%;
}
.cover-preview img {
  max-height: 140px; width: auto; max-width: 100%; border-radius: 4px;
}
.char-count { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }

.preview-body { min-height: 260px; }
.preview-body.prose { max-width: none; }
.preview-body .empty { border-style: solid; }
.preview-error {
  border: 1px solid #f0c9c9; background: #fdf2f2; color: var(--danger);
  border-radius: var(--radius); padding: .6rem .8rem; font-size: .88rem;
}
.preview-placeholder { color: var(--muted); font-size: .9rem; }

/* The source column is much taller than the preview, so the preview follows
   the scroll instead of leaving the right half empty. */
@media (min-width: 961px) {
  .editor-pane.preview-pane {
    position: sticky; top: 76px;
    max-height: calc(100vh - 96px); overflow-y: auto;
  }
}

/* source / preview tabs — hidden until the layout is one column */
.tabs { display: none; }
.tab-panel[hidden] { display: none !important; }

/* insert-image control */
.media-bar { position: relative; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.media-bar .btn { cursor: pointer; }
/* Visually hidden but focusable: the label is the real 44px control. The
   selector has to outrank `input[type="file"]` (0,1,1) or width:100% wins and
   the control widens the page by its own width. */
.media-bar .media-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  opacity: 0; pointer-events: none;
}
.media-status {
  font-size: .82rem; color: var(--muted); min-height: 1.2em; margin-bottom: .5rem;
}
.media-status.is-error { color: var(--danger); }
.media-status.is-ok { color: var(--primary-dark); }

/* delete confirm */
.danger-zone { width: 100%; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.danger-zone[hidden] { display: none; }
.danger-zone p { font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  margin-top: auto;
}
.footer-inner {
  max-width: var(--measure); margin: 0 auto;
  padding: 1.4rem var(--pad);
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  font-size: .85rem; color: var(--muted);
}
.footer-inner .footer-links { display: flex; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--primary); text-decoration: underline; }

/* ---------- error pages ---------- */
.error-page { max-width: 34rem; padding: clamp(3rem, 8vw, 5rem) 0; }
.error-page .error-code {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .6rem;
}
.error-page h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-bottom: .7rem; }
.error-page p { color: var(--muted); margin-bottom: 1.25rem; }

/* ========================================================================== */
/* responsive                                                                 */
/* ========================================================================== */
@media (max-width: 960px) {
  .lead { grid-template-columns: 1fr; }
  .lead-media { order: -1; }
  /* minmax(0, 1fr), not 1fr: a long <pre> in the preview must not set the
     column's min-content width and widen the page. */
  .editor { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  /* The wordmark and three nav links do not share 375px without one of them
     breaking mid-row: the mark carries the brand there and the nav keeps its
     labels intact. */
  .brand-name { display: none; }
  .masthead-nav a { padding: 0 .5rem; font-size: .84rem; }
  .masthead-inner { gap: .5rem; }
  .masthead-nav a { padding: 0 .55rem; font-size: .85rem; }

  .card-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }

  /* admin table collapses to stacked rows; a 5-column table cannot fit 375px */
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    padding: .8rem .9rem; border-bottom: 1px solid var(--border);
  }
  .admin-table tr:last-child { border-bottom: 0; }
  .admin-table td { border: 0; padding: .12rem 0; text-align: left; }
  .admin-table td[data-label]::before {
    content: attr(data-label) " · ";
    font-family: var(--font-mono); font-size: .62rem; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
  }
  .admin-table .cell-status { margin-top: .35rem; }
  .admin-table .col-actions {
    text-align: left; white-space: normal; margin-top: .5rem;
    display: flex; flex-wrap: wrap; gap: .4rem;
  }
  .admin-table .col-actions form { display: inline-flex; }

  /* editor: one column, Source / Preview segmented control */
  .tabs {
    display: flex; gap: .25rem; padding: .25rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: .75rem;
  }
  .tabs button {
    flex: 1; min-height: 44px; border: 0; border-radius: 6px;
    background: transparent; color: var(--muted);
    font-family: var(--font-body); font-size: .88rem; font-weight: 600;
    cursor: pointer;
  }
  .tabs button[aria-selected="true"] {
    background: var(--surface); color: var(--text);
    box-shadow: 0 1px 2px rgba(26, 31, 28, .08);
  }
  .editor-pane.preview-pane { border: 0; padding: 0; background: none; }
  .editor-pane.preview-pane > h2 { display: none; }
}

@media (max-width: 560px) {
  .masthead-nav a { font-size: .8rem; padding: 0 .38rem; }
  .post-header h1 { font-size: 1.62rem; }
  .prose { font-size: 1rem; line-height: 1.68; }
  .admin-head .btn { margin-left: 0; width: 100%; }
  .editor-head .btn { margin-left: 0; }
}
