/* ============================================================
   Tickora Design System — "Abendkasse"
   Direction: modern box office for festive dinner events.
   Ink-navy stage surfaces, Tickora blue as brand anchor,
   spotlight amber as warm counterpoint, ticket-stub cards
   as the signature element.
   ============================================================ */

/* ---------- Self-hosted fonts (DSGVO: no external requests) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Spline Sans Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/spline-sans-mono-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Colors */
  --color-ink: #0c1428; /* deep stage navy: header, footer, hero */
  --color-ink-soft: #17223f; /* raised surface on ink */
  --color-accent: #2e5ce6; /* Tickora blue (AA on white & bg) */
  --color-accent-strong: #2249c4; /* hover/pressed */
  --color-accent-bright: #8aa4ff; /* accent on dark surfaces (AA on ink) */
  --color-gold: #f0b544; /* spotlight amber — sparingly, mostly on ink */
  --color-emerald: #177e5b; /* success (AA on white) */
  --color-bg: #f3f5fa;
  --color-surface: #ffffff;
  --color-light: #e2e7f0;
  --color-muted: #5a6478; /* AA on bg and white */
  --color-fg: #1c2438;
  --color-border: #e2e7f0;
  --color-error: #d3313c;
  --color-warning: #b87514;

  /* Raw RGB channels consumed by tailwind.config.js as
     "rgb(var(--…-rgb) / <alpha-value>)" so opacity modifiers work.
     Keep in sync with the hex values above. */
  --color-accent-rgb: 46 92 230;
  --color-bg-rgb: 243 245 250;
  --color-muted-rgb: 90 100 120;
  --color-fg-rgb: 28 36 56;
  --color-border-rgb: 226 231 240;
  --color-ink-rgb: 12 20 40;
  --color-gold-rgb: 240 181 68;

  /* Typography */
  --font-family-base:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-family-display: "Bricolage Grotesque", var(--font-family-base);
  --font-family-mono:
    "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 0.85rem;
  --shadow:
    0 1px 2px rgba(12, 20, 40, 0.05), 0 10px 28px -14px rgba(12, 20, 40, 0.14);
  --shadow-lift:
    0 2px 4px rgba(12, 20, 40, 0.06), 0 18px 40px -16px rgba(12, 20, 40, 0.22);
}

/* ---------- Base ---------- */
html {
  /* full-bleed sections use viewport-width margins; clip the few px of
     scrollbar-width overflow they can produce */
  overflow-x: clip;
}

/* Break a section out of the centered <main> column to span the viewport */
.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.65;
  min-height: 100vh;
  /* keep the footer at the viewport bottom on short pages */
  display: flex;
  flex-direction: column;
}
body > main {
  flex: 1 0 auto;
  width: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.font-display {
  font-family: var(--font-family-display);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.font-ticket {
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
}

/* Eyebrow label: small mono all-caps line above headings */
.eyebrow {
  font-family: var(--font-family-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-muted);
}
.eyebrow--accent {
  color: var(--color-accent);
}
.eyebrow--gold {
  color: var(--color-gold);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input,
textarea,
select {
  font-family: inherit;
  border-radius: var(--radius);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

::selection {
  background: rgba(46, 92, 230, 0.18);
}

/* ---------- Buttons ---------- */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-light,
.btn-gold,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.btn,
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(46, 92, 230, 0.55);
}
.btn:hover,
.btn-primary:hover {
  background-color: var(--color-accent-strong);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -10px rgba(46, 92, 230, 0.6);
}
.btn:active,
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(46, 92, 230, 0.45);
  color: var(--color-accent);
}
.btn-secondary:hover {
  border-color: var(--color-accent);
  background: rgba(46, 92, 230, 0.06);
  text-decoration: none;
}

.btn-light {
  background: #fff;
  color: var(--color-ink);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
}
.btn-light:hover {
  background: #f0f3fa;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-muted);
  text-decoration: none;
}

.btn-gold {
  background-color: var(--color-gold);
  color: var(--color-ink);
  box-shadow: 0 12px 26px -12px rgba(240, 181, 68, 0.65);
}
.btn-gold:hover {
  background-color: #f6c360;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--color-error);
  color: white;
}
.btn-danger:hover {
  filter: brightness(0.92);
  text-decoration: none;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  isolation: isolate;
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 0.25rem);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.card--hover {
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}
.card--hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(46, 92, 230, 0.35);
}

/* Signature: admission-ticket card with punched side notches and a
   perforation line. The notch circles are painted in the page
   background color, so use only on --color-bg surfaces. */
.ticket-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 0.25rem);
  box-shadow: var(--shadow);
  --notch-bottom: 4.4rem; /* distance of perforation from card bottom */
}
.ticket-card::before,
.ticket-card::after {
  content: "";
  position: absolute;
  bottom: calc(var(--notch-bottom) - 0.55rem);
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  z-index: 1;
}
.ticket-card::before {
  left: -0.62rem;
  clip-path: inset(0 0 0 45%);
  border-left: none;
}
.ticket-card::after {
  right: -0.62rem;
  clip-path: inset(0 45% 0 0);
  border-right: none;
}

/* Mask-based punched notches for tickets on non-bg surfaces (e.g. the
   dark hero). Put box-shadow / drop-shadow on a WRAPPER element —
   a shadow on the masked element itself would be clipped away. */
.punched {
  --notch-y: 68%;
  -webkit-mask-image:
    radial-gradient(0.6rem at 0 var(--notch-y), transparent 98%, #000),
    radial-gradient(0.6rem at 100% var(--notch-y), transparent 98%, #000);
  mask-image:
    radial-gradient(0.6rem at 0 var(--notch-y), transparent 98%, #000),
    radial-gradient(0.6rem at 100% var(--notch-y), transparent 98%, #000);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.ticket-divider {
  border: none;
  border-top: 2px dashed var(--color-border);
}
/* Zero-specificity reset of the browser's default hr margin. theme.css is
   linked after tailwind.css, so a plain `.ticket-divider { margin: 0 }` would
   beat every `my-*` utility a template puts on the divider. */
:where(.ticket-divider) {
  margin: 0;
}

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
}
.chip--ink {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}

/* Inline result messages (form feedback). Defined here rather than as Tailwind
   utilities because server-rendered HTMX fragments also use them, and the
   Tailwind build only scans templates — never Python source. */
.notice {
  border-radius: calc(var(--radius) + 0.25rem);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
}
.notice--success {
  border-color: rgba(23, 126, 91, 0.35);
  background: rgba(23, 126, 91, 0.08);
  color: #0f5b41;
}
.notice--error {
  border-color: rgba(211, 49, 60, 0.35);
  background: rgba(211, 49, 60, 0.07);
  color: #9b1c25;
}

/* Availability. The label always states the fact; these only tint it. */
.chip--free {
  border-color: rgba(23, 126, 91, 0.3);
  background: rgba(23, 126, 91, 0.08);
  color: #0f5b41;
}
.chip--scarce {
  border-color: rgba(184, 117, 20, 0.35);
  background: rgba(184, 117, 20, 0.1);
  color: var(--color-warning);
}
.chip--sold {
  border-color: var(--color-border);
  background: var(--color-light);
  color: var(--color-muted);
}
.dot-free,
.dot-scarce,
.dot-sold {
  display: inline-block;
  height: 0.45rem;
  width: 0.45rem;
  border-radius: 9999px;
  background: currentColor;
}

/* Calendar-style date block on term cards: the date is what guests scan for. */
.date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 3.4rem;
  padding: 0.4rem 0;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, #fff, var(--color-bg));
  line-height: 1.05;
}
.date-block__day {
  font-family: var(--font-family-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-fg);
}
.date-block__month {
  font-family: var(--font-family-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.dot-accent {
  display: inline-block;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: var(--color-accent);
}
.dot-gold {
  display: inline-block;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: var(--color-gold);
}

/* ---------- Forms ---------- */
.input {
  border: 1px solid var(--color-border);
  border-radius: 0.7rem;
  padding: 0.6rem 0.9rem;
  min-width: 0;
  background-color: var(--color-surface);
  color: var(--color-fg);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}
.input::placeholder {
  color: rgba(90, 100, 120, 0.75);
}
.input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(46, 92, 230, 0.18);
}
.input:focus-visible {
  outline: none;
}

/* ---------- Dark stage surfaces ---------- */
.stage {
  position: relative;
  isolation: isolate;
  background-color: var(--color-ink);
  color: #eef1f8;
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  /* two soft spotlights: brand blue + a warm amber from above */
  background:
    radial-gradient(
      60rem 32rem at 82% -10%,
      rgba(46, 92, 230, 0.35),
      rgba(46, 92, 230, 0) 60%
    ),
    radial-gradient(
      38rem 24rem at 12% 110%,
      rgba(240, 181, 68, 0.14),
      rgba(240, 181, 68, 0) 55%
    );
}
.stage .eyebrow {
  color: var(--color-gold);
}
/* …but not inside light cards placed on the stage: gold on white is 1.8:1 */
.stage .card .eyebrow,
.stage .ticket-card .eyebrow,
.stage .punched .eyebrow {
  color: var(--color-muted);
}

.text-on-ink-muted {
  color: rgba(238, 241, 248, 0.66);
}

/* ---------- Header / footer ---------- */
.site-header {
  background: rgba(12, 20, 40, 0.92);
  color: #eef1f8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .site-header {
    background: rgba(12, 20, 40, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}
.site-header .nav-link {
  color: rgba(238, 241, 248, 0.75);
  transition: color 140ms ease;
}
.site-header .nav-link:hover,
.site-header .nav-link:focus-visible {
  color: #fff;
  text-decoration: none;
}

.site-footer {
  background: var(--color-ink);
  color: rgba(238, 241, 248, 0.72);
}
.site-footer a:hover {
  color: #fff;
}

/* Decorative ticket barcode block (pure CSS stripes) */
.barcode {
  height: 2.6rem;
  background: repeating-linear-gradient(
    90deg,
    currentColor 0,
    currentColor 2px,
    transparent 2px,
    transparent 5px,
    currentColor 5px,
    currentColor 6px,
    transparent 6px,
    transparent 10px
  );
  opacity: 0.75;
}

/* ---------- Misc ---------- */
.text-accent {
  color: var(--color-accent);
}
.text-muted {
  color: var(--color-muted);
}
.text-gold {
  color: var(--color-gold);
}

.shadow-card {
  box-shadow: var(--shadow);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  background: var(--color-ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  transition: top 150ms ease-in-out;
  z-index: 60;
}
.skip-link:focus-visible {
  top: 1rem;
}

.hero {
  padding: 3rem 0;
}
@media (min-width: 768px) {
  .hero {
    padding: 5rem 0;
  }
}

/* Feature illustration helper */
.feature-illustration {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto 1rem;
}

@media (max-width: 640px) {
  .input {
    padding: 0.65rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive display utility fallbacks (kept for templates rendered
   without a fresh tailwind build) */
.hidden {
  display: none;
}
@media (min-width: 768px) {
  .md\:hidden {
    display: none;
  }
  .md\:block {
    display: block;
  }
  .md\:flex {
    display: flex;
  }
  .md\:table {
    display: table;
  }
  .md\:inline-flex {
    display: inline-flex;
  }
}
@media (min-width: 1024px) {
  .lg\:hidden {
    display: none;
  }
  .lg\:block {
    display: block;
  }
  .lg\:flex {
    display: flex;
  }
  .lg\:table {
    display: table;
  }
}
