/* [federcori-festivals] — scoped styles, all .fed-* prefixed */
.fed-festivals {
	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-festivals *,
.fed-festivals *::before,
.fed-festivals *::after {
	box-sizing: border-box;
}
.fed-festivals img {
	max-width: 100%;
	display: block;
}

/* Toolbar */
.fed-toolbar {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
}
.fed-search {
	position: relative;
	flex: 1;
}
.fed-search .fed-icon-search {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 15px;
	height: 15px;
	color: var(--fed-gray);
	fill: currentColor;
}
.fed-search-input {
	width: 100%;
	padding: 13px 16px 13px 40px;
	border: 1.5px solid var(--fed-line);
	border-radius: 12px;
	font: inherit;
	font-size: 0.875rem; /* 14px */
	color: var(--fed-ink);
	background: var(--fed-white);
}
.fed-search-input:focus {
	outline: none;
	border-color: var(--fed-navy);
}

/* Mobile filter toggle */
.fed-filter-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 11px 18px;
	border: 1.5px solid var(--fed-line);
	border-radius: 12px;
	background: var(--fed-white);
	font: inherit;
	font-size: 0.875rem; /* 14px */
	font-weight: 600;
	color: var(--fed-ink);
	cursor: pointer;
}
.fed-filter-toggle .fed-icon {
	width: 14px;
	height: 14px;
	fill: none;
}

/* Layout */
.fed-layout {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 32px;
	align-items: start;
}

/* Sidebar */
.fed-sidebar {
	display: flex;
	flex-direction: column;
	background: var(--fed-white);
	border: 1px solid var(--fed-line);
	border-radius: var(--fed-radius);
	padding: 22px 24px;
	color: var(--fed-ink);
}
.fed-sidebar-head {
	display: none;
}
.fed-sidebar-backdrop {
	display: none;
}
.fed-results {
	min-width: 0; /* don't blow out the grid track */
}

/* Reset */
.fed-reset {
	margin-top: 22px;
	padding: 0;
	border: none;
	background: none;
	font: inherit;
	font-size: 0.8125rem; /* 13px */
	font-weight: 600;
	color: var(--fed-red);
	cursor: pointer;
	align-self: flex-start;
}
.fed-reset:hover {
	color: var(--fed-red-dark);
	text-decoration: underline;
}

/* Facets */
.fed-facet {
	border: none;
}
.fed-facet + .fed-facet {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--fed-line);
}
.fed-facet summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	list-style: none;
	font-size: 0.8125rem; /* 13px */
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fed-gray);
	margin-bottom: 12px;
}
.fed-facet summary::-webkit-details-marker {
	display: none;
}
.fed-facet summary .fed-icon {
	width: 11px;
	height: 11px;
	fill: none;
	transition: transform 0.2s ease;
}
.fed-facet[open] summary .fed-icon {
	transform: rotate(180deg);
}

/* real checkbox hidden; a dot or chip stands in for it */
.fed-check-row input[type='checkbox'] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* "Anno" ruler */
.fed-ruler {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-left: 20px;
}
.fed-ruler::before {
	content: '';
	position: absolute;
	left: 4px;
	top: 10px;
	bottom: 10px;
	width: 2px;
	background: var(--fed-line);
}
.fed-ruler-row {
	position: relative;
	z-index: 0;
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 8px 8px 8px 0;
	cursor: pointer;
	user-select: none;
}
/* bleeds past the row + sidebar padding to reach the sidebar edges */
.fed-ruler-row::before {
    content: '';
    position: absolute;
    inset: 0 -24px 0 -44px;
    z-index: -1;
    background: 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%),
		var(--fed-navy);
    opacity: 0;
    transition: opacity 0.2s ease;
    width: calc(100% + 20%);
    margin: auto;
    border-radius: 50px;
}
.fed-ruler-row:hover::before {
	opacity: 1;
}
.fed-ruler-row:has(input:focus-visible) {
	outline: 2px solid var(--fed-navy);
	outline-offset: 2px;
}
.fed-ruler-dot {
	position: absolute;
	left: -20px;
	top: 50%;
	transform: translateY(-50%);
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--fed-white);
	border: 2px solid var(--fed-gray);
	transition: background 0.15s ease, border-color 0.15s ease;
}
.fed-ruler-row:hover .fed-ruler-dot {
	border-color: rgba(255, 255, 255, 0.7);
}
.fed-ruler-row:has(input:checked) .fed-ruler-dot {
	border-color: var(--fed-red);
	background: var(--fed-red);
}
.fed-ruler-year {
	font-family: var(--fed-font-heading);
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--fed-gray);
	transition: color 0.15s ease, font-weight 0.15s ease;
}
.fed-ruler-row:hover .fed-ruler-year {
	color: var(--fed-white);
}
.fed-ruler-row:has(input:checked) .fed-ruler-year {
	color: var(--fed-navy);
	font-weight: 800;
}
.fed-ruler-row:hover:has(input:checked) .fed-ruler-year {
	color: var(--fed-white);
}

/* "Paese" chips */
.fed-check-list[data-facet='paese'] {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.fed-check-list[data-facet='paese'] .fed-check-row {
	padding: 7px 14px;
	border: 1px solid var(--fed-line);
	border-radius: 999px;
	font-size: 0.8125rem; /* 13px */
	font-weight: 600;
	color: var(--fed-navy);
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fed-check-list[data-facet='paese'] .fed-check-row:has(input:checked) {
	background: var(--fed-navy);
	border-color: var(--fed-navy);
	color: var(--fed-white);
}
.fed-check-list[data-facet='paese'] .fed-check-row:has(input:focus-visible) {
	outline: 2px solid var(--fed-navy);
	outline-offset: 2px;
}

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

/* Card list */
.fed-list {
	border: 1px solid var(--fed-line);
	border-radius: var(--fed-radius);
	overflow: hidden;
	background: var(--fed-white);
}
.fed-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px 14px 14px;
	border-top: 1px solid var(--fed-line);
	text-decoration: none;
	color: inherit;
	transition: opacity 0.3s ease;
	animation: fed-card-in 0.45s ease both;
}
.fed-card:first-child {
	border-top: none;
}
/* gradient lives on an always-present layer so it can fade in, not snap */
.fed-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-card > * {
	position: relative;
	z-index: 1;
}
.fed-card:hover::before {
	opacity: 1;
	animation: fed-card-glow 3s ease-in-out infinite alternate;
}
@keyframes fed-card-glow {
	0%   { background-position: 0% 0%; }
	50%  { background-position: 100% 40%; }
	100% { background-position: 40% 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.fed-card:hover::before {
		animation: none;
	}
}
.fed-card:hover .fed-card-title {
	color: var(--fed-white);
}
.fed-card:hover .fed-card-date {
	color: rgba(255, 255, 255, 0.75);
}
.fed-card:hover .fed-card-pin {
	background: rgba(255, 255, 255, 0.14);
	color: var(--fed-white);
}
.fed-list:has(.fed-card:hover) .fed-card:not(:hover) {
	opacity: 0.45;
}
@keyframes fed-card-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
@media (prefers-reduced-motion: reduce) {
	.fed-card {
		animation: none;
	}
}
.fed-card-thumb {
    position: relative;
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
    border-radius: 10px;
    background: var(--fed-navy);
    overflow: hidden;
}
.fed-card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.45s ease;
}
.fed-card-img--hover {
	opacity: 0;
}
.fed-card:hover .fed-card-img--hover {
	opacity: 1;
}
.fed-card-thumb-placeholder {
	background: linear-gradient(135deg, var(--fed-navy), var(--fed-navy-deep));
}
.fed-card-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.fed-card-title {
	font-family: var(--fed-font-heading);
	font-size: 1rem;
	font-weight: 700;
	color: var(--fed-navy);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.2s ease;
}
.fed-card-date {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.8125rem; /* 13px */
	color: var(--fed-ink-soft);
	transition: color 0.2s ease;
}
.fed-card-date .fed-icon {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}
.fed-card-pin {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--fed-bg-soft);
	color: var(--fed-navy);
	font-size: 0.8125rem; /* 13px */
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	line-height: 1;
	transition: background 0.2s ease, color 0.2s ease;
}
.fed-card-pin .fed-icon {
	width: 11px;
	height: 11px;
	fill: currentColor;
}
.fed-card-arrow {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--fed-gray);
	transition: transform 0.2s ease, color 0.2s ease;
}
.fed-card-arrow .fed-icon {
	width: 100%;
	height: 100%;
	fill: none;
}
.fed-card:hover .fed-card-arrow {
	color: var(--fed-red);
	transform: translateX(3px);
}

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

/* Responsive */
@media (max-width: 980px) {
	.fed-filter-toggle {
		display: inline-flex;
	}
	.fed-layout {
		grid-template-columns: 1fr;
	}
	.fed-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		height: 100%;
		width: min(320px, 86vw);
		border: none;
		border-radius: 0;
		padding: 24px 24px;
		overflow-y: auto;
		box-shadow: var(--fed-shadow);
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		z-index: 1001;
	}
	.fed-sidebar.is-open {
		transform: translateX(0);
	}
	.fed-sidebar-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 24px;
		font-family: var(--fed-font-heading);
		font-weight: 700;
		font-size: 1rem;
		color: var(--fed-navy);
	}
	.fed-sidebar-close {
		width: 28px;
		height: 28px;
		display: flex;
		align-items: center;
		justify-content: center;
		background: none;
		border: none;
		color: var(--fed-navy);
		cursor: pointer;
	}
	.fed-sidebar-close .fed-icon {
		width: 14px;
		height: 14px;
	}
	.fed-sidebar-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-sidebar-backdrop.is-open {
		opacity: 1;
		pointer-events: auto;
	}
}
@media (max-width: 480px) {
	.fed-card {
		padding: 12px 14px;
		gap: 12px;
	}
	.fed-card-thumb {
		flex: 0 0 56px;
		width: 56px;
		height: 56px;
	}
	.fed-card-pin {
		display: none;
	}
}
