/* Kunstsammlung – Gestaltung. Ein Stylesheet, keine externen Abhängigkeiten. */

:root {
  --grund:        #f4f2ee;
  --flaeche:      #ffffff;
  --flaeche-2:    #faf8f5;
  --rand:         #ddd8d0;
  --text:         #1e242c;
  --text-leise:   #6b7280;
  --akzent:       #8a6a3b;
  --akzent-hell:  #f2ece2;
  --gefahr:       #a03329;
  --ok:           #2e6b46;
  --schatten:     0 1px 2px rgba(20,24,30,.06), 0 4px 14px rgba(20,24,30,.05);
  --radius:       10px;
  --breite:       1400px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund:       #14181d;
    --flaeche:     #1c222a;
    --flaeche-2:   #222932;
    --rand:        #333c47;
    --text:        #e7e3dc;
    --text-leise:  #9aa4b0;
    --akzent:      #c9a267;
    --akzent-hell: #2a2620;
    --gefahr:      #e0705f;
    --ok:          #6cc08a;
    --schatten:    0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--text); }

h1 { font-size: 1.5rem; margin: .2em 0 .6em; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .5em; }

.ueberspringen {
  position: absolute; left: -9999px;
}
.ueberspringen:focus {
  left: 8px; top: 8px; z-index: 100; background: var(--flaeche);
  padding: .5em 1em; border-radius: var(--radius);
}

/* ----------------------------------------------------------------- Kopf -- */

.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
  padding: .6rem clamp(.7rem, 2vw, 1.4rem);
  padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}
.marke {
  font-weight: 650; font-size: 1.05rem; color: var(--text); text-decoration: none;
  margin-right: auto;
}
.hauptnav { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.hauptnav a {
  padding: .45em .7em; border-radius: 8px; text-decoration: none;
  color: var(--text-leise); font-size: .93rem; white-space: nowrap;
}
.hauptnav a:hover { background: var(--flaeche-2); color: var(--text); }
.hauptnav a.hier { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }
.wer { border-left: 1px solid var(--rand); margin-left: .3rem; }

.inhalt {
  max-width: var(--breite);
  margin: 0 auto;
  padding: clamp(.8rem, 2vw, 1.6rem);
  padding-bottom: 4rem;
}
body.schmal .inhalt { max-width: 620px; }

.fuss {
  display: flex; justify-content: space-between; gap: 1rem;
  max-width: var(--breite); margin: 0 auto;
  padding: 1rem clamp(.8rem, 2vw, 1.6rem) max(1rem, env(safe-area-inset-bottom));
  color: var(--text-leise); font-size: .85rem;
}

/* -------------------------------------------------------------- Bausteine -- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1rem;
  margin: 0 0 1rem;
}
fieldset.karte { border: 1px solid var(--rand); }
legend { font-weight: 650; padding: 0 .4em; }

.stapel { display: grid; gap: .8rem; }
.hinweis { color: var(--text-leise); font-size: .85rem; margin: .3em 0; }
.klein { font-size: .88rem; }
.warn { color: var(--gefahr); }
.warnkarte { border-color: var(--gefahr); }
.leer { color: var(--text-leise); padding: 2rem 0; text-align: center; }
.inline { display: inline; }

.meldung {
  padding: .7em 1em; border-radius: var(--radius); margin: 0 0 1rem;
  border: 1px solid var(--rand); background: var(--flaeche);
}
.meldung.ok     { border-color: var(--ok); color: var(--ok); }
.meldung.fehler { border-color: var(--gefahr); color: var(--gefahr); }

.liste-schlicht { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4em; min-height: 44px; padding: .5em 1em;
  background: var(--flaeche); color: var(--text);
  border: 1px solid var(--rand); border-radius: 8px;
  font: inherit; text-decoration: none; cursor: pointer;
}
.knopf:hover { background: var(--flaeche-2); color: var(--text); }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
.knopf.haupt:hover { filter: brightness(1.08); color: #fff; }
.knopf.gefahr { color: var(--gefahr); border-color: var(--gefahr); }
.knopf.klein { min-height: 36px; padding: .3em .7em; font-size: .88rem; }
.knopf.aktiv { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent); }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }

label { display: grid; gap: .25rem; font-size: .88rem; color: var(--text-leise); }
label.ankreuz, label.loeschen {
  display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text);
}
input, select, textarea {
  font: inherit; font-size: 16px;              /* verhindert das Zoomen auf iOS */
  color: var(--text); background: var(--flaeche-2);
  border: 1px solid var(--rand); border-radius: 8px;
  padding: .55em .7em; min-height: 44px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
textarea { min-height: 6em; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .knopf:focus-visible, a:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 2px;
}

dl.daten {
  display: grid; grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: .35rem 1rem; margin: 0;
}
dl.daten dt { color: var(--text-leise); font-size: .88rem; }
dl.daten dd { margin: 0; }

/* ---------------------------------------------------------------- Suche -- */

.suchleiste { margin-bottom: 1rem; }
.suchzeile { display: flex; gap: .5rem; }
/* min-width: 0 – sonst erzwingt der lange Platzhaltertext eine zu breite Zeile
   und die Seite lässt sich auf dem Telefon seitlich schieben. */
.suchzeile input { flex: 1 1 auto; min-width: 0; }
.suchzeile .knopf { flex: 0 0 auto; }

.filter {
  margin-top: .7rem; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: var(--radius);
}
.filter > summary {
  padding: .7em 1em; cursor: pointer; font-weight: 600; list-style-position: inside;
}
.filterraster {
  display: grid; gap: .7rem; padding: 0 1rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.spanne { display: flex; gap: .5rem; align-items: end; border: 1px solid var(--rand);
  border-radius: 8px; padding: .3rem .6rem .6rem; margin: 0; min-width: 0; }
.spanne input { min-width: 0; }
.spanne legend { font-size: .8rem; color: var(--text-leise); font-weight: 500; }
.filterknoepfe { display: flex; gap: .5rem; padding: 0 1rem 1rem; }

.ergebniskopf {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  margin-bottom: .9rem;
}
.zusammenfassung { margin: 0; margin-right: auto; color: var(--text-leise); }
.zusammenfassung strong { color: var(--text); }
.werkzeuge { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* -------------------------------------------------------------- Galerie -- */

.galerie {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(.6rem, 1.4vw, 1rem);
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (min-width: 900px) {
  .galerie { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
.karte-objekt {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten);
}
.karte-objekt a { display: block; text-decoration: none; color: inherit; height: 100%; }
.karte-objekt:hover { border-color: var(--akzent); }
.bildfeld {
  position: relative; aspect-ratio: 1; background: var(--flaeche-2);
  display: flex; align-items: center; justify-content: center;
}
.bildfeld img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kein-bild { color: var(--text-leise); font-size: .8rem; }
.bildfeld .anzahl {
  position: absolute; right: .4rem; bottom: .4rem;
  background: rgba(0,0,0,.65); color: #fff; font-size: .72rem;
  padding: .1em .45em; border-radius: 999px;
}
.karte-text { display: grid; gap: .12rem; padding: .6rem .7rem .8rem; }
.karte-nr { font-size: .74rem; color: var(--text-leise); letter-spacing: .04em; }
.karte-text strong { font-size: .93rem; line-height: 1.3; }
.karte-titel { font-size: .85rem; color: var(--text-leise); }
.karte-meta { font-size: .78rem; color: var(--text-leise); }

/* -------------------------------------------------------------- Tabelle -- */

.tabellenrahmen {
  overflow-x: auto; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: var(--radius);
}
table.liste { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.liste th, table.liste td {
  padding: .55em .7em; text-align: left; border-bottom: 1px solid var(--rand);
  white-space: nowrap;
}
table.liste th { position: sticky; top: 0; background: var(--flaeche-2); z-index: 1; }
table.liste th a { color: var(--text); text-decoration: none; }
table.liste th.sortiert a { color: var(--akzent); font-weight: 700; }
table.liste th.sortiert.auf a::after { content: " ▲"; font-size: .7em; }
table.liste th.sortiert.ab  a::after { content: " ▼"; font-size: .7em; }
table.liste tbody tr:hover { background: var(--flaeche-2); cursor: pointer; }
table.liste td.zahl, table.liste th:last-child { text-align: right; }
table.liste td.nr { font-variant-numeric: tabular-nums; }
.marke-bild { color: var(--akzent); font-size: .8em; }

.blaettern {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin: 1.5rem 0; color: var(--text-leise);
}

/* --------------------------------------------------------------- Detail -- */

.brotkrumen {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .8rem;
}
.blaetterpfeile { display: flex; gap: .5rem; }
.blaetterpfeile a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--rand); border-radius: 8px;
  text-decoration: none; background: var(--flaeche);
}

.detail { display: grid; gap: 1rem; }
.detailkopf {
  display: grid; gap: .3rem; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem;
}
.detailkopf h1 { margin: 0; }
.objektnr { font-size: .8rem; letter-spacing: .06em; color: var(--text-leise); text-transform: uppercase; }
.untertitel { margin: 0; color: var(--text-leise); font-style: italic; }
.detailkopf .werkzeuge { margin-top: .5rem; }

.bildbereich {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: .8rem;
}
.grossbild { display: block; }
.grossbild img {
  display: block; width: 100%; max-height: 70vh; object-fit: contain;
  background: var(--flaeche-2); border-radius: 6px;
}
.vorschauleiste {
  list-style: none; display: flex; gap: .5rem; padding: .7rem 0 0; margin: 0;
  overflow-x: auto;
}
.vorschauleiste img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--rand); display: block;
}

.angaben { display: grid; gap: 1rem; }
.angaben > .daten,
.notiz {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 1rem;
}
.notiz h2 { margin-top: 0; }

.anhaenge {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 1rem;
}
.anhangliste { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.anhangliste li {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  padding: .5rem; background: var(--flaeche-2); border-radius: 8px;
}
.anhangliste li a:first-of-type { margin-right: auto; }
.typmarke {
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  padding: .25em .5em; border-radius: 4px;
  background: var(--akzent-hell); color: var(--akzent);
}

/* ------------------------------------------------------------- Formular -- */

.formular { display: grid; gap: 1rem; }
.feldraster {
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feldraster .breit { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .feldraster .breit { grid-column: span 2; }
  .feldraster .kurz  { max-width: 12rem; }
}
.formularknoepfe { display: flex; gap: .6rem; flex-wrap: wrap; }

.dateiverwaltung { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.dateiverwaltung li {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .6rem; background: var(--flaeche-2); border-radius: 8px;
}
.dateiverwaltung img {
  width: 86px; height: 86px; object-fit: contain; border-radius: 6px;
  background: var(--flaeche); flex: none;
}
.dateisymbol {
  width: 86px; height: 86px; flex: none; display: flex; align-items: center;
  justify-content: center; background: var(--flaeche); border-radius: 6px;
  font-weight: 700; color: var(--text-leise);
}
.dateiangaben { display: grid; gap: .4rem; flex: 1; min-width: 0; }
.dateiname { font-size: .85rem; word-break: break-all; }
.uploadfelder { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.uploadfelder input[type=file] { padding: .5em; background: var(--flaeche-2); }

.benutzerkarte h2 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.marke-gesperrt { font-size: .72rem; color: var(--gefahr); border: 1px solid var(--gefahr);
  padding: .1em .45em; border-radius: 999px; font-weight: 500; }
.marke-ich { font-size: .72rem; color: var(--text-leise); border: 1px solid var(--rand);
  padding: .1em .45em; border-radius: 999px; font-weight: 500; }
.benutzerkarte .werkzeuge { margin-top: .8rem; }
.kennwortblock { margin-top: .8rem; }
.kennwortblock summary { cursor: pointer; color: var(--text-leise); font-size: .9rem; }
.kennwortblock .feldraster { margin: .7rem 0; }

/* ------------------------------------------------------------ Lichtbild -- */

.lichtbild {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8,10,13,.94);
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 1rem 1rem;
}
.lichtbild[hidden] { display: none; }
.lichtbild img { max-width: 100%; max-height: 92vh; object-fit: contain; }
.lichtbild-zu {
  position: absolute; top: max(.8rem, env(safe-area-inset-top)); right: .8rem;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; border: 0;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}

@media print {
  .kopf, .fuss, .werkzeuge, .brotkrumen, .suchleiste, .blaettern { display: none; }
  body { background: #fff; }
  .karte, .detailkopf, .bildbereich, .anhaenge, .angaben > .daten { border: 0; box-shadow: none; }
}
