/* Foto-Modul (assets/fotos.js): Banner, Event-Ordner, Ordner-Ansicht.
   Jede Demo setzt über window.FOTOS_CONFIG.vars nur ihre Farben und Schriften:
   --fx-accent, --fx-on-accent, --fx-fg, --fx-muted, --fx-surface, --fx-line, --fx-font-display, --fx-font-body, --fx-radius */
.fx, .fx-view, .fx-toast {
  --a: var(--fx-accent, #e0245e);
  --on-a: var(--fx-on-accent, #fff);
  --fg: var(--fx-fg, #1c1c1e);
  --mu: var(--fx-muted, #6b6b73);
  --sf: var(--fx-surface, #fff);
  --ln: var(--fx-line, rgba(0, 0, 0, .14));
  --fd: var(--fx-font-display, inherit);
  --fb: var(--fx-font-body, inherit);
  --dw: var(--fx-display-weight, 700);
  --r: var(--fx-radius, 18px);
  font-family: var(--fb);
  box-sizing: border-box;
}
.fx *, .fx-view *, .fx-toast * { box-sizing: border-box; }
html.fx-lock { overflow: hidden; }
.fx button, .fx-view button, .fx-toast button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fx button:focus-visible, .fx-view button:focus-visible, .fx-toast button:focus-visible, .fx .fx-b:focus-visible, .fx select:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }
.fx svg, .fx-view svg { width: 20px; height: 20px; flex: none; }

/* ── Banner „Rückblick“ ── */
.fx-banner { position: relative; width: 100%; margin: 14px 0 18px; }
.fx-banner[hidden] { display: none; }
.fx-b {
  position: relative; display: block; overflow: hidden; isolation: isolate; cursor: pointer;
  height: 200px; border-radius: var(--r); background: #111; color: #fff;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .55);
}
.fx-slides, .fx-slides img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-slides img { object-fit: cover; opacity: 0; transition: opacity .9s ease, transform 6s ease-out; transform: scale(1.04); }
.fx-slides img.on { opacity: 1; transform: scale(1.1); }
.fx-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .78)); }
.fx-tag {
  position: absolute; z-index: 2; left: 12px; top: 12px; padding: 5px 11px; border-radius: 999px;
  font: 800 11px/1 var(--fb); letter-spacing: .12em; text-transform: uppercase;
  background: var(--a); color: var(--on-a);
}
.fx-text { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 12px; display: grid; gap: 2px; }
.fx-text strong { font: var(--dw) clamp(18px, 5vw, 24px)/1.12 var(--fd); text-shadow: 0 2px 10px rgba(0, 0, 0, .55); text-wrap: balance; }
.fx-text small { font: 500 13px/1.3 var(--fb); opacity: .9; }
.fx-strip { display: flex; gap: 5px; margin-top: 7px; align-items: center; }
.fx-strip i { width: 34px; height: 34px; border-radius: 9px; background-size: cover; background-position: center; opacity: .6; border: 2px solid transparent; transition: opacity .3s, border-color .3s; }
.fx-strip i.on { opacity: 1; border-color: var(--a); }
.fx-strip em { font: 700 12px/1 var(--fb); font-style: normal; padding: 0 6px; opacity: .9; }
.fx-b-cam {
  position: absolute; z-index: 3; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(20, 20, 24, .45); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
@media (min-width: 700px) { .fx-b { height: 260px; } .fx-strip i { width: 44px; height: 44px; } }

/* ── Panel: Event-Ordner ── */
.fx-panel { margin: 20px 0; color: var(--fg); }
.fx-p-head h3 { margin: 0 0 4px; font: var(--dw) clamp(20px, 5vw, 26px)/1.15 var(--fd); }
.fx-p-head p { margin: 0 0 14px; color: var(--mu); font-size: 14px; line-height: 1.45; }
.fx-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.fx-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--a); background: transparent; color: var(--fg); font-weight: 700; font-size: 15px;
}
.fx-btn.primary { background: var(--a); color: var(--on-a); }
.fx-sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mu); }
.fx-sel select {
  min-height: 44px; max-width: 100%; border-radius: 12px; border: 1px solid var(--ln); background: var(--sf); color: var(--fg);
  font: 500 15px var(--fb); padding: 0 10px;
}
.fx-folders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .fx-folders { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.fx-folder {
  display: grid; gap: 4px; text-align: left; padding: 0 0 10px; overflow: hidden; border-radius: calc(var(--r) - 4px);
  border: 1px solid var(--ln); background: var(--sf); color: var(--fg);
  transition: transform .2s, box-shadow .2s;
}
.fx-folder:not(.leer):hover { transform: translateY(-3px); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .5); }
.fx-folder.leer { opacity: .55; cursor: default; }
.fx-cover { display: grid; place-items: center; aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--a) 14%, var(--sf)); overflow: hidden; }
.fx-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-cover b { font-size: 38px; }
.fx-fname { padding: 6px 10px 0; font: var(--dw) 15px/1.2 var(--fd); }
.fx-folder small { padding: 0 10px; color: var(--mu); font-size: 12.5px; }
.fx-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; color: var(--mu); font-size: 13px; line-height: 1.45; }
.fx-note svg { width: 16px; height: 16px; margin-top: 2px; }

/* ── Ordner-Ansicht (Vollbild, immer dunkel) ── */
.fx-view {
  position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  background: #0d0d10; color: #f5f5f7; padding-bottom: env(safe-area-inset-bottom);
}
.fx-view[hidden] { display: none; }
.fx-v-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: rgba(13, 13, 16, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.fx-v-title { flex: 1; min-width: 0; }
.fx-v-title h3 { margin: 0; font: var(--dw) 20px/1.15 var(--fd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-v-title small { color: rgba(255, 255, 255, .65); font-size: 13px; }
.fx-round {
  min-width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); padding: 0 12px;
  display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; font-size: 20px; line-height: 1;
}
.fx-round[hidden] { display: none; }
.fx-round.del { font-size: 14px; font-weight: 700; background: rgba(224, 36, 62, .75); }
.fx-v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 4px; padding: 4px; }
@media (min-width: 700px) { .fx-v-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 8px 16px; } }
.fx-ph { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #222; }
.fx-ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.fx-ph:hover img { transform: scale(1.05); }
.fx-ph em { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; background: var(--a); color: var(--on-a); font: 700 11px/1 var(--fb); font-style: normal; }
.fx-empty { grid-column: 1 / -1; padding: 40px 16px; text-align: center; color: rgba(255, 255, 255, .6); }
.fx-v-note { margin: auto 0 0; padding: 18px 16px 24px; text-align: center; color: rgba(255, 255, 255, .55); font-size: 12.5px; }
.fx-lb { position: fixed; inset: 0; z-index: 3; display: grid; place-items: center; background: #000; }
.fx-lb[hidden] { display: none; }
.fx-lb > img { max-width: 100%; max-height: calc(100% - 140px); object-fit: contain; }
.fx-lb-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.fx-lb-cap { flex: 1; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .75); }
.fx-round.nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 28px; padding: 0 0 4px; }
.fx-round.prev { left: 10px; } .fx-round.next { right: 10px; }

/* ── Hinweis oben ── */
.fx-toast {
  position: fixed; z-index: 2100; left: 50%; top: calc(14px + env(safe-area-inset-top)); max-width: min(92vw, 460px);
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px;
  background: rgba(24, 24, 28, .94); color: #fff; font: 600 14px/1.35 var(--fb); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6);
  transform: translate(-50%, -24px); opacity: 0; pointer-events: none; transition: transform .3s, opacity .3s;
}
.fx-toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.fx-toast button { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--a); color: var(--on-a); font-weight: 800; white-space: nowrap; min-height: 36px; }

@media (prefers-reduced-motion: reduce) {
  .fx-slides img, .fx-slides img.on { transition: none; transform: none; }
  .fx-folder, .fx-ph img, .fx-toast { transition: none; }
}
