/* weltsein-design adaptiert fuer bb — minimal, content-first */

@font-face {
  font-family: "Inter";
  src: url("/static/feier/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/feier/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/feier/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/feier/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #4a7a3f;
  --brand-light: #5a8f4e;
  --bg: #faf9f7;
  --bg-secondary: #f0eee9;
  --text: #3d4a3f;
  --text-muted: #7a8b7e;
  --border: #d8d4cc;
  --error: #b34b3f;
  --max-width: 720px;
  --radius: 4px;
}

html.dark {
  --brand: #8fa37a;
  --brand-light: #a0b48c;
  --bg: #1a1b17;
  --bg-secondary: #242421;
  --text: #c8d4ca;
  --text-muted: #8b9a8e;
  --border: #3a3a36;
  --error: #d77163;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.9rem; margin: 0 0 .7em; }
h2 { font-size: 1.3rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }

p { margin: 0 0 1em; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--brand-light); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-title {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.site-header .grow { flex: 1; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
}

/* Cards / sections */
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  background: var(--bg);
}

.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group > label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: .75rem .9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.5;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
textarea { resize: vertical; min-height: 220px; }

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .95rem;
  min-height: 44px;
}
.radio-row input[type="radio"] {
  accent-color: var(--brand);
}
.radio-row label:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand);
}

/* Inspirations-Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  min-height: 36px;
  line-height: 1.2;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.selected {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
html.dark .chip.selected { color: var(--bg); }
.chip-label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

/* Active prompt — gross dargestellt ueber dem Textfeld */
.active-prompt {
  border-left: 3px solid var(--brand);
  padding: .25rem 0 .25rem 1rem;
  margin: 1rem 0 1rem;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 1.05rem;
  line-height: 1.4;
}
.active-prompt.hidden { display: none; }

/* Drop-Zone */
.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
}
.drop-zone.dragover {
  border-color: var(--brand);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--bg));
}
.drop-zone .pick-btn {
  display: inline-block;
  margin-top: .4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-list {
  margin-top: .8rem;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.file-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  min-width: 0;
}
.file-list li .ftype {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}
.file-list li .fname {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  color: var(--text);
}
.file-list li .fname .basename {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list li .fname .ext {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.file-list li .fsize {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.file-list li button {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: .25rem .5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .75rem;
}
.file-list li button.preview:hover { color: var(--brand); border-color: var(--brand); }
.file-list li button.remove:hover { color: var(--error); border-color: var(--error); }

/* Preview-Lightbox */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}
.preview-box {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.25rem 1.25rem 1.25rem;
  max-width: min(100%, 900px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  overflow: auto;
}
.preview-close {
  position: absolute;
  top: .35rem;
  right: .5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .5rem;
  min-height: 44px;
  min-width: 44px;
}
.preview-close:hover { color: var(--text); }
.preview-media {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: var(--radius);
}
audio.preview-media { width: 100%; max-width: 480px; }
.preview-caption {
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
}

/* Audio-Recorder */
.audio-recorder {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.audio-recorder .row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.audio-recorder .rec-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: .85rem;
  padding: .65rem 1rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}
.audio-recorder .rec-btn.recording {
  background: var(--error);
}
.audio-recorder .duration {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  color: var(--text);
  min-width: 4rem;
}
.audio-recorder .hint { color: var(--text-muted); font-size: .85rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
}
.btn:hover { background: var(--brand-light); border-color: var(--brand-light); color: #fff; }
.btn.btn-ghost {
  background: transparent;
  color: var(--brand);
}
.btn.btn-ghost:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }

/* Messages */
.msg {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.msg-error {
  border-color: var(--error);
  color: var(--error);
}

ul.errorlist {
  margin: 0 0 .5rem;
  padding-left: 1rem;
  color: var(--error);
  font-size: .9rem;
}

.thanks {
  text-align: center;
  padding: 3rem 1rem 1rem;
}
.thanks h1 { font-size: 2.4rem; }
.thanks p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; }
.thanks .btn { margin: .25rem; }

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.spacer { height: 1.5rem; }
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Feed + Galerie */
.feed-nav {
  display: flex;
  gap: .35rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.feed-nav-link {
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .65rem 1rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.feed-nav-link:hover { color: var(--text); }
.feed-nav-link.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.feed-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--bg);
}
.feed-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  flex-wrap: wrap;
}
.feed-card-head .who { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.feed-card-head .who strong { color: var(--text); font-weight: 700; }
.feed-card-head .who .addr {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
}
.feed-card-head time {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
}
.feed-prompt {
  border-left: 3px solid var(--brand);
  margin: .25rem 0 .9rem;
  padding: .15rem 0 .15rem 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.0rem;
  line-height: 1.4;
  color: var(--text);
}
.feed-text {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 1rem;
}
.feed-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .6rem;
  margin-top: .5rem;
}
.feed-img {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
  cursor: zoom-in;
  border: 1px solid var(--border);
}
.feed-img img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
}
.feed-video {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius);
  background: #000;
}
.feed-audio {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .8rem;
  background: var(--bg-secondary);
}
.feed-audio-label {
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
  word-break: break-all;
}
.feed-audio audio { width: 100%; }
.feed-att-note { grid-column: 1 / -1; padding: .5rem .7rem; border: 1px dashed var(--border); border-radius: var(--radius); }

/* Galerie */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .5rem;
}
.gallery-tile {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
  display: block;
}
.gallery-tile:hover img { transform: scale(1.03); }
