/**
 * WW Events Taxis - Teilnehmer Addon — frontend styles.
 *
 * Palette mirrors the parent plugin (accent #3788d8 / #2c6cb0, 4px
 * radii, circular avatars) so the widget reads as native.
 */

.wwet-rsvp {
	/* ------------------------------------------------------------------
	 * Avatars per row. Change this single number to e.g. 10 to show ten
	 * images per line instead of eight. (How many avatars appear before
	 * the "more" button is a separate, admin-configurable setting.)
	 * ------------------------------------------------------------------ */
	--wwet-cols: 8;

	--wwet-primary: #3788d8;
	--wwet-primary-dark: #2c6cb0;
	--wwet-avatar-size: 44px;
	--wwet-gap: 8px;
	margin: 0 0 1em;
}

/* --- Action area: button / login link / attending state ----------- */

.wwet-rsvp__action {
	margin-bottom: 14px;
}

.wwet-btn {
	display: inline-block;
	/* background: var(--wwet-primary); */
	background: var(--button_farbe);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 10px 20px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.wwet-btn:hover,
.wwet-btn:focus {
	/* background: var(--wwet-primary-dark); */
	background: var(--button_farbe_hover);
	color: #fff;
}

.wwet-btn:focus-visible {
	outline: 2px solid var(--wwet-primary-dark);
	outline-offset: 2px;
}

.wwet-btn:disabled,
.wwet-btn.is-loading {
	opacity: 0.65;
	cursor: default;
}

.wwet-attending {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #eaf6ec;
	border: 1px solid #cde9d3;
	color: #1a7f37;
	font-weight: 600;
	font-size: 14px;
	border-radius: 4px;
	padding: 8px 14px;
}

.wwet-attending__check {
	font-size: 15px;
	line-height: 1;
}

/* --- Count + empty state ------------------------------------------ */

.wwet-count {
	margin: 0 0 10px;
	font-size: 14px;
	color: #555;
}

.wwet-empty {
	margin: 0;
	font-size: 14px;
	color: #777;
	font-style: italic;
}

/* --- Avatar grid: 8 per row, 2 rows visible ----------------------- */

.wwet-grid {
	display: grid;
	grid-template-columns: repeat(var(--wwet-cols), 1fr);
	gap: var(--wwet-gap);
	max-width: calc(var(--wwet-cols) * var(--wwet-avatar-size) + (var(--wwet-cols) - 1) * var(--wwet-gap));
}

.wwet-avatar {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: hidden;
	background: #f0f0f1;
	padding: 0;
	border: 0;
	text-decoration: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.wwet-avatar {
	cursor: pointer;
}

a.wwet-avatar:hover,
a.wwet-avatar:focus-visible {
	transform: scale(1.08);
	box-shadow: 0 0 0 2px var(--wwet-primary);
	z-index: 2;
}

a.wwet-avatar:focus-visible {
	outline: none;
}

.wwet-avatar--static {
	cursor: default;
}

.wwet-avatar__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

/* Hidden overflow avatars (everything past the 16th slot). */
.wwet-grid:not(.is-expanded) .wwet-avatar--overflow {
	display: none;
}

/* --- The "more" (three dots) trigger in slot 16 ------------------- */

.wwet-grid__more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	background: #e4e7ea;
	color: #555;
	cursor: pointer;
}

.wwet-grid__more:hover,
.wwet-grid__more:focus-visible {
	background: #d6dadf;
	transform: scale(1.08);
	box-shadow: 0 0 0 2px #c3c9d0;
	outline: none;
}

.wwet-dots {
	display: flex;
	gap: 3px;
	align-items: center;
}

.wwet-dots span {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	display: block;
}

/* Once expanded, the trigger is gone and overflow avatars fade in. */
.wwet-grid.is-expanded .wwet-grid__more {
	display: none;
}

.wwet-grid.is-expanded .wwet-avatar--overflow {
	animation: wwet-pop 0.22s ease both;
}

@keyframes wwet-pop {
	from {
		opacity: 0;
		transform: scale(0.6);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* --- "Meine Teilnahmen" cancel button (BuddyPress profile) -------- */

.wwet-cancel-form {
	margin: 0;
}

.wwet-cancel-button {
	display: inline-block;
	background: transparent;
	color: #b3261e;
	border: 1px solid #e2b3b0;
	border-radius: 4px;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wwet-cancel-button:hover,
.wwet-cancel-button:focus {
	background: #b3261e;
	border-color: #b3261e;
	color: #fff;
}

.wwet-cancel-button:focus-visible {
	outline: 2px solid #b3261e;
	outline-offset: 2px;
}

.wwet-teilnahmen-table .ww-events-col-action {
	text-align: right;
	white-space: nowrap;
}

/* --- Members directory: attended-event thumbnails ----------------- */

.wwet-mle {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	margin: 6px 0;
	clear: both;
	padding-top: 9px;
}

@media screen and (max-width: 767px) {
	.wwet-mle {
		justify-content: center;
	}
	
}

.wwet-mle__icon {
	display: inline-flex;
	align-items: center;
	color: var(--wwet-primary, #3788d8);
	flex: 0 0 auto;
}

.wwet-mle__icon svg {
	width: 38px;
	height: 38px;
	display: block;
}

.wwet-mle__list {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.wwet-mle__item {
	display: block;
	width: 36px;
	height: 36px;
	border-radius: 4px;
	overflow: hidden;
	background: #f0f0f1;
	flex: 0 0 auto;
	line-height: 0;
}

.wwet-mle__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wwet-mle__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: #e4e7ea;
}

/* --- Event already over: inert, greyed-out "Teilnehmen" button ---- */

/* The Tippy tooltip is bound to this wrapper, because a disabled
 * <button> never dispatches mouse events. The button sets
 * pointer-events: none so the hover falls through to the wrapper. */
.wwet-past {
	display: inline-block;
	cursor: not-allowed;
}

.wwet-btn.wwet-btn--past {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}

.wwet-btn.wwet-btn--past:hover,
.wwet-btn.wwet-btn--past:focus {
	/* No hover brightening for a disabled/over event. */
	background: var(--button_farbe);
	box-shadow: none;
}
