/*
 * Kinora C2 design tokens for the web: kinora.pl pages and the programme widget (plan 041,
 * docs/design/kinora-style.md). Colour values come from admin/core/src/accent.ts (C2_NEUTRALS,
 * C2_STATUS, kinoraPalette); admin/core/test/webTokens.test.ts checks every mode against it.
 *
 * Schemes: the system's (prefers-color-scheme), or forced with data-scheme="light|dark" on <html>
 * (widget ?theme=) or on a section that stays dark in both schemes (home hero). Keep the selector
 * structure: festival theme.css (admin/core/src/site.ts) overrides the accent with the same selectors.
 * Order of the blocks matters: light, dark, forced dark, high contrast light, high contrast dark.
 */

/* Schibsted Grotesk (SIL OFL 1.1, assets/fonts/OFL.txt), variable wght 400–900, from @fontsource-variable. */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/schibsted-grotesk-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched fallback (Schibsted: ascent 2000, descent 528 of 2048 units), so the swap barely moves the layout (CLS). */
@font-face {
  font-family: "Schibsted Grotesk Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 104%;
  ascent-override: 94%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root,
[data-scheme="light"] {
  color-scheme: light;

  /* Neutrals (kinora-style §3), light. */
  --kinora-bg: #F7F6F2;
  --kinora-surface: #FFFFFF;
  --kinora-text: #141416;
  --kinora-text2: #6B6B70;
  --kinora-text3: #3A3A3E;
  --kinora-rule: #E2DFD9;
  --kinora-border: #CFCBC3;
  --kinora-placeholder: #E9E7E2;
  --kinora-glass: rgba(255, 255, 255, 0.78);

  /* Status colours (text in light). */
  --kinora-status-delayed: #9E5E00;
  --kinora-status-cancelled: #C33529;

  /* Accent roles: Kinora coral (hub, home page). A festival page overrides them with /f/<id>/theme.css,
     the widget with its festival colour. accent-stroke equals accent when no outline is needed. */
  --kinora-accent: #E5684B;
  --kinora-accent-text: #B4432A;
  --kinora-on-accent: #161618;
  --kinora-accent-stroke: #E5684B;

  /* The QR card stays light in both schemes: graphite code on #F2F2F2 (kinora-style §9). */
  --kinora-qr-card: #F2F2F2;
  --kinora-qr-ink: #161618;
  --kinora-qr-ink2: #4A4A50;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    color-scheme: dark;
    --kinora-bg: #0B0B0C;
    --kinora-surface: #151517;
    --kinora-text: #F2F2F2;
    --kinora-text2: #8E8E93;
    --kinora-text3: #D6D6D9;
    --kinora-rule: #232326;
    --kinora-border: #333333;
    --kinora-placeholder: #1A1A1D;
    --kinora-glass: rgba(62, 62, 66, 0.72);
    --kinora-status-delayed: #F5A524;
    --kinora-status-cancelled: #FF5A4E;
    --kinora-accent: #E5684B;
    --kinora-accent-text: #E5684B;
    --kinora-on-accent: #161618;
    --kinora-accent-stroke: #E5684B;
  }
}

[data-scheme="dark"] {
  color-scheme: dark;
  --kinora-bg: #0B0B0C;
  --kinora-surface: #151517;
  --kinora-text: #F2F2F2;
  --kinora-text2: #8E8E93;
  --kinora-text3: #D6D6D9;
  --kinora-rule: #232326;
  --kinora-border: #333333;
  --kinora-placeholder: #1A1A1D;
  --kinora-glass: rgba(62, 62, 66, 0.72);
  --kinora-status-delayed: #F5A524;
  --kinora-status-cancelled: #FF5A4E;
  --kinora-accent: #E5684B;
  --kinora-accent-text: #E5684B;
  --kinora-on-accent: #161618;
  --kinora-accent-stroke: #E5684B;
}

/* High contrast (plan 038): text2 → text3, border → text2, rule → border, accent text at 7:1. */
@media (prefers-contrast: more) {
  :root,
  [data-scheme="light"] {
    --kinora-text2: #3A3A3E;
    --kinora-border: #6B6B70;
    --kinora-rule: #CFCBC3;
    --kinora-accent-text: #853C2C;
    --kinora-accent-stroke: #E5684B;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --kinora-text2: #D6D6D9;
    --kinora-border: #8E8E93;
    --kinora-rule: #333333;
    --kinora-accent-text: #EA866F;
    --kinora-accent-stroke: #E5684B;
  }
}

@media (prefers-contrast: more) {
  [data-scheme="dark"] {
    --kinora-text2: #D6D6D9;
    --kinora-border: #8E8E93;
    --kinora-rule: #333333;
    --kinora-accent-text: #EA866F;
    --kinora-accent-stroke: #E5684B;
  }
}

/* Scheme-independent tokens. */
:root {
  /* Text on a festival colour (accent.ts readableOn: graphite or white). */
  --kinora-graphite: #161618;
  --kinora-white: #FFFFFF;

  /* KinoraSpacing. */
  --kinora-spacing-screen: 18px;
  --kinora-spacing-section: 24px;
  --kinora-spacing-card: 12px;
  --kinora-spacing-row: 14px;
  --kinora-spacing-tight: 6px;
  --kinora-spacing-min-tap: 44px;

  /* KinoraRadius (C2: right angles; thumbnails 2). */
  --kinora-radius-none: 0px;
  --kinora-radius-thumb: 2px;
  /* Screen corners of the phone screenshot on the home page (like KinoraRadius.deviceIllustration in the apps). */
  --kinora-radius-device: 14% / 6.5%;

  /* Type (kinora-style §5), in rem so it follows the browser's text size. */
  --kinora-font: "Schibsted Grotesk", "Schibsted Grotesk Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --kinora-text-screen-title: 2.5rem;
  --kinora-text-hero-title: clamp(2.375rem, 5vw, 4rem);
  --kinora-text-display: clamp(2.375rem, 4.6vw, 3.75rem);
  --kinora-text-section-title: clamp(1.5rem, 2.6vw, 2.25rem);
  --kinora-text-section-small: 1.5rem;
  --kinora-text-row-title: 1.125rem;
  --kinora-text-row-title-large: clamp(1.125rem, 1.8vw, 1.75rem);
  --kinora-text-time: 1.1875rem;
  --kinora-text-time-large: clamp(1.1875rem, 1.8vw, 1.625rem);
  --kinora-text-stat: 1.625rem;
  --kinora-text-body: 1rem;
  --kinora-text-meta: 0.8125rem;
  --kinora-text-label: 0.75rem;
  --kinora-weight-regular: 400;
  --kinora-weight-medium: 500;
  --kinora-weight-semibold: 600;
  --kinora-weight-bold: 700;
  --kinora-leading-title: 0.98;
  --kinora-leading-row: 1.12;
  --kinora-leading-tight: 1.25;
  --kinora-leading-body: 1.55;
  --kinora-tracking-title: -0.025em;

  /* Web layout (no app counterpart). */
  --kinora-line: 1px;
  --kinora-bar: 4px;
  --kinora-tab-underline: 2px;
  --kinora-focus-ring: 2px;
  --kinora-container: 1312px;
  --kinora-gutter: 16px;
  --kinora-gutter-wide: 64px;
  --kinora-header-height: 76px;
  --kinora-logo-height: 38px;
  --kinora-aside-width: 360px;
  --kinora-thumb-width: 84px;
  --kinora-thumb-height: 56px;
  --kinora-thumb-width-large: 120px;
  --kinora-thumb-height-large: 76px;
  --kinora-day-tile: 60px;
  --kinora-time-col: 52px;
  --kinora-time-col-large: 78px;
  --kinora-icon: 20px;
  --kinora-icon-small: 14px;
  --kinora-dot: 7px;
  --kinora-qr-size: 120px;
  --kinora-qr-size-large: 148px;
  --kinora-mark: 20px;
  --kinora-measure: 62ch;
  --kinora-measure-narrow: 36ch;
  --kinora-hero-height: clamp(260px, 26vw, 380px);
  --kinora-near-height: clamp(220px, 26vw, 340px);
  --kinora-phone-width: clamp(220px, 24vw, 320px);
  /* Plan 045: the whole phone screen of the hero video (780 × 1688), narrower than the cropped screenshot was. */
  --kinora-phone-video-width: clamp(200px, 19vw, 250px);
  /* Plan 045: quick state changes (a block's chevron), as the apps' easeInOut 0.2 s. */
  --kinora-duration-quick: 200ms;
  --kinora-cal-date-col: 120px;
  --kinora-cal-month-col: 200px;
  --kinora-narrow-width: 480px;
}
