/* Downloadbereich telefonanleitungen.de
   Alles unter .dlb gekapselt, damit das e107-Theme unberührt bleibt.
   Schrift wird vom Theme geerbt; Gestaltung: Ordner als Karteireiter,
   Dateien als Verzeichnisliste mit Typ-Stempel. */

.dlb {
  --dlb-ink: #1d3f5e;
  --dlb-ink-soft: #3c6187;
  --dlb-paper: #ffffff;
  --dlb-tab: #e9eff5;
  --dlb-rule: #d6dde4;
  --dlb-muted: #5f6b76;
  --dlb-ok: #2f6b3a;
  --dlb-lock: #8a5a00;
  --dlb-lock-bg: #fbf3e1;
  --dlb-deny: #b3261e;
  box-sizing: border-box;
  width: 100%;
  max-width: 64rem;      /* wird schmaler mit dem Fenster, nie breiter als 64rem */
  min-width: 0;
  overflow-wrap: anywhere;
  color: #222;
  line-height: 1.45;
  font-size: 1rem;
}
.dlb *, .dlb *::before, .dlb *::after { box-sizing: inherit; }
.dlb a { color: var(--dlb-ink); }
.dlb a:hover { color: var(--dlb-ink-soft); }
.dlb a:focus-visible, .dlb button:focus-visible, .dlb input:focus-visible {
  outline: 3px solid #f2b705;
  outline-offset: 2px;
}
.dlb h2 { margin: 0 0 .4em; font-size: 1.45em; line-height: 1.2; color: var(--dlb-ink); }
.dlb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dlb-muted { color: var(--dlb-muted); font-size: .92em; }

/* Suche */
.dlb-search { display: flex; gap: .5rem; margin: 0 0 1.25rem; }
.dlb-search input {
  flex: 1 1 auto; min-width: 0;
  font: inherit; padding: .55rem .75rem;
  border: 1px solid var(--dlb-rule); border-bottom: 2px solid var(--dlb-ink);
  border-radius: 4px 4px 0 0; background: var(--dlb-paper);
}
.dlb-search button, .dlb .dlb-btn {   /* .dlb davor: schlägt ".dlb a" (Textfarbe) */
  font: inherit; font-weight: bold; cursor: pointer;
  padding: .55rem 1.1rem; border: 0; border-radius: 4px;
  background: var(--dlb-ink); color: #fff; text-decoration: none; display: inline-block;
}
.dlb-search button:hover, .dlb .dlb-btn:hover { background: var(--dlb-ink-soft); color: #fff; }

/* Pfad */
.dlb-crumbs ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; font-size: .95em; }
.dlb-crumbs li { color: var(--dlb-muted); }
.dlb-crumbs li + li::before { content: "/"; margin: 0 .45em; color: var(--dlb-rule); }
.dlb-crumbs li[aria-current] { color: #222; font-weight: bold; }

/* Ordnerkopf */
.dlb-head { display: flex; gap: 1rem; align-items: flex-start; margin: 0 0 1.25rem; }
.dlb-head-logo { max-width: 140px; max-height: 90px; flex: none; }
.dlb-intro { max-width: 70ch; }
.dlb-intro p:first-child { margin-top: 0; }

/* Ordner: Karteireiter */
.dlb-dirs { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .9rem .75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); padding-top: .55rem; }
.dlb-dirs li { position: relative; }
.dlb-dirs a {
  position: relative; display: flex; align-items: center; gap: .6rem;
  min-height: 3rem; padding: .6rem .8rem;
  background: var(--dlb-tab); border: 1px solid var(--dlb-rule); border-radius: 0 6px 6px 6px;
  text-decoration: none; font-weight: bold;
}
.dlb-dirs a::before {           /* der Reiter */
  content: ""; position: absolute; left: -1px; top: -.55rem;
  width: 42%; max-width: 7rem; height: .55rem;
  background: var(--dlb-tab); border: 1px solid var(--dlb-rule); border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.dlb-dirs a:hover { background: #dde7f0; }
.dlb-dirs a:hover::before { background: #dde7f0; }
.dlb-dirs img { max-height: 2.2rem; max-width: 4.5rem; flex: none; }

/* Kachelansicht (Datei "..1dreispaltig" im Ordner) */
.dlb-dirs--grid { grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); }
.dlb-dirs--grid a { flex-direction: column; justify-content: center; text-align: center; min-height: 8.5rem; }
.dlb-dirs--grid img { max-height: 4.5rem; max-width: 100%; }

/* Dateien */
.dlb-files, .dlb-hits { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--dlb-rule); }
.dlb-files a, .dlb-hits a {
  display: grid; grid-template-columns: 3.6rem 1fr auto; align-items: center; gap: .75rem;
  padding: .6rem .25rem; border-bottom: 1px solid var(--dlb-rule); text-decoration: none;
}
.dlb-files a:hover, .dlb-hits a:hover { background: #f5f8fb; }
.dlb-name { color: var(--dlb-ink); overflow-wrap: anywhere; }
.dlb-meta { color: var(--dlb-muted); font-size: .88em; white-space: nowrap; text-align: right; }
.dlb-type {                      /* Stempel */
  justify-self: start; font-size: .72em; font-weight: bold; letter-spacing: .04em;
  padding: .15em .4em; border: 1.5px solid currentColor; border-radius: 3px;
  color: var(--dlb-ink); transform: rotate(-3deg);
}
.dlb-type--pdf { color: #a1281f; }
.dlb-type--zip, .dlb-type--exe { color: #5b4a99; }
.dlb-type--jpg, .dlb-type--jpeg, .dlb-type--png, .dlb-type--gif, .dlb-type--tif, .dlb-type--tiff { color: var(--dlb-ok); }
.dlb-type--lnk, .dlb-type--lia { color: var(--dlb-muted); }
.dlb-lock { display: inline-block; margin-left: .4rem; padding: .05em .45em; border-radius: 3px;
  background: var(--dlb-lock-bg); color: var(--dlb-lock); font-size: .95em; }

/* Gleich lautende Einträge (z. B. NFD/NFC-Dubletten) */
.dlb-dup { margin-left: .35rem; color: var(--dlb-muted); font-size: .85em; font-weight: normal; }

/* Während eine Teilseite geladen wird (dlb.js) */
.dlb[aria-busy="true"] { opacity: .55; transition: opacity .15s; }

/* Suchtreffer: Stempel links über beide Zeilen, rechts Name und Fundort */
.dlb-hits a { grid-template-columns: 3.6rem 1fr; gap: .1rem .75rem; }
.dlb-hits .dlb-type { grid-row: span 2; align-self: center; }
.dlb-hits .dlb-name, .dlb-hits .dlb-where { grid-column: 2; }
.dlb-where { color: var(--dlb-muted); font-size: .88em; }
.dlb-suggest { font-size: 1.1em; }
.dlb-suggest a { font-weight: bold; }

/* Detailseite */
.dlb-file { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.dlb-file dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1.25rem; }
.dlb-file dt { color: var(--dlb-muted); }
.dlb-file dd { margin: 0; }
.dlb-preview { margin: 0; }
.dlb-preview img { display: block; max-width: 100%; height: auto; border: 1px solid var(--dlb-rule); box-shadow: 4px 4px 0 var(--dlb-tab); background: #fff; }

/* Hinweise */
.dlb-note { padding: .7rem .9rem; border-left: 4px solid var(--dlb-lock); background: var(--dlb-lock-bg); max-width: 70ch; }
.dlb-empty { color: var(--dlb-muted); }
.dlb-back { margin: 1rem 0 0; }
.dlb-back a::before { content: "‹ "; }

/* Debug (nur Admins mit ?debug) */
.dlb-debug { padding: .5rem .75rem; background: #fdecea; color: var(--dlb-deny); font-size: .9em; }
.dlb .dlb-denied a, .dlb .dlb-denied .dlb-name { color: var(--dlb-deny); }
.dlb-codes { font-size: .8em; color: var(--dlb-muted); }

/* Schmal: einspaltig */
@media (max-width: 640px) {
  .dlb-search { flex-direction: column; }
  .dlb-head { flex-direction: column; }
  .dlb-dirs { grid-template-columns: 1fr; }
  .dlb-dirs--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlb-files a, .dlb-hits a { grid-template-columns: 3.2rem 1fr; }
  .dlb-meta { grid-column: 2; text-align: left; }
  .dlb-file { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dlb-type { transform: none; }
  .dlb[aria-busy="true"] { transition: none; }
}
