:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef2ff;
  --text: #152033;
  --muted: #697386;
  --line: #dfe5ef;
  --brand: #365cff;
  --brand-strong: #1f3fd1;
  --accent: #00a896;
  --danger: #d64545;
  --shadow: 0 24px 80px rgba(21, 32, 51, .12);
  --radius: 24px;
  --radius-sm: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(54, 92, 255, .18), transparent 32rem),
    radial-gradient(circle at 80% 5%, rgba(0, 168, 150, .16), transparent 28rem),
    var(--bg);
  color: var(--text);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; background: var(--text); color: var(--bg); border-radius: .75rem; }
.skip-link:focus { top: 1rem; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid rgba(223, 229, 239, .65);
  backdrop-filter: blur(18px); background: color-mix(in srgb, var(--bg) 78%, transparent);
}
.brand { display: flex; align-items: center; gap: .9rem; }
.brand-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 1rem; background: linear-gradient(135deg, var(--brand), var(--accent)); color: white; font-weight: 900; font-size: 1.5rem; box-shadow: var(--shadow); }
.eyebrow, .brand p { margin: 0 0 .2rem; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.1rem, 2vw, 1.35rem); }
h2 { font-size: clamp(2rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -.06em; margin-bottom: 1.25rem; }
h3 { margin-bottom: .5rem; }
main { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.nav-actions, .hero-actions, .filter-group, .post-actions, .section-head, .queue-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
button, .secondary, .ghost { border: 0; border-radius: 999px; padding: .82rem 1.1rem; text-decoration: none; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
button:hover, .secondary:hover, .ghost:hover { transform: translateY(-1px); }
.primary { background: var(--brand); color: white; box-shadow: 0 12px 30px color-mix(in srgb, var(--brand) 30%, transparent); }
.primary:hover { background: var(--brand-strong); }
.secondary, .ghost, .filter { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.hidden { display: none !important; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: stretch; padding: clamp(2rem, 6vw, 5rem) 0 2rem; }
.hero-copy { min-height: 460px; padding: clamp(1.5rem, 4vw, 4rem); border: 1px solid var(--line); border-radius: calc(var(--radius) + 12px); background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 82%, transparent), color-mix(in srgb, var(--surface-strong) 78%, transparent)); box-shadow: var(--shadow); }
.hero-copy p:not(.pill) { max-width: 72ch; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.25rem); line-height: 1.65; }
.pill { display: inline-flex; margin-bottom: 1.5rem; padding: .55rem .85rem; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 800; }
.qr-card { display: flex; flex-direction: column; justify-content: center; padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.qr-card p { color: var(--muted); line-height: 1.55; }
.real-qr { display: block; padding: 1rem; background: #ffffff; border: 1px solid var(--line); border-radius: 1.25rem; text-decoration: none; margin-bottom: 1.5rem; }
.real-qr img { display: block; width: 100%; height: auto; }
.toolbar { display: flex; justify-content: center; gap: 1rem; align-items: center; margin: 1rem 0; }
.toolbar > div { width: 100%; }
.toolbar .filter-group { justify-content: center; }
.filter { white-space: nowrap; }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.hashtag-empty { padding: .82rem 1.1rem; color: var(--muted); }
.dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0 2rem; }
.metric { padding: 1.25rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.metric span { display: block; font-size: 2rem; line-height: 1; font-weight: 900; }
.metric p { margin: .35rem 0 0; color: var(--muted); }
.wall { columns: 4 280px; column-gap: 1rem; }
.post-card { display: inline-block; width: 100%; margin: 0 0 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 30px rgba(21, 32, 51, .08); break-inside: avoid; }
.post-card.pinned { border-color: var(--brand); box-shadow: 0 14px 38px color-mix(in srgb, var(--brand) 22%, transparent); }
.post-media { min-height: 240px; height: 260px; background-color: var(--surface-strong); background-repeat: no-repeat; background-position: center; background-size: contain; }
.post-body { padding: 1rem; }
.post-meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.avatar { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--surface-strong); color: var(--brand); font-weight: 900; }
.author { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handle, .text, .hint { color: var(--muted); line-height: 1.55; }
.handle { margin: .15rem 0 0; font-size: .85rem; }
.source { display: none; }
.text { color: var(--text); font-size: 1.03rem; }
.tag-list { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.tag, .tag-button { border: 0; padding: 0; background: transparent; color: var(--brand); font-weight: 800; font-size: .9rem; }
.tag-button:hover { text-decoration: underline; transform: none; }
.like { padding: .55rem .75rem; font-size: .9rem; background: var(--surface-strong); color: var(--text); }
dialog { width: min(620px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: var(--radius); background: transparent; }
dialog::backdrop { background: rgba(2, 8, 23, .68); backdrop-filter: blur(6px); }
.dialog-card { display: grid; gap: 1rem; padding: clamp(1rem, 4vw, 2rem); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.dialog-card label, .admin-login label { display: grid; gap: .45rem; font-weight: 800; }
.dialog-card input, .dialog-card textarea, .admin-login input { width: 100%; border: 1px solid var(--line); border-radius: 1rem; padding: .95rem 1rem; color: var(--text); background: var(--surface); }
.dialog-head { display: flex; justify-content: space-between; gap: 1rem; }
.icon-button { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; background: var(--surface-strong); color: var(--text); }
.form-error, .form-status { min-height: 1.4rem; margin: 0; font-weight: 800; }
.form-error { color: var(--danger); }
.form-status { color: var(--brand); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.admin-page main { width: min(1120px, calc(100% - 2rem)); }
.admin-shell { margin-top: clamp(1rem, 4vw, 3rem); }
.admin-login { display: grid; gap: 1rem; max-width: 520px; margin-top: 1rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-strong); }
.admin-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
.moderation { margin-top: 2.5rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-subsection { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.queue { display: grid; gap: .85rem; }
.queue-item { display: grid; grid-template-columns: 156px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-strong); }
.queue-item p { margin: .2rem 0 0; color: var(--muted); }
.admin-photo-button, .admin-photo-placeholder { width: 156px; height: 110px; border-radius: 1rem; border: 1px solid var(--line); background: var(--surface); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.admin-photo-button { padding: 0; }
.admin-photo-button img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--surface-strong); }
.admin-status { display: flex; align-items: center; gap: .35rem; margin-top: .45rem; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.admin-status span { padding: .2rem .5rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 800; }
.approve { background: var(--accent); color: #04241f; }
.reject, .delete-existing { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.pin-admin { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.image-preview-dialog { width: min(1100px, calc(100% - 2rem)); padding: 1rem; background: var(--surface); }
.image-preview-dialog img { display: block; max-width: 100%; max-height: 82vh; margin: 0 auto; object-fit: contain; }
.image-preview-close { position: absolute; right: 1rem; top: 1rem; }
.display-mode { overflow: hidden; background: radial-gradient(circle at 10% 10%, rgba(54, 92, 255, .18), transparent 32rem), radial-gradient(circle at 90% 20%, rgba(0, 168, 150, .14), transparent 30rem), var(--bg); }
.display-mode .topbar, .display-mode .hero, .display-mode .toolbar, .display-mode .dashboard { display: none !important; }
.display-mode main { width: 100vw; min-height: 100vh; margin: 0; padding: clamp(1rem, 2vw, 2rem); }
.display-mode .wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-content: center; gap: clamp(1rem, 2vw, 2rem); min-height: calc(100vh - clamp(2rem, 4vw, 4rem)); columns: initial; column-gap: initial; }
.display-mode .post-card { display: block; width: 100%; margin: 0; min-height: 360px; opacity: 0; transform: translateY(20px) scale(.98); animation: displayPostIn 900ms ease forwards, displayPostFloat 8s ease-in-out infinite; animation-delay: calc(var(--display-index, 0) * 180ms), calc(var(--display-index, 0) * 220ms + 900ms); }
.display-mode .post-card:nth-child(1) { --display-index: 0; } .display-mode .post-card:nth-child(2) { --display-index: 1; } .display-mode .post-card:nth-child(3) { --display-index: 2; } .display-mode .post-card:nth-child(4) { --display-index: 3; } .display-mode .post-card:nth-child(5) { --display-index: 4; } .display-mode .post-card:nth-child(6) { --display-index: 5; } .display-mode .post-card:nth-child(7) { --display-index: 6; } .display-mode .post-card:nth-child(8) { --display-index: 7; } .display-mode .post-card:nth-child(9) { --display-index: 8; } .display-mode .post-card:nth-child(10) { --display-index: 9; }
.display-mode .post-media { height: clamp(190px, 24vh, 340px); }
.display-mode .post-actions { display: none; }
@keyframes displayPostIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes displayPostFloat { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.01); } }
@media (prefers-reduced-motion: reduce) { .display-mode .post-card { animation: none; opacity: 1; transform: none; } }
@media (max-width: 900px) { .topbar, .hero { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; } .hero { display: grid; } .dashboard, .admin-tools { grid-template-columns: repeat(2, 1fr); } .nav-actions, .filter-group { width: 100%; } .nav-actions button, .filter { flex: 1; } .queue-item { grid-template-columns: 1fr; } }
@media (max-width: 560px) { main { width: min(100% - 1rem, 1440px); } .dashboard, .admin-tools { grid-template-columns: 1fr; } .admin-photo-button, .admin-photo-placeholder { width: 100%; height: 180px; } }


/* Display-Modus bleibt eine reine Beitragsansicht und nutzt auf breiten Displays vier Spalten. */
@media (min-width: 1400px) {
  .display-mode .wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* Responsives Vierer-Layout */
.wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  columns: initial;
  column-gap: initial;
}

.post-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  break-inside: initial;
}

.post-media {
  height: clamp(190px, 14vw, 280px);
}

.post-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-actions {
  margin-top: auto;
}

.like.liked,
.like:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.like.liked {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-strong));
  color: var(--brand);
}

@media (max-width: 1280px) {
  .wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .wall {
    grid-template-columns: 1fr;
  }
}


/* Hashtag-Vorschläge */
.suggestion-block {
  display: grid;
  gap: .5rem;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.suggestion-chip,
.save-tags {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--brand);
  border-radius: 999px;
  padding: .55rem .8rem;
  font-weight: 900;
}

.suggestion-chip:hover {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-strong));
}

.admin-tag-editor {
  display: grid;
  gap: .45rem;
}

.admin-tag-editor input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .85rem 1rem;
  color: var(--text);
  background: var(--surface);
}

.admin-tag-editor {
  margin-top: .85rem;
  color: var(--text);
  font-weight: 800;
}

.save-tags {
  color: var(--brand);
}


/* Einzelne Hashtags im Adminbereich löschen */
.admin-editable-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
}

.admin-tag-chip {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--brand);
  border-radius: 999px;
  padding: .45rem .7rem;
  font-weight: 900;
}

.admin-tag-chip span {
  margin-left: .25rem;
  color: var(--danger);
  font-weight: 900;
}

.admin-tag-chip:hover {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
  color: var(--danger);
}

.admin-tag-fallback-note {
  margin: .55rem 0 0;
  font-size: .88rem;
}


/* Optionaler Einzel-Hashtag mit Autocomplete */
.label-optional {
  color: var(--muted);
  font-weight: 700;
}

.suggestion-chip.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}


/* Autocomplete-Vorschläge im Formular */
.suggestion-list {
  min-height: 2.5rem;
}

.suggestion-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}


/* Display-Modus: clientseitige Rotation sichtbarer Beiträge */
.display-mode .wall.display-rotating {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.display-mode .wall.display-rotating .post-card {
  animation: displayPageIn 700ms ease-out both, displayPostFloat 8s ease-in-out infinite;
}

@keyframes displayPageIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
