/* Stili condivisi dei widget CFL. Classi con prefisso .cfl- */

/* ---------- cfl-logo-carousel ---------- */
.cfl-logo-carousel {
	--cfl-lc-duration: 30s;
	--cfl-lc-card-width: 295px;
	--cfl-lc-card-height: 102px;
	--cfl-lc-gap: 19px;
	--cfl-lc-accent: #007b81;
	--cfl-lc-toggle-bg: #4cf3c1;
	--cfl-lc-toggle-color: #033540;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
}

.cfl-logo-carousel__viewport {
	width: 100%;
	overflow: hidden;
	/* spazio per l'ombra delle card */
	padding: 4px 0 8px;
}

.cfl-logo-carousel__track {
	display: flex;
	gap: var(--cfl-lc-gap);
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
	animation: cfl-lc-scroll var(--cfl-lc-duration) linear infinite;
}

.cfl-logo-carousel.is-paused .cfl-logo-carousel__track,
.cfl-logo-carousel__viewport:hover .cfl-logo-carousel__track,
.cfl-logo-carousel__viewport:focus-within .cfl-logo-carousel__track {
	animation-play-state: paused;
}

/* Metà traccia + metà gap: la seconda copia prende esattamente il posto della prima */
@keyframes cfl-lc-scroll {
	to { transform: translateX(calc(-50% - var(--cfl-lc-gap) / 2)); }
}

.cfl-logo-carousel__item {
	flex: 0 0 auto;
	margin: 0;
}

.cfl-logo-carousel__card {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--cfl-lc-card-width);
	height: var(--cfl-lc-card-height);
	padding: 16px 40px;
	background: #fff;
	border: 1px solid transparent;
	border-radius: 6px;
	box-shadow: 0 4px 4px rgba(180, 180, 180, 0.25);
	transition: border-color 0.2s ease;
}

a.cfl-logo-carousel__card:hover,
a.cfl-logo-carousel__card:focus-visible,
span.cfl-logo-carousel__card:hover {
	border-color: var(--cfl-lc-accent);
}

a.cfl-logo-carousel__card:focus-visible {
	outline: 2px solid var(--cfl-lc-accent);
	outline-offset: 2px;
}

.cfl-logo-carousel__card img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	mix-blend-mode: multiply;
}

/* Selettori doppi: battono il reset dei <button> del tema (Hello) */
.cfl-logo-carousel .cfl-logo-carousel__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--cfl-lc-toggle-bg);
	color: var(--cfl-lc-toggle-color);
	cursor: pointer;
}

.cfl-logo-carousel .cfl-logo-carousel__toggle:hover,
.cfl-logo-carousel .cfl-logo-carousel__toggle:focus {
	background: var(--cfl-lc-toggle-bg);
	color: var(--cfl-lc-toggle-color);
}

.cfl-logo-carousel .cfl-logo-carousel__toggle:focus-visible {
	outline: 2px solid var(--cfl-lc-toggle-color);
	outline-offset: 3px;
}

/* Icona pausa: due barre outline (come da design) */
.cfl-logo-carousel__icon {
	display: block;
	flex: 0 0 auto;
	position: relative;
	width: 21px;
	height: 28px;
}

.cfl-logo-carousel__icon::before,
.cfl-logo-carousel__icon::after {
	content: "";
	position: absolute;
	top: 0;
	box-sizing: border-box;
	width: 8px;
	height: 28px;
	border: 2.5px solid currentColor;
}

.cfl-logo-carousel__icon::before { left: 0; }
.cfl-logo-carousel__icon::after { right: 0; }

/* Icona play */
.cfl-logo-carousel.is-paused .cfl-logo-carousel__icon::after { display: none; }
.cfl-logo-carousel.is-paused .cfl-logo-carousel__icon::before {
	left: 4px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 14px 0 14px 20px;
	border-color: transparent transparent transparent currentColor;
}

@media (max-width: 767px) {
	.cfl-logo-carousel .cfl-logo-carousel__toggle { width: 56px; height: 56px; }
	.cfl-logo-carousel__icon { transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
	.cfl-logo-carousel__track { animation-play-state: paused; }
}

/* ---------- cfl-project-card ---------- */
.cfl-project-card {
	--cfl-pc-radius: 10px;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-sizing: border-box;
	min-height: 584px;
	height: 100%;
	padding: 21px 11px;
	overflow: hidden;
	border-radius: var(--cfl-pc-radius);
	background: #033540;
	color: #fff;
	font-family: "Lato", sans-serif;
	isolation: isolate;
}

/* Selettore doppio: batte ".elementor img { height: auto }" */
.cfl-project-card .cfl-project-card__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

.cfl-project-card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	/* Velo della foto: trasparente fino al 25%, #033540 al 90% al 50%, pieno dal 54%. */
	background: linear-gradient(to bottom, rgba(102, 102, 102, 0) 25%, rgba(3, 53, 64, 0.9) 50%, #033540 54%);
}

.cfl-project-card__top {
	order: -1;   /* nel markup è dopo il corpo della card (ordine di lettura), a video in alto */
	display: flex;
	justify-content: flex-end;
}

.cfl-project-card__sdg {
	display: flex;
	gap: 11px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cfl-project-card__sdg img,
.cfl-project-card__sdg-fallback {
	display: block;
	width: 42px;
	height: 42px;
}

.cfl-project-card__sdg-fallback {
	color: #fff;
	font: 900 18px/42px "Montserrat", sans-serif;
	text-align: center;
}

.cfl-project-card__body {
	display: flex;
	flex-direction: column;
	gap: 21px;
	padding: 0 10px;
}

.cfl-project-card__heading {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.cfl-project-card .cfl-project-card__ente {
	margin: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	text-transform: uppercase;
	color: #fff;
}

.cfl-project-card .cfl-project-card__title {
	margin: 0;
	font-family: "Lato", sans-serif;
	font-size: 19px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: #fff;
}

.cfl-project-card__progress {
	position: relative;
	height: 14px;
	border-radius: 7px;
	background: #e7e7e7;
}

.cfl-project-card__progress span {
	position: absolute;
	top: 2px;
	left: 2px;
	height: 10px;
	max-width: calc(100% - 4px);
	border-radius: 5px;
	background: #43dbcc;
}

.cfl-project-card__box {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 21px 14px;
	border: 1px solid #4cf3c1;
	border-radius: 7px;
}

.cfl-project-card__numbers {
	display: flex;
	flex: 1 1 50%;
	flex-direction: column;
	gap: 21px;
	color: #f5f6f5;
	font-size: 16px;
	line-height: 1.2;
}

.cfl-project-card__numbers p {
	margin: 0;
}

.cfl-project-card__numbers strong {
	font-weight: 800;
	letter-spacing: -0.02em;
}

.cfl-project-card__actions {
	display: flex;
	flex: 1 1 50%;
	flex-direction: column;
	gap: 21px;
}

.cfl-project-card .cfl-project-card__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 9px 10px;
	border: 1px solid #fff;
	border-radius: 20px;
	font: 700 12px/1.2 "Montserrat", sans-serif;
	text-transform: uppercase;
	text-decoration: none;
	color: #fff;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cfl-project-card .cfl-project-card__btn--primary {
	border-color: #007b81;
	background: #4cf3c1;
	color: #3b3c3b;
}

.cfl-project-card .cfl-project-card__btn:hover,
.cfl-project-card .cfl-project-card__btn:focus-visible {
	background: #fff;
	color: #033540;
}

.cfl-project-card .cfl-project-card__btn:focus-visible {
	outline: 2px solid #4cf3c1;
	outline-offset: 2px;
}

/* Variante compatta (raccolte concluse) */
.cfl-project-card--compact {
	--cfl-pc-radius: 7px;
	min-height: 374px;
	padding: 15px 8px;
}

/* Nel design le foto delle card compatte sono inquadrate sul lato sinistro */
.cfl-project-card--compact .cfl-project-card__image { object-position: 10% center; }
.cfl-project-card .cfl-project-card__image--placeholder { object-position: center top; }

.cfl-project-card--compact .cfl-project-card__sdg { gap: 8px; }

.cfl-project-card--compact .cfl-project-card__sdg img,
.cfl-project-card--compact .cfl-project-card__sdg-fallback {
	width: 31px;
	height: 31px;
	font-size: 13px;
	line-height: 31px;
}

.cfl-project-card--compact .cfl-project-card__body {
	gap: 16px;
	padding: 0 7px;
}

.cfl-project-card--compact .cfl-project-card__heading { gap: 5px; }
.cfl-project-card--compact .cfl-project-card__ente { font-size: 14px; }
.cfl-project-card--compact .cfl-project-card__title { font-size: 16px; }

.cfl-project-card--compact .cfl-project-card__box {
	justify-content: space-between;
	padding: 15px 10px;
	border-radius: 5px;
}

.cfl-project-card__status {
	flex: 1 1 auto;
	margin: 0;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 800;
	color: #f5f6f5;
}

.cfl-project-card--compact .cfl-project-card__btn {
	flex: 0 1 143px;
	min-width: 0;
	white-space: nowrap;
	padding: 7px 10px;
	border-radius: 62px;
}

/* ---------- Pannelli apribili (.cfl-collapsible + pulsante con classe cfl-toggle) ---------- */
.cfl-collapsible:not(.is-open) { display: none; }
.elementor-editor-active .cfl-collapsible { display: flex !important; }

/* Numero di filtri attivi nel pulsante "Filtra" (cfl-widgets.js, initFilterCount) */
.cfl-toggle .cfl-toggle__count {
	font-weight: 700;
	color: var(--e-global-color-accent, #007B81);
}

.cfl-toggle .cfl-toggle__count[hidden] {
	display: none;
}

/* Filtro progetti (Taxonomy Filter con classe cfl-filter): i nomi lunghi (iniziative, partner)
   vanno a capo invece di essere tagliati su schermi stretti */
.elementor-widget-taxonomy-filter.cfl-filter .e-filter-item {
	flex-shrink: 1;
	max-width: 100%;
	white-space: normal;
	text-align: start;
}

/* Voce selezionata in grassetto (il widget non ha una tipografia per lo stato attivo) */
.elementor-widget-taxonomy-filter.cfl-filter .e-filter-item[aria-pressed="true"] {
	font-weight: 700;
}

/* "Azzera filtri" (pannello filtri progetti): link-pulsante sotto i gruppi, solo con filtri attivi.
   Selettori doppi: il reset dei <button> di Hello sovrascrive bordi e sfondi */
.cfl-filter-reset.cfl-filter-reset {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	padding: 4px 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-family: var(--e-global-typography-cflsmall-font-family, "Lato"), sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: var(--e-global-color-accent, #007B81);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.cfl-filter-reset.cfl-filter-reset::before {
	content: "\2715";   /* × */
	content: "\2715" / "";
	font-size: 12px;
	text-decoration: none;
}

.cfl-filter-reset.cfl-filter-reset:hover,
.cfl-filter-reset.cfl-filter-reset:focus {
	background: none;
	color: var(--e-global-color-primary, #033540);
}

.cfl-filter-reset.cfl-filter-reset:focus-visible {
	outline: 3px solid var(--e-global-color-accent, #007B81);
	outline-offset: 3px;
}

.cfl-filter-reset[hidden] {
	display: none;
}

/* ---------- FAQ Search (cfl-faq-search) ---------- */
.cfl-faq-search {
	--cfl-fs-color: var(--e-global-color-primary, #033540);
	margin: 0;
}

.cfl-faq-search .cfl-faq-search__label {
	display: block;
	margin-bottom: 8px;
	font-family: var(--e-global-typography-cflsmall-font-family, "Lato"), sans-serif;
	font-weight: 600;
	font-size: 16px;
	color: var(--cfl-fs-color);
}

.cfl-faq-search .cfl-faq-search__field {
	display: flex;
	align-items: stretch;
	border: 2px solid var(--e-global-color-accent, #007B81);
	border-radius: 30px;
	background: #fff;
	overflow: hidden;
}

.cfl-faq-search .cfl-faq-search__field:focus-within {
	outline: 3px solid var(--e-global-color-secondary, #4CF3C1);
	outline-offset: 2px;
}

.cfl-faq-search .cfl-faq-search__input.cfl-faq-search__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 48px;
	padding: 10px 24px;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-family: var(--e-global-typography-text-font-family, "Lato"), sans-serif;
	font-size: 16px;
	color: #1C1C1C;
	outline: 0;
}

.cfl-faq-search .cfl-faq-search__input::placeholder {
	color: #6E6E6E;
	opacity: 1;
}

.cfl-faq-search .cfl-faq-search__button.cfl-faq-search__button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	padding: 10px 28px;
	border: 0;
	border-radius: 0 30px 30px 0;
	background: var(--e-global-color-primary, #033540);
	color: #fff;
	font-family: var(--e-global-typography-accent-font-family, "Montserrat"), sans-serif;
	font-weight: 700;
	font-size: 16px;
	text-transform: uppercase;
	cursor: pointer;
}

.cfl-faq-search .cfl-faq-search__button.cfl-faq-search__button:hover {
	background: var(--e-global-color-accent, #007B81);
}

.cfl-faq-search .cfl-faq-search__status {
	margin: 12px 0 0;
	font-size: 16px;
	color: var(--cfl-fs-color);
}

.cfl-faq-search .cfl-faq-search__status:empty {
	display: none;
}

/* Variante su sfondo scuro */
.cfl-faq-search--dark .cfl-faq-search {
	--cfl-fs-color: #fff;
}

.cfl-faq-search--dark .cfl-faq-search .cfl-faq-search__field {
	border-color: #fff;
}

.cfl-faq-search--dark .cfl-faq-search .cfl-faq-search__button.cfl-faq-search__button {
	background: var(--e-global-color-secondary, #4CF3C1);
	color: var(--e-global-color-primary, #033540);
}

.cfl-faq-search--dark .cfl-faq-search .cfl-faq-search__button.cfl-faq-search__button:hover {
	background: #fff;
}

@media (max-width: 480px) {
	.cfl-faq-search .cfl-faq-search__button.cfl-faq-search__button { padding: 10px 18px; }
	.cfl-faq-search .cfl-faq-search__button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Voci e gruppi nascosti dalla ricerca (il widget accordion imposta display:flex sulle voci) */
.cfl-faq [hidden] {
	display: none !important;
}
