/* Smarica design system for the pages not built with the component runtime
   (blog, article, services, contract, onboarding, admin).

   Tokens mirror the component pages exactly, so a visitor moving between a
   runtime page and one of these sees one continuous site. It restyles the
   existing class names rather than requiring new markup, which keeps the
   CMS and form wiring (blog-list.js, articles.js, hydrate.js, lead.js,
   funnel.js, admin.js) working untouched.

   Replaces assets/styles.css on those pages. */

:root {
  --canvas: #F7F5F1;
  --surface: #FFFFFF;
  --ink: #0E0E12;
  --accent: #FF4F0A;
  --accent-ink: #FFFFFF;
  --line: #E8E4DC;
  --line-soft: #F1EDE4;
  --muted: #77747C;
  --muted-2: #8E8981;
  --blue: #246BFE;
  --green: #25A85A;

  --display: 'Instrument Serif', Georgia, serif;
  --ui: 'Space Grotesk', system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;

  --r-pill: 999px;
  --r-card: 22px;
  --r-lg: 30px;
  --r-input: 11px;

  --shadow-card: 0 1px 2px rgba(14, 14, 18, .04), 0 12px 32px rgba(14, 14, 18, .06);
  --shadow-pop: 0 18px 48px rgba(14, 14, 18, .16);

  --wrap: 1240px;
  --gutter: clamp(18px, 4vw, 48px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* The site nav is position:fixed, so pages carrying it must reserve its
   height or the first section sits underneath. SiteNav switches layout at
   w >= 1060 (98px tall) and is 74px below that - keep these in sync with it. */
body[data-chrome] { padding-top: 74px; }

@media (min-width: 1060px) {
  body[data-chrome] { padding-top: 98px; }
}

/* ---------- layout ---------- */

.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(46px, 7vw, 96px) var(--gutter);
}

.section-head { max-width: 780px; margin: 0 0 clamp(26px, 4vw, 44px); }

.section-head.split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
}

.eyebrow {
  display: inline-block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.eyebrow-blue { color: var(--blue); }

.section-title {
  font-family: var(--ui);
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.06;
  letter-spacing: -.02em;
  font-weight: 700;
  margin: 0 0 14px;
}

/* The component pages set key phrases in the serif italic. */
.section-title em { font-family: var(--display); font-style: italic; font-weight: 400; }

.section-lede {
  font-size: clamp(15.5px, 1.5vw, 18px);
  line-height: 1.62;
  color: var(--muted);
  margin: 0;
  max-width: 62ch;
}

h1, h2, h3, h4 { font-family: var(--ui); letter-spacing: -.015em; line-height: 1.15; }

.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.5; }

.dot {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--line);
  margin: 0 10px;
  vertical-align: middle;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 15px 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #E8470A; }

.btn-outline, .btn-ghost-orange {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-outline:hover, .btn-ghost-orange:hover { border-color: var(--ink); }
.btn-ghost-orange { color: var(--accent); border-color: rgba(255, 79, 10, .35); }
.btn-ghost-orange:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }

/* Filter and tab pills */
.chip-btn, .tab-btn {
  font-family: var(--ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all .16s ease;
}

.chip-btn:hover, .tab-btn:hover { color: var(--ink); border-color: var(--ink); }
.chip-btn.is-active, .tab-btn.is-active { background: var(--ink); color: #FFF; border-color: var(--ink); }

.blog-filter { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- cards ---------- */

.featured-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.featured-media { min-height: 300px; background-size: cover; background-position: center; position: relative; }
.featured-body { padding: clamp(24px, 3.4vw, 44px); }
.featured-body h2 { font-size: clamp(23px, 2.5vw, 34px); margin: 0 0 12px; }
.featured-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.thumb-tag {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(14, 14, 18, .82);
  color: #FFF;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--line-soft); }
.blog-card h3 { font-size: 19px; margin: 0 0 8px; }
.blog-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.blog-card > :not(.blog-thumb) { padding: 0 20px; }
.blog-card > :last-child { padding-bottom: 22px; }

.blog-thumb { aspect-ratio: 16 / 10; background-size: cover; background-position: center; background-color: var(--line-soft); position: relative; }

.blog-meta {
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-top: 18px;
}

.post-list { margin: 16px 0 0; padding: 0 0 0 18px; color: var(--muted); font-size: 15px; }
.post-list li { margin: 0 0 7px; }

/* Service / detail cards */
.svc-detail-card, .contact-card, .kv {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 2.6vw, 32px);
}

.svc-detail-block { margin-bottom: clamp(24px, 3vw, 40px); }
.svc-detail-meta { font-family: var(--ui); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }

.svc-card-tag {
  display: inline-block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 79, 10, .08);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}

.svc-link { color: var(--accent); text-decoration: none; font-weight: 600; font-family: var(--ui); }
.svc-link:hover { text-decoration: underline; }

/* ---------- forms (lead.js + funnel.js depend on these hooks) ---------- */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }

.field > label, .field > span:first-child {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field input, .field select, .field textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], select, textarea {
  font-family: var(--body);
  font-size: 15px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--canvas);
  color: var(--ink);
  width: 100%;
}

.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.field.full { grid-column: 1 / -1; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.form-error { color: #C4523A; font-size: 14px; margin: 10px 0 0; }
.thanks { color: var(--green); font-size: 14.5px; font-weight: 600; margin: 10px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chips label, .chips-multi label {
  font-family: var(--ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s ease;
}

.chips input, .chips-multi input { position: absolute; opacity: 0; pointer-events: none; }
.chips input:checked + label, .chips-multi input:checked + label,
.chips label:has(input:checked), .chips-multi label:has(input:checked) {
  background: var(--ink); color: #FFF; border-color: var(--ink);
}

/* ---------- funnel modal ---------- */

#funnelModal {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 18, .55);
  backdrop-filter: blur(3px);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

#funnelModal .funnel-card, #funnelModal > div {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  padding: clamp(22px, 3vw, 38px);
}

#funnelBar { height: 4px; background: var(--accent); border-radius: var(--r-pill); transition: width .3s ease; }

.funnel-step { display: none; }
.funnel-step.is-active { display: block; }
.funnel-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.funnel-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* ---------- article page ----------
   The old styles.css held this layout. Without it the body ran the full
   viewport width, giving ~200 character lines. Prose needs a measure. */

.article {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 52px) var(--gutter) clamp(50px, 7vw, 96px);
}

.article-back { margin: 0 0 26px; }
.link-arrow { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.link-arrow:hover { color: var(--accent); }

.article-head { margin: 0 0 26px; }
.article-head h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 10px 0 14px; }

.article-lede {
  font-size: clamp(17px, 1.7vw, 19.5px);
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.article-hero {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  background-size: cover;
  background-position: center;
  background-color: var(--line-soft);
  margin: 0 0 clamp(24px, 3vw, 38px);
}

.article-body { font-size: 17px; line-height: 1.72; color: #26242A; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2 { font-size: clamp(21px, 2.3vw, 27px); margin: 1.9em 0 .55em; }
.article-body > :first-child { margin-top: 0; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.article-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 2.6vw, 30px);
  margin: clamp(30px, 4vw, 44px) 0 0;
}

.article-cta h3 { margin: 8px 0 6px; font-size: 21px; }
.article-cta p { margin: 0; }

.article-related { margin: clamp(34px, 4.5vw, 52px) 0 0; }
.article-related h4 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; }

/* Ad slots sit inside the measure, so centre them without stretching. */
.ad-wrap { display: flex; justify-content: center; margin: clamp(28px, 3.5vw, 40px) 0; }

/* ---------- client intake brief (brief.html) ----------
   Deliberately no site nav: this is a focused task after payment or booking,
   and the nav would invite the client to wander off mid-form. */

.brief-brand { display: block; padding: 22px var(--gutter) 0; max-width: 760px; margin: 0 auto; }
.brief-brand img { height: 34px; width: auto; }

.brief-main { max-width: 760px; margin: 0 auto; padding: 22px var(--gutter) clamp(50px, 8vw, 90px); }

.brief-banner {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 22px;
}

.brief-banner.is-good { border-color: rgba(37, 168, 90, .35); background: rgba(37, 168, 90, .07); }

.brief-progress { margin: 0 0 22px; }

.brief-progress-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 8px;
}

.brief-step-label {
  font-family: var(--ui); font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}

.brief-step-name { font-family: var(--body); font-size: 13.5px; color: var(--muted); }

.brief-bar { height: 5px; background: var(--line-soft); border-radius: var(--r-pill); overflow: hidden; }
.brief-bar > span { display: block; height: 100%; width: 12.5%; background: var(--accent); border-radius: var(--r-pill); transition: width .3s ease; }

.brief-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3.4vw, 38px);
}

.brief-title { font-size: clamp(23px, 3vw, 31px); line-height: 1.14; margin: 0 0 6px; }
.brief-lede { font-family: var(--body); font-size: 15.5px; line-height: 1.6; color: var(--muted); margin: 0 0 22px; }

.brief-field { margin: 22px 0 0; }
.brief-field:first-of-type { margin-top: 18px; }

.brief-label {
  display: block; font-family: var(--ui); font-size: 14.5px; font-weight: 600;
  letter-spacing: -.01em; margin: 0 0 8px;
}

.brief-req {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); margin-left: 6px;
}

.brief-hint { font-family: var(--body); font-size: 13px; color: var(--muted); margin: -4px 0 10px; }

.brief-field input, .brief-field textarea {
  width: 100%; font-family: var(--body); font-size: 15px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-input); background: var(--canvas); color: var(--ink);
}

.brief-field input:focus, .brief-field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.brief-field.is-bad input, .brief-field.is-bad textarea { border-color: #C4523A; }
.brief-field.is-bad .brief-label { color: #C4523A; }

.brief-count { display: block; text-align: right; font-size: 12px; color: var(--muted-2); margin-top: 4px; }

.brief-options { display: flex; flex-wrap: wrap; gap: 8px; }

.brief-opt {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ui); font-size: 14px; font-weight: 500;
  padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); cursor: pointer; transition: all .14s ease;
}

.brief-opt:hover { border-color: var(--ink); }
.brief-opt.is-on { background: var(--ink); color: #FFF; border-color: var(--ink); }

.brief-tier {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--r-pill); background: var(--line-soft); color: var(--muted);
}

.brief-opt.is-on .brief-tier { background: rgba(255, 255, 255, .16); color: #FFF; }
.brief-tier-inc { background: rgba(37, 168, 90, .12); color: #1B7A42; }
.brief-tier-add { background: rgba(255, 79, 10, .1); color: #C43C08; }
.brief-tier-ass { background: rgba(36, 107, 254, .1); color: #1B4FBF; }

.brief-matrix { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.brief-matrix-head, .brief-matrix-row {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); align-items: center; gap: 8px; padding: 10px 14px;
}

.brief-matrix-head { background: var(--canvas); font-family: var(--ui); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.brief-matrix-head span:not(:first-child), .brief-matrix-row > button { justify-self: center; }
.brief-matrix-row { border-top: 1px solid var(--line); font-family: var(--body); font-size: 14px; }

.brief-radio {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; padding: 0; transition: all .14s ease;
}

.brief-radio:hover { border-color: var(--ink); }
.brief-radio.is-on { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }

.brief-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 0;
}

/* An explicit display value beats the browser's [hidden] rule, so hiding these
   from JS silently failed. Restore it for anything the form toggles. */
.brief-main [hidden], .brief-nav[hidden], .brief-progress[hidden] { display: none !important; }

.brief-nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.brief-saved { font-family: var(--body); font-size: 13px; color: var(--green); }

.brief-summary { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 18px; margin: 0 0 22px; font-family: var(--body); font-size: 14.5px; }
.brief-summary dt { font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.brief-summary dd { margin: 0; line-height: 1.55; }

.brief-note {
  border: 1px solid var(--line); background: var(--canvas);
  border-radius: 14px; padding: 16px 18px; margin: 0 0 20px;
  font-family: var(--body); font-size: 14.5px; line-height: 1.6;
}

.brief-check { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; cursor: pointer; }
.brief-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); }

.brief-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.brief-error { color: #C4523A; font-family: var(--body); font-size: 14px; margin: 12px 0 0; }
.brief-foot { font-family: var(--body); font-size: 13px; color: var(--muted); text-align: center; margin: 22px 0 0; }

@media (max-width: 560px) {
  .brief-matrix-head, .brief-matrix-row { grid-template-columns: 1fr; text-align: left; gap: 6px; }
  .brief-matrix-head { display: none; }
  .brief-matrix-row > button { justify-self: start; }
}

/* ---------- misc ---------- */

.contact-left { max-width: 520px; }
.socials { display: flex; gap: 12px; flex-wrap: wrap; }
.socials a { color: var(--muted); text-decoration: none; font-size: 14px; }
.socials a:hover { color: var(--accent); }

.kv { display: grid; gap: 10px; }

/* motion.js adds .is-in once the element scrolls into view. Without the
   script (or with reduced motion) content must still be visible. */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in, .no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .blog-card:hover { transform: none; }
}

/* ---------- admin (no public chrome; same visual language) ---------- */

/* admin.css assumed base layout rules that lived in the old styles.css.
   These replace the ones it still depends on. */

.admin-login { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }

.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(26px, 4vw, 38px);
  box-shadow: var(--shadow-card);
}

.admin-login-card h1 { font-size: 27px; margin: 0 0 6px; }
.admin-login-card p { margin: 0; }

.admin-login-card label {
  display: block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 20px 0 7px;
}

.admin-login-card .btn { margin-top: 16px; }
.btn.full { width: 100%; }
.admin-error { color: #C4523A; font-size: 14px; margin: 10px 0 0; }

.admin-top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.admin-brand { display: flex; align-items: center; gap: 12px; font-family: var(--ui); font-weight: 700; }
.admin-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-status { font-size: 13px; color: var(--muted); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px var(--gutter); }
.admin-app > .pane, .admin-app section { padding: 0 var(--gutter) 32px; }

.pane { display: none; }
.pane.is-active { display: block; }

.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px var(--gutter);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* ---------- blog index (blog.html) ---------- */

/* Card grid used by the "latest" row and by each category group. Kept
   separate from .blog-grid so blog-list.js keeps targeting exactly one
   element (the fallback grid). */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(16px, 2.2vw, 26px);
}

.latest-row { margin-top: clamp(18px, 2.4vw, 28px); }

.section-note {
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
}

.blog-empty {
  font-family: var(--ui);
  font-size: 14.5px;
  color: var(--muted);
  padding: 26px 0;
  margin: 0;
}

/* Most read: list + sticky aside */

.blog-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(24px, 3.4vw, 48px);
  align-items: start;
}

@media (max-width: 940px) {
  .blog-split { grid-template-columns: 1fr; }
}

.blog-aside { display: grid; gap: 18px; }

@media (min-width: 941px) {
  .blog-aside { position: sticky; top: 118px; }
}

.aside-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
}

.aside-note p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; }

.rank-list { list-style: none; margin: 0; padding: 0; }

.rank-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.rank-item:first-child { padding-top: 0; }
.rank-item:last-child { border-bottom: 0; }

.rank-num {
  flex: none;
  min-width: 30px;
  font-family: var(--ui);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--accent);
}

/* No view data for this article - a neutral marker, never a fake number. */
.rank-num.is-blank { color: var(--line); font-size: 18px; }

.rank-body { text-decoration: none; color: inherit; min-width: 0; }
.rank-body h3 { font-size: 17px; margin: 0 0 6px; }
.rank-body:hover h3 { color: var(--accent); }
.rank-body .blog-meta { padding-top: 0; }

/* Category groups */

.cat-group { margin: 0 0 clamp(26px, 4vw, 46px); }
.cat-group[hidden] { display: none; }

.cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cat-head h3 { font-size: clamp(19px, 2.2vw, 25px); margin: 0; }

.cat-count {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- advertisement slots ----------
   Empty, labelled containers only - no third-party script is loaded here.
   Size comes from --ad-w / --ad-h set inline per slot. The placeholder chrome
   is drawn with :empty + a ::before label, so the moment real markup is
   injected the frame, label and reserved height all disappear. */

.ad-wrap {
  display: flex;
  justify-content: center;
  margin: clamp(18px, 3vw, 34px) auto 0;
  padding: 0 var(--gutter);
  max-width: var(--wrap);
}

.section .ad-wrap, .blog-aside .ad-wrap { padding: 0; }

.ad-slot {
  width: 100%;
  max-width: var(--ad-w, 728px);
  min-height: var(--ad-h, 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.ad-slot::before {
  content: 'Advertisement';
  font-family: var(--ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-2);
  opacity: .7;
}

/* A filled slot collapses to its ad and nothing else. */
.ad-slot:not(:empty) {
  display: block;
  border: 0;
  border-radius: 0;
  background: none;
  min-height: 0;
  max-width: none;
}

.ad-slot:not(:empty)::before { content: none; }
