/* ==========================================================================
   VIPecase: Galerie-Seite (galerie.html)
   Nur seitenspezifische Ergänzungen; Tokens und Komponenten aus main.css
   (.page-head, .gallery, .g-item, .inspo, .price-board, .btn, .icon-btn).
   Keine Rotation, kein Bounce, kein zusätzlicher Zuckerstreifen.
   ========================================================================== */

/* ---------- Seitenkopf ---------- */
.gx-head { padding-bottom: clamp(24px, 4vw, 40px); }

/* ---------- Galerie-Abschnitt ---------- */
.gx-gallery { padding-top: clamp(28px, 4vw, 48px); }
.gx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: clamp(20px, 3vw, 32px); }
.gx-toolbar:not(:has(.gx-filter:not([hidden]))) { margin-bottom: 0; }

/* Filter: nur mit JavaScript sichtbar (gallery.js entfernt hidden); ohne JS bleiben alle Bilder sichtbar */
.gx-filter { display: flex; flex-wrap: wrap; gap: 10px; }
.gx-filter[hidden] { display: none; }
.gx-chip {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 12px 0 20px;
  border: 0; border-radius: var(--r-pill);
  background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-family: var(--f-text); font-weight: 700; font-size: var(--fs-2); letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.gx-chip[aria-pressed="true"] { background: var(--pink); box-shadow: inset 0 0 0 2px var(--ink); }
.gx-count {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 26px; padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--lav-soft); color: var(--ink);
  font-size: var(--fs-1); font-weight: 800; font-variant-numeric: tabular-nums;
}
.gx-chip[aria-pressed="true"] .gx-count { background: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .gx-chip[aria-pressed="false"]:hover { background: var(--blush); }
}

/* Raster: 2 Spalten, ab 700 px 4 Spalten; Leitbild groß (mobil volle Breite, sonst 2 × 2).
   23 Bilder: 1 großes (2 × 2) + 2 breite (2 × 1) + 20 normale = 28 Felder: geht in 2 und 4 Spalten ohne Lücke auf.
   Die breiten Kacheln stehen an Position 8 und 15 (je mit normalen Kacheln in derselben Zeile), damit sie in beiden Rastern an einer Zeilengrenze beginnen. */
.gx-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.gx-item[hidden] { display: none; }
.gx-item--big { grid-column: 1 / -1; aspect-ratio: 4 / 5; }
.gx-item--wide { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
.gx-item--wide img { object-position: 50% 28%; } /* breiter Zuschnitt: Ring oben nicht abschneiden */
@media (min-width: 700px) {
  .gx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .gx-item--big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .gx-item--wide { grid-column: span 2; aspect-ratio: auto; }
}
@media (min-width: 1100px) { .gx-grid { gap: 18px; } }
/* Gefiltert: alle Kacheln gleich groß, damit keine Lücken entstehen */
.gx-grid.is-filtered .gx-item--big, .gx-grid.is-filtered .gx-item--wide { grid-column: auto; grid-row: auto; aspect-ratio: 3 / 4; }

.gx-link { position: absolute; inset: 0; display: block; border-radius: inherit; color: inherit; }
/* Fokus innen (die Kachel schneidet mit overflow: hidden ab): Ink-Rahmen mit Creme-Saum, auf jedem Foto sichtbar */
.gx-link:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; box-shadow: inset 0 0 0 7px var(--cream); z-index: 1; }

/* ---------- Inspiration (KI): bewusst klein, wie Startseite ---------- */
.gx-gallery + .inspo { border-top: 1px solid var(--line); }

/* ---------- Angebote ---------- */
.gx-offers-grid { display: grid; gap: 32px; align-items: center; }
.gx-offers-grid > * { min-width: 0; }
.gx-offers-copy h2 { margin-bottom: 0.4em; }
.gx-offers-copy .prices-lead { margin-bottom: 26px; }
@media (min-width: 900px) { .gx-offers-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 80px; } }
@media (max-width: 379px) { .gx-offers-copy .btn { white-space: normal; text-align: left; } }

/* ---------- Lightbox (<dialog>, gallery.js) ---------- */
html.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--ink); color: var(--cream);
  overscroll-behavior: contain;
}
.lightbox::backdrop { background: rgb(32 26 50 / 0.7); }
.lightbox :focus-visible { outline-color: var(--pink); }
.lb-inner {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lb-count { margin: 0; font-weight: 700; font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 48px; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill);
  background: var(--paper); color: var(--ink);
  font-family: var(--f-text); font-weight: 700; font-size: var(--fs-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}
.lb-btn .icon { width: 22px; height: 22px; }
.lb-close { padding: 0 18px 0 14px; }
@media (hover: hover) and (pointer: fine) { .lb-btn:hover { background: var(--pink); } }
.lb-figure { margin: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; justify-items: center; }
.lb-media { min-height: 0; width: 100%; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.lb-media picture { display: contents; }
.lb-media img {
  width: auto; height: auto;
  max-width: 100%; max-height: calc(100dvh - 220px);
  object-fit: contain;
  border-radius: var(--r-media);
  background: var(--ink-2);
}
.lb-caption { max-width: 60ch; text-align: center; font-size: var(--fs-2); line-height: 1.45; color: var(--lav); }
.lb-nav { display: flex; justify-content: center; gap: 16px; }
.lb-nav .lb-btn { min-width: 56px; }
@media (min-width: 900px) {
  .lb-media img { max-height: calc(100dvh - 210px); }
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-fade 180ms var(--ease-out); }
  .lightbox[open]::backdrop { animation: lb-fade 180ms var(--ease-out); }
}
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
