/* ==========================================================================
   MMDC News — mmdcgov.com
   Editorial design system. Mobile-first, light + dark themes.
   ========================================================================== */

/* ------------------------------- 1. Tokens ------------------------------- */
:root {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --paper: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f4f0e8;
  --ink: #14161a;
  --ink-2: #454a53;
  --muted: #787d86;
  --line: #e2ddd2;
  --line-2: #efebe2;
  --rule: #14161a;
  --accent: #cf3f22;
  --accent-ink: #ffffff;
  --accent-soft: rgba(207, 63, 34, 0.09);
  --shadow-1: 0 1px 2px rgba(20, 22, 26, 0.05);
  --shadow-2: 0 10px 30px -14px rgba(20, 22, 26, 0.28);

  --maxw: 1240px;
  --gutter: 18px;
  --radius: 3px;
  --header-h: 60px;

  --step--1: clamp(0.78rem, 0.77rem + 0.06vw, 0.82rem);
  --step-0: clamp(0.95rem, 0.93rem + 0.12vw, 1.02rem);
  --step-1: clamp(1.12rem, 1.06rem + 0.3vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.5vw, 2.5rem);
  --step-4: clamp(2.05rem, 1.5rem + 2.6vw, 3.5rem);

  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #0f1114;
  --surface: #16181c;
  --surface-2: #1c1f24;
  --ink: #f3f1ec;
  --ink-2: #b6babf;
  --muted: #84888f;
  --line: #2a2e34;
  --line-2: #212429;
  --rule: #f3f1ec;
  --accent: #ff6a4d;
  --accent-ink: #16181c;
  --accent-soft: rgba(255, 106, 77, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 12px 34px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ------------------------------ 2. Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: var(--step--1);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ----------------------------- 3. Layout -------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 820px; }
.wrap--reading { max-width: 760px; }

.section { padding-block: 40px; }
.section + .section { border-top: 1px solid var(--line); }

/* --------------------------- 4. Reading progress ------------------------ */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 90;
  background: transparent;
  pointer-events: none;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* ----------------------------- 5. Top bar ------------------------------- */
.topbar {
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
html[data-theme="dark"] .topbar { background: var(--surface-2); color: var(--ink); }
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 34px;
}
.topbar__date { flex: none; color: color-mix(in srgb, var(--paper) 62%, transparent); }
html[data-theme="dark"] .topbar__date { color: var(--muted); }
.topbar__ticker {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.topbar__tag {
  flex: none;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 3px 7px;
  border-radius: 2px;
  font-weight: 700;
}
.topbar__track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  animation: ticker 42s linear infinite;
}
.topbar__track a { color: inherit; opacity: 0.86; }
.topbar__track a:hover { opacity: 1; color: var(--accent); }
.topbar:hover .topbar__track { animation-play-state: paused; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.topbar__social { display: none; gap: 14px; flex: none; }
.topbar__social a:hover { color: var(--accent); }

/* ------------------------------ 6. Header ------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand__mark {
  width: 26px; height: 26px;
  border-radius: 2px;
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  flex: none;
}
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand__sub {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.nav { display: none; align-items: center; gap: 2px; margin-left: 8px; }
.nav a {
  position: relative;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius);
  transition: color 0.16s ease, background 0.16s ease;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 11px; right: 11px; bottom: 2px;
  height: 2px;
  background: var(--accent);
}

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--ink-2);
  transition: background 0.16s ease, color 0.16s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.btn-menu { display: grid; }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.drawer[data-open="true"] { visibility: visible; opacity: 1; }
.drawer__scrim {
  position: absolute; inset: 0;
  background: rgba(12, 13, 16, 0.5);
  backdrop-filter: blur(2px);
}
.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(88vw, 380px);
  background: var(--paper);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.drawer[data-open="true"] .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer__label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer__body { padding: 10px 18px 24px; overflow-y: auto; }
.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 16px;
  font-weight: 500;
}
.drawer__link span:last-child { color: var(--muted); font-size: 12px; }
.drawer__link:hover { color: var(--accent); }
.drawer__foot { margin-top: 22px; display: grid; gap: 10px; }

/* --------------------------- 7. Search overlay -------------------------- */
.search {
  position: fixed;
  inset: 0;
  z-index: 130;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.search[data-open="true"] { visibility: visible; opacity: 1; }
.search__scrim { position: absolute; inset: 0; background: rgba(12, 13, 16, 0.55); }
.search__panel {
  position: relative;
  width: min(92vw, 680px);
  margin: 8vh auto 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.search[data-open="true"] .search__panel { transform: translateY(0); }
.search__field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.search__field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search__input {
  flex: 1;
  border: 0;
  background: none;
  font-size: 17px;
  outline: none;
}
.search__kbd {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 6px;
}
.search__results { max-height: min(56vh, 460px); overflow-y: auto; }
.search__hint { padding: 18px; color: var(--muted); font-size: 13px; }
.search__item {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-2);
  align-items: flex-start;
}
.search__item:hover { background: var(--surface-2); }
.search__item img { width: 56px; height: 42px; object-fit: cover; border-radius: 2px; flex: none; }
.search__item strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.search__item small { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ------------------------------- 8. Bits -------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 2px;
  transition: background 0.16s ease, color 0.16s ease;
}
a.chip:hover { background: var(--accent); color: var(--accent-ink); }
.chip--plain {
  background: none;
  color: var(--muted);
  padding: 0;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.meta__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.sec-head__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.sec-head__label::before {
  content: "";
  width: 15px; height: 3px;
  background: var(--accent);
  flex: none;
}
.sec-head__sub { font-size: 12px; color: var(--muted); }
.sec-head__more {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sec-head__more:hover { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--ink); color: var(--paper); }
.btn--block { width: 100%; }

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------- 9. Hero -------------------------------- */
.hero { padding-block: 26px 34px; }
.hero__grid { display: grid; gap: 24px; }

.lead { display: block; }
.lead__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
}
.lead__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.lead:hover .lead__media img { transform: scale(1.035); }
.lead__flag {
  position: absolute;
  left: 0; top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 11px;
}
.lead__body { padding-top: 16px; }
.lead__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 10px 0 10px;
}
.lead:hover .lead__title { color: var(--accent); }
.lead__excerpt {
  color: var(--ink-2);
  font-size: var(--step-0);
  line-height: 1.62;
  max-width: 62ch;
}
.lead__meta { margin-top: 14px; }

.hero__side { display: grid; gap: 2px; }
.hero__side-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mini {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-2);
  align-items: start;
}
.mini__num {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  padding-top: 2px;
}
.mini__title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.mini:hover .mini__title { color: var(--accent); }
.mini__meta { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ------------------------------- 10. Grids ------------------------------ */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card { display: flex; flex-direction: column; }
.card__media {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
}
.card:hover .card__title { color: var(--accent); }
.card__excerpt {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Wide list item with thumbnail */
.row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 15px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
  align-items: start;
}
.row__media {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
}
.row__media img { width: 100%; height: 100%; object-fit: cover; }
.row__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  margin-bottom: 7px;
}
.row:hover .row__title { color: var(--accent); }
.row__excerpt {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

/* Timestamp rail (right-hand column) */
.rail { display: grid; gap: 0; }
.rail__item {
  display: block;
  padding: 13px 0;
  border-bottom: 1px dotted var(--line);
}
.rail__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 5px;
}
.rail__item:hover .rail__title { color: var(--accent); }
.rail__meta { font-size: 11px; color: var(--muted); }

/* ------------------------- 11. Category filter bar --------------------- */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  white-space: nowrap;
  transition: all 0.16s ease;
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------------------------- 12. Newsletter ---------------------------- */
.newsletter {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 30px 22px;
  display: grid;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
html[data-theme="dark"] .newsletter { background: var(--surface-2); border: 1px solid var(--line); }
.newsletter::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 210px; height: 210px;
  border: 34px solid var(--accent);
  border-radius: 50%;
  opacity: 0.22;
}
.newsletter__kicker {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.newsletter__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 10px 0 8px;
}
.newsletter__text {
  font-size: 13.5px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  max-width: 46ch;
}
html[data-theme="dark"] .newsletter__text { color: var(--ink-2); }
.newsletter__form { display: grid; gap: 10px; position: relative; z-index: 1; }
.newsletter__input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--paper) 26%, transparent);
  background: color-mix(in srgb, var(--paper) 8%, transparent);
  color: var(--paper);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
html[data-theme="dark"] .newsletter__input { border-color: var(--line); color: var(--ink); background: var(--surface); }
.newsletter__input::placeholder { color: color-mix(in srgb, var(--paper) 46%, transparent); }
html[data-theme="dark"] .newsletter__input::placeholder { color: var(--muted); }
.newsletter__input:focus { border-color: var(--accent); }
.newsletter__note { font-size: 11.5px; color: color-mix(in srgb, var(--paper) 52%, transparent); }
html[data-theme="dark"] .newsletter__note { color: var(--muted); }
.newsletter__note a { text-decoration: underline; }
.newsletter__ok {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------- 13. Footer ----------------------------- */
.footer {
  margin-top: 46px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 40px 24px;
}
.footer__grid { display: grid; gap: 30px; }
.footer__brandcol { max-width: 34ch; }
.footer__about {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.footer__col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.footer__links { display: grid; gap: 10px; }
.footer__links a { font-size: 13.5px; color: var(--ink-2); }
.footer__links a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer__legal a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 12px; }
.footer__social a {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
}
.footer__social a:hover { border-color: var(--accent); color: var(--accent); }
.footer__social svg { width: 15px; height: 15px; }

/* -------------------------- 14. Article detail -------------------------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  padding-block: 18px;
}
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { opacity: 0.5; }

.article__head { padding-bottom: 24px; }
.article__title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 14px 0 16px;
  text-wrap: balance;
}
.article__standfirst {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 400;
  max-width: 62ch;
  margin-bottom: 22px;
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.byline { display: flex; align-items: center; gap: 10px; }
.byline__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
  font-family: var(--font-display);
}
.byline__name { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.byline__role { font-size: 11.5px; color: var(--muted); }

.article__figure { margin: 0 0 30px; }
.article__figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.article__caption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.article__layout { display: grid; gap: 30px; }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}
.toc__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc__list { display: grid; gap: 2px; counter-reset: toc; }
.toc__link {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
  border-bottom: 1px solid var(--line-2);
}
.toc__link::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  padding-top: 2px;
}
.toc__link:hover { color: var(--accent); }
.toc__link[data-active="true"] { color: var(--ink); font-weight: 600; }

.body { font-size: 17px; line-height: 1.75; color: var(--ink-2); }
.body > * + * { margin-top: 22px; }
.body h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin-top: 42px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.body h2::before {
  content: "";
  display: block;
  width: 24px; height: 3px;
  background: var(--accent);
  margin-bottom: 12px;
}
.body p { margin: 0; }
.body > p:first-of-type {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
}
.body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.pullquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.tag {
  font-size: 11.5px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-2);
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.share__label {
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.share__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--ink-2);
}
.share__btn:hover { border-color: var(--ink); color: var(--ink); }
.share__btn svg { width: 14px; height: 14px; }

.author-box {
  margin-top: 34px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
}
.author-box__avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.author-box__name { font-weight: 600; font-size: 15px; }
.author-box__role {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 3px 0 8px;
  font-weight: 700;
}
.author-box__bio { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.pager {
  display: grid;
  gap: 12px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.pager__item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
}
.pager__item:hover { border-color: var(--ink); }
.pager__dir {
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 7px;
}
.pager__title { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.pager__item--next { text-align: right; }

.side-block { display: grid; gap: 22px; }
.sticky-side { position: sticky; top: calc(var(--header-h) + 20px); }

/* --------------------------- 15. Page (static) -------------------------- */
.page-head {
  padding-block: 34px 26px;
  border-bottom: 1px solid var(--line);
}
.page-head__kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-head__title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 12px 0 14px;
}
.page-head__intro {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 68ch;
}
.page-head__updated {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.page-body { padding-block: 34px 10px; }
.page-body h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.022em;
  margin-bottom: 12px;
}
.page-body section + section { margin-top: 36px; }
.page-body p + p { margin-top: 14px; }
.page-body p { color: var(--ink-2); line-height: 1.72; }
.page-body ul { margin-top: 16px; display: grid; gap: 10px; }
.page-body ul li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
  line-height: 1.65;
}
.page-body ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 1px;
}

/* Contact page */
.contact-grid { display: grid; gap: 30px; padding-block: 34px; }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.16s ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field__error { font-size: 12px; color: var(--accent); min-height: 0; }
.form__ok {
  padding: 14px 16px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--ink);
}

.info-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.info-card + .info-card { margin-top: 16px; }
.info-card__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.info-card dl { display: grid; gap: 12px; margin: 0; }
.info-card dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.info-card dd { margin: 3px 0 0; font-size: 14px; color: var(--ink-2); }
.info-card dd a:hover { color: var(--accent); }

.faq { display: grid; gap: 4px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.faq__q:hover { color: var(--accent); }
.faq__icon {
  flex: none;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px;
  color: var(--muted);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.faq__item[data-open="true"] .faq__icon { transform: rotate(45deg); border-color: var(--accent); color: var(--accent); }
.faq__a {
  display: none;
  padding: 0 0 18px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 70ch;
}
.faq__item[data-open="true"] .faq__a { display: block; }

/* Dashboard / stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--surface); padding: 18px 16px; }
.stat__num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* 404 */
.empty {
  text-align: center;
  padding-block: 70px;
}
.empty__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--ink);
}
.empty__code span { color: var(--accent); }
.empty__title { font-size: var(--step-2); font-weight: 600; margin: 18px 0 10px; }
.empty__text { color: var(--ink-2); max-width: 46ch; margin: 0 auto 24px; }
.empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-2) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

/* Graceful image fallback: keeps the layout intact if an illustration fails. */
.card__media.is-fallback,
.lead__media.is-fallback,
.row__media.is-fallback,
.article__figure.is-fallback,
.search__item.is-fallback {
  background:
    repeating-linear-gradient(135deg,
      transparent 0 9px,
      color-mix(in srgb, var(--accent) 12%, transparent) 9px 10px),
    linear-gradient(160deg, var(--surface-2), var(--accent-soft));
  position: relative;
}
.card__media.is-fallback::after,
.lead__media.is-fallback::after,
.row__media.is-fallback::after,
.article__figure.is-fallback::after {
  content: "MMDC";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--accent);
  opacity: 0.75;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------- 16. Responsive ----------------------------- */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .topbar__social { display: flex; }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newsletter { padding: 36px 32px; }
  .newsletter__form { grid-template-columns: 1fr auto; align-items: start; }
  .pager { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 132px 1fr; gap: 18px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (min-width: 860px) {
  :root { --header-h: 68px; --gutter: 32px; }
  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__grid { grid-template-columns: 1.55fr 1fr; gap: 40px; }
  .hero { padding-block: 34px 44px; }
  .section { padding-block: 52px; }
  .article__layout.has-toc { grid-template-columns: 250px minmax(0, 1fr); gap: 48px; }
  .article__layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
  .article__layout.has-toc { grid-template-columns: 220px minmax(0, 1fr) 280px; }
  .footer__grid { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .side-block { gap: 26px; }
}

@media (min-width: 1040px) {
  .nav { display: flex; }
  .btn-menu { display: none; }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--2 { gap: 30px; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .topbar__track { animation: none; }
}

/* Print */
@media print {
  .topbar, .header, .footer, .newsletter, .share, .toc, .progress, .drawer, .search { display: none !important; }
  body { background: #fff; color: #000; }
}