/* Küchen-Slider "Aus unserer Küche" auf der Clubheim-Seite: Fotos als Stapel (Variante 3, Cap, 2026-11-11).
   publish_clubheim_kueche() lädt diese Datei mit den Fotos in die Seite, der Ablauf steht in assets/js/kueche.js.
   Links Zähler, Titel und Pfeile, rechts der Kartenstapel: vorn das aktuelle Foto, dahinter die nächsten, links das vorherige. */

/* Die seitlich herausragenden Karten dürfen die Seite nicht breiter machen (am Handy ragen sie über den Rand) */
.clubheim-kueche {
  overflow-x: clip;
}

@supports not (overflow: clip) {
  .clubheim-kueche {
    overflow-x: hidden;
  }
}

.kueche-slider {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: var(--space-4);
  min-height: 540px;
}

.kueche-slider:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 8px;
  border-radius: var(--radius);
}

/* ---------- Links: Zähler, Titel, Pfeile ---------- */

.kueche-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.kueche-zaehler {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 9vw, 7.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--c-gold);
}

.kueche-zaehler i {
  margin-left: 0.2em;
  font-style: normal;
  font-size: 0.36em;
  color: var(--c-muted);
}

.kueche-titel {
  margin: 0.6rem 0 0;
  /* zwei Zeilen Platz, damit beim Wechsel kurzer Titel nichts springt */
  min-height: 2.2em;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--c-white);
}

.kueche-hand {
  margin: 0.4rem 0 0;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.2;
  color: var(--c-gold);
}

/* Zeigt, wie lange das Foto noch steht, bis der Stapel von selbst weiterläuft */
.kueche-balken {
  position: relative;
  width: min(260px, 60%);
  height: 2px;
  margin-top: var(--space-3);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.kueche-balken b {
  position: absolute;
  inset: 0;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: left;
}

.kueche-pfeile {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--space-3);
}

.kueche-pfeil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  appearance: none;
  border: 1.5px solid rgba(217, 182, 92, 0.65);
  border-radius: 50%;
  background: none;
  color: var(--c-gold);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.kueche-pfeil:hover,
.kueche-pfeil:focus-visible {
  background: var(--c-gold);
  color: var(--c-black);
}

.kueche-pfeil:focus-visible {
  outline: 2px solid var(--c-white);
  outline-offset: 3px;
}

/* ---------- Rechts: der Stapel ---------- */

.kueche-stapel {
  position: relative;
  height: 520px;
  touch-action: pan-y;
  user-select: none;
}

.kueche-karte {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(360px, 62%);
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  appearance: none;
  border: 1.5px solid rgba(217, 182, 92, 0.5);
  border-radius: var(--radius-sm);
  background: var(--c-bg-alt);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
  cursor: zoom-in;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(0deg) scale(0.8);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease, filter 0.6s ease;
}

.kueche-karte:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 4px;
}

/* Das Foto liegt ganz in der Karte (nichts wird abgeschnitten), der Rand dahinter ist das gleiche Foto, unscharf und abgedunkelt. */
.kueche-karte-hg {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  max-width: none;
  object-fit: cover;
  filter: blur(16px) brightness(0.5);
}

.kueche-karte-bild {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kueche-karte[data-pos="0"] {
  z-index: 5;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.kueche-karte[data-pos="1"] {
  z-index: 4;
  opacity: 1;
  filter: brightness(0.55);
  transform: translate(-8%, -52%) rotate(6deg) scale(0.94);
}

.kueche-karte[data-pos="2"] {
  z-index: 3;
  opacity: 1;
  filter: brightness(0.38);
  transform: translate(18%, -48%) rotate(12deg) scale(0.88);
}

.kueche-karte[data-pos="-1"] {
  z-index: 4;
  opacity: 1;
  filter: brightness(0.55);
  transform: translate(-92%, -48%) rotate(-6deg) scale(0.94);
}

/* Ohne JavaScript steht nur das erste Foto da */
.kueche-slider:not(.is-aktiv) .kueche-karte:not(:first-child) {
  display: none;
}

.kueche-slider:not(.is-aktiv) .kueche-karte:first-child {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.kueche-slider:not(.is-aktiv) .kueche-pfeile,
.kueche-slider:not(.is-aktiv) .kueche-balken {
  display: none;
}

/* ---------- Schmale Fenster: Stapel oben, Text darunter ---------- */

@media (max-width: 900px) {
  .kueche-slider {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    min-height: 0;
  }

  .kueche-stapel {
    order: -1;
    height: 440px;
  }

  .kueche-zaehler {
    font-size: 4rem;
  }

  .kueche-titel {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .kueche-stapel {
    height: 400px;
  }

  .kueche-karte {
    width: 64%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kueche-karte {
    transition: none;
  }

  .kueche-balken {
    display: none;
  }
}
