/*
 * Design tokens. Components use only these variables, never raw hex values. Light mode only for now.
 * Contrast ratios for every documented pairing are computed live on /stil-rehberi.
 * The comment after each colour is shown on the style guide; keep the "--color-name: #hex; /* usage *\/" format.
 */

/*
 * Hanken Grotesk (SIL Open Font License: wwwroot/fonts/hanken-grotesk/OFL.txt), self-hosted: one variable file with
 * weights 400-600, Latin plus Turkish, preloaded by the layouts. The fallback is Arial scaled to Hanken's width and
 * line metrics, so text does not jump when the font arrives.
 */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk/HankenGrotesk-Variable.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk Fallback";
  src: local("Arial");
  size-adjust: 101.98%;
  ascent-override: 98.06%;
  descent-override: 29.71%;
  line-gap-override: 0%;
}

:root {
  /* Brand colours, from the Söz Gençte logo. */
  --color-ink:        #002C33; /* logo wordmark: headings, footer background, primary text accents */
  --color-teal:       #0099B0; /* logo teal: accents, rules, focus ring; not for text on light backgrounds (3.4:1) */
  --color-teal-dark:  #007385; /* links, primary buttons, current menu item: 5.5:1 on white */
  --color-teal-light: #5CC6D6; /* links and accents on the dark footer: 7.5:1 on ink */

  /* Neutrals, slightly tinted towards the brand teal so they sit with the logo. */
  --color-text:       #1D2B2E; /* body text */
  --color-muted:      #516368; /* dates, captions, hints, secondary text: 6.3:1 on white */
  --color-field:      #7A8C90; /* form field borders: 3.5:1 on white (WCAG 1.4.11) */
  --color-line:       #DCE4E6; /* decorative borders, dividers, table rules */
  --color-bg:         #FFFFFF; /* page background */
  --color-bg-subtle:  #F3F7F8; /* alternating page sections */
  --color-tint:       #E3F1F4; /* highlighted blocks (next event, notices); use sparingly */
  --color-surface:    #FFFFFF; /* cards and form fields */
  --color-white:      #FFFFFF; /* text and icons on ink and teal */

  /* Feedback */
  --color-error:      #B3261E; /* form errors only */
  --color-warning:    #8A5A00; /* warnings only */

  /* Derived shades for interaction states only (not additional brand colours). */
  --color-teal-dark-hover: color-mix(in srgb, var(--color-teal-dark) 82%, #000000);
  --color-error-hover: color-mix(in srgb, var(--color-error) 78%, #000000);
  --color-on-ink-rule: color-mix(in srgb, #FFFFFF 18%, var(--color-ink));
  --color-on-ink-muted: color-mix(in srgb, #FFFFFF 78%, var(--color-ink));

  /* Typography: one family, Hanken Grotesk; a calm role scale where weight and space do as much as size. */
  --font-sans: "Hanken Grotesk", "Hanken Grotesk Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --font-size-caption: 0.8125rem; /* 13px: badges, the date tile month, counters (with the strong weight) */
  --font-size-small: 0.875rem;   /* 14px: meta, captions, hints, breadcrumbs, the footer */
  --font-size-ui: 1rem;          /* 16px: buttons, the admin panel's base text */
  --font-size-body: 1.0625rem;   /* 17px */
  --font-size-lead: clamp(1.125rem, 1.08rem + 0.2vw, 1.1875rem); /* 18-19px */
  --font-size-h4: 1.0625rem;     /* 17px, set apart from body by weight */
  --font-size-h3: 1.1875rem;     /* 19px */
  --font-size-h2: clamp(1.375rem, 1.25rem + 0.55vw, 1.625rem);   /* 22-26px */
  --font-size-h1: clamp(1.75rem, 1.5rem + 1.1vw, 2.25rem);       /* 28-36px */
  --font-size-date: 1.5rem;      /* 24px: the day on date tiles */
  --font-weight-normal: 400;
  --font-weight-medium: 500;     /* menu links */
  --font-weight-strong: 600;     /* headings, labels, buttons, emphasis: the only bold */
  --line-height-body: 1.6;
  --line-height-heading: 1.2;    /* h1, h2 */
  --line-height-title: 1.3;      /* h3, h4, card titles */
  --measure: 35rem;              /* running text: about 70-75 characters of Hanken at 17px */
  --measure-wide: 42rem;         /* a page title with its lead */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Shape */
  --radius-small: 6px;
  --radius-card: 10px;
  --border-thin: 1px;
  --border-accent: 3px;
  --content-width: 72rem;
  --gutter: 1rem;               /* 16px side gutter on phones */
  --header-height: 4.5rem;
}

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