/* ============================================================================
   Eisaal — public site stylesheet
   Sanctuary design system, Everyday · Light only.
   Tokens mirror lib/modules/theme/presentation/colors/sanctuary_colors.dart
   and typography/app_fonts.dart (see docs/design handoff token tables).
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-gradient: linear-gradient(135deg, #FBF8F3 0%, #F5F3EF 100%);
  --bg: #FBF8F3;
  --elevated: rgba(255, 255, 255, 0.86);
  --raised: rgba(255, 255, 255, 0.62);
  --floating: rgba(255, 255, 255, 0.95);

  /* Text */
  --on-surface: #2C2C2C;
  --secondary: #6B6258;
  --tertiary: rgba(44, 44, 44, 0.50);

  /* Brand */
  --primary: #C49A2A;        /* primaryBrand — never for body text */
  --primary-text: #8B7420;   /* primaryText — WCAG-safe gold */
  --accent: #005C4B;         /* Hussaini green */
  --gold: #C5A059;           /* zareehGold — rims only */
  --error: #B00020;

  /* Neutral roles */
  --icon-neutral: #5A5048;
  --icon-container: rgba(44, 44, 44, 0.06);
  --hairline: rgba(196, 154, 42, 0.10);
  --thread: rgba(196, 154, 42, 0.35);
  --gold-subtle: rgba(196, 154, 42, 0.10);

  /* Depth */
  --edge-elevated: inset 1.5px 1.5px 0 rgba(197, 160, 89, 0.35), inset -1px -1px 0 rgba(197, 160, 89, 0.12);
  --edge-raised: inset 1px 1px 0 rgba(197, 160, 89, 0.12);
  --shadow-elevated: 0 6px 18px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.03);
  --shadow-standard: 0 3px 10px rgba(0, 0, 0, 0.03);
  --shadow-floating: 0 8px 24px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Shape & rhythm */
  --r-card: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-full: 999px;
  --s-xs: 4px; --s-sm: 8px; --s-md: 12px; --s-lg: 16px; --s-xl: 20px;
  --s-xxl: 24px; --s-xxxl: 32px; --s-xxxxl: 40px; --s-hero: 48px;

  /* Type */
  --f-display: "Cinzel", "Times New Roman", serif;
  --f-title: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-arabic: "Noto Naskh Arabic", "Scheherazade New", serif;
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient) fixed;
  color: var(--on-surface);
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.7;
  font-feature-settings: "tnum" 1;
  position: relative;
}
/* Geometry texture at 6% multiply — same as SanctuaryScaffold everyday */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: url("assets/textures/geometry_seamless.jpg") center / 320px 320px repeat;
  opacity: 0.06;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 var(--s-xl); }

a { color: var(--primary-text); }
a.link {
  color: var(--primary-text);
  text-decoration: none;
  border-bottom: 1px solid var(--thread);
  transition: border-color 150ms cubic-bezier(.33,1,.68,1);
}
a.link:hover { border-bottom-color: var(--primary-text); }

/* ---------- Header --------------------------------------------------------- */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: var(--floating);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: var(--shadow-standard);
}
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-lg); padding: var(--s-md) 0; }
.brand {
  display: inline-flex; align-items: center; gap: var(--s-smMd, 10px);
  margin-right: auto; text-decoration: none; color: var(--on-surface);
  font-family: var(--f-display); font-weight: 600; font-size: 17px; letter-spacing: 0.12em;
}
.brand img {
  width: 34px; height: 34px; border-radius: 9px;
  box-shadow: var(--shadow-standard), 0 0 0 1px var(--hairline);
}
.brand span { color: var(--primary-text); }
nav.primary { display: flex; flex-wrap: wrap; gap: var(--s-xs); }
nav.primary a {
  color: var(--secondary); text-decoration: none; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em;
  padding: 6px 12px; border-radius: var(--r-full);
  transition: background 150ms cubic-bezier(.33,1,.68,1), color 150ms cubic-bezier(.33,1,.68,1);
}
nav.primary a:hover { color: var(--on-surface); background: var(--icon-container); }
nav.primary a.active { color: var(--primary-text); background: var(--gold-subtle); }

/* ---------- Typography ----------------------------------------------------- */
main.wrap { padding-top: var(--s-hero); padding-bottom: var(--s-sm); }
h1 {
  font-family: var(--f-title); font-weight: 600;
  font-size: 34px; line-height: 1.2; letter-spacing: 0.01em;
  margin: 0 0 var(--s-sm);
}
h2 {
  font-family: var(--f-title); font-weight: 600;
  font-size: 22px; line-height: 1.3;
  margin: var(--s-xxxxl) 0 var(--s-md); padding-top: var(--s-sm);
  scroll-margin-top: 84px;
}
h3 { font-family: var(--f-body); font-weight: 600; font-size: 16.5px; margin: var(--s-xxl) 0 var(--s-sm); }
p, li { color: var(--on-surface); }
.lede { font-size: 18.5px; line-height: 1.6; color: var(--secondary); margin: 0 0 var(--s-xxl); }
.meta { color: var(--tertiary); font-size: 14px; margin: 0 0 var(--s-xs); }
.fine { font-size: 13.5px; color: var(--secondary); margin-top: var(--s-md); }
strong { font-weight: 600; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
code { background: var(--icon-container); padding: 1px 6px; border-radius: 6px; }
pre {
  background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: var(--s-md) var(--s-lg); overflow-x: auto; line-height: 1.5;
}
pre code { background: none; padding: 0; }
ul { padding-left: 22px; } ol { padding-left: 22px; } li { margin: 6px 0; }

/* Eyebrow — Cinzel section header (AppFonts.sectionHeaderStyle) */
.eyebrow {
  font-family: var(--f-display); font-weight: 600; font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--primary-text);
  margin: 0 0 var(--s-sm);
}

/* Ornament rule — thread gradient with ۞ (replaces the old gold bar) */
hr.rule {
  border: 0; height: 1px; margin: var(--s-xxl) 0 var(--s-xxxl); position: relative; overflow: visible;
  background: linear-gradient(90deg, var(--thread), transparent 70%);
}
hr.rule::after {
  content: "\06DE"; /* ۞ */
  position: absolute; left: 0; top: 50%; transform: translateY(-52%);
  font-size: 12px; line-height: 1; color: var(--thread);
  background: var(--bg); padding-right: 6px;
}

/* ---------- Surfaces ------------------------------------------------------- */
.card {
  background: var(--elevated);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-elevated), var(--edge-elevated);
  padding: var(--s-xl) 22px;
  margin: var(--s-xl) 0;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-lg); margin: var(--s-xl) 0; }
.grid .card { margin: 0; }
.grid .card p { color: var(--secondary); font-size: 14.5px; }

/* Raised note with a 2px brand rule (the occasion-banner shape) */
.callout {
  background: var(--raised);
  border-left: 2px solid var(--primary);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-standard), var(--edge-raised);
  padding: var(--s-lg) var(--s-xl);
  margin: var(--s-xl) 0;
}
.callout p { margin: 6px 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* Tables */
.tablewrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--s-lg) 0;
  background: var(--elevated); border-radius: var(--r-card);
  box-shadow: var(--shadow-elevated), var(--edge-elevated);
}
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th {
  font-family: var(--f-display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-text);
  background: var(--gold-subtle); white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }

/* Table of contents */
.toc { font-size: 15px; }
.toc a { color: var(--secondary); text-decoration: none; }
.toc a:hover { color: var(--primary-text); }

/* Numbered steps — ring-outline badges */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps li { position: relative; padding-left: 42px; margin: var(--s-lg) 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--primary); color: var(--primary-text);
  font-family: var(--f-display); font-weight: 600; font-size: 13px; line-height: 25px; text-align: center;
}
.path { font-weight: 500; color: var(--on-surface); }

/* FAQ accordions */
details {
  background: var(--elevated); border-radius: var(--r-card);
  box-shadow: var(--shadow-standard), var(--edge-raised);
  padding: 2px var(--s-xl); margin: var(--s-md) 0;
  transition: box-shadow 150ms cubic-bezier(.33,1,.68,1);
}
details[open] { box-shadow: var(--shadow-elevated), var(--edge-elevated); }
summary {
  cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 16px;
  list-style: none; display: flex; gap: var(--s-md); align-items: flex-start;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+"; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--thread); color: var(--primary-text);
  font-weight: 500; font-size: 15px; line-height: 19px; text-align: center; margin-top: 2px;
}
details[open] summary::before { content: "\2212"; border-color: var(--primary); }
details .body { padding: 0 0 var(--s-lg) 34px; }
details .body p:first-child { margin-top: 0; }

/* Store badges */
.badges { display: flex; flex-wrap: wrap; gap: var(--s-md); margin: var(--s-xxl) 0 var(--s-sm); }
.badge {
  display: flex; align-items: center; gap: var(--s-md); min-width: 220px;
  background: var(--elevated); border-radius: var(--r-md);
  box-shadow: var(--shadow-standard), var(--edge-raised);
  padding: var(--s-md) var(--s-lg); color: var(--on-surface); text-decoration: none; font-size: 14px;
  transition: transform 150ms cubic-bezier(.33,1,.68,1), box-shadow 150ms;
}
.badge:hover { transform: scale(0.98); box-shadow: var(--shadow-elevated), var(--edge-elevated); }
.badge strong { display: block; font-size: 15px; }
.badge em { font-style: normal; color: var(--secondary); font-size: 12.5px; }
.badge svg { width: 22px; height: 22px; color: var(--icon-neutral); flex: 0 0 auto; }

/* Placeholder marker — intentionally loud until filled */
.ph {
  background: var(--gold-subtle); border-bottom: 1px dashed var(--primary);
  padding: 0 3px; border-radius: 2px; font-size: 0.95em;
}

/* ---------- Home hero (the page's single Tier-1 surface) ------------------ */
.hero {
  position: relative; overflow: hidden;
  background: var(--elevated); border-radius: var(--r-card);
  box-shadow: var(--shadow-elevated), var(--edge-elevated);
  padding: var(--s-xxxl) var(--s-xxxl) var(--s-xxl);
  margin: 0 0 var(--s-xxxl);
}
.hero .eyebrow { margin-bottom: var(--s-md); }
.hero h1 { font-size: 40px; margin-bottom: var(--s-md); }
.hero .lede { margin-bottom: 0; max-width: 34em; }
.hero .watermark {
  position: absolute; right: 12px; bottom: -14px; width: 150px; height: 150px;
  opacity: 0.045; color: var(--primary); pointer-events: none;
}
.hero .watermark svg { width: 100%; height: 100%; }
.hero-icon {
  width: 64px; height: 64px; border-radius: 16px; display: block; margin-bottom: var(--s-xl);
  box-shadow: var(--shadow-standard), 0 0 0 1px var(--hairline);
}

/* Feature rows — Tier-2 card with 20px neutral icons */
.features { padding: var(--s-sm) 22px; }
.feature { display: flex; gap: var(--s-lg); align-items: flex-start; padding: var(--s-lg) 0; border-bottom: 1px solid var(--hairline); }
.feature:last-child { border-bottom: 0; }
.feature .icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--icon-container); color: var(--icon-neutral);
  display: grid; place-items: center;
}
.feature .icon svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 2px; font-size: 15.5px; }
.feature p { margin: 0; color: var(--secondary); font-size: 14.5px; }

/* ---------- Footer --------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--hairline); margin-top: var(--s-hero); padding: var(--s-xxl) 0 var(--s-hero);
  color: var(--secondary); font-size: 14px;
}
footer.site nav { display: flex; flex-wrap: wrap; gap: var(--s-xs) var(--s-lg); }
footer.site a { color: var(--secondary); text-decoration: none; }
footer.site a:hover { color: var(--primary-text); }

/* ---------- Responsive ----------------------------------------------------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  main.wrap { padding-top: var(--s-xxxl); }
  h1 { font-size: 28px; }
  .hero { padding: var(--s-xxl) var(--s-xl) var(--s-xl); }
  .hero h1 { font-size: 30px; }
  .hero .watermark { width: 110px; height: 110px; }
  .bar { padding: 10px 0; }
  nav.primary a { font-size: 13px; padding: 5px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
