/* ==========================================================
   24 Türchen – Stylesheet
   ========================================================== */
:root {
  --bg: #f6f0e4;
  --surface: #fffcf6;
  --surface-2: #efe6d3;
  --ink: #1d2a23;
  --muted: #5b6a61;
  --line: #e2d6bf;
  --primary: #1d4d3a;
  --primary-hover: #163d2e;
  --primary-ink: #fffcf6;
  --accent: #a8262b;
  --accent-hover: #8e1f24;
  --accent-ink: #fffcf6;
  --gold: #b98c1c;
  --ok: #2f7a4f;
  --ok-bg: #e3f1e6;
  --warn: #8a5a00;
  --warn-bg: #fbefd2;
  --err: #a8262b;
  --err-bg: #f8e2e0;
  --info-bg: #e2ecf6;
  --info: #2a5a86;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(29, 42, 35, .06), 0 10px 30px -14px rgba(29, 42, 35, .22);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ph-0: #1d4d3a; --ph-1: #a8262b; --ph-2: #b98c1c; --ph-3: #33566e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1814;
    --surface: #15231c;
    --surface-2: #1c2e25;
    --ink: #efe8d8;
    --muted: #a3b0a7;
    --line: #2a3d33;
    --primary: #8fd1ae;
    --primary-hover: #a8ddc0;
    --primary-ink: #0e1814;
    --accent: #f08a84;
    --accent-hover: #f5a39e;
    --accent-ink: #1a0d0c;
    --gold: #e2c063;
    --ok: #8fd1ae; --ok-bg: #173527;
    --warn: #ecc66a; --warn-bg: #3a2f14;
    --err: #f08a84; --err-bg: #3c1d1b;
    --info: #9cc3ea; --info-bg: #1a2c3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --ph-0: #24543f; --ph-1: #7d2a2c; --ph-2: #7a6224; --ph-3: #2c4a5f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 600; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 760px; }
.page { padding-top: 40px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .7em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.star { color: var(--accent); font-weight: 700; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
.logo:hover { color: var(--primary); }
.logo-mark { width: 34px; height: 34px; }
.main-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a.is-active { background: var(--surface-2); }
.main-nav a.nav-cta { background: var(--primary); color: var(--primary-ink); }
.main-nav a.nav-cta:hover { background: var(--primary-hover); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .98rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--primary); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); color: #fff; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--err); border-color: currentColor; }
.btn-danger-ghost:hover { background: var(--err-bg); color: var(--err); }
@media (prefers-color-scheme: dark) { .btn-ok, .btn-danger, .btn-ok:hover { color: #0e1814; } }
.btn-small { padding: 7px 14px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn .star { color: inherit; opacity: .8; }

/* ---------- Hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { display: grid; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.25fr 1fr; padding-top: 72px; padding-bottom: 72px; } }
.hero h1 { max-width: 16ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.doors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 460px; width: 100%; justify-self: center; }
.door {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px;
  font-family: var(--serif); font-weight: 700; font-size: clamp(.95rem, 2.4vw, 1.3rem);
  color: rgba(255, 252, 246, .95); position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .14), inset 0 -3px 0 rgba(0, 0, 0, .14);
}
.door::after { content: ""; position: absolute; right: 18%; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.door-v0 { background: var(--ph-0); }
.door-v1 { background: var(--ph-1); }
.door-v2 { background: var(--ph-0); filter: brightness(1.15); }
.door-v3 { background: var(--ph-3); }
.door-v4 { background: var(--ph-2); }
.door.is-open { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }
.door.is-open::after { display: none; }
.door.is-today { background: var(--gold); color: #1d2a23; box-shadow: 0 0 0 4px rgba(185, 140, 28, .25); }
@media (max-width: 899px) { .doors { max-width: 360px; } }

/* ---------- Filter ---------- */
.list-section { padding-top: 40px; padding-bottom: 24px; scroll-margin-top: 80px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.field { position: relative; display: flex; }
.field-search { flex: 1 1 260px; }
.field-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.filters .field-search input { padding-left: 42px; }
.filters input, .filters select { height: 46px; }
.filters .field:not(.field-search) { flex: 1 1 150px; }
.filters .btn { flex: 0 0 auto; }
@media (max-width: 560px) { .filters .btn { flex: 1 1 100%; } }

input[type=text], input[type=url], input[type=search], input[type=password], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 100px; }

.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.cat-chip { text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: .9rem; font-weight: 500; }
.cat-chip span { color: var(--muted); font-size: .8rem; margin-left: 2px; }
.cat-chip:hover { border-color: var(--primary); color: var(--ink); }
.cat-chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.cat-chip.is-active span { color: inherit; opacity: .75; }
.result-info { color: var(--muted); font-size: .92rem; margin: 10px 0 0; }

/* ---------- Karten ---------- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #fff; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; position: relative; overflow: hidden; }
.ph span { font-family: var(--serif); font-weight: 700; font-size: 4.2rem; color: rgba(255, 252, 246, .92); position: relative; z-index: 1; }
.ph::before { content: ""; position: absolute; inset: 14%; border: 2px dashed rgba(255, 255, 255, .35); border-radius: 12px; }
.ph::after { content: ""; position: absolute; right: 24%; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.ph-0 { background: var(--ph-0); } .ph-1 { background: var(--ph-1); } .ph-2 { background: var(--ph-2); } .ph-3 { background: var(--ph-3); }
.badge { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.badge-tipp { background: var(--gold); color: #1d2a23; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.card-title { margin-bottom: 2px; }
.card-brand { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.card-desc { font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 8px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 14px; font-size: .86rem; color: var(--muted); }
.chip { background: var(--surface-2); color: var(--ink); padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: .82rem; }

/* ---------- Leer-Zustand & CTA ---------- */
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); margin-top: 24px; }
.empty p { color: var(--muted); max-width: 46ch; margin-inline: auto; }
.empty-ph { width: 92px; height: 92px; border-radius: 16px; margin: 0 auto 20px; }
.empty-ph span { font-size: 2.6rem; }
.small-empty { padding: 32px 20px; }
.small-empty p { margin: 0; }
.cta-wrap { margin-top: 40px; margin-bottom: 64px; }
.cta-band { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; background: var(--primary); color: var(--primary-ink); border-radius: var(--radius); padding: 32px; }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { margin: 0; opacity: .85; max-width: 56ch; }

/* ---------- Flash ---------- */
.flash-wrap { padding-top: 20px; }
.flash { padding: 14px 18px; border-radius: var(--radius-s); margin-bottom: 16px; border: 1px solid transparent; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash-error { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.flash a { color: inherit; font-weight: 600; }
.flash .code { background: var(--surface); color: var(--ink); padding: 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; }

/* ---------- Formulare ---------- */
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .card-form { padding: 30px; } }
.form-row { margin-bottom: 18px; }
.form-row label, .form-row > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.form-grid { display: grid; gap: 0 18px; }
@media (min-width: 620px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.req { color: var(--accent); }
.opt { color: var(--muted); font-weight: 400; font-size: .86rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 18px; font-size: .93rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.form-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-section { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 16px; }

.success-box { text-align: center; padding: 40px 0; }
.success-box .lead, .success-box p { margin-inline: auto; }
.success-box .hero-actions { justify-content: center; }
.door-big { width: 96px; margin: 0 auto 24px; font-size: 2.6rem; }

/* ---------- Rechtstexte ---------- */
.legal h2 { font-size: 1.3rem; margin-top: 2em; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 22px; }
.legal .address { padding-left: 14px; border-left: 3px solid var(--line); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px 20px; margin: 20px 0; }
.toc ol { margin: 0; padding-left: 20px; columns: 2 220px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 36px; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.footer-brand { max-width: 560px; }
.footer-note { color: var(--muted); margin-top: 12px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: var(--ink); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom { color: var(--muted); font-size: .82rem; padding-top: 20px; padding-bottom: 28px; margin-top: 24px; border-top: 1px solid var(--line); }

/* ---------- Admin ---------- */
.admin-head, .edit-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.admin-head h1, .edit-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0; }
.edit-head .muted { margin: 8px 0 0; }
.admin-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-head-actions form { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { text-decoration: none; color: var(--muted); padding: 10px 16px; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--primary); }
.tab-count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); font-size: .78rem; text-align: center; margin-left: 4px; }
.tab-count.is-hot { background: var(--accent); color: var(--accent-ink); }

.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row { display: grid; grid-template-columns: 72px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-items: start; }
@media (min-width: 900px) { .admin-row { grid-template-columns: 84px 1fr auto; align-items: center; } }
.admin-thumb { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #fff; }
.admin-thumb img { width: 100%; height: 100%; object-fit: contain; }
.admin-thumb .ph span { font-size: 1.6rem; }
.admin-thumb .ph::before, .admin-thumb .ph::after { display: none; }
.admin-main h3 { margin-bottom: 4px; font-size: 1.12rem; }
.admin-main h3 a { color: var(--ink); text-decoration: none; }
.admin-main h3 a:hover { color: var(--accent); }
.admin-meta { color: var(--muted); font-size: .86rem; margin: 0 0 4px; }
.admin-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-gold { background: var(--gold); color: #1d2a23; }
.admin-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
@media (min-width: 900px) { .admin-actions { grid-column: auto; justify-content: flex-end; max-width: 380px; } }

.back-link { display: inline-block; margin-bottom: 16px; text-decoration: none; color: var(--muted); font-size: .92rem; }
.status { font-weight: 600; padding: 1px 8px; border-radius: 999px; font-size: .85rem; }
.status-pending { background: var(--warn-bg); color: var(--warn); }
.status-approved { background: var(--ok-bg); color: var(--ok); }
.status-rejected { background: var(--err-bg); color: var(--err); }
.edit-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .edit-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.edit-side { display: flex; flex-direction: column; gap: 20px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .btn { flex: 0 0 auto; }
.suggest { margin-top: 10px; padding: 12px; background: var(--info-bg); color: var(--info); border-radius: var(--radius-s); font-size: .86rem; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.suggest code { background: var(--surface); color: var(--ink); }
.edit-img { max-height: 180px; width: auto; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 8px; margin-bottom: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 14px 0; margin-top: 20px; border-top: 1px solid var(--line); z-index: 2; }
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line); }
.login-wrap { display: grid; place-items: center; min-height: 60vh; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 2rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
