/* ==========================================================================
   base.css — brand tokens, surfaces, reset, typography for Masjid Ibnu Khaldun
   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: #2d1a76;   /* BRAND identity indigo, formulir C (logo colour 1) */
  --c-secondary: #0994db; /* BRAND sky blue, formulir C (logo colour 2) */
  --c-accent: #066fa3;    /* BRAND sky blue darkened for text: links, focus (5.08 on paper) */
  --c-paper: #f6f5fb;     /* BRAND light neutral, tint of primary */
  --c-ink: #150d3d;       /* BRAND dark neutral, shade of primary */

  /* 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);
  --c-surface: color-mix(in srgb, var(--c-paper) 30%, white); /* cards, forms */
  --on-dark: #ffffff;
  --c-field-border: color-mix(in srgb, var(--c-ink) 50%, var(--c-paper)); /* input boundary, ≥ 3:1 on paper and surface */

  /* Type: BRAND fonts (never a layout reference's fonts). Load them with MIK_FONTS_URL in functions.php. */
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-arabic: "Noto Naskh Arabic", serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem; /* 17px body, layout.md */
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --fs-2xl: clamp(1.9375rem, 1.45rem + 1.6vw, 3rem); /* H2 31 → 48 */
  --fs-3xl: clamp(2.375rem, 1.5rem + 3.6vw, 4.25rem); /* H1 38 → 68 */
  --fs-hero: clamp(2.75rem, 1.6rem + 5vw, 6rem);

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* strong ease-out: entrances, reveals */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* on-screen movement */

  /* 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: 1rem;
  --radius-sm: 0.375rem;

  /* Layout */
  --container: 79.5rem; /* 1272px */
  --gutter: clamp(1.25rem, 4vw + 0.5rem, 4rem); /* ~23px phone, ~39px tablet, ~59px at 1280, 64px max */
  --header-h: 5.5rem; /* 1.25rem inset + 4.25rem floating bar */
}



/* 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-primary); --btn-fg: var(--on-primary); --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-primary); --btn-fg: var(--on-primary); --focus: var(--c-ink);
}
.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;
  -moz-osx-font-smoothing: grayscale;
}
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; text-decoration-thickness: from-font; }

/* Typography ------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h1 { line-height: 1.06; font-weight: 800; }
h3, h4 { letter-spacing: -0.01em; } /* below 24px: lighter tracking */
p { text-wrap: pretty; }
.ar { font-family: var(--font-arabic); font-weight: 500; }
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-inline-start: var(--space-6); }
.prose a { color: var(--link); font-weight: 600; }
.prose blockquote { border-inline-start: 4px solid var(--focus, var(--c-accent)); padding-inline-start: 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; inset-inline-start: 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: 600;
}
.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; }
}
