/**
 * TIER 3 — THEME TOKENS
 *
 * UI-spezifische Tokens pro Element und State. Komponenten greifen
 * ausschließlich auf diese Schicht zu — niemals direkt auf Primitives.
 *
 * Format: --theme-[element]-[eigenschaft]-[state]
 */

:root {
  /* ==========================================================================
     BUTTON — Primary (gefüllt, Brand-Accent)
     ========================================================================== */
  --theme-btn-primary-bg: var(--brand-accent-500);
  --theme-btn-primary-bg-hover: var(--brand-primary-500);
  --theme-btn-primary-text: var(--color-white);
  --theme-btn-primary-border: transparent;

  /* BUTTON — Secondary (weiß auf Bild/Brand-Fläche) */
  --theme-btn-secondary-bg: var(--color-white);
  --theme-btn-secondary-bg-hover: var(--brand-primary-500);
  --theme-btn-secondary-text: var(--color-black);
  --theme-btn-secondary-border: var(--color-white);

  /* BUTTON — Outline */
  --theme-btn-outline-bg: transparent;
  --theme-btn-outline-bg-hover: var(--color-white);
  --theme-btn-outline-text: var(--color-white);
  --theme-btn-outline-text-hover: var(--color-black);
  --theme-btn-outline-border: var(--color-white);

  /* BUTTON — Ghost/Link (unterstrichen, wie "Mehr über den Veranstalter") */
  --theme-btn-link-text: var(--text-primary);
  --theme-btn-link-text-hover: var(--brand-primary-500);

  /* BUTTON — Geometrie */
  --theme-btn-padding-block: var(--spacing-4);
  --theme-btn-padding-inline: var(--spacing-5);
  --theme-btn-radius: var(--brand-radius);
  --theme-btn-font-size: var(--font-size-body);
  --theme-btn-font-weight: var(--font-weight-bold);
  /* Buttons sind UI-Elemente: Grotesk liest sich hier ruhiger als die
     kontrastreiche Headline-Serif. */
  --theme-btn-font-family: var(--brand-font-body);

  /* ==========================================================================
     CARD
     ========================================================================== */
  --theme-card-bg: var(--background-secondary);
  --theme-card-bg-hover: var(--background-secondary);
  --theme-card-text: var(--text-primary);
  --theme-card-border: transparent;
  --theme-card-radius: var(--brand-radius-card);
  --theme-card-padding: var(--spacing-8);
  --theme-card-shadow: none;
  /* Ein Schlagschatten ist auf schwarzem Grund unsichtbar — stattdessen
     zeichnet ein roter Rand die Karte beim Hover nach. */
  --theme-card-shadow-hover: 0 0 0 1px var(--brand-primary-500);

  /* ==========================================================================
     EVENT-ROW — die Listenzeile aus "Alle Events im Überblick"
     ========================================================================== */
  --theme-event-row-bg: var(--background-secondary);
  --theme-event-row-bg-hover: var(--brand-secondary-300);
  --theme-event-row-padding: var(--spacing-4);
  --theme-event-row-gap: var(--spacing-4);
  /* Höhe ist das Leitmaß: Die Cover sind Hochformat-Plakate (2:3), die
     Breite ergibt sich daraus. So bleibt die Zeilenhöhe kontrollierbar. */
  --theme-event-row-thumb-height: 5.5rem;
  --theme-event-row-accent: var(--brand-primary-500);

  /* ==========================================================================
     NAVIGATION
     ========================================================================== */
  /* Das Logo ist eine breite Wortmarke — moderate Höhe genügt. */
  --theme-nav-height: 5.5rem;
  --theme-nav-height-compact: 4.25rem;
  --theme-nav-bg: transparent;
  --theme-nav-bg-scrolled: color-mix(in oklab, var(--brand-secondary-100) 92%, transparent);
  /* Auf dunklem Grund ist die Schrift IMMER weiß — auch nach dem Scrollen,
     weil die Fläche darunter ebenfalls dunkel ist. */
  --theme-nav-text: var(--color-white);
  --theme-nav-text-scrolled: var(--color-white);
  --theme-nav-blur: 16px;

  /* NAVIGATION — Fullscreen-Overlay.
     Auf dunklem Grund wirkt eine vollflächig rote Fläche erdrückend —
     stattdessen Schwarz mit rotem Hover-Akzent. */
  --theme-menu-bg: var(--brand-secondary-500);
  --theme-menu-text: var(--color-white);
  --theme-menu-font-size: var(--font-size-display);
  --theme-menu-font-family: var(--brand-font-title);

  /* ==========================================================================
     FORM
     ========================================================================== */
  --theme-input-bg: transparent;
  --theme-input-text: var(--text-primary);
  --theme-input-placeholder: var(--text-muted);
  --theme-input-border: var(--border-default);
  --theme-input-border-focus: var(--brand-primary-500);
  --theme-input-radius: var(--brand-radius);
  --theme-input-padding-block: var(--spacing-3);
  --theme-input-padding-inline: var(--spacing-4);

  /* ==========================================================================
     BADGE / TAG
     ========================================================================== */
  --theme-badge-bg: var(--brand-primary-500);
  --theme-badge-text: var(--color-white);
  --theme-badge-radius: var(--brand-radius);
  --theme-badge-font-size: var(--font-size-tiny);

  /* ==========================================================================
     MEDIA
     ========================================================================== */
  --theme-media-radius: var(--brand-radius-media);
  --theme-media-bg: var(--brand-secondary-400);
  --theme-media-overlay: linear-gradient(
    to top,
    color-mix(in oklab, var(--color-black) 72%, transparent) 0%,
    color-mix(in oklab, var(--color-black) 28%, transparent) 45%,
    transparent 100%
  );

  /* ==========================================================================
     SPONSOR-TILE
     ========================================================================== */
  /* Dezente Fläche statt Rot: Bei einem Logo-Band sollen die Partner
     wirken, nicht die Kacheln. Rot bleibt dem CTA vorbehalten. */
  --theme-sponsor-bg: var(--color-white);
  --theme-sponsor-bg-hover: var(--brand-primary-500);
  --theme-sponsor-logo: color-mix(in oklab, var(--color-white) 80%, transparent);

  /* ==========================================================================
     FOOTER
     ========================================================================== */
  --theme-footer-bg: var(--background-primary);
  --theme-footer-text: var(--text-primary);
  --theme-footer-link: var(--text-primary);
  --theme-footer-link-hover: var(--brand-primary-500);

  /* ==========================================================================
     SCROLL-PROGRESS
     ========================================================================== */
  --theme-progress-bg: var(--brand-primary-500);
  --theme-progress-height: 3px;

  /* ==========================================================================
     SELECTION
     ========================================================================== */
  --theme-selection-bg: var(--brand-primary-500);
  --theme-selection-text: var(--color-white);
}

/**
 * INVERTED CONTEXT
 * Auf dunklen/Brand-Flächen genügt diese Klasse — alle Kind-Komponenten
 * übernehmen die invertierten Werte automatisch (Wiki: css-section-utilities).
 */
.is-inverted {
  /* Grundlayout ist dunkel — "inverted" meint hier also eine HELLE Fläche
     (rote Brand-Kachel oder Weiß) mit entsprechend dunkler Schrift. */
  --text-primary: var(--color-white);
  --text-secondary: color-mix(in oklab, var(--color-white) 82%, transparent);
  --text-muted: color-mix(in oklab, var(--color-white) 65%, transparent);
  --text-brand: var(--color-white);

  --border-default: color-mix(in oklab, var(--color-white) 38%, transparent);
  --border-subtle: color-mix(in oklab, var(--color-white) 20%, transparent);
  --border-strong: var(--color-white);

  /* Auf roter Fläche kehrt der Button um: weiß mit rotem Text */
  --theme-btn-primary-bg: var(--color-white);
  --theme-btn-primary-bg-hover: var(--color-black);
  --theme-btn-primary-text: var(--brand-primary-500);

  --theme-btn-outline-border: var(--color-white);
  --theme-btn-outline-text: var(--color-white);
  --theme-btn-outline-bg-hover: var(--color-white);
  --theme-btn-outline-text-hover: var(--brand-primary-500);

  --theme-btn-link-text: var(--color-white);
  --theme-btn-link-text-hover: color-mix(in oklab, var(--color-white) 75%, transparent);

  --theme-input-border: color-mix(in oklab, var(--color-white) 38%, transparent);
  --theme-input-text: var(--color-white);
  --theme-input-placeholder: color-mix(in oklab, var(--color-white) 65%, transparent);

  --focus-ring-color: var(--color-white);
}
