/* [federcori-events] — scoped styles, all .fed-ev-* prefixed */
.fed-ev {
	font-family: var(--fed-font-body);
	font-size: var(--fed-fs-body);
	line-height: 1.5;
	color: var(--fed-ink);
	max-width: 1220px;
	margin: 0 auto;
}
.fed-ev *,
.fed-ev *::before,
.fed-ev *::after {
	box-sizing: border-box;
}
.fed-ev img {
	max-width: 100%;
	display: block;
}
.fed-ev-icon {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	fill: currentColor;
}

/* Taxonomy-archive context chip */
.fed-ev-context {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.fed-ev-context-term {
	font-family: var(--fed-font-heading);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--fed-navy);
	background: var(--fed-bg-soft);
	padding: 6px 12px;
	border-radius: 999px;
}
.fed-ev-context-clear {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--fed-red);
	text-decoration: none;
}
.fed-ev-context-clear:hover {
	color: var(--fed-red-dark);
	text-decoration: underline;
}
.fed-ev-context-clear .fed-ev-icon {
	width: 10px;
	height: 10px;
}

/* Layout — a top bar (year chips + reset) above the results on desktop; becomes an
   off-canvas panel on mobile (see the responsive block), same behavior as
   [federcori-festivals]'s sidebar. */
.fed-ev-layout {
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.fed-ev-topbar {
	display: flex;
	align-items: center;
	gap: 20px;
	background: var(--fed-white);
	border: 1px solid var(--fed-line);
	border-radius: var(--fed-radius);
	padding: 14px 24px;
}
.fed-ev-topbar-head {
	display: none;
}
.fed-ev-backdrop {
	display: none;
}
.fed-ev-filter-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
	padding: 11px 18px;
	border: 1.5px solid var(--fed-line);
	border-radius: 12px;
	background: var(--fed-white);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--fed-ink);
	cursor: pointer;
}
.fed-ev-filter-toggle .fed-ev-icon {
	width: 14px;
	height: 14px;
}
.fed-ev-results {
	min-width: 0;
}

/* Filters */
.fed-ev-facet {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: 1;
	min-width: 0;
}
.fed-ev-facet-head {
	font-family: var(--fed-font-body);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fed-gray);
	margin: 0;
	white-space: nowrap;
}

/* real checkbox hidden on every facet; the pill fill below stands in for it */
.fed-ev-check-row input[type='checkbox'] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* "Periodo" (anno) and "Categoria" chips — same pill base; "anno"'s checked state gets the
   site's signature navy/red/green gradient + white text instead of a flat navy fill. */
.fed-ev-check-list[data-facet='anno'],
.fed-ev-check-list[data-facet='categoria'] {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.fed-ev-check-list[data-facet='anno'] .fed-ev-check-row,
.fed-ev-check-list[data-facet='categoria'] .fed-ev-check-row {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border: 1px solid var(--fed-line);
	border-radius: 999px;
	font-family: var(--fed-font-body);
	font-weight: 600;
	font-size: 0.8125rem;
	color: var(--fed-navy);
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fed-ev-check-list[data-facet='categoria'] .fed-ev-check-row .fed-ev-icon {
	width: 12px;
	height: 12px;
}
.fed-ev-check-list[data-facet='categoria'] .fed-ev-check-row:has(input:checked) {
	background: var(--fed-navy);
	border-color: var(--fed-navy);
	color: var(--fed-white);
}
/* "anno" active state — the site's signature gradient instead of a flat navy fill */
.fed-ev-check-list[data-facet='anno'] .fed-ev-check-row:has(input:checked) {
	background-color: var(--fed-navy);
	background-image:
		radial-gradient(circle at 20% 10%, rgba(226, 34, 43, 0.75), transparent 55%),
		radial-gradient(circle at 85% 90%, rgba(0, 150, 58, 0.7), transparent 55%);
	border-color: transparent;
	color: var(--fed-white);
}
.fed-ev-check-list[data-facet='anno'] .fed-ev-check-row:has(input:focus-visible),
.fed-ev-check-list[data-facet='categoria'] .fed-ev-check-row:has(input:focus-visible) {
	outline: 2px solid var(--fed-navy);
	outline-offset: 2px;
}

.fed-ev-reset {
	flex: none;
	padding: 0;
	border: none;
	background: none;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--fed-red);
	cursor: pointer;
	white-space: nowrap;
}
.fed-ev-reset:hover {
	color: var(--fed-red-dark);
	text-decoration: underline;
}

/* Results */
.fed-ev-timeline {
	display: flex;
	flex-direction: column;
}
.fed-ev-year-group {
	padding: 26px 0;
	border-top: 1px solid var(--fed-line);
}
.fed-ev-year-group:first-child {
	border-top: none;
	padding-top: 0;
}
.fed-ev-year-label {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 16px;
}
.fed-ev-year-num {
	font-family: var(--fed-font-heading);
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--fed-navy);
	line-height: 1;
}
.fed-ev-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
}

/* Card */
.fed-ev-card {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--fed-line);
	border-radius: var(--fed-radius);
	overflow: hidden;
	background: var(--fed-white);
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s ease, opacity 0.3s ease;
}
/* gradient lives on an always-present layer so it can fade in, not snap */
.fed-ev-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: var(--fed-navy);
	background-image:
		radial-gradient(circle at 20% 10%, rgba(226, 34, 43, 0.5), transparent 55%),
		radial-gradient(circle at 85% 90%, rgba(0, 150, 58, 0.45), transparent 55%);
	background-size: 180% 180%;
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}
.fed-ev-card > * {
	position: relative;
	z-index: 1;
}
.fed-ev-photo {
	position: relative;
	aspect-ratio: 4 / 3;
	background: linear-gradient(150deg, #2a2c5c, var(--fed-navy-deep));
	overflow: hidden;
}
.fed-ev-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 25%; /* keep faces framed when a portrait poster is cropped */
	display: block;
}
.fed-ev-img--ph {
	display: flex;
	align-items: center;
	justify-content: center;
}
.fed-ev-img--ph .fed-ev-icon {
	width: 46px;
	height: 46px;
	color: rgba(255, 255, 255, 0.22);
}
.fed-ev-body {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 15px 16px 17px;
    flex: 1;
}

.fed-ev-title {
    font-family: var(--fed-font-heading);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--fed-navy);
    line-height: 1.3;
    /* text-wrap: pretty; */
    /* display: -webkit-box; */
    /* -webkit-line-clamp: 2; */
    /* -webkit-box-orient: vertical; */
    /* overflow: hidden; */
    transition: color 0.2s ease;
}
.fed-ev-eyebrow {
	font-family: var(--fed-font-body);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fed-red);
	transition: color 0.2s ease;
}
.fed-ev-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    margin-top: auto;
    padding-top: 12px;
}
.fed-ev-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: var(--fed-ink-soft);
    white-space: nowrap;
    transition: color 0.2s ease;
}
.fed-ev-date .fed-ev-icon {
	width: 11px;
	height: 11px;
	fill: none;
}
.fed-ev-venue {
	margin-top: auto;
	width: 100%;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 8px;
	line-height: 1.3;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	background: var(--fed-bg-soft);
	color: var(--fed-navy);
	transition: background 0.2s ease, color 0.2s ease;
}
.fed-ev-venue .fed-ev-icon {
	width: 11px;
	height: 11px;
	fill: currentColor;
}

/* Card hover */
.fed-ev-card:hover {
	box-shadow: var(--fed-shadow);
}
.fed-ev-card:hover::before {
	opacity: 1;
	animation: fed-ev-glow 3s ease-in-out infinite alternate;
}
.fed-ev-card:hover .fed-ev-title {
	color: var(--fed-white);
}
.fed-ev-card:hover .fed-ev-eyebrow {
	color: rgba(255, 255, 255, 0.7);
}
.fed-ev-card:hover .fed-ev-date {
	color: rgba(255, 255, 255, 0.7);
}
.fed-ev-card:hover .fed-ev-venue {
	background: rgba(255, 255, 255, 0.14);
	color: var(--fed-white);
}
.fed-ev-grid:has(.fed-ev-card:hover) .fed-ev-card:not(:hover) {
	opacity: 0.9;
}
@keyframes fed-ev-glow {
	0%   { background-position: 0% 0%; }
	50%  { background-position: 100% 40%; }
	100% { background-position: 40% 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.fed-ev-card:hover::before {
		animation: none;
	}
}

/* Loading / empty */
.fed-ev-sentinel {
	height: 1px;
}
.fed-ev-loading {
	display: flex;
	justify-content: center;
	padding: 30px 0;
}
.fed-ev-loading.fed-hidden {
	display: none;
}
.fed-ev-spinner {
	width: 32px;
	height: 32px;
	animation: fed-ev-spin 0.85s linear infinite;
}
.fed-ev-spinner circle {
	fill: none;
	stroke: var(--fed-navy);
	stroke-width: 4;
	stroke-linecap: round;
	stroke-dasharray: 100;
	stroke-dashoffset: 75;
}
@keyframes fed-ev-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	.fed-ev-spinner {
		animation-duration: 2.4s;
	}
}
.fed-ev-empty {
	text-align: center;
	padding: 30px 0;
	font-size: 0.875rem;
	color: var(--fed-ink-soft);
}

/* Responsive */
@media (max-width: 1180px) {
	.fed-ev-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 980px) {
	.fed-ev-filter-toggle {
		display: inline-flex;
	}
	.fed-ev-topbar {
		position: fixed;
		top: 0;
		left: 0;
		height: 100%;
		width: min(320px, 86vw);
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
		border: none;
		border-radius: 0;
		padding: 24px;
		overflow-y: auto;
		box-shadow: var(--fed-shadow);
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		z-index: 1001;
	}
	.fed-ev-topbar.is-open {
		transform: translateX(0);
	}
	.fed-ev-topbar-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-family: var(--fed-font-heading);
		font-weight: 700;
		font-size: 1rem;
		color: var(--fed-navy);
	}
	.fed-ev-topbar-close {
		width: 28px;
		height: 28px;
		display: flex;
		align-items: center;
		justify-content: center;
		background: none;
		border: none;
		color: var(--fed-navy);
		cursor: pointer;
	}
	.fed-ev-topbar-close .fed-ev-icon {
		width: 14px;
		height: 14px;
	}
	.fed-ev-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(18, 18, 40, 0.5);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
		z-index: 1000;
	}
	.fed-ev-backdrop.is-open {
		opacity: 1;
		pointer-events: auto;
	}
	.fed-ev-facet {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.fed-ev-reset {
		align-self: flex-start;
	}
	.fed-ev-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.fed-ev-photo {
		aspect-ratio: 3 / 2;
	}
}
@media (max-width: 768px) {
	.fed-ev-grid {
		grid-template-columns: 1fr;
	}
	.fed-ev-photo {
		aspect-ratio: 16 / 9;
	}
}
