@font-face { font-family: "Source Sans 3"; font-weight: 300; font-display: swap; src: url("/fonts/source-sans-3-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --rot: #e40038;
  --rot-dunkel: #cb0031;
  --grau1: #e6e6df;
  --grau2: #ececec;
  --grau-abstufung: #d8d2ca;
  --balken-grau: #60605d;
  --text: #000;
  --font: "Source Sans 3", Arial, sans-serif;
  --page-max: 2400px;
  --gutter: clamp(16px, 3vw, 72px);
  --viewer-text: clamp(320px, 24vw, 440px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.45; color: var(--text); background: #fff; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--rot); }
h1, h2, h3 { hyphens: manual; text-align: left; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 10px 16px; background: #000; color: #fff; font-weight: 700; }
.skip-link:focus { top: 16px; }
main:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #000; outline-offset: 2px; box-shadow: 0 0 0 5px #fff;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf: Logo oben links auf Weiß, Dreiecksraster in der gegenüberliegenden Ecke */
.site-header { position: relative; padding: 20px var(--gutter) 0; max-width: var(--page-max); margin: 0 auto; min-height: 96px; }
.logo { display: inline-block; position: relative; z-index: 1; background: #fff; padding: 4px 8px 4px 0; }
.logo img { height: 56px; width: auto; }
.triangles { position: absolute; top: 0; right: 0; width: clamp(160px, 22vw, 460px); aspect-ratio: 382 / 223; background: url("/triangles.svg") top right / contain no-repeat; }

.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) 48px; }
.intro { margin: 40px 0 28px; max-width: min(72rem, 70vw); }
.intro h1 { margin: 0 0 8px; color: var(--rot); font-weight: 700; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; }
.subtitle { margin: 0; font-size: 1.25rem; font-weight: 300; }
.page-title { margin: 36px 0 20px; color: var(--rot); font-size: 2rem; line-height: 1.15; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.search { flex: 1 1 260px; max-width: 440px; }
.search input { width: 100%; font: inherit; padding: 10px 14px; border: 2px solid var(--grau-abstufung); border-radius: 0; background: #fff; }
.search input:focus { outline: none; border-color: var(--rot); }

.button { display: inline-block; font: inherit; font-weight: 700; color: #fff; background: var(--rot); border: 0; border-radius: 0; padding: 10px 18px; text-decoration: none; cursor: pointer; }
.button:hover, .button:focus-visible { background: var(--rot-dunkel); }
.button.danger { background: var(--balken-grau); }
.button.danger:hover { background: #000; }
.link-button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* Raster */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(16px, 1.4vw, 32px); grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(240px, 16vw, 360px)), 1fr)); }

.card { position: relative; display: flex; flex-direction: column; background: var(--grau2); }
.card-open { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.card-open:focus-visible { outline: 3px solid var(--rot); outline-offset: 2px; }
.card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--grau1); }
.placeholder { display: block; background: var(--grau1) url("/favicon.svg") center / 22% no-repeat; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 16px; }
.card-nr { margin: 0; font-size: .85rem; font-weight: 600; color: var(--balken-grau); letter-spacing: .02em; }
.title-nr { font-weight: 400; color: var(--balken-grau); font-size: .7em; }
.card-title { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.card:hover .card-title { color: var(--rot); }
.card.status-weg .card-img { filter: grayscale(1); opacity: .45; }
.card-edit { position: absolute; top: 8px; right: 8px; padding: 4px 10px; background: #fff; color: #000; font-weight: 600; font-size: .9rem; text-decoration: none; }
.card-edit:hover { background: var(--rot); color: #fff; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { display: inline-block; padding: 2px 8px; background: var(--balken-grau); color: #fff; font-weight: 600; font-size: .85rem; }
.tag-reserved { background: var(--rot); }
.tag-gone { background: #000; }
.empty { padding: 32px 0; font-size: 1.2rem; color: var(--balken-grau); }

/* Großansicht */
#viewer { width: 100%; max-width: min(1700px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; background: #fff; overflow: auto; }
#viewer::backdrop { background: rgb(0 0 0 / .75); }
.viewer { position: relative; display: grid; grid-template-columns: 1fr; }
.viewer-media { position: relative; display: flex; align-items: center; justify-content: center; background: #fff; touch-action: pan-y; }
.viewer-media img { width: auto; max-width: 100%; max-height: 82dvh; object-fit: contain; }
/* Maße bekannt (--w/--h aus app.js): Breite so wählen, wie das große Bild sie nach dem Laden hätte */
.viewer-media img.sized { width: min(var(--w) * 1px, 100%, 82dvh * var(--w) / var(--h)); aspect-ratio: var(--w) / var(--h); }
/* Desktop: Dialog so breit wie Bild + Textspalte, kein Rahmen ums Bild */
@media (min-width: 900px) {
  #viewer { width: fit-content; }
  .viewer { display: flex; align-items: flex-start; }
  .viewer-media { flex: 0 1 auto; min-height: 0; }
  .viewer-media img { max-width: calc(min(1700px, 100vw - 32px) - var(--viewer-text)); max-height: calc(100dvh - 32px); }
  .viewer-media img.sized { width: min(var(--w) * 1px, min(1700px, 100vw - 32px) - var(--viewer-text), (100dvh - 32px) * var(--w) / var(--h)); }
  .viewer-text { flex: 0 0 var(--viewer-text); width: var(--viewer-text); }
}
.viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: rgb(255 255 255 / .85); font: inherit; font-size: 2rem; line-height: 1; cursor: pointer; }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }
.viewer-prev:hover, .viewer-next:hover { background: #fff; color: var(--rot); }
.viewer-count { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); margin: 0; padding: 2px 8px; color: #fff; background: rgb(0 0 0 / .55); font-size: .9rem; }
.viewer-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border: 0; background: var(--rot); color: #fff; font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.viewer-close:hover { background: var(--rot-dunkel); }
.viewer-text { padding: 20px 20px 24px; }
.viewer-text h2 { margin: 0 44px 10px 0; font-size: 1.6rem; line-height: 1.2; }
.viewer-desc { white-space: pre-line; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.button.secondary { background: var(--balken-grau); }
.button.secondary:hover { background: #000; }

/* Formulare */
.form { display: grid; gap: 20px; max-width: 720px; }
.login { max-width: 360px; }
fieldset { margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { display: block; margin-bottom: 6px; font-weight: 700; }
.field input[type="text"], .field input[type="password"], .field textarea, .field select { width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--grau-abstufung); border-radius: 0; background: #fff; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--rot); }
.field textarea { min-height: 10rem; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 20px; }
.hint { margin: 6px 0 0; font-size: .9rem; color: var(--balken-grau); }
.error { margin: 6px 0 0; color: var(--rot); font-weight: 600; }
.alert { margin: 0; padding: 10px 14px; background: var(--rot); color: #fff; font-weight: 600; }
.image-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.image-list li { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--grau2); font-size: .95rem; }
.image-delete { align-self: flex-start; color: var(--rot-dunkel); font-weight: 600; }
.image-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 4px; }
.new-previews:not(:empty) { margin-top: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.delete-form { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--grau-abstufung); max-width: 720px; }

.site-footer { max-width: var(--page-max); margin: 0 auto; padding: 20px var(--gutter) 40px; border-top: 1px solid var(--grau-abstufung); font-size: .9rem; color: var(--balken-grau); }
.site-footer a { color: inherit; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legal { max-width: 46rem; }
.legal h2 { margin: 32px 0 8px; font-size: 1.3rem; }

@media (min-width: 700px) {
  .site-header { padding-top: 28px; min-height: 120px; }
  .logo img { height: 76px; }
}

@media (min-width: 1600px) {
  .logo img { height: 96px; }
  .site-header { min-height: 150px; }
  .card-title { font-size: 1.25rem; }
}
