/*
 * Kulturstelle – Komponenten (Plakat-Karte, Buttons, Tags, Formulare, Hinweise …).
 * Gestaltung siehe docs/design/index.html, Abschnitt 09.
 */

/* ---------- Blobs: unscharfe Lichtflecken hinter Inhalten ---------- */
.blobs { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i {
  position: absolute; border-radius: 50%; aspect-ratio: 1; opacity: .9;
  filter: blur(var(--blob-blur, 56px)); transition: transform 1.2s var(--ease);
}
.blobs i:nth-child(1) { background: var(--blob-1); width: 56%; top: -24%; right: -18%; }
.blobs i:nth-child(2) { background: var(--blob-2); width: 52%; bottom: -26%; left: -20%; }
.blobs i:nth-child(3) { background: var(--blob-3); width: 28%; top: 44%; left: 50%; opacity: .5; }
/* Breite Flächen (Bänder, Footer): an der Höhe messen, damit die Bühnenfarbe dominiert */
.blobs.wide i { width: auto; height: 130%; }
.blobs.wide i:nth-child(1) { top: -55%; right: -6%; }
.blobs.wide i:nth-child(2) { height: 120%; bottom: -60%; left: -6%; }
.blobs.wide i:nth-child(3) { height: 70%; top: 35%; left: 48%; }
@media (prefers-reduced-motion: no-preference) {
  .blobs.drift i { animation: drift var(--dur-blob) ease-in-out infinite alternate; }
  .blobs.drift i:nth-child(2) { animation-duration: 34s; animation-direction: alternate-reverse; }
  .blobs.drift i:nth-child(3) { animation-duration: 22s; }
}
@keyframes drift { to { transform: translate(9%, 12%) scale(1.15); } }

/* ---------- Plakat-Karte ---------- */
.poster {
  position: relative; isolation: isolate; overflow: hidden; display: block;
  container-type: inline-size; aspect-ratio: 1 / 1;
  background: var(--stage); color: var(--on-stage); text-decoration: none;
}
.poster .blobs i { filter: blur(15cqi); }
.poster__in {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto;
  text-align: center; padding: 6.5cqi 6cqi 6cqi;
}
.poster__date, .poster__venue { display: block; font-weight: var(--fw-meta); font-size: max(.95rem, 6.4cqi); line-height: 1.15; }
.poster__body { align-self: center; display: block; }
.poster__title {
  display: block; margin: 0; font-family: var(--font-display); font-weight: var(--fw-display);
  /* --w = Zeichen des längsten Worts: lange Wörter werden kleiner statt umzubrechen */
  font-size: min(var(--t, 10cqi), 88cqi / (var(--w, 1) * var(--display-char)));
  line-height: var(--lh-display); letter-spacing: var(--tracking-display);
  text-wrap: balance; hyphens: auto; overflow-wrap: break-word;
}
.poster__sub { display: block; margin-top: .55em; font-weight: var(--fw-meta); font-size: max(.85rem, 4.6cqi); line-height: 1.25; text-wrap: balance; }
/* Foto randabfallend: Graustufen, per luminosity in die Bühnenfarbe eingefärbt */
.poster__img {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.15) brightness(.85); mix-blend-mode: luminosity;
}
.poster--img::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background: linear-gradient(var(--stage) 0%, transparent 30%, transparent 70%, var(--stage) 100%);
}
/* Freisteller (PNG mit Transparenz): Duotone über den Blobs */
.poster__cutout {
  position: absolute; bottom: 0; right: -4%; z-index: -1; width: 70%; height: 72%;
  object-fit: contain; object-position: bottom right; filter: var(--duo);
}
.poster:hover .blobs i { transform: scale(1.18) translate(-4%, 4%); }
.poster.is-closed { background: #2C2734; color: var(--ks-white); }
.poster.is-closed > * { filter: grayscale(1); opacity: .55; }

/* Event in Listen: Karte + Meta-Zeile */
.events { display: grid; gap: clamp(16px, 2.5vw, 28px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.event { display: grid; gap: 10px; align-content: start; }
.event__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .9375rem; color: var(--ks-muted); }
.event__meta b { color: var(--ks-ink); }
/* Anfang der Beschreibung, auf drei Zeilen gekürzt */
.event__teaser {
  margin: 0; font-size: .9375rem; line-height: 1.45; color: var(--ks-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 1.45em; border-radius: var(--radius-pill); border: 1.5px solid transparent;
  font: var(--fw-strong) 1rem/1.1 var(--font-text); text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--ks-ink); color: var(--ks-white); }
.btn--primary:hover { background: var(--ks-violet); }
.btn--light { background: var(--ks-white); color: var(--ks-ink); }
.btn--light:hover { background: var(--ks-lilac); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--ghost:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn--small { min-height: 36px; padding: 0 1.05em; font-size: .875rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.link-arrow { font-weight: var(--fw-strong); text-decoration: none; }
/* Pfeil als Maske: Louis George Cafe hat kein «→» */
.link-arrow::after {
  content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .35em; vertical-align: -.08em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 8h12M9 3.5 13.5 8 9 12.5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 8h12M9 3.5 13.5 8 9 12.5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur-fast) var(--ease);
}
.link-arrow:hover::after { transform: translateX(.2em); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 .75em; border-radius: var(--radius-pill);
  font-size: .8125rem; font-weight: var(--fw-strong); line-height: 1; white-space: nowrap;
  background: var(--ks-paper-2); color: var(--ks-ink);
}
.tag--new { background: var(--ks-mint); }
.tag--few { background: var(--ks-sun); }
.tag--closed { background: var(--ks-ink); color: var(--ks-white); }
.tag--outline { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.tag--status-0 { background: var(--ks-paper-2); }
.tag--status-1 { background: var(--ks-mint); }
.tag--status-2 { background: var(--ks-lilac); }
.tag--status-3 { background: var(--ks-red); color: var(--ks-white); }
.tag--large { height: 34px; padding: 0 1em; font-size: .9375rem; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: 6px; }
.field > label, .field__label { font-size: .875rem; font-weight: var(--fw-strong); }
.field small, .field .helptext { color: var(--ks-muted); font-size: .8125rem; }
.input,
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="number"],
.form input[type="url"], .form select, .form textarea {
  width: 100%; min-height: 48px; padding: 10px 16px; border-radius: var(--radius-m);
  border: 1.5px solid var(--ks-line); background: var(--ks-white); color: inherit; font: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form textarea { min-height: 120px; }
.input:hover, .form input:hover, .form select:hover, .form textarea:hover { border-color: rgba(20, 16, 28, .35); }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--ks-ink); box-shadow: 0 0 0 4px rgba(121, 41, 201, .2);
}
.input[readonly], .form input[readonly] { background: var(--ks-paper-2); color: var(--ks-muted); border-color: transparent; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--ks-red); font-size: .8125rem; font-weight: var(--fw-strong); }
.field:has(.errorlist) input { border-color: var(--ks-red); }

/* Stepper (− 1 +) um ein normales Zahlenfeld */
.stepper { display: inline-flex; align-items: center; flex: none; height: 42px; border: 1.5px solid var(--ks-line); border-radius: var(--radius-pill); background: var(--ks-white); }
.stepper button {
  width: 40px; height: 100%; border: 0; border-radius: var(--radius-pill); background: none;
  font: 400 1.25rem/1 var(--font-text); color: inherit; cursor: pointer;
}
.stepper button:hover { background: var(--ks-paper-2); }
.stepper input {
  width: 2.6em; min-height: 0; height: 100%; padding: 0; border: 0 !important; background: none;
  text-align: center; font: var(--fw-strong) 1rem var(--font-text); box-shadow: none !important; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.no-js .stepper button { display: none; }
.no-js .stepper input { width: 4em; }

/* ---------- Boxen ---------- */
.box { background: var(--ks-white); padding: clamp(20px, 3vw, 32px); }
.box > :last-child { margin-bottom: 0; }

/* Reservationsbox */
.resbox { display: grid; gap: var(--space-4); align-content: start; background: var(--ks-white); padding: clamp(20px, 3vw, 28px); }
.resbox__title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.resbox__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: 14px; border-bottom: 1px solid var(--ks-line); }
.resbox__row label { display: grid; font-size: .9375rem; line-height: 1.35; font-weight: var(--fw-strong); }
.resbox__row label span { color: var(--ks-muted); font-size: .875rem; font-weight: var(--fw-body); }
.resbox__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.0625rem; }
.resbox__total output { font-weight: var(--fw-strong); font-size: 1.5rem; }
.resbox__hint { margin: 0; font-size: .8125rem; color: var(--ks-muted); line-height: 1.45; }
.resbox p { margin: 0; }

/* ---------- Hinweise ---------- */
.alert {
  display: flex; gap: 14px; margin: 0 0 var(--space-4); padding: 14px 18px 14px 14px;
  border-radius: var(--radius-m); background: var(--ks-paper-2); font-size: .9375rem; line-height: 1.5;
}
.alert::before { content: ""; flex: none; width: 4px; border-radius: 2px; background: var(--alert, var(--ks-violet)); }
.alert > div > :last-child { margin-bottom: 0; }
.alert--info    { --alert: var(--ks-blue); background: #E3E9FD; }
.alert--success { --alert: #1F9E62;        background: #DDF5E9; }
.alert--warn    { --alert: #C9A21F;        background: #FBF2D3; }
.alert--danger  { --alert: var(--ks-red);  background: #F9E1E6; }

/* ---------- Aufruf «Mitmachen» (Team, Kulturorte): Bühne mit Titel und Aktion ---------- */
.join {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5) var(--space-7);
  margin-block: var(--space-7); padding: clamp(24px, 4vw, 48px);
  background: var(--stage); color: var(--on-stage); --blob-blur: 70px;
}
.join:last-child { margin-bottom: 0; }
.join__text { flex: 1 1 26em; max-width: 40em; }
.join__title { margin-bottom: var(--space-3); font-family: var(--font-display); font-size: var(--fs-display-m); line-height: 1.05; letter-spacing: var(--tracking-display); }
.join p { margin: 0; color: var(--on-stage-small); }
.join .actions { gap: var(--space-3) var(--space-5); }

/* ---------- Fakten-Liste (Wann / Wo / …) ---------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px var(--space-5); margin: 0; }
.facts dt { color: var(--ks-muted); }
.facts dd { margin: 0; }

/* ---------- Datums-Kachel ---------- */
.date-tile {
  flex: none; display: grid; place-content: center; width: 64px; aspect-ratio: 1; text-align: center;
  background: var(--stage); color: var(--on-stage); line-height: 1.05;
}
.date-tile b { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.date-tile span { font-size: .75rem; font-weight: 300; }

/* ---------- Listenzeilen (Reservationen) ---------- */
.rows { display: grid; gap: 10px; margin: 0 0 var(--space-6); padding: 0; list-style: none; }
.row-item { display: flex; align-items: center; gap: var(--space-4); padding: 12px 16px 12px 12px; background: var(--ks-white); text-decoration: none; }
a.row-item:hover { outline: 1.5px solid var(--ks-ink); outline-offset: -1.5px; }
.row-item__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-item__title { font-weight: var(--fw-strong); }
.row-item__sub { font-size: .875rem; color: var(--ks-muted); }
.row-item__end { display: grid; justify-items: end; gap: 6px; font-size: .875rem; text-align: right; }
.row-item.is-cancelled { opacity: .55; }
@media (max-width: 640px) {
  .row-item { flex-wrap: wrap; }
  .row-item__end { width: 100%; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; }
}

/* ---------- Karten (Team, Kulturorte) ---------- */
.cards { display: grid; gap: clamp(16px, 2.5vw, 28px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card { display: grid; align-content: start; background: var(--ks-white); }
.card__media { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1; background: var(--stage); color: var(--on-stage); container-type: inline-size; }
.card__media--wide { aspect-ratio: 4 / 3; }
.card__media img { width: 100%; height: 100%; object-fit: cover; filter: var(--duo); }
.card__initials { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 28cqi; letter-spacing: var(--tracking-display); }
.card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 8cqi; text-align: center; font-family: var(--font-display); font-size: 9cqi; line-height: 1.05; }
.card__body { padding: var(--space-5); }
.card__title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; margin-bottom: 4px; }
.card__meta { font-size: .875rem; color: var(--ks-violet); font-weight: var(--fw-strong); margin-bottom: var(--space-3); }
.card__text { font-size: .9375rem; margin: 0; }

/* ---------- Ablauf (Reservationsstatus) ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: .875rem; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--ks-muted); }
.steps li + li::before { content: ""; width: 24px; height: 1px; background: var(--ks-line); }
.steps li.is-done { color: var(--ks-ink); }
.steps li.is-current { color: var(--ks-ink); font-weight: var(--fw-strong); }

/* ---------- Dialog (Plakat des Monats) ---------- */
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(92vw, 900px); max-height: 92vh; }
dialog.lightbox::backdrop { background: rgba(20, 16, 28, .82); }
dialog.lightbox img { max-height: 86vh; width: auto; margin-inline: auto; }
dialog.lightbox form { display: flex; justify-content: flex-end; margin-bottom: 10px; }

/* ---------- Leerer Zustand ---------- */
.empty { padding: var(--space-6); background: var(--ks-paper-2); color: var(--ks-muted); text-align: center; }
.empty > :last-child { margin-bottom: 0; }

.resbox__form { display: grid; gap: var(--space-4); }
.resbox__form .errorlist { margin-top: -8px; }
