/*
 * Elbfabrik Events – Frontend
 * Farben und Radien lassen sich über diese Variablen anpassen,
 * z. B. in Avada → Optionen → Benutzerdefiniertes CSS.
 */
:root {
	--ef-accent: var(--awb-color5, #0a4a7f);
	--ef-accent-contrast: #fff;
	--ef-text: inherit;
	--ef-muted: rgba(0, 0, 0, .62);
	--ef-border: rgba(0, 0, 0, .12);
	--ef-surface: var(--awb-color1, #fff);
	--ef-soft: rgba(0, 0, 0, .04);
	--ef-radius: 8px;
	--ef-demand: #9a5b00;
	--ef-demand-bg: #fdf1dc;
	--ef-soldout: #a4262c;
	--ef-soldout-bg: #fbe9ea;
	--ef-custom: #0a4a7f;
	--ef-custom-bg: #e6f0f8;
}

/* Grundelemente */
.ef-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ef-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	padding: .7em 1.3em; border: 2px solid var(--ef-accent); border-radius: var(--ef-radius);
	background: var(--ef-accent); color: var(--ef-accent-contrast); font: inherit; font-weight: 600; line-height: 1.2;
	text-decoration: none; text-transform: none; letter-spacing: 0; box-shadow: none; margin: 0; cursor: pointer; transition: filter .15s;
}
.ef-btn:hover, .ef-btn:focus-visible { filter: brightness(1.1); color: var(--ef-accent-contrast); }
.ef-btn--ghost { background: transparent; color: var(--ef-accent); }
.ef-btn--ghost:hover, .ef-btn--ghost:focus-visible { background: var(--ef-accent); color: var(--ef-accent-contrast); filter: none; }
.ef-btn--small { padding: .45em .9em; font-size: .9em; }
.ef-btn[hidden] { display: none; }
.ef-overview :focus-visible, .ef-termine :focus-visible, .ef-carousel :focus-visible, .ef-tickets :focus-visible { outline: 2px solid var(--ef-accent); outline-offset: 2px; }

.ef-badge {
	display: inline-block; padding: .2em .6em; border-radius: 4px; font-size: .8em; font-weight: 700; line-height: 1.4;
	background: var(--ef-soft); color: var(--ef-muted);
}
.ef-badge--demand { background: var(--ef-demand-bg); color: var(--ef-demand); }
.ef-badge--soldout { background: var(--ef-soldout-bg); color: var(--ef-soldout); }
.ef-badge--custom { background: var(--ef-custom-bg); color: var(--ef-custom); }

.ef-notice { padding: 1em 1.2em; border-left: 4px solid var(--ef-accent); background: var(--ef-soft); border-radius: 0 var(--ef-radius) var(--ef-radius) 0; }

/* Übersicht
 * Selektoren mit zwei Klassen, damit Theme-Stile (Avada-Typografie, Links, Überschriften) nicht durchschlagen. */
.ef-overview .ef-overview__bar { display: flex; flex-direction: column; gap: 14px; margin: 0 0 28px; }
.ef-overview .ef-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.ef-overview .ef-chip {
	margin: 0; padding: .45em 1em; border: 1px solid var(--ef-border); border-radius: 999px; background: var(--ef-surface);
	color: inherit; font: inherit; font-size: .95em; line-height: 1.3; cursor: pointer; box-shadow: none; text-transform: none;
}
.ef-overview .ef-chip:hover { border-color: var(--ef-accent); }
.ef-overview .ef-chip.is-active { background: var(--ef-accent); border-color: var(--ef-accent); color: var(--ef-accent-contrast); }
.ef-overview .ef-overview__tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.ef-overview .ef-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.ef-overview .ef-dates__field { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: .85em; color: var(--ef-muted); }
.ef-overview .ef-dates__field input,
.ef-overview .ef-search {
	height: 42px; margin: 0; padding: 0 .8em; border: 1px solid var(--ef-border); border-radius: var(--ef-radius);
	background: var(--ef-surface); color: inherit; font: inherit; font-size: 1rem; box-shadow: none;
}
.ef-overview .ef-dates__field input { width: 160px; }
.ef-overview .ef-search { flex: 1 1 220px; min-width: 0; max-width: 360px; }
.ef-overview .ef-dates__reset { margin: 0 0 10px; padding: 0; border: 0; background: none; color: var(--ef-accent); font: inherit; font-size: .9em; text-decoration: underline; cursor: pointer; }
.ef-overview .ef-dates__reset[hidden] { display: none; }
.ef-overview .ef-viewtoggle { display: inline-flex; margin-left: auto; border: 1px solid var(--ef-border); border-radius: var(--ef-radius); overflow: hidden; }
.ef-overview .ef-viewtoggle button { height: 40px; margin: 0; padding: 0 1em; border: 0; border-radius: 0; background: var(--ef-surface); color: inherit; font: inherit; font-size: .9em; cursor: pointer; box-shadow: none; }
.ef-overview .ef-viewtoggle button[aria-pressed="true"] { background: var(--ef-accent); color: var(--ef-accent-contrast); }
.ef-overview.is-loading .ef-overview__items { opacity: .5; transition: opacity .15s; }
.ef-overview .ef-overview__empty { margin: 0; padding: 2em 0; color: var(--ef-muted); }
.ef-overview .ef-overview__empty[hidden], .ef-overview .ef-overview__more[hidden] { display: none; }
.ef-overview .ef-overview__foot { margin-top: 28px; text-align: center; }

.ef-overview .ef-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 24px; }
.ef-overview .ef-view-list { display: flex; flex-direction: column; gap: 14px; }

/* Monatstrenner */
.ef-overview .ef-month {
	grid-column: 1 / -1; margin: 28px 0 0; padding: 0 0 8px; border-bottom: 2px solid var(--ef-accent);
	color: inherit; font-size: 1.3em; line-height: 1.3; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.ef-overview .ef-month:first-child { margin-top: 0; }
.ef-overview .ef-view-list .ef-month { margin-bottom: 2px; }

/* Karte */
.ef-overview .ef-card { position: relative; display: flex; flex-direction: column; margin: 0; background: var(--ef-surface); border: 1px solid var(--ef-border); border-radius: var(--ef-radius); overflow: hidden; }
.ef-overview .ef-card.is-pinned { border-color: var(--ef-accent); box-shadow: inset 0 3px 0 var(--ef-accent); }
.ef-overview .ef-card__media { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--ef-soft); overflow: hidden; }
.ef-overview .ef-card__media img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; margin: 0; transition: transform .3s; }
.ef-overview .ef-card:hover .ef-card__media img { transform: scale(1.03); }
.ef-overview .ef-card__ph { position: absolute; inset: 0; background: linear-gradient(135deg, var(--ef-soft), transparent); }
.ef-overview .ef-card__cal {
	position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; align-items: center; min-width: 52px;
	padding: 6px 8px 5px; background: var(--ef-surface); color: var(--ef-accent); border-radius: 6px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.ef-overview .ef-card__d { font-size: 1.6em; font-weight: 800; }
.ef-overview .ef-card__m { font-size: .75em; font-weight: 600; margin-top: 3px; }
.ef-overview .ef-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 0; flex: 1; }
.ef-overview .ef-card__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ef-overview .ef-card__when { margin: 0; font-size: .9em; line-height: 1.4; color: var(--ef-muted); }
.ef-overview .ef-card__when span { white-space: nowrap; }
.ef-overview .ef-card__title { margin: 0; padding: 0; font-size: 1.2em; line-height: 1.3; }
.ef-overview .ef-card__title a { color: inherit; text-decoration: none; }
.ef-overview .ef-card__title a::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.ef-overview .ef-card__title a:hover { color: var(--ef-accent); }
.ef-overview .ef-card__sub, .ef-overview .ef-card__loc { margin: 0; font-size: .95em; line-height: 1.45; color: var(--ef-muted); }
.ef-overview .ef-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 18px; margin-top: auto; }
.ef-overview .ef-card__price { font-weight: 700; color: var(--ef-accent); white-space: nowrap; }
.ef-overview .ef-card__cta { position: relative; z-index: 1; margin-left: auto; white-space: nowrap; }
.ef-overview .ef-card.is-soldout .ef-card__media { filter: grayscale(.7); }

/* Kacheln: ohne Treffpunkt, damit die Karte luftig bleibt */
.ef-overview .ef-view-grid .ef-card__loc { display: none; }

/* Liste: Bild | Inhalt | Preis + Button */
.ef-overview .ef-view-list .ef-card { display: grid; grid-template-columns: minmax(160px, 230px) minmax(0, 1fr) auto; align-items: stretch; }
.ef-overview .ef-view-list .ef-card__media { aspect-ratio: auto; min-height: 140px; }
.ef-overview .ef-view-list .ef-card__body { padding: 16px 20px; justify-content: center; }
.ef-overview .ef-view-list .ef-card__foot { flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; padding: 16px 20px; margin: 0; }
.ef-overview .ef-view-list .ef-card__cta { margin-left: 0; }
@media (max-width: 720px) {
	.ef-overview .ef-view-list .ef-card { grid-template-columns: 120px minmax(0, 1fr); }
	.ef-overview .ef-view-list .ef-card__media { grid-row: 1 / span 2; min-height: 0; }
	.ef-overview .ef-view-list .ef-card__cal { left: 8px; top: 8px; min-width: 44px; }
	.ef-overview .ef-view-list .ef-card__body { padding: 12px 14px 0; }
	.ef-overview .ef-view-list .ef-card__foot { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px 14px; }
	.ef-overview .ef-viewtoggle { margin-left: 0; }
	.ef-overview .ef-dates__field input { width: 100%; }
	.ef-overview .ef-dates, .ef-overview .ef-dates__field { flex: 1 1 140px; }
	.ef-overview .ef-search { max-width: none; }
}

/* Kalenderblock (Terminliste, Galerie, Nächster Termin) */
.ef-cal {
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 7px 8px 6px;
	background: var(--ef-surface); color: var(--ef-accent); border: 1px solid var(--ef-border); border-radius: var(--ef-radius); line-height: 1;
}
.ef-cal__d { font-size: 1.6em; font-weight: 800; }
.ef-cal__m { font-size: .8em; margin-top: 3px; }
.ef-carousel .ef-carousel__cal { position: absolute; left: 18px; top: 18px; min-width: 66px; padding: 10px; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); font-size: 1.15em; }

/* Termine – kompakt auf schmalen Spalten (Container Query) */
.ef-termine { container-type: inline-size; }
.ef-termine .ef-termine__title { margin: 0 0 4px; padding: 0 0 10px; border-bottom: 2px solid var(--ef-accent); }
.ef-termine .ef-termine__list { list-style: none; margin: 0; padding: 0; }
.ef-termine .ef-termin {
	display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 18px; align-items: center;
	margin: 0; padding: 14px 0; border-bottom: 1px solid var(--ef-border);
}
.ef-termine .ef-termin[hidden] { display: none; }
.ef-termine .ef-termin:focus { outline: none; }
.ef-termine .ef-termin__text { line-height: 1.4; }
.ef-termine .ef-termin__side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.ef-termine .ef-termin.is-soldout .ef-termin__text, .ef-termine .ef-termin.is-soldout .ef-cal { opacity: .55; }
.ef-termine .ef-termine__more { margin-top: 14px; }
.ef-termine .ef-termine__count { font-weight: 400; opacity: .8; }

@container (max-width: 560px) {
	.ef-termine .ef-termin { gap: 4px 12px; padding: 10px 0; }
	.ef-termine .ef-cal { min-width: 46px; padding: 5px 6px 4px; }
	.ef-termine .ef-cal__d { font-size: 1.25em; }
	.ef-termine .ef-cal__m { font-size: .72em; }
	/* Datum steht im Kalenderblock: hier nur Wochentag + Uhrzeit, für Screenreader bleibt das volle Datum lesbar */
	.ef-termine .ef-termin__wd { display: block; font-weight: 600; }
	.ef-termine .ef-termin__full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
	.ef-termine .ef-termin__sep { display: none; }
	.ef-termine .ef-termin__time { display: block; font-size: .9em; color: var(--ef-muted); }
	.ef-termine .ef-termin__side { flex-direction: column; align-items: flex-end; gap: 4px; }
	.ef-termine .ef-termin__side .ef-btn--small { padding: .45em .8em; font-size: .85em; }
	.ef-termine .ef-termine__more { width: 100%; }
}

/* Tickets */
.ef-tickets { display: flex; flex-direction: column; gap: 24px; }
.ef-ticket__price { margin: 0 0 8px; font-weight: 700; font-size: 1.1em; }
.ef-ticket { scroll-margin-top: 120px; }

/* Galerie */
.ef-carousel { position: relative; }
.ef-carousel__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--ef-radius); }
.ef-carousel__track::-webkit-scrollbar { display: none; }
.ef-carousel__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.ef-carousel__slide img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.ef-carousel__nav {
	position: absolute; top: calc(50% - 20px); transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .9); color: #111; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.ef-carousel__nav--prev { left: 12px; }
.ef-carousel__nav--next { right: 12px; }
.ef-carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.ef-carousel__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--ef-border); cursor: pointer; }
.ef-carousel__dot[aria-current="true"] { background: var(--ef-accent); }

/* Eckdaten – richtet sich nach der Breite der Spalte (Container Query), nicht nur nach dem Bildschirm */
.ef-eckdaten { container-type: inline-size; }
.ef-eckdaten .ef-eckdaten__title { margin: 0; padding: 0 0 12px; border-bottom: 2px solid var(--ef-accent); }
.ef-eckdaten .ef-eckdaten__grid {
	display: grid; grid-template-columns: repeat(var(--ef-cols, 5), minmax(0, 1fr));
	margin: 0; padding: 0; border-bottom: 1px solid var(--ef-border);
}
.ef-eckdaten .ef-eckdaten__item { min-width: 0; margin: 0; padding: 18px 20px 20px; border-left: 1px solid var(--ef-border); }
.ef-eckdaten .ef-eckdaten__item:first-child { padding-left: 0; border-left: 0; }
.ef-eckdaten dt { margin: 0 0 4px; padding: 0; font-size: .85em; font-weight: 400; line-height: 1.3; color: var(--ef-muted); }
.ef-eckdaten dd { margin: 0; padding: 0; line-height: 1.35; }
.ef-eckdaten .ef-eckdaten__value { display: block; font-size: 1.05em; font-weight: 700; color: inherit; overflow-wrap: break-word; hyphens: auto; }
.ef-eckdaten .ef-eckdaten__link { color: inherit; text-decoration: underline; text-decoration-color: var(--ef-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ef-eckdaten .ef-eckdaten__link::after { content: "↗"; display: inline-block; margin-left: 4px; font-weight: 400; color: var(--ef-accent); }
.ef-eckdaten .ef-eckdaten__link:hover, .ef-eckdaten .ef-eckdaten__link:focus-visible { color: var(--ef-accent); }
.ef-eckdaten .ef-eckdaten__sub { display: block; margin-top: 4px; font-size: .9em; color: var(--ef-muted); }

@container (max-width: 760px) {
	.ef-eckdaten .ef-eckdaten__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
	.ef-eckdaten .ef-eckdaten__item,
	.ef-eckdaten .ef-eckdaten__item:first-child { padding: 14px 0 14px 16px; border-left: 0; border-bottom: 1px solid var(--ef-border); }
	.ef-eckdaten .ef-eckdaten__item:nth-child(odd) { padding: 14px 16px 14px 0; border-right: 1px solid var(--ef-border); }
	/* ungerade Anzahl: das letzte Feld nimmt die volle Breite */
	.ef-eckdaten .ef-eckdaten__item:last-child:nth-child(odd) { grid-column: 1 / -1; padding-right: 0; border-right: 0; }
}

/* Smartphone: alle Felder untereinander, Beschriftung links, Wert rechts */
@container (max-width: 520px) {
	.ef-eckdaten .ef-eckdaten__title { padding-bottom: 10px; }
	.ef-eckdaten .ef-eckdaten__grid { grid-template-columns: 1fr; }
	.ef-eckdaten .ef-eckdaten__item,
	.ef-eckdaten .ef-eckdaten__item:first-child,
	.ef-eckdaten .ef-eckdaten__item:nth-child(odd),
	.ef-eckdaten .ef-eckdaten__item:last-child:nth-child(odd) {
		display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; align-items: baseline;
		grid-column: auto; padding: 10px 0; border-right: 0; border-left: 0;
	}
	.ef-eckdaten dt { margin: 0; font-size: .85em; }
	.ef-eckdaten .ef-eckdaten__value { font-size: 1em; }
	.ef-eckdaten .ef-eckdaten__sub { margin-top: 2px; font-size: .85em; }
}

/* Treffpunkt */
.ef-treffpunkt { display: flex; flex-direction: column; gap: 2px; }
.ef-treffpunkt__addr { color: var(--ef-muted); }
.ef-treffpunkt__maps { color: var(--ef-accent); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
	.ef-overview .ef-card__media img, .ef-btn { transition: none; }
	.ef-overview .ef-card:hover .ef-card__media img { transform: none; }
}
