/* Galerie – Farben als Tokens fuer hell und dunkel (Darstellung: darstellung.js).
   Der Betrachter ist bewusst immer dunkel (Buehne fuer Fotos und Videos). */
:root {
  color-scheme: light;
  --grund: #f4f5f7;
  --flaeche: #ffffff;
  --flaeche-2: #e9ecf1;
  --text: #1b1f24;
  --text-leise: #5b6470;
  --linie: #d5dae1;
  --akzent: #1f6feb;
  --akzent-text: #ffffff;
  --fehler: #b3261e;
  --hinweis-grund: #fff4d6;
  --hinweis-text: #6b4e00;
  --schatten: 0 1px 2px rgb(0 0 0 / .08), 0 4px 14px rgb(0 0 0 / .06);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --grund: #0f1115;
    --flaeche: #181b21;
    --flaeche-2: #232831;
    --text: #e6e9ee;
    --text-leise: #9aa3af;
    --linie: #2e343e;
    --akzent: #4c8dff;
    --akzent-text: #0b0d10;
    --fehler: #ff8a80;
    --hinweis-grund: #3a2f12;
    --hinweis-text: #f3d68a;
    --schatten: 0 1px 2px rgb(0 0 0 / .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --grund: #0f1115;
  --flaeche: #181b21;
  --flaeche-2: #232831;
  --text: #e6e9ee;
  --text-leise: #9aa3af;
  --linie: #2e343e;
  --akzent: #4c8dff;
  --akzent-text: #0b0d10;
  --fehler: #ff8a80;
  --hinweis-grund: #3a2f12;
  --hinweis-text: #f3d68a;
  --schatten: 0 1px 2px rgb(0 0 0 / .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--grund);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.gesperrt { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--akzent); }
button, select, input, .knopf {
  font: inherit;
  color: inherit;
}
button, .knopf {
  background: var(--flaeche-2);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: .45em .9em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4em;
}
button:hover, .knopf:hover { border-color: var(--akzent); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
select, input[type=text], input[type=password] {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: .45em .6em;
}

/* Kopf */
.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 16px 20px 12px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky;
  top: 0;
  z-index: 5;
}
.kopf-titel { flex: 1 1 260px; min-width: 0; }
.kopf h1 { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.untertitel { margin: 2px 0 0; color: var(--text-leise); }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.filter button { border: 0; border-radius: 0; background: var(--flaeche); }
.filter button + button { border-left: 1px solid var(--linie); }
.filter button[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); }
.darstellung { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.darstellung button { border: 0; border-radius: 0; background: var(--flaeche); padding: .35em .7em; font-size: .9em; }
.darstellung button + button { border-left: 1px solid var(--linie); }
.darstellung button[aria-pressed="true"] { background: var(--flaeche-2); font-weight: 600; }

.pfad { padding: 10px 20px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--text-leise); }
.pfad .trenner { opacity: .6; }

main { flex: 1; padding: 16px 20px 24px; width: 100%; max-width: 1600px; margin: 0 auto; }

.karte {
  max-width: 560px;
  margin: 8vh auto 0;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 22px 24px;
}
.karte h2 { margin: 0 0 8px; font-size: 1.15rem; }
.karte p { color: var(--text-leise); }
.karte form { display: grid; gap: 12px; margin-top: 14px; }
.karte label { display: grid; gap: 4px; font-weight: 500; }
.karte form button[type=submit] { justify-self: start; background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.ergebnis { margin-top: 16px; padding: 12px; background: var(--flaeche-2); border-radius: 8px; display: grid; gap: 10px; }
.ergebnis a#lb-link { overflow-wrap: anywhere; font-weight: 600; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }
.fehler { color: var(--fehler); }
.hinweis { background: var(--hinweis-grund); color: var(--hinweis-text); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }

/* Raster */
.raster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
@media (max-width: 520px) {
  .raster { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  main { padding: 10px 6px 20px; }
  .kopf { padding: 12px 14px 10px; }
}
.kachel { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--flaeche-2); }
.kachel-knopf, .kachel.ordner a {
  all: unset;
  box-sizing: border-box;
  position: absolute; inset: 0;
  cursor: pointer;
  display: block;
}
.kachel-knopf:focus-visible, .kachel.ordner a:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }
.kachel img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.kachel-knopf:hover img { transform: scale(1.03); }
.abzeichen {
  position: absolute; right: 6px; bottom: 6px;
  background: rgb(0 0 0 / .65); color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  pointer-events: none;
}
.abzeichen.links { right: auto; left: 6px; background: rgb(120 60 0 / .8); pointer-events: auto; }
.blaettern { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.blaettern.an { opacity: 1; }
.blaettern-balken { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--akzent); opacity: 0; pointer-events: none; }
.blaettern-balken.an { opacity: 1; }
.kachel.ordner a { display: grid; place-content: center; text-align: center; gap: 6px; padding: 10px; }
.ordner-zeichen { font-size: 42px; }
.kachel-name { font-weight: 600; overflow-wrap: anywhere; }

/* Betrachter – immer dunkel */
.betrachter {
  position: fixed; inset: 0; z-index: 20;
  background: #050607; color: #e9ecef;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}
.betrachter button, .betrachter .knopf, .betrachter select {
  background: #1d2127; border-color: #343a44; color: #e9ecef;
}
.b-kopf { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 14px; }
.b-info { min-width: 0; display: grid; }
.b-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-stelle { color: #a7b0bb; font-size: .9em; }
.b-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.b-tempo, .b-auto { display: inline-flex; gap: 6px; align-items: center; font-size: .9em; color: #c9d0d8; }
.b-mitte { display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 0; }
.b-pfeil { font-size: 34px; line-height: 1; padding: 16px 12px; margin: 0 6px; background: transparent !important; border: 0 !important; }
.b-buehne { min-width: 0; min-height: 0; height: 100%; display: grid; place-items: center; touch-action: pan-y; }
.b-buehne video, .b-buehne img { max-width: 100%; max-height: calc(100vh - 200px); display: block; background: #000; }
.b-buehne video:fullscreen { max-height: none; }
.streifen { display: flex; gap: 3px; overflow-x: auto; padding: 8px 14px; scrollbar-width: thin; }
.streifen-bild {
  flex: 0 0 auto; height: 54px; padding: 0 !important; border-radius: 3px !important;
  background-repeat: no-repeat; border: 2px solid transparent !important; opacity: .7;
}
.streifen-bild:hover, .streifen-bild.jetzt { opacity: 1; border-color: #4c8dff !important; }
.b-tasten { margin: 0; padding: 4px 14px 10px; color: #7d8792; font-size: 12px; text-align: center; }
@media (max-width: 520px) {
  .b-pfeil { padding: 10px 4px; margin: 0; font-size: 28px; }
  .b-tasten { display: none; }
  .b-buehne video, .b-buehne img { max-height: calc(100vh - 170px); }
}

.fuss { color: var(--text-leise); font-size: 12.5px; text-align: center; padding: 10px 16px 18px; }
.fuss p { margin: 0; }
