/* ============================================================
   MOTO-ZÜRICH — Bildergalerie (Impressionen-2026.html)
   Raster in Originalformat (kein Beschnitt — Wasserzeichen bleibt
   sichtbar), Filter nach Thema, Lightbox. JS: mz-galerie.js
   ============================================================ */

/* ---------- 360°-Rundgang: Vorschau, iframe erst nach Klick ---------- */
section.mzg-tour-block { padding-bottom: 0; }
section.mzg-block { padding-top: clamp(48px, 7vw, 88px); }
.mzg-tour3d { position: relative; aspect-ratio: 16 / 9; max-height: 78vh; width: 100%; overflow: hidden; background: var(--night); border: 1px solid var(--line-strong); }
.mzg-tour3d-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.16,1,0.3,1), filter 0.4s; }
.mzg-tour3d::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,18,34,0.10) 0%, rgba(7,18,34,0.55) 100%); pointer-events: none; }
.mzg-tour3d:hover .mzg-tour3d-poster { transform: scale(1.03); }
.mzg-tour3d-play {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: transparent; border: 0; cursor: pointer; color: #fff; width: 100%;
}
.mzg-tour3d-badge {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3.4vw, 40px); line-height: 1;
  width: clamp(92px, 11vw, 132px); height: clamp(92px, 11vw, 132px); border-radius: 50%; display: grid; place-items: center;
  background: rgba(10,25,41,0.55); border: 3px solid var(--action-yellow); color: var(--action-yellow);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: transform 0.25s, background 0.25s;
}
.mzg-tour3d-play:hover .mzg-tour3d-badge, .mzg-tour3d-play:focus-visible .mzg-tour3d-badge { transform: scale(1.06); background: rgba(10,25,41,0.75); }
.mzg-tour3d-label { font-family: var(--font-mono); font-weight: 700; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; background: var(--action-yellow); color: #141414; padding: 12px 18px; }
.mzg-tour3d-play:focus-visible { outline: 3px solid var(--action-yellow); outline-offset: -6px; }
.mzg-tour3d iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.mzg-tour3d.is-live::after { display: none; }
.mzg-tour3d-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-top: 14px; }
.mzg-tour3d-text { font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--fg); }
.mzg-tour3d-text b { color: var(--brand-dark); }
.mzg-tour3d-ext { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; white-space: nowrap; }
html[data-theme="dark"] .mzg-tour3d-text b, html[data-theme="dark"] .mzg-tour3d-ext { color: var(--brand-light); }
@media (max-width: 600px) { .mzg-tour3d { aspect-ratio: 4 / 3; } .mzg-tour3d-label { font-size: 12px; } }

/* ---------- Tages-Überschriften im Raster ---------- */
.mzg-day-h {
  margin: 0 0 10px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-body); font-weight: 600; font-size: 16px; color: var(--muted);
}
.mzg-day + .mzg-day { margin-top: clamp(40px, 5vw, 64px); }
.mzg-day-h span { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); text-transform: uppercase; color: var(--fg); }
.mzg-day[hidden] { display: none; }
.mzg-day { scroll-margin-top: 140px; }               /* Sprung von der Startseite (#tag-N): Überschrift nicht unter dem Header */
.mzg-day-text { font-family: var(--font-body); font-size: var(--fs-lead, 18px); line-height: 1.6; color: var(--fg); max-width: 760px; margin: 0 0 20px; }

/* ---------- Filter ---------- */
.mzg-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 24px; }
.mzg-chip {
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; cursor: pointer;
  background: transparent; color: var(--brand); border: 1px solid var(--line-strong); transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.mzg-chip i { font-style: normal; font-weight: 500; opacity: 0.65; }
.mzg-chip:hover { border-color: var(--brand); }
.mzg-chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.mzg-chip:focus-visible { outline: 2px solid var(--action-yellow); outline-offset: 2px; }

/* ---------- Raster: Zeilen mit Originalproportionen ---------- */
.mzg-grid { --row-h: 260px; display: flex; flex-wrap: wrap; gap: 8px; }
.mzg-grid::after { content: ""; flex-grow: 999; }               /* letzte Zeile nicht aufblähen */
.mzg-item {
  position: relative; display: block; overflow: hidden; background: var(--night-soft);
  flex-grow: var(--r); flex-basis: calc(var(--r) * var(--row-h)); aspect-ratio: var(--r);
  max-height: calc(var(--row-h) * 1.6);
}
.mzg-item[hidden] { display: none; }
.mzg-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.3s; }
.mzg-item:hover img { transform: scale(1.03); }
.mzg-item:focus-visible { outline: 3px solid var(--action-yellow); outline-offset: 2px; }

@media (max-width: 900px) { .mzg-grid { --row-h: 180px; } }
@media (max-width: 600px) {
  .mzg-grid { --row-h: 100px; gap: 6px; }
  .mzg-chip { padding: 10px 12px; font-size: 12px; }
}

/* ---------- Lightbox ---------- */
.mzg-lb { position: fixed; inset: 0; z-index: 10000; background: rgba(7,18,34,0.96); display: flex; align-items: center; justify-content: center; }
.mzg-lb[hidden] { display: none; }
.mzg-lb-fig { margin: 0; max-width: min(92vw, 1600px); max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 12px; touch-action: pan-y; }
.mzg-lb-img { max-width: 100%; max-height: calc(86vh - 40px); width: auto; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.mzg-lb-cap { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.7); text-align: center; }
.mzg-lb-close, .mzg-lb-nav {
  position: absolute; background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.18);
  font-size: 34px; line-height: 1; width: 56px; height: 56px; cursor: pointer; display: grid; place-items: center; transition: background 0.2s;
}
.mzg-lb-close:hover, .mzg-lb-nav:hover { background: rgba(255,255,255,0.18); }
.mzg-lb-close:focus-visible, .mzg-lb-nav:focus-visible { outline: 2px solid var(--action-yellow); outline-offset: 2px; }
.mzg-lb-close { top: 18px; right: 18px; }
.mzg-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.mzg-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.mzg-lb-count { position: absolute; top: 30px; left: 24px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em; color: rgba(255,255,255,0.75); }
html.mzg-lock, html.mzg-lock body { overflow: hidden; }
@media (max-width: 600px) {
  .mzg-lb-nav { top: auto; bottom: 18px; transform: none; width: 52px; height: 52px; }
  .mzg-lb-prev { left: calc(50% - 60px); } .mzg-lb-next { right: calc(50% - 60px); }
  .mzg-lb-fig { max-height: 78vh; } .mzg-lb-img { max-height: calc(78vh - 36px); }
}

/* ---------- Dark Mode ---------- */
html[data-theme="dark"] .mzg-chip { color: #fff; border-color: rgba(255,255,255,0.3); }
html[data-theme="dark"] .mzg-chip:hover { border-color: #fff; }
html[data-theme="dark"] .mzg-chip.is-active { background: var(--brand-light); border-color: var(--brand-light); color: #0a1929; }

@media (prefers-reduced-motion: reduce) { .mzg-item img, .mzg-tour3d-poster { transition: none; } .mzg-item:hover img { transform: none; } }

/* ---------- Link auf den vollständigen Satz (Google Drive) ---------- */
.mzg-drive { margin-top: clamp(40px, 5vw, 64px); padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.mzg-drive-text { font-family: var(--font-body); font-size: var(--fs-lead, 18px); line-height: 1.6; color: var(--fg); margin: 0; max-width: 640px; }
.mzg-drive-text b { color: var(--brand-dark); }
.mzg-drive-btn { font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--brand); padding: 16px 22px; text-decoration: none; border: 2px solid var(--brand); transition: background 0.2s, color 0.2s; }
.mzg-drive-btn:hover { background: transparent; color: var(--brand); }
.mzg-drive-btn:focus-visible { outline: 3px solid var(--action-yellow); outline-offset: 2px; }
html[data-theme="dark"] .mzg-drive-text b { color: var(--brand-light); }
html[data-theme="dark"] .mzg-drive-btn:hover { color: #fff; border-color: var(--brand-light); }
@media (max-width: 600px) { .mzg-drive-btn { width: 100%; box-sizing: border-box; text-align: center; } .mzg-drive > * { min-width: 0; } }

/* ---------- «Mehr Fotos anzeigen» je Tag ---------- */
.mzg-day.is-collapsed:not(.is-measuring) .mzg-item.is-more { display: none; }
.mzg-day.is-collapsed:not(.is-measuring) .mzg-grid::after { display: none; }   /* letzte sichtbare Zeile voll breit */
.mzg-more { display: block; margin: 20px auto 0; font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; padding: 14px 20px; cursor: pointer; background: transparent; color: var(--brand); border: 1px solid var(--line-strong); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.mzg-more::after { content: " ↓"; }
.mzg-more:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.mzg-more:focus-visible { outline: 3px solid var(--action-yellow); outline-offset: 2px; }
html[data-theme="dark"] .mzg-more { color: #fff; border-color: rgba(255,255,255,0.3); }
html[data-theme="dark"] .mzg-more:hover { background: var(--brand-light); color: #0a1929; border-color: var(--brand-light); }
@media (max-width: 600px) { .mzg-more { width: 100%; } }
