/* ==========================================================================
   Chor Jeunesse Eferding – Stylesheet
   --------------------------------------------------------------------------
   Farben, Schriften und Abstände werden zentral unter :root festgelegt.
   Wer z. B. das Blau ändern möchte, ändert nur --blau.
   ========================================================================== */

:root {
  --blau: #00a7e3;          /* Markenfarbe aus dem Logo */
  --blau-dunkel: #0077a8;
  --blau-hell: #e5f6fc;
  --tinte: #14202b;         /* Text / dunkle Flächen */
  --grau: #5b6873;
  --linie: #dde5eb;
  --hintergrund: #f7f9fb;
  --weiss: #ffffff;
  --akzent: #f2b631;        /* warmer Akzent für Hinweise */

  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --schrift-titel: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --radius: 14px;
  --schatten: 0 1px 2px rgba(20, 32, 43, .06), 0 8px 24px rgba(20, 32, 43, .08);
  --breite: 1160px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--tinte);
  background: var(--hintergrund);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blau-dunkel); text-underline-offset: 3px; }
a:hover { color: var(--blau); }

h1, h2, h3 {
  font-family: var(--schrift-titel);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--blau); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--tinte); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container { width: min(100% - 2.5rem, var(--breite)); margin-inline: auto; }
.container--schmal { width: min(100% - 2.5rem, 780px); margin-inline: auto; }

/* ========== Kopfbereich & Navigation ========== */

.kopf {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--linie);
}
.kopf__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 92px; padding-block: .7rem;
}
.logo { display: block; flex-shrink: 0; line-height: 0; }
/* Logo über die Höhe skalieren – das Seitenverhältnis (2,3:1) bleibt immer erhalten */
.logo img { height: 74px; width: auto; max-width: none; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.nav a {
  display: block; padding: .5rem .85rem; border-radius: 999px;
  color: var(--tinte); text-decoration: none; font-weight: 500; font-size: 1rem;
  transition: background .2s, color .2s;
}
.nav a:hover { background: var(--blau-hell); color: var(--blau-dunkel); }
.nav a[aria-current="page"] { background: var(--blau); color: #fff; }

.nav-toggle {
  display: none;
  background: none; border: 0; padding: .6rem; cursor: pointer; color: var(--tinte);
}
.nav-toggle span {
  display: block; width: 26px; height: 2px; background: currentColor; margin: 6px 0;
  transition: transform .25s, opacity .25s;
}

@media (max-width: 940px) {
  .js .nav-toggle { display: block; }
  .kopf__inner { min-height: 72px; padding-block: .5rem; }
  .logo img { height: 56px; }
  .js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--linie);
    box-shadow: var(--schatten);
    display: none;
  }
  .js .nav.offen { display: block; }
  .nav ul { flex-direction: column; padding: .75rem 1.25rem 1.25rem; }
  .nav a { padding: .8rem 1rem; border-radius: 10px; font-size: 1.1rem; }
  /* ohne JavaScript: Menü einfach unter dem Logo anzeigen */
  html:not(.js) .kopf__inner { flex-wrap: wrap; padding-block: .75rem; }
  html:not(.js) .nav ul { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ========== Hero (Startseite) ========== */

.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #12b4ec 0%, var(--blau) 35%, var(--blau-dunkel) 100%);
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}
.hero::before {
  /* dezente Notenlinien */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: 8%; height: 150px;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.13) 0 1px, transparent 1px 16px);
  transform: rotate(-4deg);
}
.hero__raster {
  position: relative; display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}
.hero__eyebrow {
  display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.18); padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: .35em; }
.hero p { font-size: 1.2rem; max-width: 540px; opacity: .95; }
.hero__bild {
  border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 30, 50, .35); width: 100%;
  transform: rotate(1.2deg); border: 6px solid rgba(255,255,255,.9);
}
.hero .button { background: #fff; color: var(--blau-dunkel); border-color: #fff; }
.hero .button:hover { background: var(--tinte); border-color: var(--tinte); color: #fff; }
.hero .button--hell { background: transparent; color: #fff; border-color: rgba(255,255,255,.8); }
.hero .button--hell:hover { background: #fff; color: var(--blau-dunkel); }
@media (max-width: 860px) {
  .hero__raster { grid-template-columns: 1fr; }
  .hero__bild { transform: none; }
}

/* ========== Seitenkopf (Unterseiten) ========== */

.seitenkopf {
  background: linear-gradient(135deg, var(--blau) 0%, var(--blau-dunkel) 100%);
  color: #fff; padding-block: clamp(2.5rem, 6vw, 4.5rem);
  position: relative; overflow: hidden;
}
.seitenkopf::after {
  /* dezente Notenlinien als Dekoration */
  content: ""; position: absolute; inset: auto -10% -30px -10%; height: 120px;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.14) 0 1px, transparent 1px 14px);
  transform: rotate(-3deg);
}
.seitenkopf h1 { margin: 0; }
.seitenkopf p { margin: .5rem 0 0; font-size: 1.15rem; opacity: .92; max-width: 640px; }

/* ========== Abschnitte ========== */

.abschnitt { padding-block: clamp(3rem, 7vw, 5.5rem); }
.abschnitt--weiss { background: var(--weiss); }
.abschnitt--dunkel { background: var(--tinte); color: #e9eef2; }
.abschnitt--dunkel h2 { color: #fff; }

.abschnitt__kopf {
  display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.abschnitt__kopf h2 { margin: 0; }
.eyebrow {
  display: block; color: var(--blau-dunkel); font-weight: 600; font-size: .85rem;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: .4rem;
}
.abschnitt--dunkel .eyebrow { color: var(--blau); }

.zweispaltig {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 820px) { .zweispaltig { grid-template-columns: 1fr; } }

.bild-rund { border-radius: var(--radius); box-shadow: var(--schatten); width: 100%; }

.zitat {
  font-family: var(--schrift-titel); font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-style: italic;
  border-left: 4px solid var(--blau); padding-left: 1.2rem; margin: 0 0 1.5rem;
}

/* ========== Buttons ========== */

.button {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--blau); color: #fff; text-decoration: none; font-weight: 600;
  padding: .75rem 1.4rem; border-radius: 999px; border: 2px solid var(--blau);
  transition: background .2s, color .2s, transform .2s;
}
.button:hover { background: var(--blau-dunkel); border-color: var(--blau-dunkel); color: #fff; transform: translateY(-1px); }
.button--hell { background: transparent; color: #fff; border-color: rgba(255,255,255,.8); }
.button--hell:hover { background: #fff; color: var(--tinte); border-color: #fff; }
.button--rahmen { background: transparent; color: var(--blau-dunkel); }
.button--rahmen:hover { background: var(--blau); color: #fff; }
.button--klein { padding: .4rem .95rem; font-size: .92rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.link-pfeil { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-pfeil::after { content: " →"; }

/* ========== Info-Karten ========== */

.karten { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.karte {
  background: #fff; border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--schatten);
  border-top: 4px solid var(--blau);
}
.karte h3 { margin-bottom: .4rem; }
.karte p:last-child { margin-bottom: 0; }
.abschnitt--dunkel .karte { background: rgba(255,255,255,.06); box-shadow: none; color: #e9eef2; }
.abschnitt--dunkel .karte h3 { color: #fff; }

/* ========== TERMINE ========== */

.termin-liste { display: grid; gap: 1rem; }

.termin {
  display: grid; grid-template-columns: 96px 1fr; gap: 1.25rem; align-items: start;
  background: #fff; border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--schatten);
  border-left: 5px solid var(--blau);
}
.termin time {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--blau-hell); color: var(--blau-dunkel); border-radius: 12px;
  padding: .6rem .4rem; text-align: center; font-weight: 600; line-height: 1.15;
  min-height: 96px;
}
/* Die Datums-Kachel wird per JavaScript aus dem datetime-Attribut erzeugt */
.termin time .wt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.termin time .tag { font-size: 2rem; font-family: var(--schrift-titel); color: var(--tinte); }
.termin time .mon { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.termin time .jahr { font-size: .78rem; font-weight: 500; color: var(--grau); }

.termin h3 { margin: .1rem 0 .4rem; }
.termin p { margin: 0 0 .35rem; color: var(--grau); }
.termin .zeit, .termin .ort {
  display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.1rem; color: var(--tinte); font-weight: 500;
}
.termin .zeit::before, .termin .ort::before {
  content: ""; width: 1.05em; height: 1.05em; background: var(--blau-dunkel); flex-shrink: 0;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.termin .zeit::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.termin .ort::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.termin .info { margin-top: .5rem; }
.termin .button { margin-top: .6rem; }

.termin--vergangen { opacity: .7; border-left-color: var(--linie); box-shadow: none; }
.termin--vergangen time { background: #eef1f4; color: var(--grau); }

.termin-hinweis {
  background: #fff; border: 2px dashed var(--linie); border-radius: var(--radius);
  padding: 2rem; text-align: center; color: var(--grau);
}
.termin-hinweis[hidden] { display: none; }

.vergangene { margin-top: 3rem; }
.vergangene summary {
  cursor: pointer; font-weight: 600; color: var(--grau); padding: .6rem 0; list-style: none;
}
.vergangene summary::-webkit-details-marker { display: none; }
.vergangene summary::before { content: "▸ "; }
.vergangene[open] summary::before { content: "▾ "; }
.vergangene .termin-liste { margin-top: 1rem; }

@media (max-width: 560px) {
  .termin { grid-template-columns: 72px 1fr; gap: .9rem; padding: 1rem; }
  .termin time { min-height: 80px; }
  .termin time .tag { font-size: 1.6rem; }
}

/* Startseite: aktuelles Plakat neben den nächsten Terminen */
.termine-start {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start;
}
.termine-start:not(:has(.termine-start__plakat)) { display: block; }
.termine-start__plakat { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.termine-start__plakat img { width: 100%; transition: transform .4s; }
.termine-start__plakat:hover img { transform: scale(1.02); }
@media (max-width: 720px) {
  .termine-start { grid-template-columns: 1fr; }
  .termine-start__plakat { max-width: 420px; width: 100%; margin-inline: auto; }
}

/* Kompakte Termin-Vorschau auf der Startseite */
.vorschau .termin { box-shadow: none; border: 1px solid var(--linie); border-left: 5px solid var(--blau); }
.vorschau .termin .info, .vorschau .termin .button { display: none; }

/* ========== HIGHLIGHTS ========== */

.highlight-liste { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }

.highlight {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  background: #fff; border-radius: calc(var(--radius) + 4px); padding: clamp(1.1rem, 3vw, 2rem);
  box-shadow: var(--schatten);
}
.highlight:nth-child(even) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.highlight:nth-child(even) .galerie { order: 2; }
/* Plakate (Hochformat) schmaler darstellen */
.highlight:has(.galerie--plakat) { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.highlight:nth-child(even):has(.galerie--plakat) { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
@media (max-width: 820px) {
  .highlight, .highlight:nth-child(even),
  .highlight:has(.galerie--plakat), .highlight:nth-child(even):has(.galerie--plakat) { grid-template-columns: 1fr; }
  .galerie--plakat { max-width: 340px; }
  .highlight:nth-child(even) .galerie { order: 0; }
}
.highlight .datum {
  color: var(--blau-dunkel); font-weight: 600; font-size: .95rem; letter-spacing: .03em; margin-bottom: .3rem;
}
.highlight h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.highlight .downloads { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* Galerie: erstes Bild groß, weitere Bilder als kleine Kacheln */
.galerie { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.galerie a {
  display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--blau-hell);
}
.galerie a:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.galerie--plakat a:first-child { aspect-ratio: auto; }
.galerie--plakat a:first-child img { object-fit: contain; height: auto; }
.galerie img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.galerie a:hover img { transform: scale(1.04); }

/* Kompakte Highlight-Vorschau auf der Startseite */
.vorschau-highlights { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.vorschau-highlights .highlight { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
.vorschau-highlights .highlight .galerie { order: 0; }
.vorschau-highlights .galerie a:not(:first-child),
.vorschau-highlights .highlight p:not(.datum),
.vorschau-highlights .downloads { display: none; }
.vorschau-highlights .galerie a:first-child { aspect-ratio: 4 / 3; }
.vorschau-highlights .galerie img { object-fit: cover; object-position: top; height: 100%; }
.vorschau-highlights h2 { font-size: 1.3rem; margin: 0; }

/* Fotoarchiv */
.archiv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.archiv a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; }
.archiv img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.archiv a:hover img { transform: scale(1.05); }

/* ========== Lightbox (Bildvergrößerung) ========== */

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
}
.lightbox::backdrop { background: rgba(8, 14, 20, .75); }
.lightbox[open] { background: rgba(8, 14, 20, .7); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 1rem 1rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #dfe7ee; margin-top: .8rem; text-align: center; }
.lightbox button {
  position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
}
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-zu { top: 1rem; right: 1rem; }
.lightbox .lb-zurueck { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-weiter { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ========== Hörproben ========== */

.hoerprobe {
  display: grid; grid-template-columns: 1fr minmax(240px, 380px); gap: 1rem; align-items: center;
  background: #fff; border-radius: var(--radius); padding: 1.1rem 1.4rem; box-shadow: var(--schatten);
}
.hoerprobe h3 { margin: 0; font-size: 1.15rem; }
.hoerprobe p { margin: .2rem 0 0; color: var(--grau); font-size: .95rem; }
.hoerprobe audio { width: 100%; }
@media (max-width: 640px) { .hoerprobe { grid-template-columns: 1fr; } }

/* ========== Tabellen (Intern) ========== */

.tabelle { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.tabelle th, .tabelle td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle th { background: var(--blau-hell); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; }
.tabelle audio { width: 100%; min-width: 200px; height: 40px; }
@media (max-width: 640px) {
  .tabelle thead { display: none; }
  .tabelle tr { display: block; border-bottom: 1px solid var(--linie); padding: .5rem 0; }
  .tabelle td { display: block; border: 0; padding: .35rem 1rem; }
}

/* ========== Kontakt / Text ========== */

.adresse { font-style: normal; font-size: 1.15rem; line-height: 1.8; }
.text h2 { font-size: 1.5rem; margin-top: 2rem; }
.text h2:first-child { margin-top: 0; }

/* ========== Fußbereich ========== */

.fuss { background: var(--tinte); color: #b9c5cf; padding-block: 3rem 1.5rem; margin-top: auto; font-size: .95rem; }
.fuss a { color: #fff; }
.fuss__raster { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .fuss__raster { grid-template-columns: 1fr; } }
.fuss img { height: 64px; width: auto; margin-bottom: 1rem; opacity: .95; }
.fuss h3 { font-family: var(--schrift); font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: #fff; margin-bottom: .8rem; }
.fuss ul { list-style: none; padding: 0; margin: 0; }
.fuss li { margin-bottom: .35rem; }
.fuss__unten {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.5rem; padding-top: 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .88rem;
}

/* ========== Druck ========== */
@media print {
  .kopf, .fuss, .nav-toggle, .buttons, .vergangene summary { display: none !important; }
  .seitenkopf { background: none; color: #000; padding: 0 0 1rem; }
  .termin, .highlight { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
