/* Blockflötenorchester Hannover – responsives Layout nach dem Contao-Design von 2011 */

:root {
  --rot: #850101;
  --rot-dunkel: #5e0000;
  --grau: #d0d0d0;
  --grau-hell: #f3f3f3;
  --text: #222;
  --text-leise: #777;
  --breite: 960px;
  --navi-breite: 250px;
  --abstand: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--rot);
  color: var(--text);
  font: 14px/1.6 Verdana, Geneva, "DejaVu Sans", sans-serif;
}

img, video { max-width: 100%; height: auto; }

a { color: var(--rot); }
a:hover, a:focus-visible { color: #000; text-decoration: none; }

#wrapper {
  max-width: var(--breite);
  margin: 30px auto 40px;
  background: #fff;
  border-left: 1px solid var(--grau);
  border-right: 1px solid var(--grau);
}

/* ------------------------------------------------------------ Kopf */
#kopf {
  display: grid;
  grid-template-columns: var(--navi-breite) 1fr;
  grid-template-areas:
    "links rechts"
    "navi  navi";
}
.kopf-links { grid-area: links; display: flex; flex-direction: column; justify-content: space-between; }
.kopf-rechts { grid-area: rechts; display: flex; flex-direction: column; }

.logo { display: block; padding: 10px 5px; }
.logo img { display: block; }

.titel {
  margin: 0;
  padding: 10px 20px 0 10px;
  min-height: 60px;
  color: var(--rot);
  font-size: 22px;
  font-weight: bold;
  font-style: italic;
  line-height: 1.2;
}
.titel small { font-size: 0.82em; font-weight: bold; }

.kopfbild { padding: 0 20px 10px 10px; }
.kopfbild img { display: block; width: 100%; aspect-ratio: 680 / 250; object-fit: cover; }

.kopf-termine {
  margin: 0 5px 10px 0;
  padding: 5px 10px;
  min-height: 92px;
  border-top: 2px solid var(--rot);
  border-bottom: 2px solid var(--rot);
  font-size: 13px;
  line-height: 1.4;
}
.kopf-termine-titel { margin: 0 0 4px; font-weight: bold; color: var(--rot); }
.kopf-termine ul { list-style: none; margin: 0; padding: 0; }
.kopf-termine li { margin-bottom: 3px; }
.kopf-termine .datum { display: block; font-size: 12px; color: var(--text-leise); }

.navi-oben { grid-area: navi; background: var(--rot); }
.navi-oben ul { display: flex; flex-wrap: wrap; margin: 0; padding: 2px 0 2px 11px; list-style: none; }
.navi-oben li { border-right: 1px solid #fff; }
.navi-oben a { display: block; padding: 0 10px 0 6px; color: #fff; text-decoration: none; font-size: 13px; }
.navi-oben a:hover, .navi-oben a[aria-current] { text-decoration: underline; color: #fff; }

/* ------------------------------------------------------------ Inhalt + Navigation */
#container {
  display: grid;
  grid-template-columns: var(--navi-breite) 1fr;
}

#navi { padding-top: 48px; }
#navi > ul, #navi ul ul { list-style: none; margin: 0; padding: 0; }
#navi li { border-top: 1px solid #fff; border-bottom: 1px solid #fff; }
#navi a {
  display: block;
  padding: 6px;
  color: var(--rot);
  font-weight: bold;
  text-decoration: none;
}
#navi a:hover, #navi a:focus-visible, #navi a[aria-current] { background: var(--rot); color: #fff; }
#navi li.aktiv:has(ul) { border: 1px solid var(--rot); border-left: 0; }
#navi li.aktiv:has(ul) > a { background: var(--rot); color: #fff; }
#navi ul ul { padding-left: 10px; }
#navi ul ul a { font-weight: normal; }
#navi ul ul a[aria-current] { font-weight: bold; }
.menue-knopf { display: none; }

#main {
  min-width: 0;
  padding: 0 10px 30px 10px;
}

#main h1,
#main h2 {
  margin: 25px 0 12px;
  border-bottom: 5px solid var(--rot);
  font-size: 22px;
  font-weight: normal;
  line-height: 1.5;
  color: #000;
}
#main h2 { font-size: 19px; border-bottom-width: 3px; clear: both; }
#main h3 { margin: 18px 0 6px; font-size: 15px; color: #333; }

#main p { margin: 0 0 1em; }

/* ------------------------------------------------------------ Bilder */
.bild { margin: 0 0 1em; }
.bild img {
  display: block;
  padding: 3px;
  background: #fff;
  border: 2px solid var(--rot);
}
.bild a:hover img { border-color: #a6a6a6; }
.bild figcaption { margin-top: 4px; font-size: 13px; color: var(--text-leise); }
.bild.links  { float: left;  margin: 0 20px 10px 0; max-width: 50%; }
.bild.rechts { float: right; margin: 0 0 10px 20px; max-width: 50%; }

.galerie {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0 0 1.5em;
  clear: both;
}
.galerie.spalten-1 { grid-template-columns: 1fr; }
.galerie.spalten-2 { grid-template-columns: repeat(2, 1fr); }
.galerie.spalten-4 { grid-template-columns: repeat(4, 1fr); }
.galerie .bild { margin: 0; }
.galerie .bild img { width: auto; max-width: 100%; }

/* Bilderstrecke (z.B. Danksagungen) */
.slider-rahmen { position: relative; margin: 0 0 1.5em; }
.slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 10px;
  scrollbar-width: thin;
}
.slider .bild { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.slider .bild img { width: 100%; }
.slider-knopf {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(133, 1, 1, .85); color: #fff; font-size: 24px; cursor: pointer;
}
.slider-knopf.sl-zurueck { left: 8px; }
.slider-knopf.sl-vor { right: 8px; }

/* Video / Audio */
.medien { margin: 0 0 1.5em; }
.medien video { display: block; width: 100%; background: #000; }
.medien audio { width: 100%; max-width: 480px; }
.medien figcaption { font-weight: bold; margin-bottom: 4px; }

/* ------------------------------------------------------------ Termine */
.terminliste { clear: both; margin-top: 1em; }
.termin { padding-bottom: 12px; }
.termin .datum { display: inline-block; min-width: 7.5em; padding-right: 12px; color: var(--text-leise); white-space: nowrap; }
.termin .zeit { color: var(--text-leise); font-size: 13px; }
.termin .teaser { padding-left: 7.5em; }
.termin .teaser p { margin: 2px 0 6px; }
.info { color: var(--text-leise); margin-top: -4px; }
.zurueck { clear: both; margin-top: 2em; }

/* ------------------------------------------------------------ Fuss */
#fuss {
  padding: 30px 11px 8px;
  background: #fff;
  color: var(--text-leise);
  font-size: 12px;
}

/* ------------------------------------------------------------ Lightbox */
#lightbox {
  max-width: 96vw; max-height: 96vh;
  padding: 0; border: 0; background: transparent; overflow: visible;
}
#lightbox::backdrop { background: rgba(0, 0, 0, .85); }
#lightbox img { display: block; max-width: 92vw; max-height: 88vh; border: 4px solid #fff; background: #fff; }
#lightbox button {
  position: fixed; border: 0; background: rgba(0,0,0,.4); color: #fff;
  font-size: 34px; line-height: 1; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
}
#lightbox .lb-zu { top: 12px; right: 12px; }
#lightbox .lb-zurueck { left: 12px; top: 50%; transform: translateY(-50%); }
#lightbox .lb-vor { right: 12px; top: 50%; transform: translateY(-50%); }
#lightbox button[hidden] { display: none; }

/* ------------------------------------------------------------ Tablet */
@media (max-width: 900px) {
  .titel { font-size: 20px; }
}

/* ------------------------------------------------------------ Handy */
@media (max-width: 720px) {
  body { font-size: 16px; }
  #wrapper { margin: 0; border: 0; }

  #kopf {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo    titel"
      "bild    bild"
      "termine termine"
      "navi    navi";
    align-items: center;
  }
  .kopf-links, .kopf-rechts { display: contents; }
  .logo { grid-area: logo; }
  .titel { grid-area: titel; min-height: 0; }
  .kopfbild { grid-area: bild; }
  .kopf-termine { grid-area: termine; }
  .logo { padding: 8px; }
  .logo img { width: 110px; height: auto; }
  .titel { padding: 8px 8px 8px 0; font-size: 21px; align-self: center; }
  .titel small { display: block; font-size: 0.7em; }
  .kopfbild { padding: 0; }
  .kopf-termine { margin: 0; min-height: 0; border-top: 0; padding: 8px 12px; }
  .kopf-termine:not(:has(li)) { display: none; }

  .navi-oben ul { justify-content: center; padding: 4px 0; }
  .navi-oben a { font-size: 14px; padding: 2px 8px; }

  #container { display: block; }
  #navi { padding: 0; border-bottom: 2px solid var(--rot); }
  .menue-knopf {
    display: flex; align-items: center; gap: .5em;
    width: 100%; padding: 10px 12px;
    border: 0; background: var(--grau-hell);
    color: var(--rot); font: bold 16px Verdana, sans-serif; cursor: pointer; text-align: left;
  }
  .menue-knopf::before { content: "☰"; font-size: 20px; }
  .menue-knopf[aria-expanded="true"]::before { content: "✕"; }
  #navi-liste { display: none; }
  #navi.offen #navi-liste { display: block; }
  #navi a { padding: 10px 12px; }

  #main { padding: 0 12px 24px; }
  #main h1 { font-size: 21px; margin-top: 16px; }

  .bild.links, .bild.rechts { float: none; margin: 0 0 1em; max-width: 100%; }
  .bild.links img, .bild.rechts img { margin: 0 auto; }
  .galerie, .galerie.spalten-3, .galerie.spalten-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .termin .datum { display: block; }
  .termin .teaser { padding-left: 0; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .slider { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; }
  #navi, .navi-oben, .kopfbild, #lightbox, .slider-knopf { display: none; }
  #container { display: block; }
}
