/* ==========================================================================
   base.css — brand tokens, surfaces, reset, typography for Al Hasaniyyah Malang Raya
   Colours and fonts come from the organisation: its brand guideline, or derived
   from its logo + description. A layout reference contributes no colour or font.
   Colour literals live ONLY in the five --c-* tokens below; everything else uses
   var() or color-mix() of them.  Check: python3 tools/palette.py lint <this css folder>
   ========================================================================== */

:root {
  /* Brand palette: 3 hues + 2 neutrals. BRAND: replace these neutral boilerplate defaults
     with the organisation's colours; `palette.py lint` fails while any hue is still a default. */
  --c-primary: #4a6420;   /* BRAND identity: Green Dome in the logo */
  --c-secondary: #dfc06e; /* BRAND supporting: minaret gold in the logo */
  --c-accent: #184c4a;    /* BRAND highlight: the logo's stars (buttons, links, focus) */
  --c-paper: #eff2da;     /* BRAND light neutral: olive-cream tint of primary + secondary */
  --c-ink: #1a2310;       /* BRAND dark neutral: primary at L 10% */

  /* Text colour on each brand colour: paper or ink, whichever `palette.py contrast` passes. */
  --on-primary: var(--c-paper);
  --on-secondary: var(--c-ink);
  --on-accent: var(--c-paper);

  /* Type: BRAND fonts (never a layout reference's fonts). Load them with ALHM_FONTS_URL in functions.php. */
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-arabic: "Amiri", "Times New Roman", serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --fs-2xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
  --fs-3xl: clamp(2.25rem, 1.4rem + 3.4vw, 4.25rem);
  --fs-hero: clamp(2.75rem, 1.6rem + 5vw, 6rem);

  /* Space & shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --radius: 1.5rem;
  --radius-sm: 0.375rem;

  /* Layout */
  --container: 76rem;
  --gutter: 1.25rem;
  --header-h: 4.5rem;
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

/* Surfaces: the only four section backgrounds. Accent is never a surface.
   Components read --bg/--fg/--muted/--line/--link/--btn-bg/--btn-fg/--focus.
   BRAND: `palette.py contrast` lists the surfaces where accent buttons pass (≥ 3:1);
   on the others, buttons, links and focus use the surface's text colour instead. */
.surface-paper {
  --bg: var(--c-paper); --fg: var(--c-ink);
  --muted: color-mix(in srgb, var(--c-ink) 68%, var(--c-paper));
  --line: color-mix(in srgb, var(--c-ink) 16%, var(--c-paper));
  --link: var(--c-accent); --btn-bg: var(--c-accent); --btn-fg: var(--on-accent); --focus: var(--c-accent);
}
.surface-primary {
  --bg: var(--c-primary); --fg: var(--on-primary);
  --muted: color-mix(in srgb, var(--on-primary) 78%, var(--c-primary));
  --line: color-mix(in srgb, var(--on-primary) 22%, var(--c-primary));
  --link: var(--on-primary); --btn-bg: var(--on-primary); --btn-fg: var(--c-primary); --focus: var(--on-primary);
}
.surface-secondary {
  --bg: var(--c-secondary); --fg: var(--on-secondary);
  --muted: color-mix(in srgb, var(--on-secondary) 78%, var(--c-secondary));
  --line: color-mix(in srgb, var(--on-secondary) 22%, var(--c-secondary));
  --link: var(--on-secondary); --btn-bg: var(--c-accent); --btn-fg: var(--on-accent); --focus: var(--c-accent);
}
.surface-ink {
  --bg: var(--c-ink); --fg: var(--c-paper);
  --muted: color-mix(in srgb, var(--c-paper) 72%, var(--c-ink));
  --line: color-mix(in srgb, var(--c-paper) 18%, var(--c-ink));
  --link: var(--c-paper); --btn-bg: var(--c-paper); --btn-fg: var(--c-ink); --focus: var(--c-paper);
}
[class*="surface-"] { background: var(--bg); color: var(--fg); }

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--space-4)); }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
}
img, picture, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4, h5, h6, li { overflow-wrap: break-word; }
ul[class], ol[class], nav ul, nav ol { list-style: none; padding: 0; }
a { color: inherit; text-underline-offset: 0.18em; }

/* Typography ------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; letter-spacing: -0.01em; }
h1 em, h2 em, h3 em { font-style: italic; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
.lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--muted); max-width: 60ch; }

/* Long-form content (WordPress the_content() lands here) */
.prose { font-size: 1.0625rem; line-height: 1.75; max-width: 68ch; }
.prose > * + * { margin-top: var(--space-6); }
.prose h2 { margin-top: var(--space-12); }
.prose ul, .prose ol { padding-left: var(--space-6); }
.prose a { color: var(--link); font-weight: 600; }
.prose blockquote { border-left: 4px solid var(--focus, var(--c-accent)); padding-left: var(--space-6); font-size: var(--fs-xl); }

/* Accessibility ---------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--focus, var(--c-accent)); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100%; z-index: 100;
  padding: var(--space-2) var(--space-4); background: var(--c-ink); color: var(--c-paper);
  border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: var(--space-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
