/* ==========================================================================
   arikkan.info — warm scholarly design system
   ========================================================================== */

/* ---------- 1. Tokens — direction C "Editoryal" ---------- */
:root {
  color-scheme: light;

  /* Surfaces — crisp editorial white */
  --paper:      #ffffff;
  --paper-2:    #f6f7f8;
  --paper-3:    #eaedf0;
  --card:       #ffffff;

  /* Ink */
  --ink:        #1a1d23;
  --ink-2:      #4b515a;
  --ink-3:      #868d97;

  /* Accents — teal primary + restrained ochre */
  --green:      #0f766e;
  --green-2:    #0d9488;
  --green-soft: #ddf0ed;
  --gold:       #9a6b1f;
  --gold-2:     #bd8f3e;
  --gold-soft:  #f5eede;

  --rule:       #e5e8eb;
  --rule-2:     #d3d8dd;

  --sel:        #cdeeea;

  /* Type — Inter (UI/headings) + Source Serif 4 (screen-reading serif) */
  --ff-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-body:    "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ff-ui:      "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-body: 1.0625rem;      /* UI / listings — stays compact */
  --lh-body: 1.7;

  /* Reading column — generous, user-adjustable via [data-fs] */
  --fs-read: 1.1875rem;      /* ~19px default */
  --lh-read: 1.78;
  --measure: 39rem;

  /* Space */
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --shell:  76rem;

  /* Effects */
  --shadow-1: 0 1px 2px rgba(20,23,28,.04), 0 2px 8px rgba(20,23,28,.05);
  --shadow-2: 0 2px 4px rgba(20,23,28,.05), 0 12px 32px -8px rgba(20,23,28,.14);
  --radius: 8px;
  --radius-lg: 13px;

  --ease: cubic-bezier(.22,.61,.36,1);
  font-optical-sizing: auto;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:      #14171c;
  --paper-2:    #1b1f26;
  --paper-3:    #252b34;
  --card:       #191d24;

  --ink:        #e8ebef;
  --ink-2:      #b2b9c2;
  --ink-3:      #828a94;

  --green:      #2dd4bf;
  --green-2:    #5eead4;
  --green-soft: #10322d;
  --gold:       #dcb464;
  --gold-2:     #e7cd8f;
  --gold-soft:  #2a2414;

  --rule:       #2a2f38;
  --rule-2:     #3b424d;
  --sel:        #14453f;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 2px 4px rgba(0,0,0,.35), 0 14px 34px -10px rgba(0,0,0,.6);
}

/* Font-size steps (reading control) — scale the reading column, not the UI */
:root[data-fs="s"]  { --fs-read: 1.0625rem; --lh-read: 1.75; }
:root[data-fs="l"]  { --fs-read: 1.3125rem; --lh-read: 1.85; --measure: 41rem; }
:root[data-fs="xl"] { --fs-read: 1.4375rem; --lh-read: 1.9;  --measure: 43rem; }

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
/* The HTML `hidden` attribute only sets `display:none` at user-agent priority, so
   any component rule with its own `display` silently defeats it. Several here do
   (.field is grid, .tile is flex). Make `hidden` mean hidden. */
[hidden] { display: none !important; }
/* Soft parchment ground so an image that hasn't loaded (or hasn't been mirrored
   yet) reads as a placeholder block rather than a broken-image glyph. */
.prose img, .book__cover img, .hero__besmele { background: var(--paper-3); }
img.is-missing {
  min-height: 6rem; border: 1px dashed var(--rule-2); border-radius: var(--radius);
  background: var(--paper-2); color: var(--ink-3);
  font-family: var(--ff-ui); font-size: .78rem; padding: 1.5rem 1rem; text-align: center;
}
.hero__plaque:has(img.is-missing), .tile__thumb:has(img.is-missing),
.card__media:has(img.is-missing) { display: none; }
.pagehead--img .pagehead__bg.is-missing { opacity: 0; }
::selection { background: var(--sel); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 3px; border-radius: 3px; }
button { font: inherit; color: inherit; }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--green); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
  font-family: var(--ff-ui); font-size: .9rem;
}
.skip:focus { left: 0; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 3. Reading progress ---------- */
#progress {
  position: fixed; inset: 0 auto auto 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--green-2), var(--gold-2));
  z-index: 60; transition: width .1s linear; pointer-events: none;
}

/* ---------- 4. Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  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(--rule);
  transition: box-shadow .25s var(--ease), background .25s var(--ease);
}
.masthead.is-stuck { box-shadow: var(--shadow-1); }
.masthead__bar {
  display: flex; align-items: center; gap: 1rem;
  min-height: 4.25rem;
}
.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand__mark {
  font-family: var(--ff-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em;
  color: var(--ink); line-height: 1.1; white-space: nowrap;
}
.brand__mark em { font-style: normal; color: var(--green-2); }
.brand__sub {
  font-family: var(--ff-ui); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
@media (max-width: 900px) { .brand__sub { display: none; } }

/* Nav */
.nav { font-family: var(--ff-ui); }
.nav > ul { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav a {
  display: block; padding: .5rem .68rem; border-radius: 7px;
  font-size: .875rem; font-weight: 500; line-height: 1.4;
  color: var(--ink-2); text-decoration: none;
  transition: background .16s var(--ease), color .16s var(--ease);
  white-space: nowrap;
}
.nav a:hover { background: var(--paper-3); color: var(--ink); }
.nav a[aria-current] { color: var(--green-2); background: var(--green-soft); font-weight: 600; }
.nav .has-sub > a::after {
  content: ""; display: inline-block; width: .34em; height: .34em; margin-left: .45em;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-.15em) rotate(45deg); opacity: .55;
}
.nav ul ul {
  position: absolute; top: calc(100% + .35rem); left: 0; min-width: 15rem; max-width: 22rem;
  list-style: none; margin: 0; padding: .4rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.nav li:hover > ul, .nav li:focus-within > ul { opacity: 1; visibility: visible; transform: none; }
.nav ul ul a { white-space: normal; padding: .5rem .6rem; font-size: .84rem; }

.nav-toggle, .icon-btn {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none;
  border: 1px solid var(--rule); background: transparent; border-radius: 8px;
  color: var(--ink-2); cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn:hover, .nav-toggle:hover { background: var(--paper-3); color: var(--ink); border-color: var(--rule-2); }
.icon-btn svg, .nav-toggle svg { width: 1.05rem; height: 1.05rem; }
.nav-toggle { display: none; }

:root[data-theme="dark"] .icon-btn .i-sun,  :root:not([data-theme="dark"]) .icon-btn .i-moon { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon, :root:not([data-theme="dark"]) .icon-btn .i-sun  { display: none; }

@media (max-width: 1280px) {
  .nav-toggle { display: inline-grid; order: 9; }
  .nav {
    order: 10; flex-basis: 100%; display: none;
    border-top: 1px solid var(--rule); padding: .6rem 0 1rem;
    max-height: min(70vh, 34rem); overflow-y: auto;
  }
  .nav.is-open { display: block; }
  .masthead__bar { flex-wrap: wrap; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: .62rem .5rem; font-size: .95rem; }
  .nav .has-sub > a::after { float: right; margin-top: .5em; }
  .nav ul ul {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-left: 2px solid var(--rule); border-radius: 0;
    margin: 0 0 .3rem .55rem; padding: 0 0 0 .3rem; min-width: 0; max-width: none;
  }
  .nav ul ul a { font-size: .875rem; color: var(--ink-3); }
}

/* Keep the whole bar on one line on phones */
@media (max-width: 620px) {
  .masthead__bar { gap: .5rem; min-height: 3.65rem; }
  .brand__mark { font-size: 1.05rem; }
  .masthead__tools { gap: .25rem; }
  .icon-btn, .nav-toggle { width: 2.15rem; height: 2.15rem; border-radius: 7px; }
  .icon-btn svg, .nav-toggle svg { width: .95rem; height: .95rem; }
}
@media (max-width: 380px) {
  #fs-toggle { display: none; }
}

/* ---------- 5. Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--green); }
.hero__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2; opacity: .72;
  filter: saturate(.8) contrast(1.04);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(10,38,30,.18), rgba(9,32,26,.78) 80%),
    linear-gradient(180deg, rgba(12,42,34,.42), rgba(10,34,28,.88));
}
.hero__inner { padding-block: clamp(2.75rem, 8vw, 6rem); text-align: center; color: #f6f1e4; }
.hero__eyebrow {
  font-family: var(--ff-ui); font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-2); margin: 0 0 1.25rem;
}
/* Parchment plaque behind the besmele calligraphy. `multiply` dissolves the
   scan's white ground into the plaque whichever polarity the source has. */
.hero__plaque {
  display: block; width: min(430px, 82%); margin: 0 auto 1.75rem;
  padding: .9rem 1.4rem; border-radius: 10px;
  background: linear-gradient(180deg, #fbf6ea, #f0e7d3);
  border: 1px solid rgba(196,160,90,.55);
  box-shadow: 0 3px 10px rgba(0,0,0,.28), 0 18px 40px -16px rgba(0,0,0,.55);
}
.hero__besmele { width: 100%; mix-blend-mode: multiply; }
.hero h1 {
  font-family: var(--ff-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.08;
  font-size: clamp(2.1rem, 6.2vw, 3.75rem); margin: 0 0 .85rem; color: #fdfaf2;
  text-wrap: balance;
}
.hero__lede {
  max-width: 40rem; margin: 0 auto; font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  line-height: 1.65; color: #ded5c2;
}
.hero__rule {
  width: 4.5rem; height: 2px; margin: 1.7rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 2rem; }

/* Page header (interior) */
.pagehead { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--rule); }
.pagehead--img { background: var(--green); border-bottom: 0; }
.pagehead--img .pagehead__bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .48;
}
.pagehead--img::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(11,38,31,.62), rgba(10,32,26,.93));
}
.pagehead__inner { padding-block: clamp(2.1rem, 5vw, 3.4rem) clamp(2.1rem, 5vw, 3.6rem); max-width: 52rem; }
.pagehead--img .pagehead__inner { color: #f4efe2; }
.pagehead h1 {
  font-family: var(--ff-display); font-weight: 700; letter-spacing: -.018em; line-height: 1.12;
  font-size: clamp(1.75rem, 4.3vw, 2.85rem); margin: 0; text-wrap: balance;
}
.pagehead--img h1 { color: #fdfaf2; }
.pagehead__lede { margin: .9rem 0 0; color: var(--ink-2); font-size: 1.05rem; max-width: 42rem; }
.pagehead--img .pagehead__lede { color: #d8cfbd; }

/* Breadcrumb */
.crumbs {
  font-family: var(--ff-ui); font-size: .78rem; color: var(--ink-3);
  padding-block: .9rem 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
}
.pagehead--img .crumbs { color: #b6ac97; }
.crumbs a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--green-2); border-bottom-color: currentColor; }
.pagehead--img .crumbs a:hover { color: var(--gold-2); }
.crumbs span[aria-hidden] { opacity: .45; }

/* Post meta */
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem;
  font-family: var(--ff-ui); font-size: .8rem; color: var(--ink-3); margin-top: 1.15rem;
}
.pagehead--img .meta { color: #c3b9a4; }
.meta time { font-variant-numeric: tabular-nums; }
.meta .dot { opacity: .4; }

.chip {
  display: inline-block; font-family: var(--ff-ui); font-size: .72rem; font-weight: 500;
  letter-spacing: .02em; padding: .22rem .6rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  text-decoration: none; white-space: nowrap;
}
a.chip:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.pagehead--img .chip { background: rgba(255,255,255,.1); color: var(--gold-2); border-color: rgba(212,175,106,.35); }
.pagehead--img a.chip:hover { background: var(--gold-2); color: #1a1409; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-ui); font-size: .875rem; font-weight: 600; line-height: 1;
  padding: .78rem 1.25rem; border-radius: 8px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .14s var(--ease), background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold-2); color: #201803; border-color: var(--gold-2); }
.btn--primary:hover { background: #d8b877; border-color: #d8b877; box-shadow: 0 6px 20px -6px rgba(196,160,90,.6); }
.btn--ghost { background: rgba(255,255,255,.06); color: #f2ece0; border-color: rgba(255,255,255,.28); }
.btn--ghost:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }
.btn--outline { background: transparent; color: var(--green-2); border-color: color-mix(in srgb, var(--green-2) 35%, transparent); }
.btn--outline:hover { background: var(--green-soft); border-color: var(--green-2); }
.btn svg { width: 1rem; height: 1rem; flex: none; }

/* ---------- 7. Long-form prose ---------- */
.layout { display: grid; grid-template-columns: minmax(0,1fr); gap: clamp(2rem,5vw,3.5rem); padding-block: clamp(2.2rem,5vw,3.5rem) clamp(3rem,7vw,5rem); }
.layout--with-aside { grid-template-columns: minmax(0,1fr) 16.5rem; }
@media (max-width: 1000px) { .layout--with-aside { grid-template-columns: minmax(0,1fr); } }

.prose {
  max-width: var(--measure);
  font-size: var(--fs-read); line-height: var(--lh-read);
  color: #35302a;
}
:root[data-theme="dark"] .prose { color: #e4dccb; }
.prose > * + * { margin-top: 1.4em; }
.prose p { margin: 0; }
.prose a {
  color: var(--green-2); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 calc(100% - .06em);
  padding-bottom: .04em;
  transition: background-size .2s var(--ease), color .16s var(--ease);
}
.prose a:hover { color: var(--gold); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose em { font-style: italic; }

.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--ff-display); color: var(--ink); line-height: 1.24; letter-spacing: -.01em;
  font-weight: 600; margin-top: 2.5em; margin-bottom: .5em; text-wrap: balance; scroll-margin-top: 6rem;
}
.prose h2 { font-size: 1.52em; }
.prose h3 { font-size: 1.28em; }
.prose h4 { font-size: 1.12em; font-weight: 600; }
.prose h5 { font-size: 1.02em; font-weight: 600; }
.prose h6 {
  font-family: var(--ff-ui); font-size: .8em; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.prose h2 + *, .prose h3 + *, .prose h4 + *, .prose h5 + *, .prose h6 + * { margin-top: .7em; }

.prose ul, .prose ol { margin: 1.35em 0; padding-left: 1.35em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--gold); }
.prose ol { list-style: decimal; }
.prose ul { list-style: none; padding-left: 1.5em; }
.prose ul > li { position: relative; }
.prose ul > li::before {
  content: ""; position: absolute; left: -1.05em; top: .72em;
  width: .38em; height: .38em; border-radius: 50%; background: var(--gold-2);
}

.prose hr { border: 0; height: 1px; background: var(--rule); margin: 2.75em 0; }

.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); box-shadow: var(--shadow-1); margin-inline: auto; }
.prose figcaption {
  font-family: var(--ff-ui); font-size: .8rem; color: var(--ink-3);
  text-align: center; margin-top: .7rem; line-height: 1.5;
}
.prose img { border-radius: var(--radius); }

/* Ayet / hadith pull-quote — auto-detected from fully-bold paragraphs.
   Direction C: teal top rule, thin bottom rule, Inter semibold. */
.ayet {
  margin: 2.2em 0; padding: 1.05rem 0;
  border-top: 2px solid var(--green); border-bottom: 1px solid var(--rule);
  font-family: var(--ff-display); font-style: normal; font-weight: 600;
  font-size: 1.02em; line-height: 1.5; letter-spacing: -.006em; color: var(--ink);
}
:root[data-theme="dark"] .ayet { color: var(--ink); }
.ayet strong { font-weight: 600; font-style: normal; }
.ayet em { font-style: italic; }
.ayet p { margin: 0; }
.ayet p + p { margin-top: .55em; }
.ayet__src {
  display: block; margin-top: .75rem; font-family: var(--ff-ui); font-size: .72rem;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green-2); font-style: normal;
}
/* Emphasised passage that isn't a literal quotation — poems, salawât, key points */
.ayet--plain {
  border-top-color: var(--gold-2); font-family: var(--ff-body); font-style: normal; font-weight: 400;
  font-size: 1.02em; line-height: 1.7; color: var(--ink-2);
}
.ayet--plain strong { font-style: normal; font-weight: 600; color: var(--ink); }
.ayet--plain .ayet__src { color: var(--ink-3); }

/* PDF / download card */
.dl {
  display: flex; align-items: center; gap: .85rem;
  margin: .55rem 0; padding: .8rem 1rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none !important; background-image: none !important;
  color: var(--ink); box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.dl:hover { transform: translateY(-1px); border-color: var(--gold-2); box-shadow: var(--shadow-2); color: var(--ink); }
.dl__icon {
  flex: none; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 7px;
  background: var(--green-soft); color: var(--green-2);
}
.dl--pdf .dl__icon { background: color-mix(in srgb, #c0392b 12%, transparent); color: #c0392b; }
:root[data-theme="dark"] .dl--pdf .dl__icon { background: rgba(226,110,96,.14); color: #e26e60; }
.dl--ext .dl__icon { background: var(--gold-soft); color: var(--gold); }
.dl__icon svg { width: 1.15rem; height: 1.15rem; }
.dl__text { display: grid; gap: .1rem; min-width: 0; }
.dl__t { font-family: var(--ff-ui); font-size: .92rem; font-weight: 600; line-height: 1.35; }
.dl__s { font-family: var(--ff-ui); font-size: .7rem; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.dl__arrow { margin-left: auto; color: var(--ink-3); flex: none; padding-left: .5rem; }
.dl__arrow svg { width: 1rem; height: 1rem; transition: transform .18s var(--ease); }
.dl:hover .dl__arrow { color: var(--gold); }
.dl--page:hover .dl__arrow svg { transform: translateX(3px); }
.dl--pdf:hover .dl__arrow svg { transform: translateY(2px); }
.dl-group { margin: 1.6em 0; display: grid; gap: .55rem; }
.dl-group .dl { margin: 0; }

/* ---------- 8. Aside / TOC ---------- */
.aside { font-family: var(--ff-ui); align-self: start; position: sticky; top: 5.6rem; }
@media (max-width: 1000px) { .aside { position: static; } }
.aside__title {
  font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 .8rem; padding-bottom: .55rem; border-bottom: 1px solid var(--rule);
}
.toc { list-style: none; margin: 0; padding: 0; font-size: .84rem; line-height: 1.45; max-height: calc(100vh - 12rem); overflow-y: auto; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: .38rem 0 .38rem .8rem; color: var(--ink-2); text-decoration: none;
  border-left: 2px solid var(--rule);
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.toc a:hover { color: var(--ink); border-left-color: var(--rule-2); }
.toc a.is-active { color: var(--green-2); border-left-color: var(--green-2); font-weight: 600; }
.toc .lvl-3 a { padding-left: 1.5rem; font-size: .8rem; }
.aside__block + .aside__block { margin-top: 2rem; }
.aside__links { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.aside__links li + li { margin-top: .1rem; }
.aside__links a { display: block; padding: .4rem .5rem; margin-left: -.5rem; border-radius: 6px; color: var(--ink-2); text-decoration: none; }
.aside__links a:hover { background: var(--paper-3); color: var(--ink); }
.aside__links a[aria-current] { color: var(--green-2); font-weight: 600; background: var(--green-soft); }

/* ---------- 9. Cards & listings ---------- */
.section { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section--tint { background: var(--paper-2); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section__title { font-family: var(--ff-display); font-size: clamp(1.4rem, 3.2vw, 1.95rem); font-weight: 700; letter-spacing: -.015em; margin: 0; line-height: 1.15; }
.section__title small { display: block; font-family: var(--ff-ui); font-size: .74rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: .55rem; }
.section__more { font-family: var(--ff-ui); font-size: .85rem; font-weight: 600; color: var(--green-2); text-decoration: none; white-space: nowrap; }
.section__more:hover { color: var(--gold); }
.section__more::after { content: " \2192"; }

.grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  text-decoration: none; color: inherit; box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--rule-2); }
.card__media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--paper-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card__media img { transform: scale(1.045); }
.card__media--none { display: grid; place-items: center; background: linear-gradient(135deg, var(--green-soft), var(--gold-soft)); }
.card__media--none svg { width: 2.5rem; height: 2.5rem; color: var(--gold-2); opacity: .7; }
.card__body { padding: 1.05rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card__kicker { font-family: var(--ff-ui); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.card__title { font-family: var(--ff-display); font-size: 1.09rem; font-weight: 700; line-height: 1.28; letter-spacing: -.01em; margin: 0; color: var(--ink); text-wrap: balance; }
.card:hover .card__title { color: var(--green-2); }
.card__excerpt { font-size: .89rem; line-height: 1.62; color: var(--ink-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; padding-top: .5rem; display: flex; align-items: center; gap: .6rem; font-family: var(--ff-ui); font-size: .75rem; color: var(--ink-3); }

/* Tile — listing item that works with or without a thumbnail */
.tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); }
.tile {
  display: flex; gap: 1.05rem; align-items: flex-start;
  padding: 1.05rem 1.15rem; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--rule-2); }
.tile__thumb {
  flex: none; width: 5.25rem; height: 5.25rem; border-radius: 9px; overflow: hidden;
  background: var(--paper-3);
}
.tile__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.tile:hover .tile__thumb img { transform: scale(1.06); }
.tile__body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.tile__kicker { font-family: var(--ff-ui); font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tile__title {
  font-family: var(--ff-display); font-size: 1.04rem; font-weight: 700; line-height: 1.28;
  letter-spacing: -.008em; color: var(--ink); text-wrap: balance;
}
.tile:hover .tile__title { color: var(--green-2); }
.tile__excerpt {
  font-size: .875rem; line-height: 1.6; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile__foot { font-family: var(--ff-ui); font-size: .74rem; color: var(--ink-3); margin-top: .2rem; }
@media (max-width: 480px) { .tile__thumb { width: 4rem; height: 4rem; } }

/* Inline link to a video */
.prose a.video-link::after {
  content: "▶"; display: inline-block; margin-left: .4em; font-size: .7em;
  vertical-align: .1em; color: var(--gold);
}
.dl--video .dl__icon { background: color-mix(in srgb, #c0392b 12%, transparent); color: #c0392b; }
:root[data-theme="dark"] .dl--video .dl__icon { background: rgba(226,110,96,.14); color: #e26e60; }

/* Compact list rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.rows a {
  display: flex; align-items: baseline; gap: 1rem; padding: 1rem .35rem;
  text-decoration: none; color: inherit;
  transition: background .16s var(--ease), padding-left .16s var(--ease);
}
.rows a:hover { background: var(--paper-2); padding-left: .8rem; }
.rows__t { font-family: var(--ff-display); font-size: 1.02rem; font-weight: 600; line-height: 1.35; letter-spacing: -.008em; flex: 1; text-wrap: balance; }
.rows a:hover .rows__t { color: var(--green-2); }
.rows__d { font-family: var(--ff-ui); font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Book cards (Kitaplar) */
.books { display: grid; gap: clamp(1.75rem, 4vw, 3rem); }
.book {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: clamp(1.25rem, 3.5vw, 2.5rem);
  align-items: start; padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
}
@media (max-width: 720px) { .book { grid-template-columns: minmax(0,1fr); } .book__cover { max-width: 12rem; } }
.book__cover img { width: 100%; border-radius: 6px; box-shadow: 0 3px 8px rgba(35,32,26,.16), 0 16px 36px -12px rgba(35,32,26,.28); }
.book__title { font-family: var(--ff-display); font-size: clamp(1.2rem, 2.6vw, 1.5rem); font-weight: 700; line-height: 1.24; letter-spacing: -.015em; margin: 0 0 .9rem; text-wrap: balance; }
.book .prose { max-width: none; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1.75rem; }
.filters__label {
  font-family: var(--ff-ui); font-size: .68rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-left: .85rem; padding-right: .1rem;
}
.filters__label:first-of-type { margin-left: .5rem; }
.filter__n { font-variant-numeric: tabular-nums; opacity: .55; font-size: .92em; margin-left: .1em; }
.filter[aria-pressed="true"] .filter__n { opacity: .75; }
@media (max-width: 620px) { .filters__label { margin-left: 0; flex-basis: 100%; margin-top: .5rem; } }
.filter {
  font-family: var(--ff-ui); font-size: .8rem; font-weight: 500;
  padding: .42rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink-2);
  transition: all .16s var(--ease);
}
.filter:hover { border-color: var(--rule-2); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #f3efe4; font-weight: 600; }
:root[data-theme="dark"] .filter[aria-pressed="true"] { color: #10201b; background: var(--green-2); border-color: var(--green-2); }
.empty { font-family: var(--ff-ui); color: var(--ink-3); padding: 3rem 0; text-align: center; }

/* ---------- 10. Prev/next ---------- */
.pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.pager a {
  display: block; padding: 1rem 1.15rem; border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none; color: inherit; background: var(--card);
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.pager a:hover { border-color: var(--gold-2); transform: translateY(-2px); }
.pager__k { font-family: var(--ff-ui); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: .35rem; }
.pager__t { font-family: var(--ff-display); font-size: .98rem; font-weight: 600; line-height: 1.35; }
.pager .next { text-align: right; }

/* ---------- 11. Contact form ---------- */
.form { max-width: 34rem; display: grid; gap: 1.1rem; font-family: var(--ff-ui); }
.field { display: grid; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field .req { color: #c0392b; }
.field input, .field textarea {
  font-family: var(--ff-ui); font-size: .95rem; color: var(--ink);
  padding: .7rem .85rem; border: 1px solid var(--rule-2); border-radius: 8px;
  background: var(--card); width: 100%;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--green-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-2) 16%, transparent); }
.form__note { font-size: .8rem; color: var(--ink-3); line-height: 1.6; }

/* Formspree honeypot — off-screen rather than display:none, which some bots skip */
.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.field__err { margin: 0; font-size: .8rem; color: #c0392b; line-height: 1.5; }
:root[data-theme="dark"] .field__err { color: #e88a7d; }
.field input[aria-invalid], .field textarea[aria-invalid] {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px color-mix(in srgb, #c0392b 14%, transparent);
}

.form__status {
  margin: 0; padding: .85rem 1.05rem; border-radius: var(--radius);
  font-size: .9rem; line-height: 1.6; border: 1px solid transparent;
}
.form__status.is-ok {
  background: var(--green-soft); color: var(--green-2);
  border-color: color-mix(in srgb, var(--green-2) 30%, transparent); font-weight: 600;
}
.form__status.is-err {
  background: color-mix(in srgb, #c0392b 8%, transparent); color: #a5341f;
  border-color: color-mix(in srgb, #c0392b 26%, transparent);
}
:root[data-theme="dark"] .form__status.is-err { color: #e88a7d; background: rgba(192,57,43,.14); }
.form__status.is-busy { background: var(--paper-3); color: var(--ink-2); }
.form__note code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--paper-3); padding: .1em .35em; border-radius: 4px; }

/* ---------- 12. Search overlay ---------- */
.search-modal {
  position: fixed; inset: 0; z-index: 90; display: none;
  padding: clamp(1rem, 8vh, 6rem) var(--gutter) 2rem;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.search-modal.is-open { display: block; }
.search-panel {
  max-width: 42rem; margin-inline: auto; background: var(--paper);
  border: 1px solid var(--rule-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
  overflow: hidden; display: flex; flex-direction: column; max-height: min(76vh, 40rem);
}
.search-bar { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--rule); flex: none; }
.search-bar svg { width: 1.1rem; height: 1.1rem; color: var(--ink-3); flex: none; }
.search-bar input {
  flex: 1; border: 0; background: transparent; outline: 0;
  font-family: var(--ff-ui); font-size: 1.02rem; color: var(--ink);
}
.search-bar kbd {
  font-family: var(--ff-ui); font-size: .68rem; color: var(--ink-3);
  border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 5px; padding: .15rem .38rem;
}
.search-results { overflow-y: auto; padding: .45rem; }
.search-results a {
  display: block; padding: .7rem .85rem; border-radius: 8px; text-decoration: none; color: inherit;
}
.search-results a:hover, .search-results a.is-sel { background: var(--paper-3); }
.sr-t { font-family: var(--ff-display); font-size: .98rem; font-weight: 600; line-height: 1.3; margin-bottom: .2rem; }
.sr-x { font-family: var(--ff-ui); font-size: .8rem; color: var(--ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-x mark, .sr-t mark { background: var(--sel); color: inherit; border-radius: 2px; padding: 0 .1em; }
.sr-k { font-family: var(--ff-ui); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: .15rem; }
.search-empty { padding: 2.5rem 1rem; text-align: center; font-family: var(--ff-ui); font-size: .9rem; color: var(--ink-3); }

/* Reading controls popover */
.fs-pop {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 55;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-2); padding: .8rem; display: none; min-width: 13rem;
}
.fs-pop.is-open { display: block; }
.fs-pop__t { font-family: var(--ff-ui); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .55rem; }
.fs-row { display: flex; gap: .3rem; }
.fs-row button {
  flex: 1; border: 1px solid var(--rule); background: transparent; border-radius: 6px;
  padding: .4rem 0; cursor: pointer; font-family: var(--ff-display); color: var(--ink-2);
  transition: all .16s var(--ease);
}
.fs-row button:hover { background: var(--paper-3); }
.fs-row button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #f3efe4; }
:root[data-theme="dark"] .fs-row button[aria-pressed="true"] { background: var(--green-2); border-color: var(--green-2); color: #10201b; }
.masthead__tools { position: relative; display: flex; gap: .4rem; align-items: center; }

/* ---------- 13. Footer ---------- */
.footer { background: var(--paper-2); border-top: 1px solid var(--rule); font-family: var(--ff-ui); }
.footer__grid {
  display: grid; gap: 2.25rem; padding-block: clamp(2.75rem, 6vw, 4rem);
  grid-template-columns: minmax(0, 1.5fr) repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}
.footer__brand { font-family: var(--ff-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em; margin: 0 0 .6rem; }
.footer__blurb { font-size: .875rem; line-height: 1.68; color: var(--ink-2); margin: 0; max-width: 28rem; }
.footer h3 { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .85rem; }
.footer ul { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.footer li + li { margin-top: .5rem; }
.footer a { color: var(--ink-2); text-decoration: none; transition: color .16s var(--ease); }
.footer a:hover { color: var(--green-2); }
.footer__bar {
  border-top: 1px solid var(--rule); padding-block: 1.35rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; justify-content: space-between;
  font-size: .8rem; color: var(--ink-3);
}
.footer__bar p { margin: 0; }

/* ---------- 13b. Extras used by generated markup ---------- */

/* Author signature / source line at the end of an article */
.prose .sig {
  font-family: var(--ff-ui); font-size: .8rem; font-style: normal; letter-spacing: .02em;
  color: var(--ink-3); margin-top: 2.5em; padding-top: 1rem;
  border-top: 1px solid var(--rule); text-align: right;
}
.prose .sig strong { font-weight: 500; color: inherit; }

/* Inline PDF link inside body copy */
.prose a.pdf-link::after {
  content: "PDF"; display: inline-block; margin-left: .4em;
  font-family: var(--ff-ui); font-size: .62em; font-weight: 700; letter-spacing: .08em;
  vertical-align: .25em; padding: .12em .38em; border-radius: 3px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
}

/* Multi-image row (e.g. three book covers side by side) */
.prose figure.figrow {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  align-items: end;
}
.prose figure.figrow img { width: 100%; box-shadow: 0 3px 8px rgba(35,32,26,.14), 0 14px 30px -12px rgba(35,32,26,.26); }
.prose figure.figrow figcaption { grid-column: 1 / -1; }

/* Book cover strip on the homepage */
.bookstrip {
  display: grid; gap: clamp(.9rem, 2vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.25rem), 1fr));
  align-items: start;
}
.bookmini { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .7rem; }
/* The covers are a mix of portrait fronts and landscape front+back spreads, so
   contain them in a fixed frame rather than cropping to a common ratio. */
.bookmini img {
  width: 100%; aspect-ratio: 3/4; object-fit: contain; object-position: center bottom;
  border-radius: 4px;
  filter: drop-shadow(0 2px 5px rgba(35,32,26,.2)) drop-shadow(0 12px 24px rgba(35,32,26,.22));
  transition: transform .25s var(--ease);
}
.bookmini:hover img { transform: translateY(-4px) scale(1.02); }
.bookmini span {
  font-family: var(--ff-ui); font-size: .8rem; font-weight: 500; line-height: 1.4;
  color: var(--ink-2); text-wrap: balance; min-height: 2.8em;
}
.bookmini:hover span { color: var(--green-2); }

/* ---------- 14. Utilities ---------- */
.lead { font-size: 1.1em; line-height: 1.72; color: var(--ink-2); }
.center { text-align: center; }
.stack-sm > * + * { margin-top: .6rem; }
/* Article print/toolbar button (top of the reading column) */
.doctools { display: flex; justify-content: flex-end; margin-bottom: 1.5rem; }
.printbtn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--ff-ui); font-size: .82rem; font-weight: 600; line-height: 1;
  color: var(--green-2); background: none; border: 1px solid var(--rule-2);
  border-radius: 999px; padding: .5rem 1rem; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.printbtn:hover { background: var(--green); color: #fff; border-color: var(--green); }
:root[data-theme="dark"] .printbtn:hover { color: #10201b; }
.printbtn svg { width: .95rem; height: .95rem; }

/* ---------- Print ---------- */
@media print {
  :root { --fs-read: 11.5pt; --lh-read: 1.5; }
  .masthead, .footer, .aside, .pager, #progress, .search-modal, .hero__cta,
  .doctools, .crumbs, .fs-pop, .nav, .meta .chip, .pager { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 11.5pt; }
  .pagehead, .pagehead--img { background: none !important; border: 0 !important; }
  .pagehead--img::after, .pagehead__bg { display: none !important; }
  .pagehead__inner { padding: 0 !important; color: #000 !important; }
  .pagehead h1 { color: #000 !important; font-size: 22pt; margin: 0 0 .3rem; }
  .meta { color: #333 !important; }
  .shell, .layout, .layout--with-aside { display: block !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .prose { max-width: 100% !important; color: #000 !important; font-size: 11.5pt !important; }
  .prose a { color: #000 !important; background: none !important; text-decoration: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #555; word-break: break-all; }
  .prose .ayet { color: #1a1a1a !important; border-left: 2pt solid #999 !important; break-inside: avoid; }
  .prose .ayet__src { color: #444 !important; }
  .prose h2, .prose h3, .prose h4 { color: #000 !important; break-after: avoid; }
  .prose img { max-width: 100% !important; }
  .dl { border: 1px solid #bbb !important; box-shadow: none !important; break-inside: avoid; }
  /* Masthead brand as a small dateline at the top of the printed page */
  #main::before { content: "arikkan.info · Ömer Reha Arıkkan"; display: block;
    font-family: var(--ff-ui); font-size: 8.5pt; color: #666; letter-spacing: .04em;
    text-transform: uppercase; margin-bottom: 1.2rem; padding-bottom: .5rem; border-bottom: 1px solid #ccc; }
  /* crumbs carries .shell too, so hide it with tag+class to beat .shell{display:block} */
  nav.crumbs { display: none !important; }
  @page { margin: 1.8cm 1.6cm; }
}
