/*
 * Ennser Museen – Veranstaltungen  (v1.3.0)
 *
 * Alle Regeln sind unter .ee-events gekapselt, damit Theme/Elementor-Styles nicht stören.
 * Zwei Layouts:
 *   .ee-events--list   kompakte Liste mit Monatsüberschriften (Standard)
 *   .ee-events--cards  Karten-Raster
 * Das Layout reagiert auf die Breite des Containers (Container Queries), nicht auf das Fenster:
 * dadurch passt es sich auch in schmalen Elementor-Spalten an.
 */

.ee-events {
  --ee-accent: #8d1003;
  --ee-accent-hover: #6b0c02;
  --ee-ink: #141827;
  --ee-muted: #777;
  --ee-card: #fff;
  --ee-line: rgba(74, 29, 14, 0.22);
  --ee-shadow: 0 2px 14px rgba(20, 24, 39, 0.08);
  --ee-shadow-hover: 0 10px 28px rgba(20, 24, 39, 0.16);
  --ee-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

  container-type: inline-size;
  scroll-margin-top: 100px; /* Beim Blättern landet die Liste nicht unter einem fixierten Header. */
  width: 100%;
  color: var(--ee-ink);
  font-family: inherit;
  line-height: 1.5;
}

/* Hover-Farbe automatisch aus der Akzentfarbe ableiten (z. B. wenn sie im Elementor-Widget geändert wird). */
@supports (color: color-mix(in srgb, red, blue)) {
  .ee-events {
    --ee-accent-hover: color-mix(in srgb, var(--ee-accent) 78%, #000);
  }
}

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

/* ---------- Gemeinsame Basis ---------- */

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

.ee-events .ee-event {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ee-events .ee-event__date {
  display: flex;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.ee-events .ee-event__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #e9e2df;
}

.ee-events .ee-event__media img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.ee-events .ee-event:hover .ee-event__media img {
  transform: scale(1.05);
}

/* Platzhalter für Termine ohne Bild (nur Liste) */
.ee-events .ee-event__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 29, 14, 0.1);
  color: var(--ee-accent);
}

.ee-events .ee-event__media--empty .ee-icon {
  width: 38%;
  height: auto;
  margin: 0;
  opacity: 0.55;
}

.ee-events .ee-event__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.ee-events .ee-event__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.ee-events .ee-event__badge {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ee-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ee-events .ee-event__title {
  margin: 0;
  padding: 0;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: break-word;
  hyphens: auto;
}

.ee-events .ee-event__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Der ganze Termin ist klickbar (gestreckter Link). */
.ee-events .ee-event__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ee-events .ee-event__title a:focus-visible {
  outline: 3px solid var(--ee-accent);
  outline-offset: 4px;
}

.ee-events .ee-event:has(.ee-event__title a:focus-visible) {
  outline: 3px solid var(--ee-accent);
  outline-offset: 3px;
}

/* Zeit & Ort */
.ee-events .ee-event__meta {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.4;
}

.ee-events .ee-event__meta li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.ee-events .ee-event__time {
  color: var(--ee-accent);
  font-weight: 500;
}

.ee-events .ee-event__venue {
  color: var(--ee-muted);
}

.ee-events .ee-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 0.14em;
}

/* Auszug */
.ee-events .ee-event__excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ee-muted);
  line-height: 1.5;
  -webkit-box-orient: vertical;
}

/* Beim Blättern (per JavaScript) wird die Liste kurz abgedunkelt. */
.ee-events.is-loading .ee-events__group,
.ee-events.is-loading .ee-events__empty {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.ee-events.is-loading .ee-events__nav {
  pointer-events: none;
}

/* Nach dem Blättern liegt der Fokus auf der Liste, ohne sichtbaren Rahmen. */
.ee-events:focus {
  outline: none;
}

/* ---------- Blättern: Vorherige / Heute / Nächste ---------- */

.ee-events .ee-events__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--ee-line);
  line-height: 1.2;
}

.ee-events .ee-events__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ee-ink);
  font-size: 18px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ee-events .ee-events__nav-link .ee-icon {
  width: 18px;
  height: 18px;
  margin: 0;
}

.ee-events a.ee-events__nav-link:hover,
.ee-events a.ee-events__nav-link:focus-visible {
  color: var(--ee-accent);
}

.ee-events a.ee-events__nav-link:focus-visible {
  outline: 2px solid var(--ee-accent);
  outline-offset: 4px;
}

/* "Heute" als kleine Pille in der Mitte */
.ee-events .ee-events__nav-today {
  padding: 6px 14px;
  border: 1px solid var(--ee-line);
  border-radius: 999px;
  font-size: 14px;
}

/* Nicht verfügbar (z. B. keine ältere Seite) */
.ee-events .ee-events__nav .is-disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---------- Fußzeile ---------- */

.ee-events .ee-events__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 26px;
}

.ee-events .ee-events__button {
  display: inline-block;
  padding: 12px 26px;
  background: var(--ee-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s ease;
}

.ee-events .ee-events__button:hover,
.ee-events .ee-events__button:focus-visible {
  background: var(--ee-accent-hover);
  color: #fff;
}

.ee-events .ee-events__ical {
  color: var(--ee-accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ee-events .ee-events__ical:hover {
  color: var(--ee-accent-hover);
}

.ee-events .ee-events__empty,
.ee-events .ee-events__notice {
  margin: 0;
  padding: 28px 24px;
  background: var(--ee-card);
  color: var(--ee-muted);
  text-align: center;
}

/* =====================================================================
 * Layout "list": kompakte Liste
 *   NOVEMBER 2026 ─────────────────
 *   MO.   [Bild]  Titel
 *    9            🕑 Zeit
 *                 📍 Ort
 * ===================================================================== */

/* Monatsüberschrift mit Linie */
.ee-events .ee-events__group + .ee-events__group {
  margin-top: 24px;
}

.ee-events .ee-events__month {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  color: var(--ee-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ee-events .ee-events__month::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--ee-line);
}

.ee-events--list .ee-event {
  display: grid;
  grid-template-columns: 44px 64px minmax(0, 1fr);
  grid-template-areas: 'date media content';
  align-items: start;
  column-gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--ee-line);
}

.ee-events--list .ee-events__month + .ee-events__list > .ee-event:first-child {
  border-top: 0;
}

.ee-events--list .ee-event--no-media {
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: 'date content';
}

/* Datum: Wochentag über der Tageszahl, ohne Kachel */
.ee-events--list .ee-event__date {
  grid-area: date;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 2px;
  color: var(--ee-accent);
  letter-spacing: 0.06em;
}

.ee-events--list .ee-event__wd {
  font-size: 13px;
}

.ee-events--list .ee-event__day {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Monat steht schon in der Überschrift */
.ee-events--list .ee-event__mon {
  display: none;
}

/* Bild: kleines Quadrat */
.ee-events--list .ee-event__media {
  grid-area: media;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
}

.ee-events--list .ee-event__content {
  grid-area: content;
}

.ee-events--list .ee-event__badges {
  margin-bottom: 6px;
}

.ee-events--list .ee-event__badge {
  padding: 4px 9px;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--ee-accent);
  font-size: 11px;
}

.ee-events--list .ee-event__title {
  margin-bottom: 4px;
  color: var(--ee-accent);
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.ee-events--list .ee-event:hover .ee-event__title a {
  color: var(--ee-accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ee-events--list .ee-event__meta {
  font-size: 15px;
}

.ee-events--list .ee-event__excerpt {
  margin-top: 6px;
  font-size: 15px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Die ganze Zeile ist klickbar, ein extra "Weiterlesen" braucht es hier nicht. */
.ee-events--list .ee-event__more {
  display: none;
}

/* Etwas mehr Luft, wenn der Container breiter ist */
@container (min-width: 480px) {
  .ee-events--list .ee-event {
    grid-template-columns: 56px 104px minmax(0, 1fr);
    column-gap: 20px;
    padding: 18px 0;
  }

  .ee-events--list .ee-event--no-media {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .ee-events--list .ee-event__wd {
    font-size: 14px;
  }

  .ee-events--list .ee-event__day {
    font-size: 32px;
  }

  .ee-events--list .ee-event__title {
    font-size: 22px;
  }

  .ee-events--list .ee-event__meta {
    font-size: 16px;
  }

  .ee-events--list .ee-event__excerpt {
    font-size: 16px;
  }
}

/* =====================================================================
 * Layout "cards": Karten-Raster
 * ===================================================================== */

.ee-events--cards .ee-events__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 24px;
}

.ee-events--cards .ee-event {
  display: flex;
  flex-direction: column;
  background: var(--ee-card);
  box-shadow: var(--ee-shadow);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.ee-events--cards .ee-event:hover {
  box-shadow: var(--ee-shadow-hover);
  transform: translateY(-2px);
}

.ee-events--cards .ee-event__media {
  aspect-ratio: 10 / 9;
}

/* Datum als Kachel über dem Bild */
.ee-events--cards .ee-event__date {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  padding: 10px 12px;
  background: var(--ee-accent);
  color: #fff;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ee-events--cards .ee-event__wd,
.ee-events--cards .ee-event__mon {
  font-size: 14px;
}

.ee-events--cards .ee-event__day {
  font-family: var(--ee-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0;
}

/* Ohne Bild: Datum als Leiste oben statt als Overlay. */
.ee-events--cards .ee-event--no-media .ee-event__date {
  position: static;
  flex-direction: row;
  align-items: baseline;
  gap: 0.55em;
  padding: 10px 18px;
  box-shadow: none;
}

.ee-events--cards .ee-event--no-media .ee-event__day {
  font-size: 26px;
}

.ee-events--cards .ee-event__content {
  flex: 1;
  padding: 18px 22px 20px;
}

.ee-events--cards .ee-event__title {
  margin-bottom: 10px;
  color: var(--ee-ink);
  font-family: var(--ee-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
}

.ee-events--cards .ee-event:hover .ee-event__title a {
  color: var(--ee-accent);
}

.ee-events--cards .ee-event__meta {
  margin-bottom: 12px;
  font-size: 17px;
}

.ee-events--cards .ee-event__excerpt {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.ee-events--cards .ee-event__more {
  margin-top: auto;
  color: var(--ee-accent);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ee-events--cards .ee-event:hover .ee-event__more {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .ee-events .ee-event,
  .ee-events .ee-event__media img,
  .ee-events .ee-event__title a,
  .ee-events .ee-events__button {
    transition: none;
  }

  .ee-events--cards .ee-event:hover {
    transform: none;
  }

  .ee-events .ee-event:hover .ee-event__media img {
    transform: none;
  }
}
