/* Einwohnermeldeamt Maulwurfstadt – Stile (30.10.2026)
   Alles hängt an .ew, damit es sich mit dem Theme nicht beißt (die App läuft auch IN einer Theme-Seite).
   Gilt für /einwohner/ (ohne Theme, auch als Overlay aus dem Terminal) und für /einwohnermeldeamt (im Theme). */

@font-face { font-family: "Bangers"; font-style: normal; font-weight: 400; src: url("/fonts_maulwurfstadt/bangers-v20-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; src: url("/fonts_maulwurfstadt/poppins-v20-latin-regular.woff2") format("woff2"); }

.ew {
  --papier: #f4f1ea; --karte: #ffffff; --tinte: #23211d; --grau: #6d6860; --linie: #d8d2c4;
  --akzent: #b8402a; --akzent-hell: #f6e3dc; --kachel: 92px;
  background: var(--papier); color: var(--tinte); font: 15px/1.45 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
}
.ew, .ew * { box-sizing: border-box; }
.ew a { color: var(--akzent); }
.ew-kopf { padding: 18px 20px 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.ew h1 { font-family: "Bangers", "Poppins", sans-serif; font-weight: 400; letter-spacing: .03em; font-size: 34px; margin: 0; padding: 0; }
.ew .stand { color: var(--grau); font-size: 13px; }
.ew .leiste { position: sticky; top: 0; z-index: 5; background: var(--papier); border-bottom: 1px solid var(--linie); padding: 10px 20px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ew .zeile { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ew .feld { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grau); margin: 0; }
.ew input[type=search], .ew input[type=number], .ew select { font: inherit; font-size: 14px; color: var(--tinte); background: var(--karte); border: 1px solid var(--linie); border-radius: 6px; padding: 5px 8px; margin: 0; height: auto; }
.ew input[type=search] { width: 230px; }
.ew input[type=number] { width: 64px; }
.ew .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ew .chip { font: inherit; font-size: 13px; border: 1px solid var(--linie); background: var(--karte); color: var(--tinte); border-radius: 14px; padding: 2px 10px; cursor: pointer; }
.ew .chip[aria-pressed=true] { background: var(--tinte); border-color: var(--tinte); color: #fff; }
.ew .ew-filterknopf { display: none; }
.ew .knopf { font: inherit; font-size: 13px; color: var(--tinte); border: 1px solid var(--linie); background: var(--karte); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.ew .zahl { margin-left: auto; font-size: 13px; color: var(--grau); }
.ew .zahl b { color: var(--tinte); }
.ew-main { padding: 14px 20px 60px; }
.ew .gruppe { margin: 0 0 22px; }
.ew .gruppe h2 { font-family: "Bangers", "Poppins", sans-serif; font-weight: 400; letter-spacing: .03em; font-size: 22px; margin: 0 0 8px; padding: 0; display: flex; align-items: baseline; gap: 10px; }
.ew .gruppe h2 small { font-family: "Poppins", sans-serif; font-size: 13px; color: var(--grau); letter-spacing: 0; }
.ew .matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--kachel), 1fr)); gap: 8px; }
.ew .kachel { position: relative; background: var(--karte); border: 1px solid var(--linie); border-radius: 6px; padding: 0 0 4px; cursor: pointer; text-align: center; overflow: hidden; will-change: transform; }
.ew .kachel:hover, .ew .kachel:focus-visible { border-color: var(--tinte); outline: none; }
.ew .kachel .n { font-size: 11px; line-height: 1.25; padding: 3px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ew .kachel .w { font-size: 11px; color: var(--grau); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.ew .klein .kachel .n, .ew .klein .kachel .w { display: none; }
.ew .leer { color: var(--grau); padding: 30px 0; }
.ew .abfrage-sql { display: block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--tinte); background: var(--karte); border: 1px solid var(--linie); border-radius: 6px; padding: 4px 8px; white-space: pre-wrap; word-break: break-word; }
.ew #kopf .stand { flex-basis: 100%; }
.ew .hinweis { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--grau); }
.ew .warnung { flex-basis: 100%; margin: 4px 0 0; padding: 8px 12px; font-size: 14px; background: #fff3c4; border: 1px solid #d9b84a; border-radius: 6px; color: #3d3214; }
.ew .kachel--anders { border-color: #d9b84a; box-shadow: 0 0 0 2px #f2d675; }
.ew .marke { position: absolute; top: 4px; left: 4px; font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 3px; background: #fff3c4; border: 1px solid #d9b84a; color: #3d3214; }
.eingebettet .ew-kopf { padding-right: 70px; }
.eingebettet .ew h1 { font-size: 26px; }

/* Bilder: Kacheln und Akte. Mit #page-content davor, weil das Theme dort allen Bildern 70 % Breite, Rand und Rahmen gibt */
.ew .kachel img, #page-content .ew .kachel img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: #dcd8cf; margin: 0; padding: 0; border: 0; box-shadow: none; }

/* Akte (Dialogfenster) */
.ew dialog { border: 1px solid var(--linie); border-radius: 10px; padding: 0; max-width: 640px; width: calc(100% - 32px); background: var(--karte); color: var(--tinte); }
.ew dialog::backdrop { background: rgba(35, 33, 29, .45); }
.ew .akte { display: grid; grid-template-columns: 240px 1fr; gap: 0 20px; padding: 20px; }
.ew .akte img, #page-content .ew .akte img { width: 240px; height: 320px; border-radius: 4px; background: #dcd8cf; margin: 0; padding: 0; border: 0; object-fit: cover; }
.ew .akte h3 { font-family: "Bangers", "Poppins", sans-serif; font-weight: 400; letter-spacing: .03em; font-size: 26px; margin: 0 0 8px; }
.ew .akte table { border-collapse: collapse; font-size: 13px; width: 100%; }
.ew .akte td { padding: 2px 8px 2px 0; vertical-align: top; border-bottom: 1px solid #eee9de; }
.ew .akte td:first-child { color: var(--grau); white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.ew .akte tr.anders td { background: #fff3c4; }
.ew .akte .original { display: block; font-size: 11px; color: var(--grau); }
.ew .akte-fuss { display: flex; justify-content: space-between; gap: 8px; padding: 0 20px 16px; }

/* Im Theme (Seite /einwohnermeldeamt): Titel kommt vom Theme, die App sitzt im Inhaltskasten */
.ew-im-theme .ew { margin: 0 -10px; border-radius: 8px; }
.ew-im-theme .ew h1 { display: none; }
.ew-im-theme .ew .leiste { border-top: 1px solid var(--linie); }

/* Handy */
@media (max-width: 620px) {
  .ew .akte { grid-template-columns: 1fr; }
  .ew .akte img, #page-content .ew .akte img { width: 180px; height: 240px; margin: 0 auto 12px; display: block; }
  .ew input[type=search] { width: 100%; }
  .ew .leiste { position: static; }
  .ew-kopf, .ew .leiste, .ew-main { padding-left: 10px; padding-right: 10px; }
  .ew .zeile > *, .ew .feld { min-width: 0; max-width: 100%; }
  .ew select { max-width: 100%; }
  .ew .zahl { margin-left: 0; }
  .ew .matrix { grid-template-columns: repeat(auto-fill, minmax(min(var(--kachel), 30%), 1fr)); }
  .eingebettet .ew-kopf { padding-right: 56px; }
  .eingebettet .ew h1 { font-size: 22px; }
  .ew-im-theme .ew { margin: 0 -8px; }
  /* Filter zugeklappt: nur Suchfeld, Knopf und Trefferzahl */
  .ew .ew-filterknopf { display: inline-block; }
  .ew .ew-filterknopf::after { content: " ▾"; }
  .ew .leiste.offen .ew-filterknopf::after { content: " ▴"; }
  .ew .leiste:not(.offen) .zeile:nth-child(1) > .feld,
  .ew .leiste:not(.offen) .zeile:nth-child(2),
  .ew .leiste:not(.offen) .zeile:nth-child(3) > :not(.zahl) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ew .kachel { transition: none !important; } }
