:root {
  --red: #b90615; --red-dark: #8f0410; --ink: #1d1d1f; --muted: #5f6368; --line: #e3e3e6; --bg: #ffffff; --soft: #f6f6f7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 2.5rem 1.25rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem; z-index: 10; }
.muted { color: var(--muted); }

/* Kopf */
.site-header { background: #fff; border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand img { display: block; height: 52px; width: auto; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { cursor: pointer; font-weight: 600; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; display: inline-block; }
.nav-toggle:focus-visible + .nav-button { outline: 2px solid var(--red); }
.menu nav > ul { list-style: none; margin: 0; padding: 0; }
.menu a { text-decoration: none; color: var(--ink); font-weight: 600; display: block; padding: .5rem .75rem; border-radius: 6px; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--red); background: #fbe9ea; }
.menu .sub ul { list-style: none; padding-left: 1rem; margin: 0; }
.menu .sub ul a { font-weight: 400; }
@media (max-width: 959px) {
  .menu nav { display: none; }
  .nav-toggle:checked ~ nav { display: block; }
  .menu nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 3px solid var(--red); padding: .5rem 1.25rem 1rem; max-height: 80vh; overflow: auto; }
}
@media (min-width: 960px) {
  .nav-button { display: none; }
  .menu nav > ul { display: flex; gap: .25rem; }
  .menu .sub { position: relative; }
  .menu .sub ul { display: none; position: absolute; top: 100%; left: 0; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .4rem; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
  .menu .sub:hover ul, .menu .sub:focus-within ul { display: block; }
}

/* Inhalte */
.hero { position: relative; overflow: hidden; color: #fff; background: #6d0a12; padding: 5rem 0 4.5rem; }
.hero-slides span { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; animation: hero-fade 30s infinite; }
.hero-slides .s1 { background-image: url("/assets/hero-1.webp"); }
.hero-slides .s2 { background-image: url("/assets/hero-2.webp"); animation-delay: 6s; }
.hero-slides .s3 { background-image: url("/assets/hero-3.webp"); animation-delay: 12s; }
.hero-slides .s4 { background-image: url("/assets/hero-4.webp"); animation-delay: 18s; }
.hero-slides .s5 { background-image: url("/assets/hero-5.webp"); animation-delay: 24s; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(120, 4, 14, .88) 0%, rgba(120, 4, 14, .55) 55%, rgba(0, 0, 0, .25) 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero .claim { font-size: 1.3rem; font-weight: 700; margin: 0 0 .5rem; }
@keyframes hero-fade { 0% { opacity: 0; } 4% { opacity: 1; } 20% { opacity: 1; } 24% { opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-slides span { animation: none; } .hero-slides .s1 { opacity: 1; } }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 .75rem; line-height: 1.2; }
.hero .lead { max-width: 760px; font-size: 1.15rem; }
.btn { display: inline-block; background: #fff; color: var(--red); padding: .7rem 1.2rem; border-radius: 6px; font-weight: 700; text-decoration: none; margin: .5rem .5rem 0 0; }
.btn-ghost { background: transparent; color: #fff; border: 2px solid #fff; }
.btn:hover { opacity: .9; color: var(--red); }
.btn-ghost:hover { color: #fff; }
.page-head { background: var(--soft); border-bottom: 1px solid var(--line); padding: 2.2rem 0 1.6rem; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.2; }
.page-head .lead { color: var(--muted); margin: .5rem 0 0; max-width: 800px; }
h2 { font-size: 1.35rem; }
.prose { max-width: 820px; }
.prose h3 { margin-top: 1.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card h3 { margin: .2rem 0 .4rem; font-size: 1.1rem; line-height: 1.3; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--red); }
.date { color: var(--muted); font-size: .9rem; margin: 0; }
.team .person img { aspect-ratio: 3 / 4; object-position: top; }
.avatar { aspect-ratio: 3 / 4; display: grid; place-items: center; background: #fbe9ea; color: var(--red); font-size: 3rem; font-weight: 700; }
.role { font-weight: 600; color: var(--red); margin: 0 0 .5rem; }
table.dates { border-collapse: collapse; width: 100%; max-width: 760px; }
table.dates th, table.dates td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.dates th { font-weight: 600; width: 55%; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.fact { background: var(--soft); border-radius: 10px; padding: 1rem 1.2rem; }
.fact h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .4rem; }
.fact .big { font-size: 1.15rem; font-weight: 700; margin: 0; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.contact { margin-bottom: 1.2rem; }
.sponsor { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
img.logo { max-width: 180px; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.steps { list-style: none; padding: 0; max-width: 860px; }
.step { display: flex; gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.step .num { flex: 0 0 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.step h3 { margin: 0; }
.step .when { font-weight: 600; color: var(--red); margin: .2rem 0 .5rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin: 1.5rem 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.post-image img { border-radius: 10px; }
.post-image { margin: 0 0 1.5rem; }
details.faq { border-bottom: 1px solid var(--line); padding: .8rem 0; }
details.faq summary { font-weight: 600; cursor: pointer; }

/* Fuß */
.site-footer { background: #1f1f22; color: #ddd; margin-top: 3rem; padding-top: 2.5rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.site-footer h2 { font-size: 1rem; color: #fff; text-transform: uppercase; letter-spacing: .05em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.5rem 1.25rem; margin-top: 2rem; border-top: 1px solid #3a3a3e; font-size: .9rem; }

/* Termine kompakt (Startseite) */
.dates-compact { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 1.2rem; align-items: start; }
.next-date { display: block; background: var(--red); color: #fff; border-radius: 12px; padding: 1.2rem 1.4rem; text-decoration: none; }
.next-date:hover { color: #fff; background: var(--red-dark); }
.next-date .kicker { display: block; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; opacity: .85; }
.next-date strong { display: block; font-size: 1.3rem; line-height: 1.25; margin: .3rem 0; }
.next-date .when { font-size: 1.15rem; font-weight: 700; }
.date-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.date-grid a { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .8rem; text-decoration: none; color: var(--ink); height: 100%; }
.date-grid a:hover { border-color: var(--red); }
.date-grid span { display: block; font-size: .85rem; color: var(--muted); }
.date-grid strong { font-size: .95rem; }
.all-dates { grid-column: 1 / -1; margin: .2rem 0 0; }
table.dates tr.next th, table.dates tr.next td { background: #fbe9ea; }
@media (max-width: 720px) {
  .dates-compact { grid-template-columns: 1fr; }
  .date-grid { display: none; }
}

/* Hervorgehobener aktueller Beitrag */
.featured { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem; align-items: start; background: var(--soft); border-radius: 14px; padding: 1.5rem; }
.featured-image { margin: 0; }
.featured-image img { width: 100%; border-radius: 10px; display: block; }
.featured h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: .2rem 0 1rem; line-height: 1.2; }
.featured h2 a { color: var(--ink); text-decoration: none; }
@media (max-width: 860px) { .featured { grid-template-columns: 1fr; padding: 1rem; } }

/* Wettbewerb: Link zur Originalseite */
.ext-link a { display: inline-block; background: var(--red); color: #fff; padding: .6rem 1.1rem; border-radius: 6px; font-weight: 700; text-decoration: none; }
.ext-link a:hover { color: #fff; background: var(--red-dark); }

/* Kontaktformular */
.contact-form { display: grid; gap: .9rem; max-width: 640px; background: var(--soft); padding: 1.3rem; border-radius: 12px; margin-bottom: 2rem; }
.contact-form label { display: grid; gap: .3rem; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; padding: .6rem; border: 1px solid #bbb; border-radius: 6px; background: #fff; width: 100%; }
.contact-form .chk { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.contact-form .chk input { width: auto; margin-top: .35rem; }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .nojs-note { display: none; }
.contact-form[data-needs-js] .nojs-note { display: block; color: var(--muted); }
.contact-form[data-needs-js] button { display: none; }
.btn-primary { font: inherit; background: var(--red); color: #fff; border: 0; padding: .7rem 1.3rem; border-radius: 6px; font-weight: 700; cursor: pointer; justify-self: start; }
.btn-primary:hover { background: var(--red-dark); }
a.m .at { white-space: nowrap; }

/* Ganze Karte klickbar: der Hauptlink der Karte deckt die Fläche ab (ohne JavaScript).
   Weitere Links in der Karte (z. B. E-Mail) liegen darüber und bleiben einzeln klickbar. */
.card-link { position: relative; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.card-link a.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link a:not(.stretched) { position: relative; z-index: 2; }
.card-link:hover { border-color: var(--red); box-shadow: 0 6px 20px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.card-link:focus-within { outline: 2px solid var(--red); outline-offset: 2px; }
.card-link a.stretched:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .card-link { transition: none; } .card-link:hover { transform: none; } }

/* Markenfarbe präsenter (Jugend-forscht-Rot) */
.site-header { border-bottom-width: 4px; }
.page-head { background: linear-gradient(120deg, var(--red) 0%, #d22a3b 100%); color: #fff; border-bottom: 0; padding: 2.6rem 0 2rem; }
.page-head .lead { color: rgba(255, 255, 255, .92); }
.section > h2, .section h2:first-child { position: relative; padding-left: .9rem; }
.section > h2::before, .section h2:first-child::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 5px; border-radius: 3px; background: var(--red); }
.featured h2::before { display: none; }
.featured h2 { padding-left: 0; }
.date { color: var(--red); font-weight: 600; }
.card { border-top: 4px solid var(--red); }
.fact { border-left: 5px solid var(--red); }
.fact h2::before { display: none; }
.fact h2 { padding-left: 0; }
.site-footer { border-top: 6px solid var(--red); }
.site-footer h2::before { display: none; }
.site-footer h2 { padding-left: 0; }
.step .num { box-shadow: 0 0 0 4px #fbe9ea; }
.section .fact h2, .section .featured h2, .section .card h2 { padding-left: 0; }
.section .fact h2::before, .section .featured h2::before, .section .card h2::before { display: none; }

/* Bildansicht (Overlay) */
.gallery a { cursor: zoom-in; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(10, 10, 12, .88); }
dialog.lightbox[open] { display: grid; place-items: center; }
dialog.lightbox img { max-width: calc(100vw - 7rem); max-height: calc(100vh - 6rem); border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); user-select: none; -webkit-user-drag: none; }
dialog.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; width: 3rem; height: 3rem; font-size: 2rem; line-height: 1; cursor: pointer; }
dialog.lightbox button:hover, dialog.lightbox button:focus-visible { background: var(--red); outline: none; }
dialog.lightbox .lb-close { top: 1rem; right: 1rem; }
dialog.lightbox .lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
dialog.lightbox .lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
dialog.lightbox .lb-count { position: absolute; bottom: .8rem; left: 0; right: 0; text-align: center; color: #ddd; margin: 0; font-size: .9rem; }
@media (max-width: 600px) { dialog.lightbox img { max-width: 100vw; border-radius: 0; } dialog.lightbox .lb-prev, dialog.lightbox .lb-next { top: auto; bottom: 1rem; transform: none; } }

/* Karte zum Veranstaltungsort (selbst gehostetes Bild) */
.map { margin: 0 0 2rem; }
.map img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.map figcaption { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.map-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 0; }
.map-links a { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; text-decoration: none; font-weight: 600; font-size: .92rem; }
.map-links a:hover { border-color: var(--red); background: #fbe9ea; }
