/* ================================================
   WP Event Liste — Frontend-Styles (BEM)
   ================================================ */

/* Container */
.event-list {
	width: 100%;
	font-family: inherit;
}

.event-list__empty {
	text-align: center;
	color: #6b7280;
	padding: 2rem;
}

/* ---- Event Row ---- */
.event-row {
	display: grid;
	grid-template-columns: 72px 1fr 220px 160px;
	align-items: center;
	gap: 1.5rem;
	/* Horizontales Padding + negativer Margin halten das Grid bündig
	   zum Container; beim Hover füllt der Hintergrund sauber aus. */
	padding: 1.5rem 0.75rem;
	margin: 0 -0.75rem;
	border-bottom: 1px solid #e5e7eb;
	border-radius: 6px;
	transition: background-color 0.15s ease, padding 0.15s ease;
}

.event-row:last-child {
	border-bottom: none;
}

.event-row:hover {
	background-color: #f0f0f0;
	padding-top: 1.75rem;
	padding-bottom: 1.75rem;
}

.event-row:has(.event-row__details-content) {
	cursor: pointer;
}

/* Extra divider line, only used/positioned in the ≤580px layout. */
.event-row__divider {
	display: none;
}

/* Date Column
   ---------------------------------------- */
.event-row__date {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.event-row__date-number {
	display: block;
	font-size: 2.75rem;
	font-weight: 800;
	line-height: 1;
	color: #111827;
}

.event-row__date-number--month {
	font-size: 1.75rem;
}

.event-row__date-month {
	display: block;
	margin-top: 4px;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #eb5d1b;
}

/* Content Column
   ---------------------------------------- */
.event-row__content {
	min-width: 0;
}

.event-row__content-text {
	min-width: 0;
}

.event-row__title {
	margin: 0 0 0.3rem !important;
	padding: 0 !important;
	font-size: 1.05rem !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	color: #111827 !important;
	border: none !important;
}

.event-row__subtitle {
	margin: 0 !important;
	font-size: 0.85rem;
	line-height: 1.55;
	color: #6b7280;
}

.event-row__details-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	margin-top: 0.4rem;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.8rem;
	font-weight: 600;
	font-family: inherit;
	color: #eb5d1b;
	/* Keeps its intrinsic width instead of stretching full-width when it becomes
	   an independent grid item on the tablet/mobile "position rotation" layouts. */
	justify-self: start;
}

.event-row__details-toggle-arrow {
	display: inline-block;
	transition: transform 0.2s ease;
}

.event-row__details-toggle[aria-expanded="true"] .event-row__details-toggle-arrow {
	transform: rotate(90deg);
}

.event-row__details-content {
	grid-column: 1 / -1;
	margin: 0.5rem 90px 0;
	margin-top: -15px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
	font-size: 0.85rem;
	line-height: 1.55;
	color: #6b7280;
	cursor: auto;
}

.event-row__details-content > *:first-child {
	margin-top: 0;
}

.event-row__details-content > *:last-child {
	margin-bottom: 0;
}

/* Mitgliederbereich: Aufzeichnung / Galerie / PDFs
   ---------------------------------------- */
.event-row__recording {
	margin: 0 0 1rem !important;
	font-weight: 600;
}

.event-row__recording a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: #eb5d1b;
}

.event-row__recording-icon {
	flex-shrink: 0;
}

.event-row__gallery-label {
	margin: 0 0 0.5rem !important;
	font-weight: 600;
	color: #111827;
}

.event-row__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
	gap: 0.6rem;
	margin-bottom: 1rem;
}

.event-row__gallery-item {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 6px;
	overflow: hidden;
	cursor: zoom-in;
}

.event-row__gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s ease;
}

.event-row__gallery-item:hover img {
	transform: scale(1.06);
}

.event-row__pdf-list {
	list-style: none;
	margin: 0 0 1rem !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.event-row__pdf-item a {
	display: inline-flex;
	align-items: center;
	color: #374151;
	text-decoration: none;
	font-weight: 600;
}

.pdf-download-icon li a:before {
	content: "\f1c1";
	font-family: "FontAwesome";
	margin-right: 8px;
	color: #eb5d1b;
}

.event-row__pdf-item a:hover {
	color: #eb5d1b;
}

/* Lightbox für die Bildergalerie
   ---------------------------------------- */
.event-row__lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(17, 24, 39, 0.92);
	cursor: zoom-out;
}

.event-row__lightbox[hidden] {
	display: none;
}

.event-row__lightbox-img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	cursor: default;
}

.event-row__lightbox-close,
.event-row__lightbox-prev,
.event-row__lightbox-next {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: none;
	cursor: pointer;
	line-height: 1;
}

.event-row__lightbox-close {
	top: 1.25rem;
	right: 1.25rem;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	font-size: 1.5rem;
}

.event-row__lightbox-prev,
.event-row__lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	font-size: 2rem;
}

.event-row__lightbox-prev {
	left: 1rem;
}

.event-row__lightbox-next {
	right: 1rem;
}

.event-row__lightbox-close:hover,
.event-row__lightbox-prev:hover,
.event-row__lightbox-next:hover {
	background: rgba(255, 255, 255, 0.25);
}

body.event-row__lightbox-open {
	overflow: hidden;
}

/* Meta Column
   ---------------------------------------- */
.event-row__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
}

.event-row__location {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.85rem;
	color: #374151;
}

.event-row__location-icon {
	flex-shrink: 0;
	color: #9ca3af;
}

/* Status Badges
   ---------------------------------------- */
.event-row__badge {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	padding: 0.2rem 0.65rem;
	border-radius: 9999px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.event-row__badge--open {
	background-color: #d1fae5;
	color: #065f46;
}

.event-row__badge--waitlist {
	background-color: #ffedd5;
	color: #9a3412;
}

/* Action Column
   ---------------------------------------- */
.event-row__action {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
}

/* Mitglieder-Thumbnail — immer ganz rechts in der Event-Zeile.
   ---------------------------------------- */
.event-row__thumbnail {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 8px;
	object-fit: cover;
	display: block;
}

/* Buttons
   ---------------------------------------- */
.event-row__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1rem 1.25rem;
	border-radius: 9999px;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.event-row__button--primary {
	background-color: transparent;
	color: #eb5d1b !important;
	border: 1px solid #eb5d1b;
	font-family: 'Inter', Helvetica, Arial, Lucida, sans-serif;
	font-weight: 600;
	font-size: 0.95rem !important;
	line-height: 1em !important;
	border-radius: 80px;
}

.event-row__button--primary:hover,
.event-row__button--primary:focus {
	background-color: #333333;
	color: #ffffff !important;
	border-color: #333333;
}

.event-row__button--secondary {
	background-color: transparent;
	color: #111827 !important;
	border: 2px solid #111827;
}

.event-row__button--secondary:hover,
.event-row__button--secondary:focus {
	background-color: #111827;
	color: #ffffff !important;
}

/* Pfeil im Button — erscheint erst beim Hovern
   ---------------------------------------- */
.event-row__button-arrow {
	display: inline-block;
	max-width: 0;
	overflow: hidden;
	opacity: 0;
	transform: translateX(-4px);
	margin-left: 0;
	transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.2s ease, margin-left 0.2s ease;
}

.event-row__button:hover .event-row__button-arrow,
.event-row__button:focus .event-row__button-arrow {
	opacity: 1;
	transform: translateX(0);
	max-width: 1.5em;
	margin-left: 0.35rem;
}

/* ---- Responsive Breakpoints ---- */
/*
   Tablet & Mobile rotate which element sits in which position (button stays put
   on tablet). To reposition the badge/location/toggle independently of their
   .meta/.content wrappers, those wrappers become `display: contents` here — the
   wrapper's box disappears and its children act as direct grid children instead.
   Desktop is untouched: the wrappers stay normal boxes there.
*/
@media (max-width: 900px) {
	.event-row {
		grid-template-columns: 72px 1fr 160px;
		background-color: #f7f7f7;
		margin: 10px 0px;
		grid-template-areas:
			"date  content  action"
			"slot2 slot3    slot1"
			"details details details";
		row-gap: 1rem;
	}

	.event-row__date    { grid-area: date; 		color: #eb5d1b;
}
	.event-row__action  { grid-area: action; }
	.event-row__details-content { grid-area: details; margin-top: 0; }

	.event-row__content { display: contents; }
	.event-row__content-text { grid-area: content; }

	.event-row__meta { display: contents; }

	/* Positionsrotation: Ort → Chip, Chip → "Mehr Details", "Mehr Details" → Ort. */
	.event-row__badge          { grid-area: slot1; }
	.event-row__details-toggle { grid-area: slot2; margin-top: 0; margin-right: auto; margin-left: 100px; white-space: nowrap;}
	.event-row__location       { grid-area: slot3; margin-left: auto;}
}

@media (max-width: 580px) {
	.event-row {
		grid-template-columns: 72px 1fr 1fr;
		row-gap: 0.75rem;
		padding-left: 20px;
		padding-right: 20px;
		margin-left: -20px;
		margin-right: -20px;
		/* Which of the location/badge/button rows exist (and how many dividers are
		   needed) varies per event — computed server-side into this custom property
		   so a missing row (and its divider) is simply absent, in any combination. */
		grid-template-areas: var(--mobile-areas);
	}

	/* Subtile Trennlinien zwischen den vorhandenen Zeilen (nur in dieser Ansicht).
	   Assigned positionally: div1 = first divider needed, div1b = second, div2 = third. */
	.event-row::before,
	.event-row::after {
		content: "";
		height: 1px;
		background-color: #e5e7eb;
	}

	.event-row::before { grid-area: div1; }
	.event-row::after   { grid-area: div2; }

	.event-row__divider {
		display: block;
		grid-area: div1b;
		height: 1px;
		background-color: #e5e7eb;
	}

	.event-row--div1-off::before   { content: none; }
	.event-row--div2-off::after    { content: none; }
	.event-row--div1b-off .event-row__divider { display: none; }

	/* Zebra-Streifen: jedes zweite Event bekommt einen dezenten grauen Hintergrund. */
	.event-row{
		background-color: #f7f7f7;
		margin: 10px 0px;
	}

	.event-row__details-content {
		grid-area: details;
		margin-top: 0;
		margin: 0.5rem 10px 0;
	}

	.event-row__content { display: contents;}
	.event-row__content-text { grid-area: content; }

	.event-row__meta { display: contents; }

	.event-row__badge          { grid-area: slot1;}
	.event-row__action         { grid-area: slot2; justify-content: flex-end;}
	.event-row__details-toggle { grid-area: slot3; margin-right: auto; justify-content: flex-start; margin-left: 0;}
	.event-row__location       { grid-area: slot4; white-space: nowrap; justify-content: flex-start; margin-left: 0;}
}
