/* Adminbereich – bewusst ruhig und funktional, in den Farben des Kalenders. */
@font-face { font-family: "Playfair Display"; font-weight: 700; src: url("/fonts/playfair-display-latin-700-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 700; src: url("/fonts/playfair-display-latin-700-italic.woff2") format("woff2"); font-display: swap; }

:root { --red: #a31524; --red-deep: #6c0a14; --gold: #c9a045; --gold-l: #f1dc9c; --navy: #1d2a4f; --ink: #24222b; --line: #dccfae; --paper: #fffdf6; --bg: #f6f1e4; --green: #2f6b3f; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1rem; line-height: 1.5; color: var(--ink); background: var(--bg); }
h1 { font-family: "Playfair Display", Georgia, serif; font-size: 1.7rem; line-height: 1.2; color: var(--red); margin: 0 0 8px; }
h3 { margin: 0; font-size: 1.08rem; }
a { color: var(--navy); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loading { text-align: center; padding: 40px; }

.top { background: var(--red-deep); color: #fff; border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; max-width: 1040px; margin: 0 auto; }
.top-title { font-family: "Playfair Display", Georgia, serif; font-size: 1.15rem; }
.top-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs { display: flex; gap: 2px; padding: 0 12px; max-width: 1040px; margin: 0 auto; }
.tab { background: transparent; border: 0; color: #f6e6c0; padding: 10px 14px; font: inherit; cursor: pointer; border-radius: 8px 8px 0 0; min-height: 44px; }
.tab.is-active { background: var(--bg); color: var(--red-deep); font-weight: 700; }
.main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }
.lead { margin: 0 0 14px; color: #4a4553; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1px solid #b9a777; background: #fff; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #fbf3dc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red-deep); color: #fff; }
.btn-primary:hover { background: #8b111e; }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: .92rem; font-weight: 500; }
.btn-danger { color: #8b111e; border-color: #d3a3a3; }
.top .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.top .btn:hover { background: rgba(255, 255, 255, .12); }

.card, .block, .door-row, .media-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.login { max-width: 400px; margin: 12vh auto 0; padding: 26px 22px; display: grid; gap: 14px; }
.form-error { color: #8b111e; margin: 0; min-height: 1.4em; font-weight: 600; }

.notice { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #eef1f8; border: 1px solid #c3cbe2; color: var(--navy); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-warn { background: #fdf0d6; border-color: #e2b85c; color: #5c3d05; }
.notice-ok { background: #e6f2e2; border-color: #a5c9a6; color: #1f4b2a; }

.door-list { display: grid; gap: 10px; }
.door-row { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; padding: 12px 14px; align-items: start; }
.door-row.is-overdue { border-color: #e2b85c; box-shadow: 0 0 0 2px #fbe4ae; }
.door-num { width: 54px; height: 54px; border-radius: 8px; background: linear-gradient(180deg, #a51624, #6c0a14); border: 2px solid var(--gold); color: var(--gold-l); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.door-num b { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-size: 1.3rem; }
.door-num .ico { width: 16px; height: 16px; }
.door-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .84rem; font-weight: 500; background: #ece6d6; color: #4a4553; vertical-align: middle; }
h1 .badge { font-family: system-ui, sans-serif; }
.badge-ok { background: #dcefd8; color: #1f4b2a; }
.badge-draft { background: #fde9c0; color: #6b4703; }
.badge-live { background: #dfe6f7; color: var(--navy); }
.badge-ready { background: #fff; border: 1px solid #a5c9a6; color: #1f4b2a; }
.issues { margin: 8px 0 0; padding-left: 20px; color: #7a2a12; font-size: .94rem; }
.door-notes { margin: 6px 0 0; font-size: .94rem; color: #4a4553; }
.door-row .edit { grid-column: 1 / -1; justify-self: start; }

.editor { display: grid; gap: 16px; }
.editor > * { margin: 0; }
.block { padding: 14px 16px 16px; display: grid; gap: 14px; min-width: 0; margin: 0; }
.block legend { font-weight: 700; color: var(--red-deep); padding: 0 6px; font-size: 1.05rem; }
.block .block { background: #fbf6e8; }
.field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-weight: 600; font-size: .95rem; }
.field-hint { font-size: .88rem; color: #5a5562; }
input[type="text"], input[type="url"], input[type="number"], input[type="password"], select, textarea { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #a99c79; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
textarea { resize: vertical; line-height: 1.45; }
.check, .radio { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input, .radio input { width: 20px; height: 20px; accent-color: var(--red); }
.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: rgba(246, 241, 228, .96); border-top: 1px solid var(--line); margin: 0 -16px -60px !important; }
.task-editor { display: grid; gap: 14px; }
.options-edit { display: grid; gap: 10px; }
.option-edit { display: grid; gap: 8px; padding: 10px; border: 1px dashed #b9a777; border-radius: 10px; background: #fff; }

.media-field { display: grid; gap: 6px; min-width: 0; }
.media-current { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.media-current img, .media-current video { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee; }
.media-empty { width: 110px; height: 72px; display: grid; place-items: center; border: 1px dashed #a99c79; border-radius: 8px; color: #5a5562; font-size: .9rem; background: #fff; }
.media-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pick { display: grid; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: 8px; background: #f6f1e4; cursor: pointer; font: inherit; font-size: .78rem; overflow: hidden; }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick img, .pick-video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; display: grid; place-items: center; background: #ddd; }
.pick.is-current { border-color: var(--red); }
.memory-edit { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.spot-stage { position: relative; cursor: crosshair; border: 2px solid var(--gold); border-radius: 8px; overflow: hidden; max-width: 640px; }
.spot-stage img { display: block; width: 100%; user-select: none; }
.spot { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; background: rgba(163, 21, 36, .45); color: #fff; font-weight: 700; display: grid; place-items: center; pointer-events: none; font-size: .85rem; }
.spot-list { display: grid; gap: 8px; }
.spot-item { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }

.media-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.media-card { padding: 10px; display: grid; gap: 6px; align-content: start; }
.media-card img, .media-card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #eee; }
.media-card p { margin: 0; }
.media-name { font-weight: 600; overflow-wrap: anywhere; }

.flash { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 24px); padding: 10px 18px; border-radius: 10px; background: var(--navy); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center; }
.flash.is-visible { opacity: 1; }
.flash-err { background: #8b111e; }

@media (min-width: 720px) {
  .door-row { grid-template-columns: auto 1fr auto; }
  .door-row .edit { grid-column: auto; align-self: center; }
  .option-edit { grid-template-columns: auto 1fr; align-items: center; }
  .option-edit .media-field, .option-edit > .btn { grid-column: 2; justify-self: start; }
}

/* Erweiterung: erzählende Inhalte */
.badge-kind { background: #f6e3e4; color: #7a0e1a; }
.media-current audio, .media-card audio { width: 100%; max-width: 340px; height: 40px; }
.media-card audio { margin: 20px 0; }
.gal-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee; }
textarea { min-height: 3.2em; }
.privacy-editor { margin-top: 34px; padding-top: 22px; border-top: 2px solid var(--line); }
.privacy-editor .actions { position: static; margin: 0 !important; background: none; border: 0; padding: 0; }
.main > form.editor:not(:last-child) .actions { position: static; margin: 0 !important; background: none; border: 0; padding: 0; }
