/* =============================================================================
   Veranstaltungskalender - Styles
   Design-Tokens aus theme.json (krautwave):
     Foreground  #FFFFFF
     Muted       #C4BFBF
     Background  transparent (wird durch übergeordneten Container gesetzt)
   ============================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.vk-kalender {
  container-type: inline-size;
  background: transparent;
  width: 100%;
}

/* ── Event-Liste ─────────────────────────────────────────────────────────── */

.vk-events-list {
  display: flex;
  flex-direction: column;
}

/* ── Einzelner Event-Eintrag ─────────────────────────────────────────────── */

.vk-event-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: clamp(1.25rem, 2vw, 3rem);
  padding: clamp(0.875rem, 1.25vw, 1.5rem) 0;
}

/* ── Datum ───────────────────────────────────────────────────────────────── */

.vk-event-date {
  font-size: var(--wp--preset--font-size--clamp, clamp(2rem, 1.25rem + 2.5vw, 4.25rem));
  font-weight: 100;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--wp--preset--color--foreground, #ffffff);
  white-space: nowrap;
}

/* ── Ort: Stadt - Venue ──────────────────────────────────────────────────── */

.vk-event-location {
  font-size: var(--wp--preset--font-size--base, 1rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--wp--preset--color--muted, #c4bfbf);
}

/* ── Button ──────────────────────────────────────────────────────────────── */

.vk-event-link-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.vk-event-link {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--wp--preset--color--foreground, #ffffff);
  border-radius: 7px;
  text-decoration: none;
  color: var(--wp--preset--color--foreground, #ffffff);
  font-size: var(--wp--preset--font-size--small, 0.875rem);
  font-weight: 400;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.vk-event-link:hover {
  opacity: 0.7;
  color: var(--wp--preset--color--foreground, #ffffff);
  text-decoration: none;
}

/* ── Kein-Termin-Hinweis ──────────────────────────────────────────────────── */

.vk-no-events {
  color: var(--wp--preset--color--muted, #c4bfbf);
  font-style: italic;
  padding: 24px 0;
}

/* ── Editor-Vorschau ─────────────────────────────────────────────────────── */

.wp-block-krautwave-veranstaltungskalender {
  width: 100%;
}
.vk-editor-preview-wrap {
  pointer-events: none;
}


/* =============================================================================
   Veranstaltungsarchiv
   ============================================================================= */

/* ── äußerer Wrapper ──────────────────────────────────────────────────── */

.vk-archiv {
  container-type: inline-size;
  width: 100%;
}

/* ── Jahr-Abschnitte ─────────────────────────────────────────────── */

.vk-archiv-year + .vk-archiv-year {
  margin-top: clamp(2.5rem, 3vw + 1rem, 5rem);
}

/* h3 erbt die globalen Theme-Stile (Farbe, Größe, Gewicht) */
.vk-archiv-year-heading {
  margin-top: 0;
  margin-bottom: clamp(0.625rem, 1vw, 1.25rem);
}

/* ── Terminliste: 920 px zentriert, Einzug gegenüber dem Jahr-h3 ── */

.vk-archiv-list {
  max-width: 920px;
  margin-inline: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Eintrag-Wrapper (Item-Zeile + Galerie) ──────────────────────── */

.vk-archiv-entry {
  border-bottom: 1px solid rgba(196, 191, 191, 0.2);
}

.vk-archiv-entry:first-child {
  border-top: 1px solid rgba(196, 191, 191, 0.2);
}

/* ── Item-Zeile ──────────────────────────────────────────────────── */

.vk-archiv-item {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 2vw, 2.5rem);
  padding-block: 0.625rem;
  border: none; /* Border liegt auf .vk-archiv-entry */
}

.vk-archiv-item:first-child {
  border-top: none;
}

/* ── Datum ───────────────────────────────────────────────────────────── */

.vk-archiv-date {
  font-size: var(--wp--preset--font-size--base, 1rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--wp--preset--color--muted, #c4bfbf);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 7.5rem; /* Platz für "dd.mm.yyyy" */
}

/* ── Ort: Stadt - Venue ──────────────────────────────────────────── */

.vk-archiv-location {
  font-size: var(--wp--preset--font-size--base, 1rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--wp--preset--color--foreground, #ffffff);
}

/* ── Leer-Zustand ────────────────────────────────────────────────── */

.vk-archiv-empty {
  color: var(--wp--preset--color--muted, #c4bfbf);
  font-style: italic;
  padding: 24px 0;
}

/* ── Editor-Vorschau ────────────────────────────────────────────── */

.wp-block-krautwave-veranstaltungsarchiv {
  width: 100%;
}

/* ── Responsive (Container Query) ──────────────────────────────── */

@container (max-width: 500px) {
  .vk-archiv-item {
    flex-direction: column;
    gap: 0.125rem;
    padding-block: 0.875rem;
  }

  .vk-archiv-date {
    min-width: unset;
  }

  .vk-archiv-gallery {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}


/* =============================================================================
   Galerie-Grid
   ============================================================================= */

.vk-archiv-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
  padding-bottom: 1rem;
}

.vk-gallery-item {
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.vk-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease, transform 0.35s ease;
}

.vk-gallery-item:hover img,
.vk-gallery-item:focus-visible img {
  opacity: 0.75;
  transform: scale(1.04);
}

.vk-gallery-item:focus-visible {
  box-shadow: 0 0 0 2px var(--wp--preset--color--foreground, #fff);
}


/* =============================================================================
   Lightbox (nativer <dialog>)
   ============================================================================= */

dialog.vk-lightbox {
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.95);
  width: 100dvw;
  height: 100dvh;
  max-width: 100dvw;
  max-height: 100dvh;
  margin: 0;
}

dialog.vk-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.vk-lightbox::backdrop {
  background: transparent;
}

/* Bild + Caption zusammen in einem Flex-Container */
.vk-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width:  calc(100dvw - 120px);
  max-height: calc(100dvh -  80px);
  gap: 10px;
}

.vk-lightbox-img {
  max-width:  100%;
  max-height: calc(100dvh - 140px); /* Raum für Caption lassen */
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

/* Caption direkt unter dem Bild */
.vk-lightbox-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  max-width: 100%;
  padding: 0 8px;
}

/* Gemeinsame Button-Basis */
.vk-lightbox-close,
.vk-lightbox-prev,
.vk-lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 12px;
  line-height: 1;
  opacity: 0.65;
  transition: opacity 0.15s ease;
  font-family: sans-serif;
}
.vk-lightbox-close:hover,
.vk-lightbox-prev:hover,
.vk-lightbox-next:hover {
  opacity: 1;
}

.vk-lightbox-close {
  top: 14px;
  right: 16px;
  font-size: 1.4rem;
}

.vk-lightbox-prev {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
}

.vk-lightbox-next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
}

.vk-lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* ── Responsive (Container Query) ───────────────────────────────────────── */

@container (max-width: 640px) {
  .vk-event-item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      'date   button'
      'location location';
    column-gap: 1rem;
    row-gap: 0.375rem;
    padding: 1.25rem 0;
  }

  .vk-event-date {
    grid-area: date;
  }

  .vk-event-location {
    grid-area: location;
    font-size: var(--wp--preset--font-size--base, 1rem);
  }

  .vk-event-link-wrap {
    grid-area: button;
    align-self: center;
    justify-content: flex-end;
  }
}
