/*
 * Front page banner "Kuratoriumstagung" (template-parts/banner-kuratorium.php).
 *
 * Kept as a separate file because the theme's Sass build (gulp 3, gulp-sass 2) no longer
 * runs on current Node versions. Positions are taken from the PowerPoint design as
 * percentages of the banner; font sizes scale with the banner width (cqw) but never drop
 * below a rem minimum, so browser text zoom still works.
 */

.kurat-banner-slot {
  width: 100%;
  margin-top: -50px; /* offsets #page's top margin, as the previous banner did */
  margin-bottom: 10px;
  container: kurat-banner / inline-size;
}

.kurat-banner {
  /* Darker than the PowerPoint's #86b499: white text needs 4.5:1, the original reaches 2.3:1. */
  --kurat-wave: #3a7553;
  --kurat-green: #1b7131; /* $green, assets/scss/szag/_colors.scss */

  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  aspect-ratio: 3.2 / 1;
  overflow: hidden;
  color: #fff;
  font-family: 'Noto Sans', sans-serif;
  background: var(--kurat-wave);
}

.kurat-banner__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.kurat-banner__wave {
  position: absolute;
  color: var(--kurat-wave);
  pointer-events: none;
}

.kurat-banner__wave svg {
  display: block;
  width: 100%;
  height: 100%;
}

.kurat-banner__wave--left {
  left: 0;
  top: -2.8%;
  width: 64%; /* wider and taller than in the PowerPoint so text and online button stay on green */
  height: 126%;
  transform: rotate(180deg);
  opacity: 0.92;
}

.kurat-banner__wave--right {
  left: 58.4%;
  top: 16.6%;
  width: 42%;
  height: 83.5%;
  opacity: 0.85;
}

.kurat-banner__content,
.kurat-banner__aside {
  position: relative;
  z-index: 1;
}

.kurat-banner__content {
  padding: 0.3cqw 0 2.5cqw 1.5cqw;
}

.kurat-banner .kurat-banner__title {
  margin: 0;
  color: #fff;
  font-family: 'Noto Sans', sans-serif;
  font-size: max(1.5rem, 4.3cqw);
  font-weight: 700;
  line-height: 1.1;
}

.kurat-banner p {
  margin: 0;
  line-height: 1.25;
}

.kurat-banner .kurat-banner__date {
  margin-top: 0.3cqw;
  font-size: max(1rem, 2.05cqw);
  font-weight: 700;
}

.kurat-banner .kurat-banner__time {
  margin-top: 0.1cqw;
  font-size: max(1rem, 2.05cqw);
  font-weight: 700;
}

.kurat-banner .kurat-banner__location {
  max-width: 42cqw; /* wraps before the text leaves the green wave */
  margin-top: 0.2cqw;
  font-size: max(0.875rem, 1.85cqw);
}

.kurat-banner .kurat-banner__online {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2cqw;
  margin-top: 1cqw;
  font-size: max(0.875rem, 1.85cqw);
}

.kurat-banner__aside {
  display: flex;
  align-items: flex-end;
  gap: 0.6cqw;
  align-self: end;
}

.kurat-banner__button {
  display: inline-flex;
  align-items: center;
  gap: 0.6cqw;
  padding: 0.55cqw 1.1cqw;
  border-radius: 0.9cqw;
  background: #fff;
  color: var(--kurat-green);
  font-size: max(0.875rem, 1.45cqw);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 0.2cqw 0.6cqw rgba(0, 0, 0, 0.15);
}

a.kurat-banner__button:hover,
a.kurat-banner__button:focus {
  color: var(--kurat-green);
  text-decoration: underline;
}

a.kurat-banner__button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.kurat-banner__button--pending {
  cursor: default;
}

.kurat-banner__note {
  font-size: 0.85em;
  font-weight: 400;
}

.kurat-banner__button--program {
  margin-bottom: 1.5cqw;
}

.kurat-banner__icon {
  flex: none;
  width: max(1rem, 1.7cqw);
  height: max(1rem, 1.7cqw);
}

.kurat-banner__logo {
  display: block;
  width: 17.9cqw;
  max-width: none;
  height: auto;
  margin: 0 -1.2cqw -0.9cqw 0;
}

/* Narrow banner: photo strip on top, text below on solid green. */
@container kurat-banner (max-width: 48rem) {
  .kurat-banner {
    grid-template-columns: minmax(0, 1fr);
    aspect-ratio: auto;
  }

  .kurat-banner__photo {
    position: static;
    grid-row: 1;
    height: 34cqw;
  }

  .kurat-banner__wave {
    display: none;
  }

  .kurat-banner__content {
    grid-row: 2;
    padding: 1rem 1rem 0;
  }

  .kurat-banner__aside {
    position: static; /* lets the logo sit on the photo, relative to the banner */
    grid-row: 3;
    padding: 1rem;
  }

  .kurat-banner .kurat-banner__title {
    font-size: 1.625rem;
  }

  .kurat-banner .kurat-banner__date,
  .kurat-banner .kurat-banner__time {
    margin-top: 0.25rem;
    font-size: 1.0625rem;
  }

  .kurat-banner .kurat-banner__location {
    max-width: none;
    font-size: 1rem;
  }

  .kurat-banner .kurat-banner__online,
  .kurat-banner__button {
    font-size: 1rem;
  }

  .kurat-banner .kurat-banner__online {
    margin-top: 1rem;
  }

  .kurat-banner__button {
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
  }

  .kurat-banner__button--program {
    margin-bottom: 0;
  }

  .kurat-banner__logo {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 4.5rem;
    margin: 0;
  }
}

/* Quick edit, only rendered for users allowed to edit the banner page. */
.kurat-banner-hidden,
.kurat-banner-message {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #1b7131;
  background: #dff1e1;
  color: #262626;
}

.kurat-banner-message {
  margin-top: 0.5rem;
}

.kurat-banner-message--error {
  border-left-color: #b3261e;
  background: #fbeaea;
}

.kurat-banner-edit {
  margin-top: 0.5rem;
  background: #fff;
  color: #262626;
}

.kurat-banner-edit__toggle {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #1b7131;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.kurat-banner-edit__toggle:focus-visible {
  outline: 3px solid #eb6815;
  outline-offset: 2px;
}

.kurat-banner-edit__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 1.5rem;
  padding: 1rem;
}

@container kurat-banner (min-width: 40rem) {
  .kurat-banner-edit__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kurat-banner-edit__row--wide {
  grid-column: 1 / -1;
  max-width: 20rem;
}

.kurat-banner-edit__row label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.kurat-banner-edit__row input[type='text'],
.kurat-banner-edit__row input[type='url'],
.kurat-banner-edit__row input[type='date'] {
  margin-bottom: 0;
}

.kurat-banner-edit__row--inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column: 1 / -1;
}

.kurat-banner-edit__row--inline input,
.kurat-banner-edit__row--inline label {
  margin: 0;
}

/* The theme hides checkboxes and draws them as a label background; put that icon over the input. */
.kurat-banner-edit__row--inline input[type='checkbox'] + label {
  margin-left: calc(-28px - 0.5rem);
}

.kurat-banner-edit__row--inline input[type='checkbox']:focus-visible + label {
  outline: 2px solid #1b7131;
  outline-offset: 2px;
}

.kurat-banner-edit__hint,
.kurat-banner-edit__error {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.kurat-banner-edit__hint {
  color: #5e5e5d;
}

.kurat-banner-edit__error {
  color: #b3261e;
  font-weight: 700;
}

.kurat-banner-edit__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  grid-column: 1 / -1;
}

.kurat-banner-edit__actions .button {
  margin: 0;
}

@media print {
  .kurat-banner-edit,
  .kurat-banner-message,
  .kurat-banner-hidden {
    display: none;
  }
}
