/* [federcori-cori] — scoped styles, all .fed-cori-* prefixed */
.fed-cori {
	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-cori *,
.fed-cori *::before,
.fed-cori *::after {
	box-sizing: border-box;
}
.fed-cori img {
	max-width: 100%;
	display: block;
}
.fed-cori-icon {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	fill: currentColor;
}

/* Taxonomy-archive context chip */
.fed-cori-context {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.fed-cori-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-cori-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-cori-context-clear:hover {
	color: var(--fed-red-dark);
	text-decoration: underline;
}
.fed-cori-context-clear .fed-cori-icon {
	width: 10px;
	height: 10px;
}

/* Toolbar — separate from the filter topbar (desktop and mobile alike): the topbar is
   off-canvas on mobile, so the count/type-toggle/filter-trigger live in their own
   always-visible card instead, styled to match the topbar's background/border/shadow. */
.fed-cori-toolbar {
	display: flex;
	align-items: flex-start;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px 20px;
	background: var(--fed-white);
	border: 1px solid var(--fed-line);
	border-radius: var(--fed-radius);
	padding: 16px 24px;
	box-shadow: var(--fed-shadow);
	margin-bottom: 48px;
}

/* Type toggle */
.fed-cori-types {
	display: inline-flex;
	border: 1.5px solid var(--fed-line);
	border-radius: 12px;
	overflow: hidden;
	background: var(--fed-white);
}
.fed-cori-type {
	padding: 11px 22px;
	border: none;
	background: none;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--fed-gray);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.fed-cori-type + .fed-cori-type {
	border-left: 1.5px solid var(--fed-line);
}
.fed-cori-type.is-active {
	background: var(--fed-navy);
	color: var(--fed-white);
}

/* Boxed-digit count */
.fed-cori-count {
	flex: none;
}
.fed-cori-count-num {
	display: inline-flex;
	gap: 4px;
}
.fed-cori-digit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 34px;
	border: 1px solid var(--fed-line);
	border-radius: 5px;
	font-family: var(--fed-font-heading);
	font-weight: 800;
	font-size: 1.1rem;
	color: var(--fed-navy);
}
.fed-cori-count-label {
	display: block;
	margin-top: 8px;
	font-size: 0.8125rem;
	color: var(--fed-gray);
}

/* Search */
.fed-cori-search {
	position: relative;
	flex: 1 1 240px;
	min-width: 180px;
}
.fed-cori-search .fed-cori-icon-search {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	width: 14px;
	height: 14px;
	color: var(--fed-gray);
}
.fed-cori-search-input {
	width: 100%;
	padding: 11px 14px 11px 36px;
	border: 1.5px solid var(--fed-line);
	border-radius: 10px;
	font: inherit;
	font-size: 0.875rem;
	color: var(--fed-ink);
	background: var(--fed-white);
}
.fed-cori-search-input:focus {
	outline: none;
	border-color: var(--fed-navy);
}
.fed-cori-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;
	font-weight: 600;
	color: var(--fed-ink);
	cursor: pointer;
}
.fed-cori-filter-toggle .fed-cori-icon {
	width: 14px;
	height: 14px;
}

/* Layout — a top bar (search + facets + reset) above the results on desktop; becomes an
   off-canvas panel on mobile (see the responsive block), same behavior/breakpoint as
   [federcori-events] and [federcori-festivals]. */
.fed-cori-layout {
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.fed-cori-topbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px 20px;
	background: var(--fed-white);
	border: 1px solid var(--fed-line);
	border-radius: var(--fed-radius);
	padding: 16px 24px;
	box-shadow: var(--fed-shadow);
	color: var(--fed-ink);
}
.fed-cori-topbar-head {
	display: none;
}
.fed-cori-backdrop {
	display: none;
}
.fed-cori-results {
	min-width: 0;
}

/* Filters — label stacked above the chips, not vertical-centered beside them (a short
   label centered next to a chip row that wraps to 2+ lines reads off-balance). */
.fed-cori-facet {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
}
.fed-cori-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;
}

/* Date range */
.fed-cori-range {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.fed-cori-range-field {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 12px;
	border: 1px solid var(--fed-line);
	border-radius: 10px;
	cursor: pointer;
}
.fed-cori-range-field:focus-within {
	border-color: var(--fed-navy);
}
.fed-cori-range-label {
	font-family: var(--fed-font-body);
	font-weight: 700;
	font-size: 0.8125rem;
	color: var(--fed-gray);
}
.fed-cori-range-field input[type='date'] {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	font: inherit;
	font-size: 0.875rem;
	color: var(--fed-navy);
	padding: 0;
}
.fed-cori-range-field input[type='date']:focus {
	outline: none;
}

/* Modalità chips */
.fed-cori-check-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.fed-cori-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-cori-check-row .fed-cori-icon {
	width: 12px;
	height: 12px;
}
.fed-cori-check-row input[type='checkbox'],
.fed-cori-check-row input[type='radio'] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}
.fed-cori-check-row:has(input:checked) {
	background: var(--fed-navy);
	border-color: var(--fed-navy);
	color: var(--fed-white);
}
.fed-cori-check-row:has(input:focus-visible) {
	outline: 2px solid var(--fed-navy);
	outline-offset: 2px;
}

.fed-cori-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-cori-reset:hover {
	color: var(--fed-red-dark);
	text-decoration: underline;
}

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

/* Card */
.fed-cori-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-cori-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-cori-card > * {
	position: relative;
	z-index: 1;
}
.fed-cori-photo {
	position: relative;
	aspect-ratio: 16 / 9; /* fixed on every device — not overridden at any breakpoint */
	background: linear-gradient(150deg, #2a2c5c, var(--fed-navy-deep));
	overflow: hidden;
}
.fed-cori-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-cori-img--ph {
	display: flex;
	align-items: center;
	justify-content: center;
}
.fed-cori-img--ph .fed-cori-icon {
	width: 46px;
	height: 46px;
	color: rgba(255, 255, 255, 0.22);
}
.fed-cori-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 15px 16px 17px;
	flex: 1;
}
.fed-cori-title {
	font-family: var(--fed-font-heading);
	font-weight: 700;
	font-size: 1rem;
	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-cori-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-cori-meta {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding-top: 2px;
}
.fed-cori-line {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 1rem;
	color: var(--fed-ink-soft);
	line-height: 1.3;
	transition: color 0.2s ease;
}
.fed-cori-line .fed-cori-icon {
	width: 11px;
	height: 11px;
	fill: currentColor;
	color: var(--fed-gray);
	transition: color 0.2s ease;
}
.fed-cori-tag {
	margin-top: auto;
	align-self: flex-start;
	max-width: 100%;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	background: var(--fed-bg-soft);
	color: var(--fed-navy);
	transition: background 0.2s ease, color 0.2s ease;
}
.fed-cori-card--score .fed-cori-body {
	gap: 9px;
	padding: 18px 18px 20px;
	min-height: 150px;
}

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

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

/* Responsive */
@media (max-width: 1180px) {
	.fed-cori-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 980px) {
	.fed-cori-filter-toggle {
		display: inline-flex;
	}
	.fed-cori-topbar {
		position: fixed;
		top: 0;
		left: 0;
		height: 100%;
		width: min(320px, 86vw);
		flex-direction: column;
		align-items: stretch;
		flex-wrap: nowrap;
		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-cori-topbar.is-open {
		transform: translateX(0);
	}
	.fed-cori-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-cori-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-cori-topbar-close .fed-cori-icon {
		width: 14px;
		height: 14px;
	}
	.fed-cori-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-cori-backdrop.is-open {
		opacity: 1;
		pointer-events: auto;
	}
	/* .fed-cori-search's flex-basis/grow are meant for the desktop row layout — in the
	   off-canvas panel's column layout that basis becomes a HEIGHT hint, so without this
	   reset the search box stretches to fill the panel and its centered icon ends up
	   floating in the empty space below the input. */
	.fed-cori-search {
		flex: none;
	}
	.fed-cori-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 768px) {
	.fed-cori-grid {
		grid-template-columns: 1fr;
	}
}
