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

html {
  scroll-behavior: smooth;
  /* Prevent header shift when pages gain/lose a vertical scrollbar */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--bib-font);
  color: var(--bib-text);
  background: var(--bib-bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--bib-primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--bib-focus);
  outline-offset: 2px;
}

.wrap {
  width: min(100% - 1.5rem, var(--bib-max));
  margin-inline: auto;
}

.main {
  flex: 1;
  padding-block: 1.25rem 2.5rem;
}

/* ——— Header ——— */

.site-header {
  background: #2a848a;
  color: #fff;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  padding-block: 0.75rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.brand-logo {
  width: auto;
  height: 56px;
  max-width: 150px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand-kicker {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.92;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-drawer {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  flex-shrink: 0;
  z-index: 30;
}

.nav-drawer > summary {
  list-style: none;
  cursor: pointer;
}

.nav-drawer > summary::-webkit-details-marker {
  display: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--bib-radius);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
  min-height: 44px;
  white-space: nowrap;
}

.nav-toggle-icon {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: #fff;
  box-shadow: 0 5px 0 #fff, 0 -5px 0 #fff;
  flex-shrink: 0;
}

.nav-drawer[open] .nav-toggle {
  background: rgba(255, 255, 255, 0.12);
}

.nav-drawer .nav {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 14rem;
  background: #1a5f64;
  border-radius: var(--bib-radius);
  padding: 0.35rem 0;
  box-shadow: 0 4px 16px rgba(12, 42, 44, 0.25);
}

.nav-drawer .nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-bottom: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-drawer .nav a:hover,
.nav-drawer .nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
}

.nav-drawer .nav a.nav-framed {
  margin: 0.35rem 0.65rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--bib-radius);
  justify-content: center;
  text-align: center;
}

.nav-drawer .nav a.nav-framed:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
}

@media (max-width: 379px) {
  .nav-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nav-toggle {
    padding: 0.55rem;
  }
}

@media (min-width: 720px) {
  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
  }

  .brand-logo {
    height: 64px;
    max-width: 220px;
  }

  .brand-kicker {
    font-size: 0.9rem;
    white-space: normal;
  }

  .brand-title {
    font-size: 0.8rem;
    white-space: normal;
  }

  .nav-drawer {
    margin-left: auto;
  }
}

/* ——— Hero / Toc ——— */

.hero-section h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--bib-text);
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.lede {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  color: var(--bib-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.lede + .lede-follow {
  margin-top: -0.55rem;
}

.toc {
  margin: 0 0 1.75rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--bib-border);
}

.toc-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bib-muted);
  margin: 0 0 0.5rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc a {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  color: var(--bib-primary-dark);
  padding: 0.35rem 0;
  min-height: 44px;
  line-height: 1.4;
}

.toc a:hover {
  text-decoration: underline;
}

.section-block {
  margin: 2rem 0 1.5rem;
  scroll-margin-top: 1rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bib-text);
  margin: 0 0 0.85rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.section-head .section-title {
  margin: 0;
}

.section-more {
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.section-more:hover {
  text-decoration: underline;
}

/* ——— Highlights (Leipzig-style cards) ——— */

.highlights {
  margin: 0 0 2rem;
}

.highlights h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--bib-text);
  margin: 0 0 1rem;
}

.highlights-viewport {
  overflow: hidden;
  width: 100%;
}

.highlights-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.35s ease;
  will-change: transform;
}

.highlight-card {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--bib-border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-height: 100%;
  box-sizing: border-box;
}

.highlight-card:hover .highlight-title {
  color: var(--bib-primary);
}

.highlight-media {
  display: block;
  aspect-ratio: 16 / 10;
  background: #e8eef0;
  overflow: hidden;
}

.highlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.highlight-media.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef4f5;
}

.highlight-media.is-empty .highlight-fallback {
  width: auto;
  height: 48px;
  max-width: 55%;
  object-fit: contain;
  opacity: 0.85;
}

.highlight-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem 1.1rem;
  flex: 1;
}

.highlight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bib-text);
  line-height: 1.35;
}

.highlight-arrow {
  color: var(--bib-primary);
  font-weight: 700;
  margin-left: 0.15rem;
}

.highlight-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--bib-muted);
  line-height: 1.4;
}

.highlights-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.1rem;
}

.highlights-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--bib-border);
  background: #fff;
  color: var(--bib-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.highlights-btn:hover:not(:disabled) {
  border-color: var(--bib-primary);
  color: var(--bib-primary);
}

.highlights-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.highlights-page {
  font-size: 0.95rem;
  color: var(--bib-muted);
  min-width: 2.5rem;
  text-align: center;
}

@media (min-width: 720px) {
  .highlights h2 {
    font-size: 1.5rem;
  }
}

@media (min-width: 1100px) {
  .highlights h2 {
    font-size: 1.55rem;
  }
}

/* ——— Filters ——— */

.filters {
  background: var(--bib-primary-soft);
  padding: 1rem;
  border-radius: var(--bib-radius);
  border: none;
  margin-bottom: 1.25rem;
}

.filters-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.filters-search {
  grid-column: 1 / -1;
}

.filters-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.filters-row-secondary {
  margin-top: 0.75rem;
  grid-template-columns: 1fr;
}

.filters label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.filters-reset {
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--bib-primary-dark);
}

.filters-reset:hover {
  text-decoration: underline;
}

@media (min-width: 720px) {
  .filters-compact .filters-row:first-child {
    grid-template-columns: 9rem 9rem minmax(10rem, 1fr) auto;
  }

  .filters-compact .filters-search {
    grid-column: auto;
  }

  .filters-compact .filters-actions {
    grid-column: auto;
  }

  .filters-row-secondary {
    grid-template-columns: minmax(12rem, 16rem);
  }
}

input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--bib-border);
  border-radius: var(--bib-radius);
  font: inherit;
  color: var(--bib-text);
  background: #fff;
  min-height: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: var(--bib-radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary {
  background: var(--bib-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--bib-btn-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--bib-primary);
  color: var(--bib-primary-dark);
}

.btn-ghost:hover {
  background: var(--bib-primary-soft);
}

/* ——— Event list rows (Leipzig) ——— */

.month-section {
  margin: 0 0 2rem;
}

.month-section:last-child {
  margin-bottom: 0;
}

.month-header {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bib-primary-darker);
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--bib-primary-soft);
  border: none;
  border-radius: var(--bib-radius);
}

@media (min-width: 720px) {
  .month-header {
    font-size: 1.45rem;
  }
}

.month-section .event-list {
  padding-inline: 0.85rem;
}

.month-section .event-row.has-media {
  /* keep media flush to the list edge while text aligns with month title */
  margin-inline: 0;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-list > li {
  border-bottom: 1px solid var(--bib-border);
}

.event-list > li:first-child {
  border-top: 1px solid var(--bib-border);
}

/* Month heading already has a rule — avoid double line above first event */
.month-section .event-list > li:first-child {
  border-top: none;
}

.event-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.95rem 0;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}

.event-row.has-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(7rem, 24vw, 11rem);
  gap: 0 1rem;
  align-items: stretch;
  padding: 0;
  min-height: 7rem;
}

.event-row-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: var(--bib-primary-soft);
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-height: 7rem;
}

.event-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.event-row.has-media .event-row-body {
  grid-column: 1;
  grid-row: 1;
  padding: 0.85rem 0;
  align-self: center;
}

.event-row-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-row:hover .event-row-title {
  color: var(--bib-primary);
  text-decoration: underline;
}

.event-row.is-cancelled {
  opacity: 0.7;
}

.event-row-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bib-primary-darker);
  line-height: 1.3;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.event-row-date,
.event-row-loc,
.event-row-price {
  font-size: 0.95rem;
  color: var(--bib-muted);
}

.event-row-topic {
  font-size: 0.85rem;
  color: var(--bib-primary-dark);
  font-weight: 600;
  margin-top: 0.15rem;
}

@media (min-width: 560px) {
  .event-row.has-media {
    grid-template-columns: minmax(0, 1fr) 12rem;
    min-height: 9rem;
  }

  .event-row.has-media .event-row-body {
    padding: 1rem 0;
  }

  .event-row.has-media .event-row-media {
    min-height: 9rem;
  }
}

.badge-cancel {
  background: var(--bib-accent-coral);
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-lg {
  display: inline-block;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
}

/* ——— Calendar download ——— */

.calendar-download p {
  margin: 0;
}

.calendar-download a {
  font-weight: 600;
  text-decoration: none;
}

.calendar-download a:hover {
  text-decoration: underline;
}

/* ——— Detail ——— */

.event-detail > .back {
  margin-bottom: 0.85rem;
}

.event-top > h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--bib-text);
  margin: 0 0 1.25rem;
  line-height: 1.25;
  max-width: 40rem;
}

.event-meta {
  background: var(--bib-primary-soft);
  border-radius: 6px;
  padding: 1.15rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
  max-width: 40rem;
}

.event-detail .meta-list {
  display: grid;
  gap: 1rem 1.5rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  align-items: start;
}

.event-detail .meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
  text-align: left;
}

.event-detail dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bib-primary-dark);
  margin: 0;
  line-height: 1.2;
}

.event-detail dd {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--bib-text);
  line-height: 1.35;
  word-break: break-word;
  text-align: left;
}

.event-detail .actions {
  margin: 0 0 1.75rem;
  padding-top: 0;
  border-top: none;
}

.ics-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--bib-primary);
  padding: 0.55rem 1rem;
  border-radius: var(--bib-radius);
  min-height: 44px;
}

.ics-link:hover {
  background: var(--bib-btn-hover);
  color: #fff;
  text-decoration: none;
}

@media (min-width: 560px) {
  .event-detail .meta-list {
    grid-template-columns: 1fr 1fr;
  }
}

.event-body-main {
  min-width: 0;
  margin: 0 0 1.35rem;
}

.event-figure {
  margin: 0 0 1.25rem;
  max-width: 40rem;
  width: 100%;
}

.event-figure-link {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #d5e4e7;
  box-shadow: 0 6px 18px rgba(12, 42, 44, 0.08);
  text-decoration: none;
  color: inherit;
  background: var(--bib-primary-soft);
  min-height: 0;
}

.event-figure-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 42, 44, 0);
  transition: background 0.18s ease;
  pointer-events: none;
}

.event-figure-link:hover::after,
.event-figure-link:focus-visible::after {
  background: rgba(12, 42, 44, 0.18);
}

.event-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 36rem);
  object-fit: contain;
  object-position: center;
}

.event-figure-hint {
  position: absolute;
  z-index: 1;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.28rem 0.5rem;
  border-radius: 3px;
  background: rgba(12, 58, 63, 0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.92;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.event-figure-link:hover .event-figure-hint,
.event-figure-link:focus-visible .event-figure-hint {
  opacity: 1;
  background: rgba(12, 58, 63, 0.98);
}

.event-figure figcaption {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--bib-muted);
}

@media (min-width: 800px) {
  .event-top.has-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem);
    grid-template-areas:
      "title ."
      "meta photo"
      "body photo"
      "actions photo";
    column-gap: 1.75rem;
    row-gap: 0;
    align-items: start;
  }

  .event-top.has-media > h1 {
    grid-area: title;
    max-width: none;
    margin-bottom: 1rem;
  }

  .event-top.has-media .event-meta {
    grid-area: meta;
    max-width: none;
    margin-bottom: 1.35rem;
  }

  .event-top.has-media .event-figure {
    grid-area: photo;
    margin: 0;
    max-width: none;
    width: 100%;
    position: sticky;
    top: 1rem;
    align-self: start;
  }

  .event-top.has-media .event-figure img {
    max-width: 100%;
    max-height: min(70vh, 32rem);
  }

  .event-top.has-media .event-body-main {
    grid-area: body;
  }

  .event-top.has-media .actions {
    grid-area: actions;
  }

  .event-top.has-media .event-body-main .prose {
    max-width: none;
  }
}

.lightbox {
  width: min(96vw, 72rem);
  max-height: 96vh;
  padding: 0.85rem;
  border: none;
  border-radius: 6px;
  background: #0c3a3f;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(8, 28, 31, 0.78);
}

.lightbox-form {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.55rem;
}

.lightbox-close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  min-height: 40px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-figure {
  margin: 0;
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: calc(96vh - 5.5rem);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.lightbox-caption {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.4;
  text-align: center;
  color: #d7ecee;
}

.summary {
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.prose {
  max-width: 40rem;
}

.note {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  background: var(--bib-primary-soft);
  border-left: 3px solid var(--bib-primary);
  border-radius: var(--bib-radius);
}

.similar-events {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bib-border);
}

.similar-events h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bib-text);
  margin: 0 0 0.75rem;
}

.back {
  margin: 0 0 1rem;
}

.back a {
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.back a:hover {
  text-decoration: underline;
}

/* ——— Calendar page ——— */

.view-toggle,
.month-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.month-nav {
  justify-content: space-between;
}

.month-current {
  font-weight: 600;
  color: var(--bib-primary-darker);
}

.calendar-desktop {
  display: none;
  background: var(--bib-surface);
  border: 1px solid var(--bib-border);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.cal-head,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-head {
  background: var(--bib-primary-dark);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  padding: 0.45rem 0;
}

.cal-cell {
  min-height: 6.5rem;
  border: 1px solid #e8eef0;
  padding: 0.35rem;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cal-cell.is-out {
  background: #f7f9fa;
}

.cal-day {
  font-weight: 700;
  color: var(--bib-primary-dark);
  line-height: 1;
}

.cal-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.cal-event {
  display: block;
  text-decoration: none;
  padding: 0.2rem 0.3rem;
  color: var(--bib-text);
  background: transparent;
  border: 1px solid #d9e2e4;
  border-radius: 2px;
  line-height: 1.25;
}

.cal-event:hover {
  background: #f3f7f8;
  border-color: #c5d4d7;
  text-decoration: none;
  color: var(--bib-text);
}

.cal-event.is-cancelled {
  opacity: 0.65;
}

.cal-event.is-cancelled .cal-title {
  text-decoration: line-through;
}

.cal-time {
  display: block;
  font-weight: 600;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--bib-muted);
  margin-bottom: 0.05rem;
}

.cal-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--bib-text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.calendar-agenda {
  display: block;
}

.agenda-day {
  margin: 0 0 1.25rem;
}

.agenda-day-heading {
  margin: 0 0 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--bib-border);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--bib-primary-darker);
}

.agenda-events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agenda-event {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.55rem 0.45rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d9e2e4;
  border-radius: 2px;
  margin-bottom: 0.35rem;
  background: var(--bib-surface);
}

.agenda-event:hover {
  background: #f3f7f8;
  border-color: #c5d4d7;
  text-decoration: none;
  color: inherit;
}

.agenda-event.is-cancelled {
  opacity: 0.65;
}

.agenda-event.is-cancelled .agenda-title {
  text-decoration: line-through;
}

.agenda-time {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bib-muted);
}

.agenda-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bib-text);
  line-height: 1.3;
}

@media (min-width: 900px) {
  .calendar-desktop {
    display: block;
  }

  .calendar-agenda {
    display: none;
  }

  .cal-cell {
    min-height: 8rem;
  }
}

/* ——— Footer ——— */

.site-footer {
  background: var(--bib-primary-darker);
  color: #e8f4f5;
  padding: 1.75rem 0;
  margin-top: auto;
}

.site-footer a {
  color: var(--bib-primary-soft);
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: #fff;
}

.opening-hours {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.35;
  max-width: 18rem;
}

.opening-hours li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  padding: 0.15rem 0.35rem;
  margin: 0 -0.35rem;
  border-radius: 3px;
}

.opening-hours .oh-day {
  font-weight: 600;
  color: #fff;
}

.opening-hours .oh-time {
  color: #e8f4f5;
  font-variant-numeric: tabular-nums;
}

.opening-hours .is-today {
  background: rgba(255, 255, 255, 0.12);
}

.opening-hours .is-today .oh-time::after {
  content: "heute";
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

.operator {
  font-size: 0.88rem;
  margin: 0.65rem 0 0.25rem;
}

.disclaimer {
  font-size: 0.82rem;
  opacity: 0.85;
  margin: 0;
}

.pre-line {
  white-space: pre-line;
}

.empty {
  padding: 1rem 0;
  color: var(--bib-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.is-embed .main {
  padding-top: 0.75rem;
}

.legal h1,
.legal h2 {
  color: var(--bib-primary-darker);
}

.legal-cookies {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bib-border);
  max-width: 40rem;
}

.legal-cookies h2 {
  scroll-margin-top: 1rem;
}

/* ——— Cookie notice ——— */

.cookie-banner {
  position: fixed;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: var(--bib-primary-darker);
  color: #e8f4f5;
  box-shadow: 0 -4px 24px rgba(0, 40, 45, 0.25);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.cookie-banner-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.cookie-banner-copy p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 44rem;
}

.cookie-banner a {
  color: var(--bib-primary-soft);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.cookie-banner a:hover {
  color: #fff;
}

.cookie-banner-accept {
  flex-shrink: 0;
  align-self: flex-start;
  min-width: 8.5rem;
}

@media (min-width: 640px) {
  .cookie-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
  }

  .cookie-banner-accept {
    align-self: center;
  }
}

.cat-icon {
  display: inline-flex;
  line-height: 0;
  color: var(--bib-primary-dark);
}

.cat-icon svg {
  display: block;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bib-primary-soft);
  color: var(--bib-primary-darker);
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

.error-page {
  padding: 2rem 0 3rem;
  max-width: 36rem;
}

.error-page-403 .error-code {
  color: #e8c4b8;
}

.error-code {
  margin: 0 0 0.35rem;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--bib-primary-soft);
  letter-spacing: -0.03em;
}

.error-page h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  color: var(--bib-text);
  line-height: 1.25;
}

.error-message {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  color: var(--bib-muted);
  line-height: 1.5;
}

.error-detail {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  word-break: break-word;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
}

@media (min-width: 720px) {
  .wrap {
    width: min(100% - 2rem, var(--bib-max));
  }

  .hero-section h1,
  .event-top > h1 {
    font-size: 1.85rem;
  }

  .event-row-title {
    font-size: 1.15rem;
  }
}

/* ——— Kinderveranstaltungen ——— */

:root {
  --kids-warm: #e07a3d;
  --kids-warm-deep: #c45f28;
  --kids-peach: #fff3e6;
  --kids-peach-soft: #ffe8d2;
  --kids-ink: #4a3428;
  --kids-muted: #6b5244;
}

.page-kids {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #ffe0c4 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #ffd4b8 0%, transparent 50%),
    #fffaf5;
  font-size: 1.08rem;
}

.page-kids .main {
  padding-top: 1.25rem;
}

.page-kids .site-header {
  border-bottom-color: #f0d2b8;
}

.kids-hero {
  display: grid;
  gap: 1.25rem;
  margin: 0 0 1.75rem;
  padding: 1.25rem 1.15rem 1.35rem;
  background: linear-gradient(145deg, var(--kids-peach) 0%, #fff8f0 55%, var(--kids-peach-soft) 100%);
  border: 1px solid #f0d2b8;
  border-radius: 12px;
  overflow: hidden;
}

.kids-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--kids-warm-deep);
}

.kids-hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  line-height: 1.15;
  color: var(--kids-ink);
  font-weight: 700;
}

.kids-lede {
  margin: 0;
  max-width: 38rem;
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--kids-muted);
}

.kids-hero-media {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffe0c8;
}

.kids-hero-link {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
}

.kids-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(28rem, 70vh);
  object-fit: contain;
  object-position: center;
  background: #fff8f0;
}

.kids-hero-hint {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: rgba(74, 52, 40, 0.82);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.92;
  pointer-events: none;
}

.kids-hero-link:hover .kids-hero-hint,
.kids-hero-link:focus-visible .kids-hero-hint {
  opacity: 1;
}

@media (min-width: 800px) {
  .kids-hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
    padding: 1.5rem 1.5rem 1.5rem 1.65rem;
  }
}

.kids-grid {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .kids-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kids-grid-preview {
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .kids-grid-preview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kids-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #f0d2b8;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.kids-card:hover {
  border-color: var(--kids-warm);
  transform: translateY(-2px);
}

.kids-card:hover .kids-card-title {
  color: var(--kids-warm-deep);
}

.kids-card-media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--kids-peach);
  overflow: hidden;
}

.kids-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kids-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1rem 1.1rem;
  flex: 1;
}

.kids-card-date {
  font-size: 1rem;
  font-weight: 700;
  color: var(--kids-warm-deep);
}

.kids-card-title {
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--kids-ink);
}

.kids-card-summary {
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--kids-muted);
}

.kids-card-price {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--kids-ink);
}

.kids-card-compact .kids-card-title {
  font-size: 1.05rem;
}

.kids-card-compact .kids-card-body {
  padding: 0.7rem 0.8rem 0.85rem;
}

.kids-empty {
  font-size: 1.1rem;
}

.page-kids .filters {
  background: rgba(255, 255, 255, 0.72);
  border-color: #f0d2b8;
}

.page-kids .filters label span,
.page-kids .admin-filters label span {
  color: var(--kids-muted);
}

.page-kids .btn-primary {
  background: var(--kids-warm);
}

.page-kids .btn-primary:hover {
  background: var(--kids-warm-deep);
}

/* Keep header link colors stable; only content links use kids accent */
.page-kids .main a[aria-current="page"],
.page-kids .kids-hero a[aria-current="page"] {
  color: var(--kids-warm-deep);
}

.page-kids .month-header {
  color: var(--kids-ink);
  background: var(--kids-peach);
  border: 1px solid #f0d2b8;
}

/* ——— Kids event detail ——— */

.page-kids-detail .event-detail.kids-detail > .back a {
  color: var(--kids-warm-deep);
  font-weight: 600;
  text-decoration: none;
}

.page-kids-detail .event-detail.kids-detail > .back a:hover {
  text-decoration: underline;
}

.page-kids-detail .kids-detail .kids-kicker {
  margin-bottom: 0.45rem;
}

.page-kids-detail .kids-detail .event-top > h1 {
  color: var(--kids-ink);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.page-kids-detail .kids-detail .event-meta {
  background: linear-gradient(145deg, var(--kids-peach) 0%, #fff8f0 55%, var(--kids-peach-soft) 100%);
  border: 1px solid #f0d2b8;
  border-radius: 12px;
  max-width: none;
}

.page-kids-detail .kids-detail dt {
  color: var(--kids-warm-deep);
}

.page-kids-detail .kids-detail dd {
  color: var(--kids-ink);
}

.page-kids-detail .kids-detail .summary {
  font-size: 1.12rem;
  color: var(--kids-muted);
}

.page-kids-detail .kids-detail .prose {
  color: var(--kids-ink);
  font-size: 1.05rem;
}

.page-kids-detail .kids-detail .prose a {
  color: var(--kids-warm-deep);
}

.page-kids-detail .kids-detail .event-figure-link {
  border-color: #f0d2b8;
  background: var(--kids-peach);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(74, 52, 40, 0.08);
}

.page-kids-detail .kids-detail .event-figure img {
  max-height: min(70vh, 36rem);
}

.page-kids-detail .kids-detail .event-figure-hint {
  background: var(--kids-warm);
}

.page-kids-detail .kids-detail .ics-link {
  background: var(--kids-warm);
}

.page-kids-detail .kids-detail .ics-link:hover {
  background: var(--kids-warm-deep);
}

.page-kids-detail .kids-similar h2 {
  color: var(--kids-ink);
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
}

.page-kids-detail .kids-similar {
  margin-top: 2rem;
  padding-top: 0.5rem;
}
