/* Chiarina viewer.css v2 — Foto-Modul Step 6c (11.05.2026)
   v2 Diff zu v1:
     + .foto-viewer__toolbar          Global-Actions im Header
     + .foto-viewer__tool             einzelner Toolbar-Button
     + .foto-viewer__item-action      Per-Beleg-Action (Share/Print)
     + Header-Layout angepasst: title links, toolbar mitte, close rechts

   v1 — Beleg-Viewer Modal (fullscreen, scrollbare Liste).
   Mobile-first, nutzt Tokens aus style.css.
   Keine Animationen, keine Transitions (Chiarina-Konvention).
   Konsistent zur .foto-modal-Familie aus foto.css.
*/

/* ---------------------------------------------------------------------------
   Backdrop
--------------------------------------------------------------------------- */
.foto-viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* ---------------------------------------------------------------------------
   Viewer-Container
--------------------------------------------------------------------------- */
.foto-viewer {
  width: 100%;
  max-width: var(--max-w);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Header — sticky oben, mit Titel + Toolbar + Schliessen-X
   Layout: title (1 1 auto) | toolbar (0 0 auto) | close (0 0 auto)
--------------------------------------------------------------------------- */
.foto-viewer__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px)) 16px;
  background: var(--color-header);
  border-bottom: 1px solid var(--color-border);
}

.foto-viewer__title {
  margin: 0;
  flex: 1 1 auto;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.foto-viewer__close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------------------
   Toolbar — Global-Actions (📦 ZIP, 🖨️ Alle drucken)
   Step 6c: Mobile zeigt nur ZIP, Desktop zeigt ZIP+Print-All.
--------------------------------------------------------------------------- */
.foto-viewer__toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.foto-viewer__tool {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------------------
   Liste — scrollbar
--------------------------------------------------------------------------- */
.foto-viewer__list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
  background: var(--color-bg);
  -webkit-overflow-scrolling: touch;
}

.foto-viewer__loading,
.foto-viewer__empty,
.foto-viewer__error {
  margin: 24px 0;
  text-align: center;
  font-size: 15px;
  color: var(--color-text-muted);
}

.foto-viewer__error {
  color: var(--color-recording);
}

/* ---------------------------------------------------------------------------
   Item — ein Beleg
--------------------------------------------------------------------------- */
.foto-viewer__item {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.foto-viewer__item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Meta-Zeile — Datum + Beschreibung + Kategorie + Betrag + Action + Loesch
--------------------------------------------------------------------------- */
.foto-viewer__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--color-text);
}

.foto-viewer__date {
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.foto-viewer__desc {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foto-viewer__cat {
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 2px 8px;
  background: var(--color-header);
  border-radius: 9px;
  white-space: nowrap;
}

.foto-viewer__amount {
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-text);
}

/* Per-Beleg-Action (Step 6c): 📤 share Mobile / 🖨️ print Desktop.
   Gleiche Maße wie Loesch-Icon, sitzt direkt davor. */
.foto-viewer__item-action {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.foto-viewer__delete {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------------------
   Bild
--------------------------------------------------------------------------- */
.foto-viewer__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: #000000;
  border-radius: 6px;
}
