/* =========================================================
   Chloe The Corgi - site styles
   Tokens, light/dark theme, layout, nav, home cards, galleries,
   blog, contact form. Mobile first.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --accent: #ff66c4;
  --accent-hover: #ff4db8;
  --accent-soft: rgba(255, 102, 196, 0.12);
  --accent-on-dark: #ff8fd3;
  --dot-texture: rgba(255, 102, 196, 0.07);

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #fff5fb;
  --text: #1a1a1a;
  --text-muted: #5b5b5b;
  --border: #eeeeee;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 18px 48px rgba(0, 0, 0, 0.16);
  --radius: 16px;
  --radius-sm: 10px;

  --nav-bg: #ffffff;
  --nav-text: #1a1a1a;
  --panel-bg: #ffffff;

  --container-max: 1350px;
  --container-pad-desktop: 32px;
  --container-pad-mobile: 20px;

  --font: "Nunito", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  color-scheme: light;
}

/* EmDash ships scoped component styles that read these names and otherwise
   fall back to hardcoded light greys, which break in dark mode. */
:root {
  --color-border: var(--border);
  --color-surface: var(--surface-muted);
  --color-bg-subtle: var(--surface-muted);
  --color-muted: var(--text-muted);
}

[data-theme="dark"] {
  --accent-soft: rgba(255, 102, 196, 0.16);
  --dot-texture: rgba(255, 143, 211, 0.08);
  --bg: #111114;
  --surface: #1b1b20;
  --surface-muted: #17171b;
  --text: #f4f4f6;
  --text-muted: #a9a9b3;
  --border: #2a2a31;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 18px 48px rgba(0, 0, 0, 0.6);
  --nav-bg: #111114;
  --nav-text: #f4f4f6;
  --panel-bg: #16161a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: clamp(24px, 4.5vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.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-link {
  position: absolute; left: 12px; top: -48px; z-index: 999;
  background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------- Container, sections ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad-desktop);
}
@media (max-width: 1024px) { .container { padding: 0 24px; } }
@media (max-width: 640px)  { .container { padding: 0 var(--container-pad-mobile); } }

.container-narrow { max-width: 600px; margin: 0 auto; }
.container-prose { max-width: 860px; margin: 0 auto; }

.section { padding: 88px 0; }
@media (max-width: 1024px) { .section { padding: 64px 0; } }
@media (max-width: 640px)  { .section { padding: 48px 0; } }

.section-muted { background: var(--surface-muted); }
.section-accent { position: relative; overflow: hidden; background: var(--accent); color: #fff; }
.section-accent::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 90%);
}
.section-accent .container { position: relative; }
.section-accent h1, .section-accent h2, .section-accent h3 { color: #fff; }
.section-accent p { color: rgba(255, 255, 255, 0.94); }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-accent .section-label { color: #fff; }
.section-header { margin-bottom: 32px; }
.section-header.center { text-align: center; }
.section-header p { color: var(--text-muted); }
.lead { font-size: 19px; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff;
  font-weight: 800; text-decoration: none;
  transition: background-color 160ms, border-color 160ms, transform 160ms;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn:active { transform: scale(0.98); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-block { display: flex; width: 100%; }
.btn svg { width: 20px; height: 20px; }

/* ---------- Header / nav (always mobile style) ---------- */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--nav-bg); color: var(--nav-text);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 72px;
}
.nav-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--nav-text); font-weight: 800; font-size: 18px; }
.nav-logo img { width: 44px; height: 44px; border-radius: 50%; }
.nav-logo:hover { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--nav-text);
  transition: background-color 160ms, color 160ms, border-color 160ms;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 22px; height: 22px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.nav-burger {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); padding: 0;
}
.nav-burger span {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform 220ms ease, opacity 220ms ease;
}
body.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Slide-out panel (applies at every width, per client request) */
.nav-links {
  position: fixed; top: 0; right: 0; left: auto;
  width: min(86vw, 380px);
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--panel-bg); color: var(--text);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 250;
  overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden;
}
body.nav-open .nav-links { transform: translateX(0); visibility: visible; }

.nav-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55); z-index: 240;
}
body.nav-open .nav-backdrop { display: block; }
body.nav-open { overflow: hidden; }

.nav-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border);
}
.nav-panel-logo-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); }
.nav-panel-logo-link img { width: 40px; height: 40px; border-radius: 50%; }
.nav-panel-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--text);
}
.nav-panel-close:hover { background: var(--accent-soft); color: var(--accent); }
.nav-panel-close svg { width: 22px; height: 22px; }

.nav-item { position: static; border-bottom: 1px solid var(--border); }
.nav-item > a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 18px 24px; font-size: 18px; font-weight: 700; color: var(--text);
}
.nav-item > a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-item > a[aria-current="page"] { color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.nav-item > a svg { width: 13px; height: 13px; transition: transform 200ms; }
.nav-item.open > a svg { transform: rotate(180deg); }
.dropdown { display: none; padding: 4px 0 12px; }
.nav-item.open .dropdown { display: block; }
.dropdown a { display: block; padding: 11px 24px 11px 40px; color: var(--text-muted); }
.dropdown a:hover { color: var(--accent); }

.nav-panel-footer {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: auto; padding: 20px 24px 28px;
}
.nav-panel-footer .social-row { justify-content: flex-start; }
.nav-panel-tagline { font-size: 14px; color: var(--text-muted); }

/* ---------- Social icons ---------- */
.social-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.social-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 160px; height: 48px; padding: 0 18px; border-radius: 999px;
  border: 2px solid var(--accent); color: var(--accent); background: transparent;
  font-weight: 800; transition: background-color 160ms, color 160ms;
}
.social-btn:hover { background: var(--accent); color: #fff; }
.social-btn svg { width: 22px; height: 22px; }
.social-btn.icon-only { padding: 0; width: 48px; }

/* ---------- Home: profile + link cards ---------- */
.profile { text-align: center; padding: 40px 0 8px; }
.profile-avatar {
  width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 20px;
  box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow);
}
.profile h1 { margin-bottom: 4px; }
.profile .tagline { color: var(--text-muted); font-size: 18px; font-weight: 700; margin-bottom: 20px; }

.link-section { padding: 32px 0 64px; }
@media (max-width: 1024px) { .link-section { padding: 32px 0 48px; } }
@media (max-width: 640px)  { .link-section { padding: 24px 0 40px; } }
.link-section .section-header { margin-bottom: 16px; text-align: center; }
.link-section h2 { font-size: 22px; }
.link-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.link-card {
  position: relative;
  display: flex; align-items: center; gap: 20px;
  min-height: 88px; padding: 12px 14px 12px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text);
  border-left: 4px solid transparent;
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}
.link-card:hover, .link-card:focus-within { border-left-color: var(--accent); transform: translateY(-2px); }
.link-card:active { transform: scale(0.99); }
/* Stretched link: the title link covers the whole card; the copy button sits above it. */
.link-card-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.link-card-title:focus-visible { outline: none; }
.link-card:has(.link-card-title:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.copy-code { position: relative; z-index: 2; }
.link-card-img {
  flex: 0 0 76px; width: 76px; height: 76px; border-radius: 16px; object-fit: cover; background: var(--surface-muted);
}
.link-card-body { flex: 1 1 auto; min-width: 0; }
.link-card-title { display: block; font-weight: 800; font-size: 17px; line-height: 1.3; color: var(--text); }
.link-card-title:hover { color: var(--text); }
.link-card-desc { display: block; font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.link-card-cta { display: block; font-size: 12px; font-weight: 800; color: var(--accent); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.link-card-arrow { flex: 0 0 auto; width: 20px; height: 20px; color: var(--text-muted); }

/* Copy code pill */
.copy-code {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 6px; padding: 5px 10px; min-height: 30px;
  border-radius: 999px; border: 1px dashed var(--accent);
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 12px; letter-spacing: 0.05em;
  transition: background-color 160ms, color 160ms, border-style 160ms;
}
.copy-code:hover { background: var(--accent); color: #fff; border-style: solid; }
.copy-code svg { width: 14px; height: 14px; }
.copy-code.copied { background: var(--accent); color: #fff; border-style: solid; }
.copy-code .copy-label-done { display: none; }
.copy-code.copied .copy-label-done { display: inline; }
.copy-code.copied .copy-label-code, .copy-code.copied svg { display: none; }

.code-callout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--surface-muted); border: 1px solid var(--border); margin-bottom: 32px;
}
.code-callout .copy-code { margin-top: 0; }

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative; overflow: hidden;
  padding: 48px 0 40px; text-align: center; background: var(--surface-muted);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot-texture) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 90%);
}
.page-hero .container { position: relative; }
.page-hero .lead { max-width: 640px; margin: 0 auto; }
@media (max-width: 640px) { .page-hero { padding: 40px 0 32px; } }

/* ---------- Split (text + image) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split-image img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 1024px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split-image { order: -1; }
}

/* Fun facts */
.facts { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .facts { grid-template-columns: 1fr; } }
.facts li {
  padding: 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.facts li:hover, .facts li:focus-within {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft), 0 12px 28px -8px rgba(255, 102, 196, 0.55);
}
.facts-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 12px;
  transition: background-color 200ms ease, color 200ms ease;
}
.facts li:hover .facts-icon, .facts li:focus-within .facts-icon {
  background: var(--accent); color: #fff;
}
.facts-icon svg { width: 22px; height: 22px; }
.facts strong { color: var(--accent); display: block; margin-bottom: 4px; }

/* ---------- Gallery ---------- */
.gallery { list-style: none; display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .gallery { gap: 12px; } }
.gallery-tile {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); color: var(--text);
  transition: transform 160ms, border-color 160ms;
}
.gallery-tile:hover, .gallery-tile:focus-visible { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.gallery-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery-caption { padding: 12px 14px 14px; }
.gallery-caption strong { display: block; font-size: 15px; line-height: 1.3; }
.gallery-caption span { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.gallery-caption .gallery-cta { color: var(--accent); font-weight: 800; font-size: 13px; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
@media (max-width: 640px) { .gallery-caption { padding: 10px 12px 12px; } .gallery-caption strong { font-size: 14px; } }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .btn { background: #fff; color: var(--accent); border-color: #fff; }
.cta-band .btn:hover { background: #fff0f9; }
.cta-band .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-muted); border-top: 1px solid var(--border); padding: 48px 0 32px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); }
.footer-logo img { width: 44px; height: 44px; border-radius: 50%; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; list-style: none; }
.footer-nav a { color: var(--text); font-weight: 700; }
.footer-nav a:hover { color: var(--accent); }
.footer-meta { font-size: 14px; color: var(--text-muted); }
.footer-meta a { color: var(--text-muted); text-decoration: underline; }
.footer-meta a:hover { color: var(--accent); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 20px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 800; font-size: 15px; }
.form-row input, .form-row textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; min-height: 48px; width: 100%;
}
.form-row textarea { resize: vertical; min-height: 140px; }
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.form-error {
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: #ffe8e8; color: #8a1f1f; border: 1px solid #f3b9b9; font-weight: 700;
}
[data-theme="dark"] .form-error { background: #3a1b1b; color: #ffb3b3; border-color: #6b2a2a; }
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: start; }
@media (max-width: 1024px) { .contact-grid { grid-template-columns: 1fr; gap: 32px; } }
.contact-aside { padding: 24px; border-radius: var(--radius); background: var(--surface-muted); border: 1px solid var(--border); text-align: center; }

/* ---------- Blog ---------- */
.blog-grid { list-style: none; display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .blog-grid { grid-template-columns: 1fr; } }
.blog-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); color: var(--text); transition: transform 160ms, border-color 160ms;
}
.blog-card:hover, .blog-card:focus-visible { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.blog-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-muted); }
.blog-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card-body h3 { font-size: 19px; margin: 0; }
.blog-card-body p { color: var(--text-muted); font-size: 15px; }
.blog-card-meta { font-size: 13px; color: var(--text-muted); margin-top: auto; }
.blog-card-more { color: var(--accent); font-weight: 800; font-size: 14px; }
.blog-empty { text-align: center; color: var(--text-muted); padding: 40px 0; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 40px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text); font-weight: 800;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination [aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.post-hero { text-align: center; }
.post-hero .container-prose { text-align: center; }
.post-hero .post-meta, .post-hero .share-row { justify-content: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 16px; }
.back-link svg { width: 16px; height: 16px; }
.post-meta { color: var(--text-muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.post-featured { margin-top: 24px; }
.post-featured img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.post-body { padding: 40px 0 0; }
.post-body h2 { margin-top: 40px; color: var(--accent); }
[data-theme="dark"] .post-body h2 { color: var(--accent-on-dark); }
.post-body h3, .post-body h4 { margin-top: 32px; }
.post-body ul, .post-body ol { padding-left: 24px; margin: 0 0 20px; }
.post-body li { margin-bottom: 6px; }
.post-body img { border-radius: var(--radius-sm); margin: 24px 0; }
.post-body figure { margin: 24px 0; }
.post-body figcaption { font-size: 14px; color: var(--text-muted); margin-top: 8px; text-align: center; }
.post-body blockquote { margin: 24px 0; padding: 12px 20px; border-left: 4px solid var(--accent); background: var(--surface-muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.post-body a { text-decoration: underline; }
.post-body pre { overflow-x: auto; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px solid var(--border); }
.post-body code { font-size: 0.92em; }
.post-body iframe, .post-body video { max-width: 100%; }

/* EmDash's scoped table styles supply the grid and zebra rows; they read the
   --color-* tokens mapped above, so they follow the theme. Only the header row
   and cell padding are overridden here, via a selector long enough to out-rank
   EmDash's scoped one. */
.post-body .emdash-table-wrapper, .post-body .table-scroll {
  margin: 28px 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.post-body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.post-body table:not(.emdash-table) { margin: 28px 0; }
.post-body table th, .post-body table td {
  border: 1px solid var(--border); padding: 12px 16px; text-align: left; vertical-align: top;
}
.post-body table thead th { background: var(--accent-soft); color: var(--text); font-weight: 800; }
.post-body .emdash-table-wrapper .emdash-table { font-size: 16px; }
.post-body .emdash-table-wrapper .emdash-table tr th,
.post-body .emdash-table-wrapper .emdash-table tr td { padding: 12px 16px; vertical-align: top; }
.post-body .emdash-table-wrapper .emdash-table thead th {
  background: var(--accent-soft); color: var(--text); font-weight: 800;
}
.post-body table th > p, .post-body table td > p { margin: 0; }

.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 16px 0; }
.share-row .share-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background-color 160ms, color 160ms, border-color 160ms;
}
.share-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.share-btn svg { width: 18px; height: 18px; }
.share-status { font-size: 14px; color: var(--accent); font-weight: 800; }
.post-share-end { margin: 48px 0 64px; padding-top: 32px; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .post-share-end { margin: 36px 0 48px; padding-top: 24px; } }

.related { margin-top: 48px; }

.notfound-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.notfound-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-weight: 800;
  transition: border-color 160ms, color 160ms, background-color 160ms;
}
.notfound-links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.in-view {
  opacity: 1; transform: none;
  animation: ds-reveal-up 700ms cubic-bezier(0.4, 0, 0.2, 1) var(--reveal-delay, 0ms) both;
}
@keyframes ds-reveal-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.in-view { opacity: 1; transform: none; animation: none; }
  .nav-links, .nav-burger span, .link-card, .gallery-tile, .blog-card, .btn, .facts li, .facts-icon { transition: none; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .site-footer, .share-row, .related, .cta-band, .back-link, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
