

.event-frame {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,2fr);
  width: 100%;
  max-width: 100%;
  clear: both;
  margin: 0 auto; /* Zentriert das Grid */
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 0;
  --distance-left: 0.8rem;
  overflow: hidden;
}

.event-info-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* verhindert, dass die Grid-Spalte sich am Inhalt aufzieht */
  column-gap: 2rem;
  row-gap: 0rem;
  border-left: 3px solid var(--da-color-red, #d2232a);
  padding-left: 2rem;
  box-sizing: border-box;
}

.event-frame {
  align-items: start; /* falls irgendwo align-items:center gesetzt wurde */
}
.event-info-frame {
  justify-content: flex-start;
  align-items: flex-start;
}

.event-info-detail-frame {
  /* Feste Spaltenzahl statt Flex-Umbruch: so hängt die Spaltenanzahl nur von
     der Breakpoint-Breite ab und nie davon, wie lang der Text eines
     einzelnen Eintrags (Datum, Uhrzeit, Ort, ...) zufällig ist. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
  row-gap: 0.3rem;
  width: 100%;
}

.event-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 340px;
  height: 300px;
  overflow: hidden;
  background-color: #f0f0f0;
  min-width: 0; /* verhindert, dass die Grid-Spalte sich an der Bildgröße aufzieht */
}

.event-thumbnail {
  width: 100%;
  height: 100%; /* Bild passt sich der Höhe des Containers an */
  object-fit: cover; /* Bild füllt den Rahmen und schneidet überschüssige Bereiche ab */
  min-width: 0; /* Bild darf im Flex-/Grid-Kontext kleiner als seine Originalgröße werden */
  display: block;
}

.event-title {
  /*grid-column-start: 1;
  grid-column-end: -1;*/
  width: 100%;
  text-align: left;
  margin-bottom: 1rem;
}

.event-description {
  overflow: hidden;
  max-height: 8.1rem;
}

.event-info-value {
  /* Lange Angaben (z. B. Ort) umbrechen statt abschneiden (28.10.2026) */
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 0;
}

.event-info-unit {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  font-size: larger;
  padding-bottom: 0.3rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.button-frame {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
}

.event-in-future {
    /*color: var(--da-color-red, #d2232a);*/
  display: none;
}

.event-in-past {
  /*text-decoration: line-through;*/
  position: relative;
  top: -.4rem; /* Verschiebt den Inhalt 1rem nach oben */
  margin-left: 1rem;
  font-size: 1rem;
  display: span;
  color: var(--da-color-red-dark, #a41b21);
}

.event-description {
  min-height: 6rem;
}

@media (max-width: 921px) {

  .event-image-frame,
  .event-info-frame {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-width: 0;
  }

  .event-frame {
    grid-template-columns: minmax(0, 1fr); /* Wechselt zu einer Spalte, darf aber schrumpfen */
    margin: 0 auto;  /* Zentriert den Container auf der Seite */
    /*border: 1px solid red;*/
  }

  .event-image-frame {
    max-width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    margin: 0; /* Verhindert Randverschiebungen */
  }

  .event-info-detail-frame {
    grid-template-columns: 1fr; /* immer einspaltig auf dem Handy, unabhängig von der Textlänge */
  }

  .event-info-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .event-thumbnail {
    width: 100%;
    max-width: 100%;
    height: auto; /* Passt die Höhe proportional zur Breite an */
    object-fit: cover;
    margin: 0; /* Verhindert zusätzlichen Leerraum */
    min-width: 0;
  }

  .event-info-frame {
    border-left: none;
    padding-left: 0;
  }
}




/* Hinweis pro Termin (09.10.2026) */
.event-note-unit .event-info-value { color: var(--da-color-red-dark, #a41b21); }

/* ------------------------------------------------------------------
   Kommende Termine / Archiv nach Jahren (19.11.2026)
   ------------------------------------------------------------------ */
.event-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--da-color-border, #dde3ec);
}
.event-nav-years { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.event-nav-label { margin-left: 0.5rem; color: var(--da-color-muted, #6b7079); }
.event-nav-link {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--da-color-primary, #27469a);
  border-radius: 999px;
  color: var(--da-color-primary, #27469a);
  text-decoration: none;
  line-height: 1.4;
}
.event-nav-link:hover,
.event-nav-link:focus-visible { background: var(--da-color-blue-light, #e9ecf5); }
.event-nav-link[aria-current="page"] {
  background: var(--da-color-primary, #27469a);
  color: #fff;
}
.event-list-heading { margin: 1.5rem 0 0; }
.event-list-empty { margin: 2rem 0; font-size: larger; }

/* im Archiv ist jeder Termin vergangen – Hinweis im Titel überflüssig */
.event-list--archive .event-in-past { display: none; }

.event-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 2rem 0;
}
.event-page-link {
  display: inline-block;
  min-width: 2.4rem;
  padding: 0.35rem 0.7rem;
  text-align: center;
  border: 1px solid var(--da-color-border, #dde3ec);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}
a.event-page-link:hover,
a.event-page-link:focus-visible { border-color: var(--da-color-primary, #27469a); }
.event-page-link[aria-current="page"] {
  background: var(--da-color-primary, #27469a);
  border-color: var(--da-color-primary, #27469a);
  color: #fff;
}
.event-archive-link { margin: 2rem 0; text-align: center; }
.event-archive-link a { text-decoration: none; display: inline-block; }

@media (max-width: 767px) {
  .event-nav-label { margin-left: 0; width: 100%; }
}

/* ------------------------------------------------------------------
   Bild nicht mehr beschneiden (19.11.2026)
   Das Bildfeld ist so hoch wie die Textbox daneben (mindestens 300 px).
   Das Bild wird vollständig gezeigt (contain), oben ausgerichtet –
   Hochformat-Plakate nutzen so die volle Höhe, Querformat die volle Breite.
   ------------------------------------------------------------------ */
@media (min-width: 922px) {
  .event-frame { align-items: stretch; }
  .event-image-frame {
    position: relative;
    height: auto;
    min-height: 300px;
    align-self: stretch;
    background-color: transparent;
  }
  .event-image-frame .event-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
  }
  .event-image-frame svg { align-self: flex-start; }
}

/* ------------------------------------------------------------------
   Bildoptionen je Veranstaltung (19.11.2026, event_list_layout.php)
   list-fit-contain = ganz zeigen (Standard, wie bisher), list-fit-cover = Fläche füllen,
   list-fit-float = Bild links oben im Textbereich, Text daneben und darunter.
   --imgw = Bildbreite (Computer/Tablet ab 922 px)
   ------------------------------------------------------------------ */
.event-image-frame { position: relative; }
.event-float-img img { display: block; width: 100%; height: auto; }
@media (min-width: 922px) {
  .event-frame.has-imgw { grid-template-columns: minmax(0, var(--imgw)) minmax(0, 1fr); }
  .event-frame.has-imgw .event-image-frame { max-width: none; }
  .event-frame.list-fit-cover .event-image-frame .event-thumbnail { object-fit: cover; object-position: center center; }
  .event-frame.list-fit-float { display: block; }
  .event-frame.list-fit-float .event-info-frame { display: flow-root; }
  .event-float-img { float: left; width: var(--imgw, 35%); margin: 0.3rem 1.5rem 1rem 0; position: relative; }
  .event-frame.list-fit-float .event-description { max-height: none; overflow: visible; } /* fließt ums Bild */
  .event-frame.list-fit-float .event-info-detail-frame { width: auto; } /* Angaben neben dem Bild statt darunter */
  .event-frame.list-fit-float .event-title { width: auto; }
}
@media (max-width: 921px) {
  .event-float-img { margin: 0 0 1rem; }
}

/* Bearbeiten (nur für Berechtigte sichtbar) */
.event-imgedit-bar { margin: .6rem 0; }
.event-imgedit-bar label { cursor: pointer; font-weight: 600; }
.event-imgedit-hint { margin: .4rem 0 0; font-size: .9em; line-height: 1.45; background: #fff8e1; border: 1px solid #f0c36d; border-radius: 4px; padding: .5rem .8rem; }
.event-imgedit-msg { margin-left: .5rem; font-weight: 700; color: #1a7f37; }
.event-imgedit-msg.is-err { color: #b32d2e; }
body.event-imgediting .event-frame[data-event-id] .event-image-frame,
body.event-imgediting .event-float-img { outline: 1px dashed rgba(230, 126, 0, .8); outline-offset: -1px; }
body.event-imgediting .event-frame.list-fit-cover .event-image-frame { cursor: grab; }
body.el-dragging, body.el-dragging * { cursor: grabbing !important; user-select: none; }
.el-h { position: absolute; z-index: 5; top: 50%; right: 0; width: 10px; height: 44px; margin-top: -22px; background: #e67e00; border: 2px solid #fff; box-shadow: 0 0 0 1px #e67e00; border-radius: 4px; cursor: ew-resize; }
.el-badge { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.75); color: #fff; font: 700 13px/1.2 system-ui, sans-serif; padding: 3px 8px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.el-menu { position: fixed; z-index: 100000; min-width: 250px; background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.2); padding: 4px 0; font: 14px/1.3 system-ui, sans-serif; color: #1d2327; }
.el-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 14px 6px 28px; font: inherit; color: inherit; cursor: pointer; position: relative; }
.el-menu button:hover:not(:disabled) { background: #f0f6fc; }
.el-menu button:disabled { color: #a7aaad; cursor: default; }
.el-menu button.is-on::before { content: '✓'; position: absolute; left: 10px; color: #2271b1; font-weight: 700; }
.el-menu .el-sep { height: 1px; background: #dcdcde; margin: 4px 0; }
.el-menu .el-note { padding: 2px 14px 6px 28px; font-size: 12px; color: #646970; }
@media (max-width: 921px) { .el-h { display: none; } }
