/* =========================================================================
   Eventplaner V2 – Stil
   Aesthetik: "Dorfabend in der blauen Stunde" – tiefes Dämmerblau,
   warmes Laternen-Bernstein, cremefarbenes Papier.
   ========================================================================= */

:root {
  --ink:        #1b2138;   /* tiefes Dämmerblau-Schwarz */
  --ink-2:      #2c3556;
  --night:      #141a30;
  --paper:      #f7f1e6;   /* warmes Creme */
  --paper-2:    #fbf7ee;
  --line:       #e3d8c3;
  --amber:      #d2823b;   /* Laternenglühen */
  --amber-deep: #b3631f;
  --rust:       #a8442c;   /* Fachwerk-Rot */
  --green:      #5d7a4f;
  --muted:      #7c7460;
  --ok-bg:      #e8f0e2;  --ok-fg:  #3f5a36;
  --err-bg:     #f6e0da;  --err-fg: #8c3520;
  --warn-bg:    #f6ecd6;  --warn-fg:#8a6516;
  --info-bg:    #e6ecf4;  --info-fg:#34466b;
  --radius:     14px;
  --shadow:     0 10px 30px -12px rgba(20,26,48,.35);
  --shadow-sm:  0 4px 14px -8px rgba(20,26,48,.4);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Outfit", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 50% -8%, #34406b 0%, transparent 60%),
    linear-gradient(180deg, #1b2138 0%, #232a47 38%, #2b2435 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 1.1rem; }

a { color: var(--amber-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--amber); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20,26,48,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--paper); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--amber); font-size: 1.05rem; transform: translateY(-1px); }
.brand-text { font-family: var(--serif); font-weight: 600; font-size: 1.32rem; letter-spacing: .2px; }
.topnav { display: flex; align-items: center; gap: 1.1rem; }
.topnav a { color: rgba(247,241,230,.85); font-weight: 500; font-size: .95rem; }
.topnav a:hover { color: #fff; text-decoration: none; }
.topnav a.ghost {
  border: 1px solid rgba(255,255,255,.22); padding: .42rem .85rem;
  border-radius: 999px; font-size: .85rem;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 4.3rem 0 3.6rem; }
.hero.has-img { background: var(--hero-img) center/cover no-repeat; }
.hero:not(.has-img) {
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(210,130,59,.22), transparent 60%);
}
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,26,48,.45) 0%, rgba(20,26,48,.78) 100%);
}
.hero:not(.has-img) .hero-veil { background: linear-gradient(180deg, rgba(20,26,48,.2), rgba(20,26,48,.45)); }
.hero-inner { position: relative; text-align: center; animation: rise .7s ease both; }
.hero-kicker {
  text-transform: uppercase; letter-spacing: .26em; font-size: .74rem;
  color: var(--amber); font-weight: 600; margin-bottom: .9rem;
}
.hero-title {
  font-family: var(--serif); font-weight: 600; color: #fff;
  font-size: clamp(2.2rem, 6vw, 3.7rem); line-height: 1.05;
  text-shadow: 0 2px 24px rgba(0,0,0,.4);
}
.hero-sub { color: rgba(247,241,230,.86); margin-top: .85rem; font-size: 1.05rem; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Main / Cards ---------- */
.main { flex: 1; padding: 2.2rem 1.1rem 4rem; }
.card {
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  margin-bottom: 1.5rem;
}
.section { scroll-margin-top: 80px; }
.section h3 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; margin-bottom: 1rem; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1.4rem;
}
.section-head h2 { font-family: var(--serif); color: #fff; font-weight: 600; font-size: 1.7rem; }
.section-head .muted { color: rgba(247,241,230,.7); }
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.section-title { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.section-title h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: .87rem; }
.ta-right { text-align: right; }
.sep { border: none; border-top: 1px solid var(--line); margin: 1.3rem 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--sans); font-weight: 600; font-size: .92rem;
  padding: .62rem 1.15rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  border-color: var(--amber-deep); color: #fff;
}
.btn-ghost { background: transparent; }
.btn-danger { background: #fff; border-color: #e0bcb0; color: var(--rust); }
.btn-danger:hover { background: var(--rust); color: #fff; border-color: var(--rust); }
.btn-sm { padding: .42rem .8rem; font-size: .82rem; }
.x {
  background: none; border: none; color: var(--rust); cursor: pointer;
  font-size: 1rem; padding: .25rem .45rem; border-radius: 8px; line-height: 1;
}
.x:hover { background: var(--err-bg); }
.inline { display: inline; }

/* ---------- Flash ---------- */
.flash {
  padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1rem;
  font-weight: 500; font-size: .95rem;
}
.flash-ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.flash-err  { background: var(--err-bg);  color: var(--err-fg); }
.flash-warn { background: var(--warn-bg); color: var(--warn-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }

/* ---------- Chips ---------- */
.chip {
  display: inline-block; font-size: .72rem; font-weight: 600;
  padding: .26rem .62rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); letter-spacing: .03em;
  vertical-align: middle;
}
.chip-lock { background: var(--ink-2); }
.chip-ok   { background: var(--green); }
.chip-warn { background: var(--amber-deep); }

/* ---------- Event-Grid (Startseite) ---------- */
.event-grid {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
}
.event-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  min-height: 200px; display: flex; align-items: flex-end;
  background: var(--ink-2); color: #fff; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .16s ease, box-shadow .2s;
}
.event-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 18px 36px -14px rgba(0,0,0,.5); }
.event-card.has-img { background: var(--card-img) center/cover no-repeat; }
.event-card-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,26,48,.15) 0%, rgba(20,26,48,.88) 78%);
}
.event-card-body { position: relative; padding: 1.25rem; width: 100%; }
.event-card-top { display: flex; gap: .4rem; margin-bottom: .6rem; flex-wrap: wrap; }
.event-card-body h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.event-card-date { margin-top: .35rem; font-size: .95rem; color: rgba(247,241,230,.92); }
.event-card-date .muted { color: rgba(247,241,230,.65); }
.event-card-loc { font-size: .87rem; color: rgba(247,241,230,.72); margin-top: .15rem; }

.empty { text-align: center; padding: 3rem 1.5rem; }
.empty-emoji { font-size: 2.6rem; margin-bottom: .6rem; }
.empty h3 { font-family: var(--serif); font-size: 1.4rem; margin-bottom: .5rem; }
.empty .btn { margin-top: 1rem; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.tabs a {
  background: rgba(255,255,255,.08); color: var(--paper);
  padding: .5rem 1rem; border-radius: 999px; font-size: .9rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,.12);
}
.tabs a:hover { background: rgba(255,255,255,.16); text-decoration: none; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: .95rem; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=email], select, textarea {
  font-family: var(--sans); font-size: .98rem; color: var(--ink);
  padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; width: 100%; font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(210,130,59,.18);
}
textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .95rem; }
.row-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-top: 1rem; }
.row-form .grow, .grow { flex: 1; min-width: 180px; }
.row-form input, .row-form select { width: auto; flex: 1; min-width: 130px; }

.toggles { display: grid; gap: .55rem; margin: .4rem 0; }
.switch { display: flex; align-items: center; gap: .6rem; font-weight: 500; font-size: .95rem; cursor: pointer; }
.switch input { width: auto; }

.file-drop {
  display: block; border: 2px dashed var(--line); border-radius: 12px;
  padding: 1.1rem; text-align: center; cursor: pointer; background: #fff;
  font-weight: 500; color: var(--muted); transition: border-color .15s, background .15s;
}
.file-drop:hover { border-color: var(--amber); background: var(--paper-2); }
.file-drop input { display: none; }

/* ---------- Auth / PIN ---------- */
.auth-card, .pin-gate { max-width: 440px; margin: 1rem auto; text-align: center; }
.auth-mark, .pin-emoji { font-size: 2rem; color: var(--amber); margin-bottom: .4rem; }
.pin-emoji { font-size: 2.4rem; }
.auth-card h2, .pin-gate h2 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: .5rem; }
.auth-card .form, .pin-form { text-align: left; margin-top: 1.2rem; }
.pin-form { display: flex; gap: .6rem; }
.pin-form input { flex: 1; }
.back-link { margin-top: 1.3rem; font-size: .9rem; }

/* ---------- Poll-Tabelle ---------- */
.table-scroll { overflow-x: auto; margin: .5rem 0 1.2rem; -webkit-overflow-scrolling: touch; }
.poll-table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .92rem; }
.poll-table th, .poll-table td {
  border: 1px solid var(--line); padding: .55rem .6rem; text-align: center;
}
.poll-table thead th { background: var(--ink); color: var(--paper); font-weight: 600; }
.poll-table .pt-name { text-align: left; white-space: nowrap; background: var(--paper-2); font-weight: 600; }
.poll-table thead .pt-name { background: var(--ink); }
.pt-date { display: block; font-size: 1rem; }
.pt-day  { display: block; font-size: .72rem; opacity: .75; }
.pt-time { display: block; font-size: .7rem; opacity: .7; }
.pt-best { background: rgba(210,130,59,.22) !important; outline: 2px solid var(--amber); }
.poll-table thead th.pt-best { background: var(--amber-deep) !important; outline: none; }
.cell-yes   { background: #e3efdd; color: var(--green); font-weight: 700; }
.cell-maybe { background: #f6ecd6; color: var(--warn-fg); font-weight: 700; }
.cell-no    { background: #fafafa; color: #c2bba8; }
.pt-sum td { background: var(--paper-2); font-weight: 600; }
.pt-comment { cursor: help; margin-left: .2rem; }
.vote-form { margin-top: 1rem; }
.vote-form > summary { list-style: none; display: inline-flex; }
.vote-form > summary::-webkit-details-marker { display: none; }
.vote-form[open] > summary { margin-bottom: 1rem; }
.vote-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
.vote-day { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; }
.vote-day legend { font-weight: 600; font-size: .85rem; padding: 0 .3rem; }
.vote-day .opt { display: flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .9rem; padding: .15rem 0; }
.vote-day .opt input { width: auto; }
.opt-yes   { color: var(--green); }
.opt-maybe { color: var(--warn-fg); }
.final-banner {
  background: var(--ok-bg); color: var(--ok-fg); padding: .9rem 1.1rem;
  border-radius: 10px; font-size: 1rem; margin: .8rem 0;
}
.final-banner a { color: var(--ok-fg); text-decoration: underline; }

.confirmed {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  background: linear-gradient(135deg, #2b3354 0%, #3a3050 100%);
  border: 1px solid rgba(210,130,59,.4);
}
.confirmed-main { display: flex; align-items: center; gap: 1rem; }
.confirmed-icon { font-size: 2rem; }
.confirmed-label {
  text-transform: uppercase; letter-spacing: .18em; font-size: .72rem;
  font-weight: 600; color: var(--amber);
}
.confirmed-date {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: #fff;
}
.confirmed .btn { flex-shrink: 0; }

/* ---------- Aufgaben ---------- */
.cat-head {
  font-family: var(--serif); font-size: 1.05rem; color: var(--amber-deep);
  margin: 1.3rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line);
}
.cat-head:first-of-type { margin-top: 0; }
.task-list { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.task {
  border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem;
  background: #fff;
}
.task-full { background: var(--paper-2); }
.task-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.task-name { font-weight: 600; }
.task-note { display: block; font-size: .83rem; color: var(--muted); }
.task-count {
  font-weight: 700; font-size: .85rem; color: var(--amber-deep);
  background: var(--paper); padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
}
.task-count.done { color: var(--green); background: var(--ok-bg); }
.task-progress { height: 5px; background: var(--line); border-radius: 999px; margin: .6rem 0; overflow: hidden; }
.task-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-deep)); transition: width .4s ease; }
.assignees { list-style: none; display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; }
.assignees li { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.assignees em { color: var(--muted); font-style: normal; }
.task-signup { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.task-signup input { flex: 1; min-width: 130px; width: auto; }
.task-done-label { color: var(--green); font-weight: 600; font-size: .88rem; margin-top: .4rem; }

/* ---------- Galerie ---------- */
.masonry { columns: 3 220px; column-gap: .9rem; }
.ph {
  break-inside: avoid; margin-bottom: .9rem; border-radius: 12px; overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--line); position: relative;
}
.ph img { width: 100%; display: block; cursor: zoom-in; transition: transform .3s ease; }
.ph:hover img { transform: scale(1.03); }
.ph figcaption { padding: .5rem .7rem; font-size: .82rem; color: var(--muted); }
.ph.mod { display: flex; flex-direction: column; }
.ph.mod img { cursor: default; }
.ph.mod form { padding: .5rem; text-align: center; }
.gallery-upload { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.4rem; }

/* ---------- Moderne Galerie (Eventdurchführung) ---------- */
.gallery-grid {
  columns: 4 240px; column-gap: 14px;
}
.gphoto {
  break-inside: avoid; margin: 0 0 14px; position: relative;
  border-radius: 16px; overflow: hidden; background: var(--ink-2);
  box-shadow: 0 8px 22px -12px rgba(20,26,48,.55);
  cursor: zoom-in;
}
.gphoto img {
  width: 100%; display: block; transition: transform .45s ease, filter .3s;
}
.gphoto:hover img { transform: scale(1.05); }
.gphoto figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.4rem .8rem .65rem; font-size: .85rem; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(15,18,32,.82));
  opacity: 0; transition: opacity .25s ease;
}
.gphoto:hover figcaption { opacity: 1; }
@media (max-width: 900px) { .gallery-grid { columns: 3 180px; } }
@media (max-width: 640px) { .gallery-grid { columns: 2 140px; } }
@media (max-width: 400px) { .gallery-grid { columns: 1; } }

.tab-btn {
  background: rgba(255,255,255,.08); color: var(--paper);
  padding: .5rem 1rem; border-radius: 999px; font-size: .9rem;
  font-weight: 600; border: 1px solid rgba(255,255,255,.14); cursor: pointer;
  font-family: var(--sans);
}
.tab-btn:hover { background: rgba(255,255,255,.18); }

/* ---------- Modal / Popup ---------- */
.modal {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(15,18,32,.78); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.modal[hidden] { display: none !important; }
.modal-box {
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 1.6rem; width: 100%; max-width: 460px; position: relative;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.55);
  animation: rise .25s ease both;
}
.modal-box h3 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 1rem; }
.modal-x {
  position: absolute; top: .7rem; right: .85rem; background: none; border: none;
  font-size: 1.3rem; color: var(--muted); cursor: pointer; line-height: 1;
}
.modal-x:hover { color: var(--rust); }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,18,32,.92); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 2rem;
}
/* hidden-Attribut muss das display:flex schlagen, sonst liegt die
   Overlay-Ebene dauerhaft als „Schleier" über der Seite */
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 92vw; max-height: 80vh; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.lightbox .lb-cap { color: rgba(255,255,255,.85); margin-top: 1rem; font-size: .95rem; }
.lb-close {
  position: absolute; top: 1.1rem; right: 1.3rem; background: none; border: none;
  color: #fff; font-size: 1.6rem; cursor: pointer;
}

/* ---------- Admin-Listen ---------- */
.admin-list { display: flex; flex-direction: column; gap: .9rem; }
.admin-row {
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.admin-row.is-archived { opacity: .62; }
.ar-main h3 { font-family: var(--serif); font-size: 1.2rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ar-main h3 .chip { font-family: var(--sans); }
.ar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.mini-table { width: 100%; border-collapse: collapse; margin-bottom: .4rem; }
.mini-table td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table tr:last-child td { border-bottom: none; }

.bg-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: .7rem; border: 1px solid var(--line); }

.intro p, .legal-body { white-space: normal; }
.legal { max-width: 720px; margin: 0 auto; }
.legal h2 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 1rem; }
.legal-body { line-height: 1.7; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid rgba(255,255,255,.08); padding: 1.6rem 0; margin-top: auto; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; color: rgba(247,241,230,.6); font-size: .87rem;
}
.footer-inner nav { display: flex; gap: 1.1rem; }
.footer-inner a { color: rgba(247,241,230,.78); }
.footer-inner a:hover { color: #fff; }

/* ---------- Responsiv ---------- */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .masonry { columns: 2 140px; }
  .section-head { align-items: flex-start; }
  .hero { padding: 3rem 0 2.6rem; }
  .topnav { gap: .7rem; }
  .topnav a:not(.ghost) { display: none; }
}
@media (max-width: 420px) {
  .masonry { columns: 1; }
}

/* ===================================================================
   Theme-Umschalter-Button
   =================================================================== */
.theme-toggle {
  background: rgba(255,255,255,.12); color: var(--paper);
  border: 1px solid rgba(255,255,255,.22); width: 34px; height: 34px;
  border-radius: 999px; cursor: pointer; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
}
.theme-toggle:hover { background: rgba(255,255,255,.22); transform: rotate(20deg); }

/* ===================================================================
   Helles Theme
   =================================================================== */
body[data-theme="light"] {
  --ink: #2a2540; --ink-2: #efe7d6; --muted: #877c66;
  --line: #e7dcc6;
  background:
    radial-gradient(1100px 600px at 50% -8%, #ffe9cf 0%, transparent 60%),
    linear-gradient(180deg, #fbf5ea 0%, #f3ead9 60%, #efe4d2 100%);
}
body[data-theme="light"] .topbar {
  background: rgba(251,245,234,.82); border-bottom: 1px solid var(--line);
}
body[data-theme="light"] .brand,
body[data-theme="light"] .brand-text { color: #2a2540; }
body[data-theme="light"] .topnav a { color: #5a5240; }
body[data-theme="light"] .topnav a:hover { color: #1b1530; }
body[data-theme="light"] .topnav a.ghost { border-color: rgba(0,0,0,.18); }
body[data-theme="light"] .theme-toggle {
  background: rgba(0,0,0,.06); color: #5a5240; border-color: rgba(0,0,0,.16);
}
body[data-theme="light"] .section-head h2,
body[data-theme="light"] .section-head .muted { color: #2a2540; }
body[data-theme="light"] .tabs a,
body[data-theme="light"] .tab-btn {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
body[data-theme="light"] .tabs a:hover,
body[data-theme="light"] .tab-btn:hover { background: var(--paper-2); }
body[data-theme="light"] .footer { border-top: 1px solid var(--line); }
body[data-theme="light"] .footer-inner { color: #877c66; }
body[data-theme="light"] .footer-inner a { color: #5a5240; }
body[data-theme="light"] .footer-inner a:hover { color: #1b1530; }
body[data-theme="light"] .hero:not(.has-img) .hero-veil {
  background: linear-gradient(180deg, rgba(255,237,210,.2), rgba(255,237,210,.05));
}
body[data-theme="light"] .hero:not(.has-img) .hero-title { color: #2a2540; text-shadow: none; }
body[data-theme="light"] .hero:not(.has-img) .hero-sub { color: #6a6048; }

/* ===================================================================
   Modernere Startseite
   =================================================================== */
.home-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 1.8rem;
}
.home-tile {
  position: relative; border-radius: var(--radius); padding: 1.5rem 1.4rem;
  border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(150deg, var(--ink-2), var(--ink));
  color: #fff; text-decoration: none; display: flex; flex-direction: column;
  min-height: 132px; transition: transform .16s ease, box-shadow .2s;
}
.home-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.home-tile.alt { background: linear-gradient(150deg, #7a4a26, #a8442c); }
.home-tile .ht-kicker {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.7); margin-bottom: .5rem;
}
.home-tile h3 { font-family: var(--serif); font-size: 1.5rem; }
.home-tile p { color: rgba(255,255,255,.82); font-size: .92rem; margin-top: .3rem; }
.home-tile .ht-go {
  margin-top: auto; font-weight: 600; font-size: .9rem;
  color: #fff; opacity: .9;
}
@media (max-width: 640px) { .home-split { grid-template-columns: 1fr; } }

.section-head .head-link {
  font-weight: 600; font-size: .95rem; color: var(--amber);
  display: inline-flex; align-items: center; gap: .35rem;
}
body[data-theme="light"] .section-head .head-link { color: var(--amber-deep); }

/* ===================================================================
   QR / Teilen / Druck
   =================================================================== */
.share-wrap { max-width: 560px; margin: 0 auto; text-align: center; }
.qr-box {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 1.6rem; display: inline-block; box-shadow: var(--shadow);
}
.qr-box svg { width: 260px; height: 260px; display: block; }
.share-link {
  word-break: break-all; background: var(--paper-2); border: 1px solid var(--line);
  padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; margin: 1rem 0;
}
.share-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

@media print {
  .topbar, .footer, .tabs, .share-actions, .skip, .theme-toggle { display: none !important; }
  body, body[data-theme="light"] { background: #fff !important; }
  .hero { padding: 1rem 0 !important; }
  .hero-veil { display: none !important; }
  .hero-title, .hero-kicker, .hero-sub { color: #000 !important; text-shadow: none !important; }
  .card, .qr-box { box-shadow: none !important; border-color: #ccc !important; }
  a { color: #000 !important; }
}

/* Absage-Banner */
.cancelled-banner {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, #7a2e22, #a8442c); color: #fff;
  border: 1px solid #5e2018;
}
.cancelled-banner .cb-icon { font-size: 1.8rem; }
.cancelled-banner .cb-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.cancelled-banner .cb-reason { color: rgba(255,255,255,.85); font-size: .92rem; margin-top: .2rem; }
.event-card.is-cancelled { opacity: .62; filter: grayscale(.3); }

/* ===================================================================
   Eventkarte – „Stretched link" + Mini-Aktionen
   =================================================================== */
.event-card { position: relative; }
.event-card-stretch {
  position: absolute; inset: 0; z-index: 1;
  text-decoration: none; color: transparent;
  border-radius: inherit;
}
.event-card-stretch:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 2px;
}
.event-card-body { position: relative; z-index: 2; pointer-events: none; }
.event-card-actions {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem;
  pointer-events: auto;
}
.card-mini {
  position: relative; z-index: 3; pointer-events: auto;
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(255,255,255,.16); color: #fff;
  padding: .35rem .75rem; border-radius: 999px;
  font-size: .82rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,.22);
  text-decoration: none;
  backdrop-filter: blur(4px);
}
.card-mini:hover {
  background: rgba(255,255,255,.28); text-decoration: none; color: #fff;
}
body[data-theme="light"] .event-card:not(.has-img) .card-mini {
  background: rgba(0,0,0,.06); color: var(--ink); border-color: rgba(0,0,0,.14);
}
body[data-theme="light"] .event-card:not(.has-img) .card-mini:hover {
  background: rgba(0,0,0,.12); color: var(--ink);
}

/* ===================================================================
   Eigene 404-Seite
   =================================================================== */
.not-found { text-align: center; padding: 3rem 1.5rem; }
.not-found .nf-emoji {
  font-size: 4rem; margin-bottom: .6rem;
  animation: nf-bob 3.5s ease-in-out infinite;
}
.not-found h2 { font-family: var(--serif); font-size: 1.8rem; margin-bottom: .4rem; }
.not-found .nf-actions {
  display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem;
}
@keyframes nf-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-8px) rotate(6deg); }
}

/* ===================================================================
   Stagger-Einblendung der Eventkarten
   =================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .event-grid > * {
    opacity: 0; transform: translateY(14px);
    animation: card-rise .55s ease forwards;
  }
  .event-grid > *:nth-child(1) { animation-delay: .04s; }
  .event-grid > *:nth-child(2) { animation-delay: .12s; }
  .event-grid > *:nth-child(3) { animation-delay: .20s; }
  .event-grid > *:nth-child(4) { animation-delay: .28s; }
  .event-grid > *:nth-child(5) { animation-delay: .36s; }
  .event-grid > *:nth-child(6) { animation-delay: .44s; }
  .event-grid > *:nth-child(n+7) { animation-delay: .50s; }
}
@keyframes card-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================================
   Skeleton-Loader für die Galerie
   =================================================================== */
.gphoto {
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.16) 50%, rgba(255,255,255,.04) 75%)
    var(--ink-2);
  background-size: 200% 100%;
  animation: skeleton 1.5s linear infinite;
}
.gphoto.is-loaded { animation: none; background: var(--ink-2); }
.gphoto img { opacity: 0; transition: opacity .45s ease; }
.gphoto.is-loaded img { opacity: 1; }
body[data-theme="light"] .gphoto {
  background:
    linear-gradient(90deg, #eee5d2 25%, #f6efde 50%, #eee5d2 75%);
  background-size: 200% 100%;
}
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================================================
   Konfetti beim Festlegen des Termins (CSS-only, kurz & dezent)
   =================================================================== */
.confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  overflow: hidden;
}
.confetti.is-on i {
  position: absolute; top: -10vh; width: 10px; height: 14px;
  opacity: 0; border-radius: 2px;
  animation: confetti-fall 2.6s ease-in forwards;
}
.confetti.is-on i:nth-child(odd)  { background: var(--amber); }
.confetti.is-on i:nth-child(3n)   { background: var(--rust); }
.confetti.is-on i:nth-child(5n)   { background: var(--green); }
.confetti.is-on i:nth-child(7n)   { background: #f6d365; transform: rotate(45deg); }
@keyframes confetti-fall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg);   opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), 110vh, 0) rotate(720deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none !important; } }

/* Lightbox-Pfeile */
.lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff; border: 0;
  width: 48px; height: 60px; border-radius: 10px; font-size: 2rem;
  cursor: pointer; line-height: 1; user-select: none;
}
.lightbox .lb-prev { left: 1.2rem; }
.lightbox .lb-next { right: 1.2rem; }
.lightbox .lb-prev:hover, .lightbox .lb-next:hover { background: rgba(0,0,0,.7); }
@media (max-width: 640px) {
  .lightbox .lb-prev, .lightbox .lb-next { width: 40px; height: 52px; font-size: 1.6rem; }
}

/* ===================================================================
   EVB-Dashboard: Statistik-Kacheln
   =================================================================== */
.stat-grid {
  display: grid; gap: .9rem; margin: 0 0 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat-tile {
  background: linear-gradient(150deg, var(--ink-2), var(--ink));
  color: #fff; padding: 1.1rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem;
  box-shadow: var(--shadow-sm);
}
.stat-tile.alert { background: linear-gradient(150deg, #7a2e22, #a8442c); }
.stat-tile .st-num { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; }
.stat-tile .st-lbl { font-size: .92rem; opacity: .85; margin-top: .15rem; }
.stat-tile .st-sub { font-size: .8rem; opacity: .7; margin-top: .15rem; }
body[data-theme="light"] .stat-tile {
  background: linear-gradient(150deg, #fff, var(--paper-2)); color: var(--ink);
}
body[data-theme="light"] .stat-tile .st-lbl { color: var(--muted); }

/* ===================================================================
   Audit-Log
   =================================================================== */
.audit-list { list-style: none; padding: 0; margin: .8rem 0 0; }
.audit-list li {
  display: grid; gap: .4rem; padding: .5rem .6rem;
  grid-template-columns: 140px 80px 1fr auto;
  border-bottom: 1px solid var(--line); align-items: baseline;
  font-size: .92rem;
}
.audit-list li:last-child { border-bottom: 0; }
.audit-when  { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; }
.audit-actor {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .05rem .55rem; font-size: .75rem;
  color: var(--muted); justify-self: start;
}
.audit-action { font-weight: 600; }
.audit-detail { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .audit-list li { grid-template-columns: 1fr; }
}

/* Vorlagen-Listen */
.tpl-list { list-style: none; padding: 0; margin: 0; }
.tpl-list li { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.tpl-list li:last-child { border-bottom: 0; }
.tpl-list details summary { cursor: pointer; padding: .3rem 0; }
.tpl-list details[open] summary { margin-bottom: .8rem; }

/* ===================================================================
   Hero-Blur, solange Termin offen
   =================================================================== */
.hero.hero-blur::before,
.hero.hero-blur .hero-bg { /* falls vorhanden */ }
.hero.has-img.hero-blur {
  /* Hintergrundbild leicht unscharf bis Termin steht */
}
.hero.has-img.hero-blur > .hero-veil {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(20,26,48,.35), rgba(20,26,48,.82));
}
@media (prefers-reduced-motion: no-preference) {
  .hero.has-img .hero-veil { transition: backdrop-filter .8s ease, background .8s ease; }
}

/* ===================================================================
   Galerie: Alben-Tabs (Chips)
   =================================================================== */
.album-tabs {
  display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.2rem;
}
.album-chip {
  padding: .42rem .9rem; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--paper);
  border: 1px solid rgba(255,255,255,.12);
  text-decoration: none; font-size: .9rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: .35rem;
}
.album-chip:hover { background: rgba(255,255,255,.16); text-decoration: none; color: #fff; }
.album-chip.active {
  background: var(--amber); border-color: var(--amber-deep); color: #fff;
}
.album-chip .ac-num {
  background: rgba(0,0,0,.18); padding: 0 .45rem; border-radius: 999px;
  font-size: .76rem; font-variant-numeric: tabular-nums;
}
body[data-theme="light"] .album-chip {
  background: #fff; color: var(--ink); border-color: var(--line);
}
body[data-theme="light"] .album-chip:hover { background: var(--paper-2); color: var(--ink); }
body[data-theme="light"] .album-chip.active { background: var(--amber); color: #fff; border-color: var(--amber-deep); }

.album-admin { margin-top: .4rem; }
.album-admin > summary { cursor: pointer; padding: .35rem 0; }
.album-list { list-style: none; padding: 0; margin: .7rem 0; display: grid; gap: .6rem; }
.album-list li {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  padding: .55rem .7rem; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 10px;
}
.album-list .row-form { flex: 1; min-width: 240px; margin: 0; }

/* ===================================================================
   Reactions auf den Bildern
   =================================================================== */
.gphoto { position: relative; }
.gphoto-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1rem .7rem .55rem;
  background: linear-gradient(180deg, transparent, rgba(15,18,32,.82));
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: .6rem; pointer-events: none;
  opacity: 0; transition: opacity .25s ease;
}
.gphoto:hover .gphoto-overlay,
.gphoto:focus-within .gphoto-overlay { opacity: 1; }
.gphoto-overlay figcaption {
  font-size: .85rem; color: #fff; line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.gphoto-overlay .gc-by { display: block; opacity: .8; font-size: .78rem; }
.gp-react {
  display: flex; gap: .35rem; pointer-events: auto;
}
.gp-react .rx {
  background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.15);
  padding: .25rem .55rem; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .25rem; font-size: .82rem;
  font-variant-numeric: tabular-nums; backdrop-filter: blur(4px);
  transition: transform .15s, background .15s;
}
.gp-react .rx:hover { background: rgba(0,0,0,.75); }
.gp-react .rx.on { background: rgba(168,68,44,.78); border-color: rgba(255,255,255,.3); }
.gp-react .rx[data-kind="heart"].on { background: rgba(168,68,44,.85); }
.gp-react .rx[data-kind="thumb"].on { background: rgba(93,122,79,.85); }
.gp-react .rx .ico { font-size: 1rem; line-height: 1; }
.gp-react .rx .num { opacity: .9; }
.gp-react .rx.pop { animation: rx-pop .35s ease; }
@keyframes rx-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Auf Touch-Geräten Overlay sichtbar machen */
@media (hover: none) {
  .gphoto-overlay { opacity: 1; }
}

/* ===================================================================
   Slideshow: Play-Button + Progress
   =================================================================== */
.lightbox .lb-play {
  position: absolute; top: 1.2rem; right: 4.2rem;
  background: rgba(0,0,0,.45); color: #fff; border: 0;
  width: 44px; height: 44px; border-radius: 999px; font-size: 1.1rem;
  cursor: pointer; line-height: 1;
}
.lightbox .lb-play:hover { background: rgba(0,0,0,.7); }
.lightbox .lb-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.12); opacity: 0;
}
.lightbox.lb-slide .lb-progress { opacity: 1; }
.lightbox .lb-progress > span {
  display: block; height: 100%; width: 0%;
  background: var(--amber);
}

/* ===================================================================
   Status-Stepper auf der Event-Seite (Planung → Galerie)
   =================================================================== */
.status-stepper {
  display: flex; align-items: stretch; gap: 0;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .65rem .9rem;
  margin: 0 0 1.4rem; overflow-x: auto;
  --accent: var(--event-accent, var(--amber));
}
.status-stepper .step {
  flex: 1 1 0; min-width: 110px; padding: .55rem .25rem;
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  position: relative; color: var(--muted); text-align: center;
}
.status-stepper .step + .step::before {
  content: ''; position: absolute; left: -50%; right: 50%; top: 1.15rem;
  height: 2px; background: var(--line); z-index: 0;
}
.status-stepper .step.done + .step::before,
.status-stepper .step.current::before { background: var(--accent); }
.status-stepper .st-icon {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; font-size: 1rem;
}
.status-stepper .step.done .st-icon {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.status-stepper .step.current .st-icon {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.status-stepper .st-label {
  font-size: .82rem; font-weight: 500;
}
.status-stepper .step.current .st-label { color: var(--accent); font-weight: 600; }
.status-stepper .step.done .st-label { color: var(--ink); }
.status-stepper.is-cancelled { opacity: .55; filter: grayscale(.35); }

body[data-theme="dark"] .status-stepper { background: rgba(255,255,255,.05); }
body[data-theme="dark"] .status-stepper .st-icon { background: var(--ink-2); border-color: var(--line); }
body[data-theme="dark"] .status-stepper .step { color: rgba(255,255,255,.55); }
body[data-theme="dark"] .status-stepper .step.done .st-label { color: #fff; }

@media (max-width: 640px) {
  .status-stepper .st-label { font-size: .72rem; }
  .status-stepper .step { min-width: 80px; }
  .status-stepper .st-icon { width: 1.8rem; height: 1.8rem; font-size: .85rem; }
}

/* ===================================================================
   Anhänge-Liste (EVB und öffentliche Event-Seite)
   =================================================================== */
.attach-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.attach-list li {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem .8rem; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 10px;
}
.attach-list .att-name {
  flex: 1; min-width: 0; font-weight: 600; text-decoration: none;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-list .att-name:hover { color: var(--amber-deep); text-decoration: none; }
.attach-list .att-meta {
  color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums;
}
body[data-theme="dark"] .attach-list .att-name { color: #fff; }
body[data-theme="dark"] .attach-list .att-name:hover { color: var(--amber); }
.attach-pub { margin-bottom: 1rem; }

/* ===================================================================
   Mail-Vorlagen-Editor in den Einstellungen
   =================================================================== */
.mailtpl-block {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1rem; margin-bottom: .8rem;
  background: var(--paper-2);
}
.mailtpl-block > summary {
  cursor: pointer; padding: .2rem 0; font-size: 1rem; user-select: none;
}
.mailtpl-block[open] > summary { margin-bottom: .7rem; }
.mailtpl-block textarea {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88rem; line-height: 1.45;
}

/* ICS-Feed-Zeile */
.ics-feed { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.ics-feed input[readonly] {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px;
  padding: .25rem .5rem; font-family: ui-monospace, monospace; font-size: .8rem;
}

/* ===================================================================
   Sommer-Theme (warm, sonnig)
   =================================================================== */
body[data-theme="summer"] {
  --ink: #4a2a08; --ink-2: #ffd9a8; --muted: #98683a;
  --line: #f1c989; --paper: #fff7e6; --paper-2: #fff0d2;
  --amber: #e07a1c; --amber-deep: #b14d00;
  --rust: #c84a1c; --green: #6a8d3a;
  background:
    radial-gradient(1100px 600px at 50% -10%, #ffe1a0 0%, transparent 60%),
    linear-gradient(180deg, #fff5dc 0%, #ffe5b8 60%, #ffd693 100%);
}
body[data-theme="summer"] .topbar {
  background: rgba(255, 240, 200, 0.85);
  border-bottom: 1px solid var(--line);
}
body[data-theme="summer"] .brand, body[data-theme="summer"] .brand-text,
body[data-theme="summer"] .topnav a { color: #4a2a08; }
body[data-theme="summer"] .topnav a.ghost { border-color: rgba(74,42,8,.25); }
body[data-theme="summer"] .theme-toggle {
  background: rgba(255,255,255,.6); color: #6b3a0e; border-color: rgba(74,42,8,.2);
}
body[data-theme="summer"] .footer-inner { color: #98683a; }
body[data-theme="summer"] .footer-inner a { color: #6b3a0e; }
body[data-theme="summer"] .tabs a, body[data-theme="summer"] .tab-btn {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
body[data-theme="summer"] .hero:not(.has-img) .hero-title { color: #4a2a08; text-shadow: none; }
body[data-theme="summer"] .hero:not(.has-img) .hero-sub { color: #98683a; }
body[data-theme="summer"] .home-tile { background: linear-gradient(150deg, #e07a1c, #b14d00); }
body[data-theme="summer"] .home-tile.alt { background: linear-gradient(150deg, #d63a18, #8a2008); }
body[data-theme="summer"] .stat-tile {
  background: linear-gradient(150deg, #fff, #ffeac4); color: var(--ink);
}

/* ===================================================================
   Winter-Theme (kühl, klar)
   =================================================================== */
body[data-theme="winter"] {
  --ink: #1a2540; --ink-2: #3a5170; --muted: #6e88a8;
  --line: #cbd8ec; --paper: #f4f7fc; --paper-2: #e8eff8;
  --amber: #5c84c4; --amber-deep: #2f5a99;
  --rust: #6a7d99; --green: #4a8a8a;
  background:
    radial-gradient(1100px 600px at 50% -10%, #d4e2f5 0%, transparent 60%),
    linear-gradient(180deg, #f4f7fc 0%, #e2ecf8 60%, #d1dff0 100%);
}
body[data-theme="winter"] .topbar {
  background: rgba(244, 247, 252, 0.85);
  border-bottom: 1px solid var(--line);
}
body[data-theme="winter"] .brand, body[data-theme="winter"] .brand-text,
body[data-theme="winter"] .topnav a { color: #1a2540; }
body[data-theme="winter"] .topnav a.ghost { border-color: rgba(26,37,64,.25); }
body[data-theme="winter"] .theme-toggle {
  background: rgba(255,255,255,.7); color: #2f5a99; border-color: rgba(26,37,64,.2);
}
body[data-theme="winter"] .footer-inner { color: var(--muted); }
body[data-theme="winter"] .footer-inner a { color: #2f5a99; }
body[data-theme="winter"] .tabs a, body[data-theme="winter"] .tab-btn {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
body[data-theme="winter"] .hero:not(.has-img) .hero-title { color: #1a2540; text-shadow: none; }
body[data-theme="winter"] .hero:not(.has-img) .hero-sub { color: #6e88a8; }
body[data-theme="winter"] .home-tile { background: linear-gradient(150deg, #3a5170, #1a2540); }
body[data-theme="winter"] .home-tile.alt { background: linear-gradient(150deg, #4a8a8a, #2f5a99); }
body[data-theme="winter"] .stat-tile {
  background: linear-gradient(150deg, #fff, #e2ecf8); color: var(--ink);
}

/* ===================================================================
   MODERNISIERUNG (v11): Vollbild-Hintergrund + verfeinerte Karten
   =================================================================== */

/* --- Vollbild-Hintergrund, wenn ein Event-Bild gesetzt ist --------- */
body[data-has-bg] {
  background: transparent;  /* der ::before übernimmt */
}
body[data-has-bg]::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background: var(--page-bg) center/cover no-repeat;
  background-attachment: fixed;
}
body[data-has-bg]::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(15,18,32,.55) 0%,
      rgba(15,18,32,.78) 35%,
      rgba(15,18,32,.92) 100%);
}
/* Bei Vollbild-BG: Hero ohne separates Bild, nur Text-Overlay */
body[data-has-bg] .hero.has-img { background: transparent; }
body[data-has-bg] .hero .hero-veil {
  background: linear-gradient(180deg,
    rgba(15,18,32,0) 0%,
    rgba(15,18,32,.35) 100%);
}
body[data-has-bg] .hero { padding-top: 3.2rem; padding-bottom: 2.2rem; }

/* Light-Themes brauchen helleren Veil */
body[data-theme="light"][data-has-bg]::after {
  background:
    linear-gradient(180deg,
      rgba(248,244,236,.55) 0%,
      rgba(248,244,236,.78) 35%,
      rgba(248,244,236,.92) 100%);
}
body[data-theme="summer"][data-has-bg]::after {
  background:
    linear-gradient(180deg,
      rgba(255,245,220,.55) 0%,
      rgba(255,235,200,.78) 35%,
      rgba(255,225,180,.92) 100%);
}
body[data-theme="winter"][data-has-bg]::after {
  background:
    linear-gradient(180deg,
      rgba(244,247,252,.55) 0%,
      rgba(226,236,248,.78) 35%,
      rgba(209,223,240,.92) 100%);
}
body[data-theme="light"][data-has-bg] .hero-title,
body[data-theme="summer"][data-has-bg] .hero-title,
body[data-theme="winter"][data-has-bg] .hero-title {
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(255,255,255,.4);
}
body[data-theme="light"][data-has-bg] .hero-sub,
body[data-theme="summer"][data-has-bg] .hero-sub,
body[data-theme="winter"][data-has-bg] .hero-sub {
  color: var(--muted);
}

/* iOS: fixed background performance + viewport fix */
@supports (-webkit-touch-callout: none) {
  body[data-has-bg]::before { background-attachment: scroll; }
}

/* --- Modernisierte Karten: mehr Luft, klarere Hierarchie ---------- */
body[data-has-bg] .card {
  background: rgba(31, 38, 64, .82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(255,255,255,.08);
}
body[data-theme="light"][data-has-bg] .card,
body[data-theme="summer"][data-has-bg] .card,
body[data-theme="winter"][data-has-bg] .card {
  background: rgba(255,255,255,.86);
  border-color: rgba(0,0,0,.06);
}

/* --- Galerie-Sektion auf Startseite: Karten wie Events ------------ */
.gallery-card-grid {
  display: grid; gap: 1.1rem; margin-top: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.gallery-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink-2); color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  aspect-ratio: 16/10;
  display: block; text-decoration: none;
  box-shadow: 0 8px 24px -12px rgba(0,0,0,.5);
  transition: transform .25s ease, box-shadow .25s ease;
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -14px rgba(0,0,0,.55);
  text-decoration: none;
}
.gallery-card .gc-img {
  position: absolute; inset: 0;
  background-position: center; background-size: cover;
  transition: transform .4s ease;
}
.gallery-card:hover .gc-img { transform: scale(1.04); }
.gallery-card .gc-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.78) 100%);
}
.gallery-card .gc-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.1rem 1.2rem;
}
.gallery-card .gc-title {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  color: #fff; line-height: 1.15; margin: 0;
}
.gallery-card .gc-meta {
  margin-top: .35rem; font-size: .85rem;
  color: rgba(255,255,255,.78);
  display: flex; gap: .6rem; align-items: center;
}
.gallery-card .gc-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 999px;
  background: rgba(0,0,0,.35); backdrop-filter: blur(6px);
  font-size: .78rem; color: #fff;
}
.gallery-card.empty {
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-style: dashed; aspect-ratio: 16/10;
}
.gallery-card.empty .gc-body { position: static; padding: 1.5rem; text-align: center; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: .3rem; }

body[data-theme="light"] .gallery-card,
body[data-theme="summer"] .gallery-card,
body[data-theme="winter"] .gallery-card {
  border-color: var(--line);
}

/* --- Galerie-Sektion auf Home: Abstand zum Event-Block ------------ */
.home-section + .home-section { margin-top: 2.4rem; }
.home-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem;
}
.home-section-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.6rem; color: var(--ink); margin: 0;
}
body[data-theme="dark"] .home-section-head h2 { color: #fff; }
.home-section-head .h-link {
  font-size: .9rem; color: var(--amber); text-decoration: none;
}
.home-section-head .h-link:hover { text-decoration: underline; }

/* --- Verfeinerte Event-Karten: mehr Luft, ruhigere Chips ---------- */
.event-card {
  border-radius: 18px;
  box-shadow: 0 6px 18px -10px rgba(0,0,0,.45);
}
.event-card-veil {
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.78) 100%);
}
.event-card-body h3 {
  font-size: 1.45rem; letter-spacing: -.01em;
}
/* Chips dezenter, abgerundeter */
.chip {
  font-size: .72rem; padding: .18rem .55rem;
  border-radius: 999px; backdrop-filter: blur(6px);
}

/* Hero etwas dezenter wenn kein Vollbild-BG, mehr Top-Padding */
.hero:not(.has-img) { padding-top: 3.2rem; padding-bottom: 2.2rem; }

/* ===================================================================
   System-Log-Viewer
   =================================================================== */
.log-toolbar { margin-bottom: 1rem; }
.log-toolbar select,
.log-toolbar input[type=text] {
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .4rem .65rem;
}
.log-view {
  background: #0d1018; color: #e2e6ee;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem; line-height: 1.45;
  padding: .6rem .8rem;
  max-height: 70vh; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
body[data-theme="light"] .log-view,
body[data-theme="summer"] .log-view,
body[data-theme="winter"] .log-view { background: #1c2030; color: #e8ecf4; }
.log-line { padding: .12rem .2rem; border-radius: 4px; }
.log-line + .log-line { border-top: 1px dashed rgba(255,255,255,.06); }
.log-line.lv-error { color: #ffb4a8; background: rgba(255,90,72,.07); }
.log-line.lv-warn  { color: #ffd58a; }
.log-line.lv-info  { color: #9ec7ff; }
.log-line.lv-debug { color: #aaa9a3; opacity: .72; }
