/* ==========================================================================
   Gujarati Samaj New Zealand — Base styles & design tokens
   --------------------------------------------------------------------------
   All colours are derived from the official logo (logo.jpg, project root).
   See DESIGN_SYSTEM.md for the full rationale and contrast measurements.
   ========================================================================== */

:root {
  /* ---- Brand colours (sampled from logo.jpg) ---------------------------- */
  --color-primary: #F78632;          /* Logo orange — Gujarat map & wordmark */
  --color-primary-strong: #BA5307;   /* Accessible orange for buttons/text (4.85:1 on white) */
  --color-primary-deep: #8F4006;     /* Hover/pressed state */
  --color-primary-soft: #FEF1E6;     /* Tinted backgrounds */

  --color-secondary: #07A2D8;        /* Logo sky blue — outer ring */
  --color-secondary-strong: #05698C; /* Accessible blue for links (6.17:1 on white) */
  --color-secondary-deep: #04516C;   /* Link hover */
  --color-secondary-soft: #E7F6FC;   /* Tinted backgrounds */

  --color-accent: #3A3A3A;           /* Logo charcoal — tagline & ring dots */
  --color-accent-deep: #2B2B2B;      /* Footer base strip, headings */

  /* ---- Neutrals ---------------------------------------------------------- */
  --color-background: #FFFFFF;
  --color-surface: #FBF8F4;          /* Warm off-white section background */
  --color-surface-alt: #F4EFE8;      /* Placeholders, subtle fills */
  --color-text: #3A3A3A;             /* Body text (11.37:1 on white) */
  --color-heading: #2B2B2B;          /* Headings (14.16:1 on white) */
  --color-muted: #5F6368;            /* Secondary text (6.05:1 on white) */
  --color-border: #E7E1D9;
  --color-border-strong: #D6CEC3;
  --color-on-dark: #F5F5F5;          /* Text on charcoal */
  --color-on-dark-muted: #C9C9C9;    /* Secondary text on charcoal (≥6:1) */
  --color-white: #FFFFFF;

  /* ---- Typography -------------------------------------------------------- */
  --font-heading: "Oswald", "Arial Narrow", "Noto Sans Gujarati", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", "Noto Sans Gujarati", system-ui, sans-serif;

  --text-xs: 0.8125rem;   /* 13px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-md: 1.125rem;    /* 18px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: clamp(1.75rem, 1.45rem + 1.1vw, 2.375rem);  /* 28 → 38px */
  --text-3xl: clamp(2.125rem, 1.6rem + 2vw, 3.25rem);     /* 34 → 52px */

  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heading: 500;
  --weight-heading-strong: 600;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-body: 1.65;
  --tracking-caps: 0.08em;

  /* ---- Layout ------------------------------------------------------------ */
  --container-width: 1200px;
  --container-narrow: 760px;
  --gutter: 24px;

  /* ---- Spacing (4px base) ------------------------------------------------ */
  --space-1: 0.25rem;   /*  4px */
  --space-2: 0.5rem;    /*  8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --section-space: clamp(3.5rem, 2.5rem + 4vw, 6rem);

  /* ---- Shape & elevation ------------------------------------------------- */
  --radius-sm: 8px;
  --border-radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(43, 43, 43, 0.06), 0 1px 3px rgba(43, 43, 43, 0.05);
  --shadow-md: 0 10px 30px rgba(43, 43, 43, 0.09);

  /* ---- Header ------------------------------------------------------------ */
  --topbar-height: 40px;
  --header-height: 84px;
  --logo-height: 64px;

  /* ---- Motion ------------------------------------------------------------ */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-fast: 150ms;
  --duration: 250ms;

  --z-header: 100;
  --z-dropdown: 110;
  --z-overlay: 1000;
}

/* ---- Reset --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul[class],
ol[class] {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  line-height: var(--leading-tight);
  letter-spacing: 0.005em;
  color: var(--color-heading);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); line-height: var(--leading-snug); }

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-secondary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease);
}

a:hover {
  color: var(--color-secondary-deep);
}

strong {
  font-weight: var(--weight-bold);
}

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-heading);
}

/* ---- Layout primitives --------------------------------------------------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--container-width));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - (var(--gutter) * 2), var(--container-narrow));
}

.section {
  padding-block: var(--section-space);
}

.section--surface {
  background-color: var(--color-surface);
}

.section--tight {
  padding-block: calc(var(--section-space) * 0.6);
}

.section-header {
  max-width: 680px;
  margin-bottom: var(--space-10);
}

.section-header--center {
  margin-inline: auto;
  text-align: center;
}

.section-title {
  margin-bottom: var(--space-3);
}

.section-intro {
  font-size: var(--text-md);
  color: var(--color-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-primary-strong);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--color-primary);
}

.lead {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-muted);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ---- Utilities ----------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  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;
  top: var(--space-2);
  left: var(--space-2);
  z-index: calc(var(--z-overlay) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent-deep);
  color: var(--color-white);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--color-white);
}

main:focus {
  outline: none;
}

/* Reserve header/footer space before layout.js renders them (reduces layout shift) */
[data-layout="header"] {
  min-height: calc(var(--topbar-height) + var(--header-height));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
