/* Isnad Press: the shared style. "The question put to him" (Abu Aaliyah, 2026-10-13):
   one family, Alegreya Sans asks and Alegreya answers; cool white, ink and one stamp
   blue that fills the question panel and every buy button; a 12-column grid with square
   edges and 1px rules. Plan: docs/superpowers/plans/2026-10-13-question-direction.md.
   Bump ?v= wherever this file is linked when it changes. */

@font-face { font-family: "Alegreya"; src: url("/fonts/Alegreya-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/Alegreya-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/AlegreyaSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/AlegreyaSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/fonts/AlegreyaSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Amiri page"; src: url("/fonts/Amiri-page.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: light dark;
  --ground: #f6f7f5;
  --ink: #14161a;
  --soft: #575d66;
  --rule: #d9dbd8;
  --link: #2338a0;
  --accent: #2338a0;          /* stamp blue: the question panel and every buy button */
  --on-accent: #ffffff;
  --on-accent-soft: #dfe4fa;
  --focus: #2338a0;
  --serif: "Alegreya", "Amiri page", Georgia, serif;
  --sans: "Alegreya Sans", "Amiri page", system-ui, sans-serif;
  --arabic: "Amiri page", "Amiri", serif;
  --gutter: 20px;
  --max: 1296px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #121417;
    --ink: #e8e9eb;
    --soft: #a3a8b0;
    --rule: #2b2f36;
    --link: #9aabff;
    --accent: #3f5bcf;
    --focus: #9aabff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.55 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, blockquote, ol, ul, dl { margin: 0; }
p { hyphens: auto; text-wrap: pretty; }
h1, h2, h3, summary { text-wrap: balance; hyphens: manual; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.2em; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.nb { white-space: nowrap; }
.sans { font-family: var(--sans); }
.arabic { font-family: var(--arabic); direction: rtl; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: var(--gutter); top: -120px; z-index: 3; padding: 12px 16px; background: var(--accent); color: var(--on-accent); font-family: var(--sans); }
.skip-link:focus { top: 12px; }

/* The header: the imprint, the catalogue, and on the book page the buy link. */
.site-header {
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter); border-bottom: 1px solid var(--rule); font-family: var(--sans);
}
.imprint { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; padding: 12px 0; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 12px 0; }
.site-nav .buy-bar { color: var(--on-accent); }

/* The question panel: the one place colour owns a region. */
.ask { background: var(--accent); color: var(--on-accent); font-family: var(--sans); font-weight: 700; }
.ask a { color: var(--on-accent); }

/* The buy control: one wording, the shop line beneath. */
.purchase-control {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60px; padding: 10px 20px; border-radius: 0;
  background: var(--accent); color: var(--on-accent); text-decoration: none; text-align: center;
  font: 700 18px/1.15 var(--sans);
  transition: transform 160ms var(--ease-out);
}
.purchase-control:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .purchase-control:hover { background: color-mix(in srgb, var(--accent) 86%, black); }
}
.purchase-control[aria-disabled] { opacity: 0.55; cursor: default; pointer-events: none; }
.buy-shop { margin-top: 2px; font-weight: 500; font-size: 0.78em; color: var(--on-accent-soft); }

/* Phones: the buy bar slides up only while no other buy control is on screen. */
.buy-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2; min-height: 56px;
  box-shadow: 0 10px 28px rgb(20 22 26 / 0.3);
  transform: translateY(calc(100% + 24px)); visibility: hidden;
  transition: transform 280ms var(--ease-out), visibility 0s linear 280ms;
}
.buy-bar.is-selling { transform: none; visibility: visible; transition: transform 280ms var(--ease-out); }

body > footer { padding: 32px var(--gutter) 96px; border-top: 1px solid var(--rule); font: 400 15px/1.5 var(--sans); color: var(--soft); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: center; }
.footer-inner a { color: var(--soft); padding: 6px 0; }
.legal { margin-top: 12px; font-size: 14px; }

@media (min-width: 900px) {
  :root { --gutter: 72px; }
  body { font-size: 21px; }
  .site-header { height: 64px; }
  .imprint { font-size: 21px; }
  .site-nav { gap: 36px; font-size: 18px; }
  .purchase-control { min-height: 64px; padding: 12px 28px; font-size: 21px; }
  .buy-bar {
    position: static; transform: none; visibility: visible; transition: none; box-shadow: none;
    flex-direction: row; gap: 6px; min-height: 0; padding: 12px 0;
    background: none; color: var(--link); font-size: 18px;
  }
  .site-nav .buy-bar { color: var(--link); }
  .site-nav .buy-bar:hover { background: none; text-decoration: underline; text-underline-offset: 4px; }
  .buy-bar .buy-shop { margin: 0; font-size: 18px; font-weight: 400; color: var(--soft); }
  .buy-bar:active { transform: none; }
  body > footer { padding-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .purchase-control, .buy-bar, .buy-bar.is-selling { transition: none; }
  .purchase-control:active { transform: none; }
}
