/* ===================================================
   naheed.me — Modern muted Scandinavian design system
   =================================================== */

:root {
  /* Neutral foundation */
  --base: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #22252a;
  --ink-soft: #565b62;
  --ink-faint: #8a8f96;
  --border: #e6e4dc;
  --border-strong: #d2cfc4;

  /* Default (neutral) theme tokens — overridden by .theme-* */
  --accent: #4a5560;
  --accent-strong: #353e47;
  --theme-bg: var(--base);
  --theme-band: #eeede7;
  --theme-surface: #ffffff;
  --theme-soft: #f0efe9;
  --theme-ink: var(--ink);

  /* Type */
  --font-display: "Merriweather", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Inter", serif;

  /* Spacing scale */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;

  /* Radii */
  --r-sm: 0.5rem;
  --r-md: 0.9rem;
  --r-lg: 1.4rem;

  /* Shadows (soft, no gradients) */
  --sh-sm: 0 1px 2px rgba(34, 37, 42, 0.04), 0 1px 3px rgba(34, 37, 42, 0.06);
  --sh-md: 0 4px 12px -2px rgba(34, 37, 42, 0.08), 0 2px 6px -2px rgba(34, 37, 42, 0.06);
  --sh-lg: 0 18px 40px -12px rgba(34, 37, 42, 0.18);

  --maxw: 70rem;
  --measure: 39rem;
}

/* ---------- Per-post themes ---------- */
.theme-sage  { --accent: #5f7a5a; --accent-strong: #4a6345; --theme-bg: #f0f3ee; --theme-band: #e3ebde; --theme-surface: #fbfcfa; --theme-soft: #e9efe5; --theme-ink: #2b3a29; }
.theme-clay  { --accent: #a86b50; --accent-strong: #874f38; --theme-bg: #f7f0eb; --theme-band: #eee0d6; --theme-surface: #fdfaf7; --theme-soft: #f0e4da; --theme-ink: #45342b; }
.theme-sky   { --accent: #4e7088; --accent-strong: #3a586d; --theme-bg: #eef3f6; --theme-band: #dde8ee; --theme-surface: #fafcfd; --theme-soft: #e4edf2; --theme-ink: #293a45; }
.theme-sand  { --accent: #9e8244; --accent-strong: #7c6533; --theme-bg: #f6f1e6; --theme-band: #ece2cf; --theme-surface: #fdfbf6; --theme-soft: #f0e8d6; --theme-ink: #423926; }
.theme-rose  { --accent: #a06d6f; --accent-strong: #7f5254; --theme-bg: #f7efef; --theme-band: #eee0e0; --theme-surface: #fdf9f9; --theme-soft: #f0e4e4; --theme-ink: #43302f; }
.theme-lilac { --accent: #7a6486; --accent-strong: #5e4c69; --theme-bg: #f3eff6; --theme-band: #e6dded; --theme-surface: #fbf9fd; --theme-soft: #ebe3f0; --theme-ink: #372f3e; }
.theme-stone { --accent: #736e64; --accent-strong: #565249; --theme-bg: #f4f3ee; --theme-band: #e8e6dd; --theme-surface: #fcfbf8; --theme-soft: #edebe2; --theme-ink: #3a382f; }
.theme-none  { --accent: #4a5560; --accent-strong: #353e47; --theme-bg: #f7f6f2; --theme-band: #eeede7; --theme-surface: #ffffff; --theme-soft: #f0efe9; --theme-ink: #22252a; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--ink); text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  margin: 0 0 var(--s4);
  letter-spacing: -0.012em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5.2vw, 3.6rem); font-weight: 900; line-height: 1.08; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 var(--s4); }
button { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s5); }
.section { padding: var(--s8) 0; }
.section--tight { padding: var(--s7) 0; }

.section-head { max-width: var(--measure); margin: 0 0 var(--s6); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s3);
}
.hint { color: var(--ink-soft); font-size: 0.94rem; }
.lead { font-size: 1.18rem; line-height: 1.6; color: var(--ink-soft); }

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s4);
}
.bento-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s6);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  color: inherit;
}
.b-2 { grid-column: span 2; }
.b-3 { grid-column: span 3; }
.b-4 { grid-column: span 4; }
.b-6 { grid-column: span 6; }
.b-r2 { grid-row: span 2; }

@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .b-2, .b-3, .b-4, .b-6 { grid-column: span 2; }
  .b-r2 { grid-row: auto; }
}
@media (max-width: 540px) {
  .bento { grid-template-columns: 1fr; }
  .b-2, .b-3, .b-4, .b-6 { grid-column: span 1; }
}

/* Themed card (used on index + home) */
.card-link {
  background: var(--theme-band);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s6);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  color: var(--theme-ink);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.card-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.card-link:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.card-link h3 { margin: 0; color: var(--theme-ink); }
.card-link .excerpt { color: var(--theme-ink); opacity: 0.82; margin: 0; flex-grow: 1; }
.card-link .post-meta { font-size: 0.82rem; color: var(--accent-strong); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Badges & tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
.badge-soft {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--accent);
}
.tags { display: flex; gap: var(--s2); flex-wrap: wrap; }
.tag-pill {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 242, 0.82);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--s3);
  padding-bottom: var(--s3);
}

.brand { display: inline-flex; align-items: center; gap: var(--s3); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 0.6rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1;
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: var(--s5); font-weight: 500; font-size: 0.95rem; }
.nav-links a { color: var(--ink-soft); position: relative; padding: var(--s1) 0; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a:not(.nav-cta).active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.nav-cta {
  background: var(--ink);
  color: #fff !important;
  padding: 0.5rem 1.05rem !important;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-cta:hover { background: #000; transform: translateY(-1px); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0.4rem;
}
.nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(-0px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    flex-direction: column; align-items: flex-start;
    gap: var(--s4); padding: var(--s5);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-cta { align-self: stretch; text-align: center; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--s8) 0 var(--s8); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--s7);
}
.hero-copy { max-width: 34rem; }
.hero h1 { margin-bottom: var(--s5); }
.hero-name {
  position: relative;
  white-space: nowrap;
}
.hero-name::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 0.08em;
  height: 0.34em;
  background: var(--accent);
  opacity: 0.22;
  border-radius: 2px;
  z-index: -1;
}
.theme-sage .hero-name::after { background: #5f7a5a; }
.hero .lead { max-width: 34rem; }
.hero-actions { display: flex; gap: var(--s3); margin-top: var(--s6); flex-wrap: wrap; }

.hero-topics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s6);
}
.topic-label { font-size: 0.85rem; color: var(--ink-faint); margin-right: var(--s2); }
.topic-pill {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  transition: all 0.14s ease;
}
.topic-pill:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }

/* Hero visual cluster */
.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}
.hero-tile {
  background: var(--theme-band);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: var(--r-lg);
  padding: var(--s5);
  box-shadow: var(--sh-md);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  color: var(--theme-ink);
}
.hero-tile i { font-size: 1.5rem; color: var(--accent); margin-bottom: var(--s2); }
.hero-tile strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.hero-tile span { font-size: 0.86rem; color: var(--theme-ink); opacity: 0.74; }
.hero-tile:nth-child(1) { transform: rotate(-2.5deg); }
.hero-tile:nth-child(2) { transform: rotate(1.8deg) translateY(0.6rem); }
.hero-tile:nth-child(3) { transform: rotate(2deg) translateY(-0.4rem); }
.hero-tile:nth-child(4) { transform: rotate(-1.6deg); }

/* gentle float */
@keyframes floaty { 0%,100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.float-a { animation: floaty 6s ease-in-out infinite; }
.float-b { animation: floaty 6s ease-in-out 0.8s infinite; }
.float-c { animation: floaty 6s ease-in-out 1.6s infinite; }
.float-d { animation: floaty 6s ease-in-out 2.4s infinite; }

/* reveal on load */
@keyframes reveal-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal-up 0.7s ease both; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .hero-visual { max-width: 30rem; }
}
@media (prefers-reduced-motion: reduce) {
  .float-a, .float-b, .float-c, .float-d, .reveal { animation: none; }
}

/* ---------- Home about bento copy ---------- */
.bento-item .eyebrow { color: var(--accent); }
.bento-feature { background: var(--ink); color: #fff; }
.bento-feature h2, .bento-feature h3 { color: #fff; }
.bento-feature .hint { color: rgba(255, 255, 255, 0.72); }
.bento-feature .eyebrow { color: rgba(255, 255, 255, 0.6); }

.tile-accent { border-top: 3px solid var(--accent); }

/* ---------- Filters ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.filter-pill {
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
  background: var(--surface);
  transition: all 0.14s ease;
}
.filter-pill:hover { border-color: var(--ink); color: var(--ink); }
.filter-pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Post detail (immersive theme) ---------- */
.post-page {
  background: var(--theme-bg);
  min-height: 70vh;
}
.post-band {
  background: var(--theme-band);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  padding: var(--s8) 0 var(--s7);
}
.post-band .container { max-width: var(--measure); }
.post-band h1 { color: var(--theme-ink); margin: var(--s4) 0 var(--s4); }
.post-band .post-meta {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  color: var(--accent-strong); font-size: 0.9rem; font-weight: 500;
  margin-bottom: var(--s4);
}
.post-band .tags .tag-pill { background: var(--theme-surface); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); color: var(--theme-ink); }

.post-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s8) var(--s5);
  color: var(--theme-ink);
}
.post-body a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.post-body a:hover { text-decoration-thickness: 2px; }

.block { margin-bottom: var(--s5); }
.block-paragraph { font-size: 1.12rem; line-height: 1.85; }
.block-heading {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  margin-top: var(--s7); color: var(--theme-ink);
}
.block[dir="rtl"] { font-family: var(--font-arabic); text-align: right; font-size: 1.3rem; line-height: 2.1; }

.block-citation {
  border-left: 3px solid var(--accent);
  padding: var(--s2) 0 var(--s2) var(--s5);
  margin: var(--s6) 0;
}
.block-citation[dir="rtl"] { border-left: none; border-right: 3px solid var(--accent); padding: var(--s2) var(--s5) var(--s2) 0; }
.block-citation .citation-text {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.2rem; line-height: 1.6; color: var(--theme-ink); margin-bottom: var(--s2);
}
.block-citation .citation-source { font-size: 0.86rem; font-weight: 600; color: var(--accent-strong); }
.block-citation .citation-source a { color: var(--accent-strong); }

.block-image img, .block-video video { border-radius: var(--r-md); width: 100%; box-shadow: var(--sh-md); }
.block-image figcaption, .block-video figcaption {
  font-size: 0.84rem; color: var(--ink-faint); margin-top: var(--s3); text-align: center;
}
.block-divider { border: none; border-top: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); margin: var(--s7) auto; width: 40%; }

.align-center { text-align: center; }
.align-right { text-align: right; }
.align-left { text-align: left; }

/* ---------- Comments (lightweight) ---------- */
.comments {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s7) var(--s5) var(--s8);
}
.comments-inner {
  border-top: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  padding-top: var(--s6);
}
.comments h3 {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: var(--s4);
}
.comment { padding: var(--s3) 0; font-size: 0.96rem; }
.comment .comment-meta { font-weight: 600; color: var(--theme-ink); margin-bottom: 2px; }
.comment p { margin: 0; color: var(--ink-soft); }
.comment-form-toggle {
  font-size: 0.88rem; color: var(--accent-strong); background: none; border: none;
  cursor: pointer; padding: 0; margin-top: var(--s4); font-weight: 600;
}
details > summary.comment-form-toggle { list-style: none; }
details > summary.comment-form-toggle::-webkit-details-marker { display: none; }
.comment-form { margin-top: var(--s5); max-width: 28rem; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: var(--s4); }
.form-field label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: var(--s2); }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; font-family: inherit; font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.form-card { max-width: 30rem; }

.notice {
  background: var(--theme-soft); color: var(--theme-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--r-sm); padding: var(--s4); margin-bottom: var(--s5);
  font-weight: 500; font-size: 0.94rem;
}
.notice-error { border-color: #b4524f; color: #8c3b39; background: #faecec; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: var(--s7) 0 var(--s5); margin-top: var(--s7); background: var(--surface); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: var(--s6);
  padding-bottom: var(--s6);
}
.footer-brand .brand { margin-bottom: var(--s4); }
.footer-blurb { font-size: 0.92rem; color: var(--ink-soft); max-width: 22rem; margin-bottom: var(--s4); }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-faint); margin-bottom: var(--s4);
}
.footer-col a, .footer-fact {
  display: block; color: var(--ink-soft); font-size: 0.92rem;
  padding: var(--s1) 0; text-decoration: none;
}
.footer-col a:hover { color: var(--ink); }
.footer-fact { color: var(--ink-faint); }
.social-links { display: flex; flex-wrap: wrap; gap: var(--s4); }
.social-links a { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink-soft); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.social-links a:hover { color: var(--ink); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3);
  border-top: 1px solid var(--border); padding-top: var(--s5);
}
.made-by { font-size: 0.84rem; color: var(--ink-faint); margin: 0; }
.footer-credit { display: inline-flex; align-items: center; gap: var(--s2); font-size: 0.84rem; margin: 0; }
.credit-label { color: var(--ink-faint); }
.credit-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--ink); font-weight: 600; text-decoration: none;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border-strong);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.credit-link:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.credit-link i { font-size: 0.82em; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s5); }
  .footer-brand { grid-column: span 2; }
}
@media (max-width: 440px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

/* ---------- About icons ---------- */
.about-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: var(--r-md);
  background: var(--theme-surface);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: var(--s4);
}

/* ---------- Cat pill ---------- */
.topic-pill-cat { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
.topic-pill-cat i { margin-right: 0.1rem; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--ink); color: #fff; padding: var(--s6) var(--s5); }
.admin-sidebar .brand { color: #fff; display: block; margin-bottom: var(--s7); }
.admin-sidebar a { display: block; color: #b9bdc4; padding: var(--s3) 0; font-weight: 500; font-size: 0.93rem; }
.admin-sidebar a:hover { color: #fff; }
.admin-main { padding: var(--s7); background: var(--base); }
@media (max-width: 860px) { .admin-shell { grid-template-columns: 1fr; } }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--base); padding: var(--s5); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-sm); }
.admin-table th, .admin-table td { text-align: left; padding: var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 0.92rem; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table th { font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); background: var(--surface-2); }
.admin-section { margin-bottom: var(--s7); }
.admin-section h2 { font-family: var(--font-body); font-size: 1.15rem; font-weight: 700; }
.row-actions { display: flex; gap: var(--s2); }
.row-actions form { display: inline; }
.icon-btn { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 0.35rem 0.7rem; cursor: pointer; color: var(--ink-soft); font-size: 0.85rem; font-weight: 500; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Block editor ---------- */
.editor-grid { display: grid; grid-template-columns: 2.1fr 1fr; gap: var(--s6); align-items: start; }
@media (max-width: 980px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s5); margin-bottom: var(--s4); box-shadow: var(--sh-sm); }
.editor-block-toolbar { display: flex; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; align-items: center; font-size: 0.85rem; }
.editor-block-toolbar select { padding: 0.3rem 0.5rem; border-radius: var(--r-sm); border: 1px solid var(--border-strong); font-size: 0.82rem; }
.editor-block textarea { width: 100%; border: none; resize: vertical; font-family: var(--font-body); font-size: 1rem; min-height: 4.5rem; padding: 0; }
.editor-block textarea:focus { outline: none; }
.editor-block[data-dir="rtl"] textarea { font-family: var(--font-arabic); text-align: right; direction: rtl; }
.editor-block .text-input { margin-top: var(--s3); width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 0.5rem 0.8rem; font-size: 0.85rem; }
.editor-add-bar { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.editor-add-bar .btn { font-size: 0.82rem; padding: 0.5rem 0.95rem; }
.sidebar-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s5); margin-bottom: var(--s5); box-shadow: var(--sh-sm); }
.sidebar-panel h4 { font-size: 0.74rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: var(--s4); }

.color-swatches { display: flex; flex-wrap: wrap; gap: var(--s3); }
.color-swatch { cursor: pointer; }
.color-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.color-swatch span { display: block; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid rgba(0,0,0,0.12); transition: transform 0.12s ease; }
.color-swatch:hover span { transform: scale(1.08); }
.color-swatch input:checked + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.upload-control { border: 1.5px dashed var(--border-strong); border-radius: var(--r-sm); padding: var(--s4); text-align: center; }
.upload-control input[type="file"] { font-size: 0.85rem; }
.upload-preview { margin-top: var(--s3); }
.upload-preview img, .upload-preview video { max-height: 11rem; border-radius: var(--r-sm); margin: 0 auto; }
.upload-status { font-size: 0.8rem; color: var(--ink-faint); margin-top: var(--s2); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0.1em 0.35em; }

/* ===================================================
   Illustrations
   =================================================== */
.illus { display: inline-flex; color: var(--accent); }
.illus svg { width: 100%; height: auto; display: block; }
.hero-tile .illus { width: 3.4rem; margin-bottom: var(--s1); }
.tile-illus { display: block; width: 3rem; color: var(--accent); margin-bottom: var(--s3); }

/* ===================================================
   Featured post
   =================================================== */
.featured {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  gap: var(--s6);
  background: var(--theme-band);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: var(--r-lg);
  padding: var(--s7);
  color: var(--theme-ink);
  box-shadow: var(--sh-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.featured:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.featured h2 { margin: var(--s2) 0 var(--s3); color: var(--theme-ink); }
.featured-excerpt { font-size: 1.1rem; color: var(--theme-ink); opacity: 0.82; margin-bottom: var(--s5); }
.featured-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s4); font-size: 0.86rem; color: var(--accent-strong); font-weight: 500; }
.featured-art { width: 78%; justify-self: center; color: var(--accent); }
@media (max-width: 720px) {
  .featured { grid-template-columns: 1fr; padding: var(--s6); }
  .featured-art { display: none; }
}

/* ===================================================
   Pull quote
   =================================================== */
.pull-quote-section { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pull-quote { display: block; max-width: 46rem; margin: 0 auto; text-align: center; color: inherit; }
.pull-quote .pq-mark { display: inline-flex; width: 3.4rem; color: var(--accent); margin-bottom: var(--s4); }
.pull-quote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.4;
  margin: 0 0 var(--s4);
  color: var(--ink);
}
.pull-quote cite { font-style: normal; font-weight: 600; color: var(--ink-soft); font-size: 0.95rem; }
.pull-quote:hover blockquote { color: #000; }

/* ===================================================
   Contact section
   =================================================== */
.contact-section { background: var(--surface); border-top: 1px solid var(--border); }
.contact-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: var(--s6); align-items: center; }
.contact-art { color: var(--accent); width: 70%; justify-self: center; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } .contact-art { display: none; } }

/* ===================================================
   Q&A ask panel
   =================================================== */
.qa-ask {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--s6);
  align-items: center;
  background: var(--theme-band);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: var(--r-lg);
  padding: var(--s7);
  box-shadow: var(--sh-md);
  color: var(--theme-ink);
}
.qa-ask-intro { display: flex; flex-direction: column; gap: var(--s4); }
.qa-ask-illus { display: block; width: 4.5rem; color: var(--accent); }
.qa-ask-intro h3 { margin: 0 0 var(--s2); color: var(--theme-ink); }
.qa-ask-form { display: flex; flex-direction: column; }
.qa-ask-form .form-field input,
.qa-ask-form .form-field textarea {
  background: var(--theme-surface);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
}
@media (max-width: 760px) {
  .qa-ask { grid-template-columns: 1fr; padding: var(--s6); }
}

/* ===================================================
   Reading experience — post page
   =================================================== */
.back-link { display: inline-flex; align-items: center; gap: var(--s2); font-size: 0.86rem; font-weight: 600; color: var(--accent-strong); margin-bottom: var(--s5); }
.back-link:hover { color: var(--theme-ink); }
.post-band .badge { margin-bottom: var(--s4); }

/* Drop cap for articles */
.typeset-article > .block-paragraph:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  float: left;
  font-size: 3.6rem;
  line-height: 0.78;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent-strong);
}

.post-tools { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border)); }
.post-tools .btn-ghost { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--accent-strong); }
.post-tools .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Prev / next */
.post-nav { background: var(--theme-bg); padding: var(--s5) 0 var(--s7); }
.post-nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); max-width: var(--measure); margin: 0 auto; }
.post-nav-item {
  display: flex; flex-direction: column; gap: var(--s2);
  background: var(--theme-band);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
  color: var(--theme-ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.post-nav-item:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.post-nav-next { text-align: right; align-items: flex-end; }
.post-nav-dir { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.post-nav-item strong { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.3; }
@media (max-width: 560px) { .post-nav-grid { grid-template-columns: 1fr; } .post-nav-next { text-align: left; align-items: flex-start; } }
