/* Basis */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; text-wrap: balance; }
a { color: var(--link); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--wrap); margin: 0 auto; padding: 0.9rem 1.25rem;
}
.site-header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.site-header nav a { font-family: var(--font-head); font-weight: 600; text-decoration: none; }
.site-header nav a.nav-cta {
  background: var(--primary); color: var(--on-primary);
  padding: 0.45rem 1rem; border-radius: var(--radius);
}
.brand { text-decoration: none; }
/* Schmale Viewports: Header stapeln statt hässlich umbrechen.
   Logo zentriert, Nav darunter als eine zentrierte Zeile. */
@media (max-width: 40rem) {
  .site-header { flex-direction: column; gap: 0.65rem; padding: 0.85rem 1rem 0.75rem; }
  .site-header nav { justify-content: center; column-gap: 0.9rem; row-gap: 0.4rem; width: 100%; }
  .site-header nav a { font-size: 1rem; }
  .site-header nav a.nav-cta { padding: 0.4rem 0.85rem; }
}

/* Kennzeichen-Komponente */
.plate {
  display: inline-flex; align-items: stretch;
  background: var(--plate-bg);
  border: 3px solid var(--plate-border);
  border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 1.6rem;
}
.plate-sm { font-size: 1.15rem; }
.plate-hero { font-size: clamp(1.8rem, 6vw, 3.2rem); }
.plate-band {
  background: var(--plate-band); color: #FFFFFF;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 0.28em 0.32em 0.22em; min-width: 1.5em;
}
.plate-band svg { width: 1.05em; height: 1.05em; display: block; }
.plate-d { font-family: var(--font-plate); font-weight: 700; font-size: 0.8em; line-height: 1; }
.plate-chars {
  /* flex+center: wird das Schild im Halter auf Leistenbreite gedehnt,
     bleiben die Zeichen mittig, wie auf dem echten Blech. Ohne Halter
     ändert das nichts (Container ist inhaltsbreit). */
  display: flex; flex: 1 1 auto; justify-content: center; align-items: center; gap: 0.26em;
  padding: 0.16em 0.5em;
  font-family: var(--font-plate); font-weight: 700;
  color: var(--plate-text); letter-spacing: 0.03em; white-space: nowrap;
}
/* Echte Engschrift statt der Stufe-1-Näherung (Barlow plus scaleX). */
.plate-eng .plate-chars { letter-spacing: 0; font-family: 'GL-Nummernschild-Eng', 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif; }
.plate-seals { display: flex; flex-direction: column; gap: 0.13em; }
.plate-seal { width: 0.4em; height: 0.4em; border-radius: 50%; }
.plate-seal-hu { background: var(--accent); border: 1px solid #8A6A00; }
.plate-seal-stadt { background: #9AA3A8; border: 1px solid #5C6467; }
/* Zusatz E/H: steht wie beim echten Schild in voller Höhe direkt hinter
   dem Ziffernblock (WÜ RT 123H). Negative Margin gleicht das Flex-Gap von
   .plate-chars aus, netto bleibt ein Mini-Abstand von 0.14em. */
.plate-zusatz { margin-left: -0.12em; }

/* Nummernschildverstärker: Halter um das Schild, Werbeleiste unten.
   Rahmen und Radius skalieren in em mit der Größenstaffel; Leiste und
   Spruch sind bewusst auf Mindestpixel gepinnt (14px/8px), damit der Text
   lesbar bleibt. Die Leisten-Proportion wächst dadurch bei kleinen
   Schildern über die realen ~16 % hinaus, das ist der Preis der Lesbarkeit. */
.halter { display: inline-flex; flex-direction: column; align-items: flex-end; font-size: 1.6rem; max-width: 100%; }
/* sm spiegelt die plate-Größenstaffel (aktuell Tests/Admin-Reserve) */
.halter-sm { font-size: 1.15rem; }
.halter-hero { font-size: clamp(1.8rem, 6vw, 3.2rem); }
.halter .plate { font-size: 1em; box-shadow: none; }
.halter-rahmen {
  display: inline-flex; flex-direction: column; align-items: stretch;
  background: var(--halter-bg);
  padding: 0.1em 0.1em 0; border-radius: 0.34em;
  box-shadow: var(--shadow); max-width: 100%;
}
.halter-leiste { display: flex; align-items: center; justify-content: center; height: 0.5em; min-height: 18px; padding: 0 0.4em; overflow: hidden; }
.halter-spruch {
  color: var(--halter-text); font-family: var(--font-body); font-weight: 600;
  font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.halter-logo { max-height: 82%; max-width: 92%; display: block; }
.halter-anzeige { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 0.15rem; }

/* Hero: Schild, Claim, CTAs und Suche als eine Einheit
   (enger Rhythmus oben, Suche als Werkzeug leicht abgesetzt). */
.hero { text-align: center; padding: 2.75rem 1.25rem 2.25rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 1rem 0 0.5rem; }
.hero p { color: var(--text-soft); max-width: 55ch; margin: 0 auto 1.4rem; }
.hero-ctas { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  padding: 0.7rem 1.4rem; border-radius: var(--radius); text-decoration: none;
  border: 2px solid var(--primary); cursor: pointer; font-size: 1.05rem;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-secondary { background: transparent; color: var(--link); }

/* Galerie */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; padding: 0; margin: 1rem 0 2rem; list-style: none; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); text-align: center;
}
.tile .plate { max-width: 100%; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; justify-content: space-between; align-items: center; margin-top: 0.6rem; font-size: 0.9rem; color: var(--text-soft); }
.tile-link { display: inline-block; text-decoration: none; border-radius: 8px; transition: transform 120ms ease; }
.tile-link:hover { transform: translateY(-2px); }
.tile-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.detail { text-align: center; }
.detail-schild { margin: 1.5rem 0 1rem; }
.detail-meta { color: var(--text-soft); }
.detail-vote { justify-content: center; margin: 1rem 0 1.5rem; }
.teilen { position: relative; display: inline-block; }
.teilen-knopf { list-style: none; cursor: pointer; }
.teilen-knopf::-webkit-details-marker { display: none; }
.teilen-menue {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 10;
  min-width: 11rem; margin: 0; padding: 0.3rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); text-align: left;
}
.teilen-menue a, .teilen-menue button {
  display: block; width: 100%; padding: 0.45rem 0.7rem; border: 0;
  background: none; color: var(--link); font: inherit; font-size: 0.95rem;
  text-decoration: none; text-align: left; border-radius: 6px; cursor: pointer;
}
.teilen-menue a:hover, .teilen-menue button:hover { background: var(--surface-2); }
.teilen-kopieren[hidden] { display: none; }
.vote-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.2rem 0.7rem; cursor: pointer; color: var(--text); font-size: 0.9rem;
}
.vote-btn[disabled] { opacity: 0.6; cursor: default; }
.votes .stern { color: var(--accent); }

/* Chips und Suche */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; list-style: none; }
.chip {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 0.2rem 0.75rem; font-size: 0.9rem; text-decoration: none;
}
.suche-form { display: flex; gap: 0.6rem; max-width: 28rem; margin: 1.9rem auto 0; }
.suche-form input {
  flex: 1; min-width: 0; padding: 0.65rem 0.9rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 1.05rem; background: var(--surface); color: var(--text);
}
.suche-form .btn { padding: 0.65rem 1.2rem; }

/* Formulare */
.form-feld { margin-bottom: 1.1rem; }
.form-feld label { display: block; font-weight: 600; font-family: var(--font-head); margin-bottom: 0.25rem; }
.form-feld .hinweis { font-size: 0.85rem; color: var(--text-soft); }
.feld-fehler { color: var(--err); font-size: 0.9rem; margin: 0.3rem 0 0; }
.form-feld input:not([type="checkbox"]), .form-feld select {
  width: 100%; max-width: 14rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 1.05rem; background: var(--surface); color: var(--text);
  text-transform: uppercase;
}
/* Nur Kennzeichen-EINGABEN in Versalien, nie Dropdown-Texte ("keiner"). */
.form-feld select { text-transform: none; }
.form-feld label:has(input[type="checkbox"]) {
  /* Fließtext-Font: font-head existiert nur in 600/700, 400 würde faux-bold. */
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 400;
}
.form-feld input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin-top: 0.25rem; flex-shrink: 0; }
.fehler {
  background: var(--surface); border-left: 5px solid var(--err);
  padding: 0.7rem 1rem; border-radius: var(--radius); margin: 1rem 0;
}
.erfolg {
  background: var(--surface); border-left: 5px solid var(--ok);
  padding: 1rem 1.2rem; border-radius: var(--radius); margin: 1rem 0;
}
.fehler > :first-child, .erfolg > :first-child { margin-top: 0; }
.fehler > :last-child, .erfolg > :last-child { margin-bottom: 0; }
.fehler ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.erfolg h1, .fehler h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.erfolg .btn { margin: 0.25rem 0.5rem 0.25rem 0; }
/* Leerzustand: einheitliche Optik für "noch nichts da"-Absätze
   (gestrichelte Kante wie die Dropzone, ruhig und zentriert). */
.leer {
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-soft);
  padding: 1.4rem 1.2rem; text-align: center; margin: 1rem 0;
}
.honig { position: absolute; left: -9999px; }

/* Sektionen */
section.block { max-width: var(--wrap); margin: 0 auto 2.5rem; padding: 0 1.25rem; }
section.block h2 { border-bottom: 3px solid var(--primary); padding-bottom: 0.4rem; }
.prose { padding-top: 2rem; padding-bottom: 2rem; }

/* Admin */
/* Admin-Kopf: Titel links, Abmelden rechts, bricht auf Schmal sauber um. */
.admin-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-kopf h1 { margin: 0; }
.admin-kopf-aktionen { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.stat-karten { display: flex; flex-wrap: wrap; gap: 0.75rem; list-style: none; padding: 0; margin: 1rem 0 2rem; }
.stat-karten li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 1rem; }
.stat-karten strong { font-family: var(--font-head); }
.queue-liste { list-style: none; padding: 0; }
.queue-eintrag {
  display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1rem; margin: 0.6rem 0;
}
.queue-meta { color: var(--text-soft); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.queue-foto { width: 10rem; height: 7rem; border-radius: var(--radius); display: block; object-fit: cover; }
.queue-eintrag form { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.queue-eintrag .btn { padding: 0.45rem 1rem; font-size: 0.95rem; }
.queue-warnung { color: var(--err); font-weight: 600; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 3rem;
  padding: 1.5rem 1.25rem 2.5rem; text-align: center; color: var(--text-soft); font-size: 0.92rem;
}
.footer-hinweis { font-size: 0.85rem; }

/* Screenreader-only (nicht mit .honig verwechseln, das ist der Honeypot) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Vote-Feedback sichtbar (title-only reicht nicht auf Touch);
   leer erzeugt der Platzhalter keinen Geisterabstand. */
.vote-status { display: block; flex-basis: 100%; font-size: 0.8rem; color: var(--text-soft); margin-top: 0.3rem; }
.vote-status:empty { margin-top: 0; }
/* Vote-Buttons nur mit JS anbieten (progressive enhancement) */
.vote-btn { display: none; }
html.js .vote-btn { display: inline-flex; align-items: center; gap: 0.3rem; }

@media (prefers-reduced-motion: no-preference) {
  .tile { transition: transform 0.15s ease; }
  .tile:hover { transform: translateY(-3px); }
}

/* Admin: Werbe-Seite */
.hinweis-werbung {
  background: var(--surface-2); border-left: 4px solid var(--err);
  padding: 0.75rem 1rem; border-radius: var(--radius); margin: 1rem 0;
}
.werbe-liste { list-style: none; padding: 0; display: grid; gap: 1rem; }
.werbe-eintrag {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
}
.werbe-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.werbe-form input[name="partner"], .werbe-form input[type="file"] {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.4rem 0.6rem; background: var(--surface); color: var(--text);
}
.dropzone {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 0.6rem 1rem; color: var(--text-soft); font-size: 0.9rem;
}
.dropzone[hidden] { display: none; }
.dropzone-aktiv { border-color: var(--primary); color: var(--primary); }
.werbe-partner { margin: 0; }
