/* Karikaturen-Archiv */

:root {
  --grund: #f6f5f3;
  --flaeche: #ffffff;
  --flaeche-2: #eeece8;
  --rand: #dedad3;
  --text: #1c1a17;
  --text-leise: #6b6560;
  --akzent: #9c4221;
  --akzent-schwach: #f2e3dc;
  --markierung: #ffe9a8;
  --schatten: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #16151a;
    --flaeche: #1f1e24;
    --flaeche-2: #2a2830;
    --rand: #37343d;
    --text: #ece9e6;
    --text-leise: #a09a95;
    --akzent: #e07a54;
    --akzent-schwach: #3a2620;
    --markierung: #6a5320;
    --schatten: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

/* Muss vor allen Layoutregeln stehen: ein eigenes display (grid, flex)
   ueberstimmt sonst das hidden-Attribut, und die Lupe stuende beim Laden
   offen. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.fixiert { overflow: hidden; }

mark { background: var(--markierung); color: inherit; border-radius: 2px; padding: 0 1px; }

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

.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--grund) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rand);
  padding: 14px 20px 10px;
}

.kopf-innen {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1500px;
  margin: 0 auto;
}

.kopf h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.suchfeld { position: relative; flex: 1; }

.suchfeld input {
  width: 100%;
  padding: 11px 38px 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.suchfeld input:focus {
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px var(--akzent-schwach);
}

.suchfeld input::-webkit-search-cancel-button { display: none; }

#leeren {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: 18px; line-height: 1;
  color: var(--text-leise);
  background: none; border: 0; border-radius: 50%;
  cursor: pointer;
}
#leeren:hover { background: var(--flaeche-2); color: var(--text); }

.abmelden { margin: 0; }
.abmelden button {
  font: inherit; font-size: 13px;
  color: var(--text-leise);
  background: none; border: 0; padding: 6px;
  cursor: pointer;
}
.abmelden button:hover { color: var(--text); text-decoration: underline; }

.kopf-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1500px;
  margin: 10px auto 0;
}

.filter-knopf {
  font: inherit; font-size: 13px;
  color: var(--text-leise);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.filter-knopf:hover { color: var(--text); }
.filter-knopf.offen { background: var(--akzent-schwach); border-color: var(--akzent); color: var(--akzent); }

.aktive-filter { display: flex; gap: 6px; flex-wrap: wrap; }

.status { margin-left: auto; font-size: 13px; color: var(--text-leise); }

.themenliste {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1500px;
  margin: 12px auto 4px;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px 2px;
}

.thema-knopf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
}
.thema-knopf:hover { border-color: var(--akzent); }
.thema-knopf.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.thema-knopf .zahl { font-size: 11px; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.thema-knopf.aktiv .zahl { color: rgba(255,255,255,.75); }

/* -------------------------------------------------------------- Raster */

main { max-width: 1500px; margin: 0 auto; padding: 22px 20px 60px; }

.raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
}

.karte {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
}
.karte:hover, .karte:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--schatten);
  border-color: var(--akzent);
  outline: none;
}

.karte img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--flaeche-2);
  display: block;
}

.karte-fuss {
  padding: 9px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13.5px;
  line-height: 1.35;
}

.karte-thema { font-size: 11.5px; color: var(--text-leise); }

.leer {
  text-align: center;
  color: var(--text-leise);
  padding: 70px 20px;
  max-width: 460px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- Lupe */

.lupe {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 26px;
}

.lupe-innen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0;
  width: 100%;
  max-width: 1260px;
  max-height: calc(100vh - 52px);
  background: var(--flaeche);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.lupe-bild {
  display: grid;
  place-items: center;
  background: var(--flaeche-2);
  padding: 18px;
  min-height: 0;
}
.lupe-bild img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; }

.lupe-info {
  padding: 22px 24px;
  overflow-y: auto;
  border-left: 1px solid var(--rand);
}
.lupe-info h2 { margin: 0 0 10px; font-size: 17px; line-height: 1.3; }

.beschreibung { margin: 0 0 14px; color: var(--text); }

.bildtext {
  margin: 0 0 16px;
  padding: 10px 13px;
  background: var(--flaeche-2);
  border-left: 3px solid var(--akzent);
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  white-space: pre-line;
  color: var(--text-leise);
}

.felder { margin: 0 0 20px; font-size: 13px; }
.felder dt { color: var(--text-leise); margin-top: 12px; font-size: 11.5px;
             text-transform: uppercase; letter-spacing: .05em; }
.felder dd { margin: 5px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }
.felder dd.schlicht { display: block; font-size: 13.5px; }

.chip {
  font: inherit; font-size: 12.5px;
  color: var(--text);
  background: var(--flaeche-2);
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.chip:hover { border-color: var(--akzent); color: var(--akzent); }
.chip.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }

.lupe-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }

.knopf {
  font: inherit; font-size: 13.5px;
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid var(--rand);
  background: var(--flaeche);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.knopf:hover { border-color: var(--akzent); }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.haupt:hover { filter: brightness(1.08); }

.lupe-zu, .lupe-blaettern {
  position: absolute;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 26px; line-height: 1;
  color: #fff;
  background: rgba(0,0,0,.42);
  border: 0; border-radius: 50%;
  cursor: pointer;
}
.lupe-zu:hover, .lupe-blaettern:hover { background: rgba(0,0,0,.7); }
.lupe-zu { top: 18px; right: 20px; }
.lupe-blaettern { top: 50%; transform: translateY(-50%); }
.lupe-blaettern.zurueck { left: 16px; }
.lupe-blaettern.vor { right: 16px; }

/* ----------------------------------------------------------- Anmeldung */

body.anmeldung { display: grid; place-items: center; min-height: 100vh; }

.anmeldekarte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 14px;
  padding: 34px 32px;
  width: min(340px, calc(100vw - 40px));
  box-shadow: var(--schatten);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.anmeldekarte h1 { margin: 0 0 6px; font-size: 17px; text-align: center; }
.anmeldekarte input {
  font: inherit; padding: 11px 13px;
  color: var(--text);
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 8px;
  outline: none;
}
.anmeldekarte input:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-schwach); }
.anmeldekarte button {
  font: inherit; font-weight: 550;
  padding: 11px;
  background: var(--akzent);
  color: #fff;
  border: 0; border-radius: 8px;
  cursor: pointer;
}
.anmeldekarte button:hover { filter: brightness(1.08); }
.fehler { margin: 0; font-size: 13px; color: #c0392b; text-align: center; }
@media (prefers-color-scheme: dark) { .fehler { color: #ff8a75; } }

/* ------------------------------------------------------------ schmaler */

@media (max-width: 860px) {
  .kopf-innen { flex-wrap: wrap; }
  .suchfeld { order: 3; flex-basis: 100%; }
  .lupe { padding: 0; }
  .lupe-innen {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    max-height: 100vh;
    border-radius: 0;
  }
  .lupe-bild img { max-height: 52vh; }
  .lupe-info { border-left: 0; border-top: 1px solid var(--rand); max-height: 44vh; }
  .lupe-blaettern { display: none; }
}
