/* Einzelansicht eines Kurses (Markup kommt aus dem Plugin „Kursverwaltung“, das Layout aus dem Theme).
   Aufbau: Kopfbereich über die volle Breite, darunter links Hinweise, Beschreibung und Anmeldeformular,
   rechts die Eckdaten-Karte, die beim Scrollen mitläuft. */
.single-kurs #site-content,
.single-kurs #site-content > article {
  margin-top: 0;
}

/* Damit die Eckdaten mitlaufen können, darf der Seitencontainer kein eigener Scrollbereich sein.
   Der Header bleibt wie bisher oben stehen und läuft nicht mit. */
@supports (overflow: clip) {
  .single-kurs .tva-main {
    overflow: visible;
    overflow-x: clip;
  }

  .single-kurs #main-head {
    position: relative;
  }
}

.single-kurs .entry-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  column-gap: 3rem;
  position: relative;
}

.single-kurs .entry-content > * {
  grid-column: 1;
  min-width: 0;
}

/* Kopfbereich: neutrale Fläche über die ganze Seitenbreite, wie bei den Veranstaltungen */
.single-kurs .entry-content::before {
  content: "";
  grid-column: 1 / -1;
  grid-row: 1 / 3;
  margin: 0 calc(50% - 50vw);
  border-radius: 0 0 15px 15px;
  background: #ECEFF1;
  z-index: 0;
}

.single-kurs .entry-content > .tva-kurs-zurueck {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  justify-self: start;
  margin: 4.5rem 0 0;
  color: #37474F;
  font-weight: 600;
  opacity: .75;
  text-decoration: none;
}

.single-kurs .entry-content > .tva-kurs-zurueck:hover {
  opacity: 1;
}

.single-kurs .entry-content > h1 {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: .75rem;
  margin: 0;
  padding: 1.25rem 0 2.5rem;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.15;
}

/* ohne Zurück-Link (z. B. Skript noch nicht geladen) braucht der Titel oben selbst Luft */
.single-kurs .entry-content > h1:first-child {
  padding-top: 4.5rem;
}

.single-kurs .entry-content > h1 .coursestatus {
  padding: .35rem .85rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
}

.single-kurs .entry-content > p:empty {
  display: none;
}

/* Hinweise und Beschreibung (zwischen Titel und Eckdaten).
   Die Beschreibung kann je nach Eingabe ein Absatz oder ein div sein. */
.single-kurs .entry-content > *:has(~ div > .kurs-info):not(h1):not(.tva-kurs-zurueck) {
  margin: 2.5rem 0 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.single-kurs .entry-content > .important_changes ~ *:has(~ div > .kurs-info):not(h1):not(.tva-kurs-zurueck) {
  margin-top: 1.5rem;
}

/* „Wichtige Änderungen“ sieht aus wie die Statusmeldungen (siehe unten): helle Fläche, farbige Kante */
.single-kurs .entry-content > .important_changes {
  padding: 1.25rem 1.5rem;
  border: 0;
  border-left: 6px solid #F44336;
  border-radius: 12px;
  box-shadow: none;
  background: #FDECEA;
  color: #333;
  font-size: 1.1rem;
  line-height: 1.6;
}

.single-kurs .important_changes .important_changes_badge {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .5rem;
  color: #37474F;
  font-family: "Maven Pro", sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
}

.single-kurs .important_changes .important_changes_badge svg {
  flex-shrink: 0;
  margin: 0;
}

.single-kurs .important_changes p {
  margin: 0;
}

/* Rechte Spalte: alle Eckdaten in einer Karte, läuft beim Scrollen mit */
.single-kurs .entry-content > div:has(> .kurs-info) {
  grid-column: 2;
  grid-row: 3 / span 40;
  align-self: start;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  margin-top: 2.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  border: 2px solid #CFD8DC;
  border-radius: 15px;
  background: #fff;
}

.admin-bar.single-kurs .entry-content > div:has(> .kurs-info) {
  top: calc(32px + 1.5rem);
  max-height: calc(100vh - 32px - 3rem);
}

.single-kurs .kurs-info {
  display: block;
  margin: 0;
  padding: .5rem 1.5rem;
}

.single-kurs .kurs-info .kurs-info-ele {
  flex: none !important;
  width: auto;
  margin: 0;
  padding: .85rem 0;
  border: 0;
  border-top: 1px solid #ECEFF1;
  border-radius: 0;
  box-shadow: none;
  background: none;
  line-height: 1.45;
  /* lange E-Mail-Adressen umbrechen statt aus der Karte zu laufen */
  overflow-wrap: anywhere;
}

.single-kurs .kurs-info .kurs-info-ele:first-child {
  border-top: 0;
}

.single-kurs .kurs-info .kurs-info-ele p {
  margin: 0;
}

.single-kurs .kurs-info .kurs-info-ele > p > strong:first-child,
.single-kurs .kurs-info .kurs-info-ele > strong:first-child {
  display: block;
  margin-bottom: .15rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #78909C;
}

.single-kurs .kurs-info .kurs-info-ele > p > strong:first-child + br,
.single-kurs .kurs-info .kurs-info-ele > strong:first-child + br {
  display: none;
}

.single-kurs .kurs-info iframe {
  display: block;
  height: 200px;
  margin: .25rem 0;
  border-radius: 10px;
}

/* Sprungknopf zum Formular: nur dort nötig, wo das Formular nicht ohnehin daneben steht */
.single-kurs .kurs-info .tva-kurs-cta {
  display: none;
  margin: .75rem 0 1rem;
  padding: .7rem 1rem;
  border: 2px solid #d62032;
  border-radius: 10px;
  background: #d62032;
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s ease-out;
}

.single-kurs .kurs-info .tva-kurs-cta:hover {
  background: #af1b31;
  border-color: #af1b31;
  color: #fff;
}

/* Statusmeldungen: ruhiger, mit farbiger Kante statt Vollfläche */
.single-kurs .entry-content > .error-message {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.5rem;
  border-left: 6px solid #37474F;
  border-radius: 12px;
  background: #ECEFF1;
  color: #333;
}

.single-kurs .entry-content > .error-message {
  font-size: 1.1rem;
  line-height: 1.6;
}

.single-kurs .entry-content > .error-message h3 {
  margin: 0 0 .5rem !important;
  color: #37474F;
  font-size: 1.3rem;
  line-height: 1.25;
}

.single-kurs .entry-content > .error-message p {
  margin: 0;
}

.single-kurs .entry-content > .error-message.red {
  border-left-color: #F44336;
  background: #FDECEA;
}

.single-kurs .entry-content > .error-message.orange {
  border-left-color: #FF9800;
  background: #FFF3E0;
}

.single-kurs .entry-content > .error-message.green {
  border-left-color: #4CAF50;
  background: #E8F5E9;
}

.single-kurs .entry-content > #form-message:empty {
  display: none;
}

.single-kurs .entry-content > h2 {
  margin: 2.5rem 0 1.25rem;
  scroll-margin-top: 2rem;
}

/* Schmale Bildschirme: eine Spalte – Beschreibung, Eckdaten, dann das Formular */
@media (max-width: 1000px) {
  .single-kurs .entry-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .single-kurs .entry-content > div:has(> .kurs-info),
  .admin-bar.single-kurs .entry-content > div:has(> .kurs-info) {
    grid-column: 1;
    grid-row: auto;
    position: static;
    max-height: none;
    margin-top: 2rem;
    overflow: visible;
  }

  .single-kurs .kurs-info .tva-kurs-cta {
    display: block;
  }

  .single-kurs .entry-content > *:has(~ div > .kurs-info):not(h1):not(.tva-kurs-zurueck) {
    margin-top: 2rem;
  }
}
