/*
Theme Name:   Design Enti Italia Child
Description:  Tema Child per Design Comuni Italia, personalizzato per la gestione di altre tipologie di enti pubblici. Rispetta le linee guida di design dell’Agenzia per l’Italia digitale rilasciate dal Team per la Trasformazione Digitale. Utilizza Bootstrap Italia. Sviluppato da Boxxapps
Author:       Boxxapps
Template:     design-enti-wordpress-theme
Version:      1.0.1
License:      AGPL 3.0 or later
Text Domain:  design_comuni_italia
*/

/*------------------------------------------
            STILI EXTRA
--------------------------------------------*/

.alignnone {
	margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
	display: block;
	margin: 5px auto 5px auto;
}

.alignright {
	float: right;
	margin: 5px 0 20px 20px;
}

.alignleft {
	float: left;
	margin: 5px 20px 20px 0;
}

a img.alignright {
	float: right;
	margin: 5px 0 20px 20px;
}

a img.alignnone {
	margin: 5px 20px 20px 0;
}

a img.alignleft {
	float: left;
	margin: 5px 20px 20px 0;
}

a img.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption {
	background: #fff;
	border: 1px solid #f0f0f0;
	max-width: 96%;
	/* Image does not overflow the content area */
	padding: 5px 3px 10px;
	text-align: center;
}

.wp-caption.alignnone {
	margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
	margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
	margin: 5px 0 20px 20px;
}

.wp-caption img {
	border: 0 none;
	height: auto;
	margin: 0;
	max-width: 98.5%;
	padding: 0;
	width: auto;
}

.wp-caption p.wp-caption-text {
	font-size: 11px;
	line-height: 17px;
	margin: 0;
	padding: 0 4px 5px;
}

/* Text meant only for screen readers. */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
	/* Many screen reader and browser combinations announce broken words as they would appear visually. */
}

.screen-reader-text:focus {
	background-color: #eee;
	clip: auto !important;
	clip-path: none;
	color: #444;
	display: block;
	font-size: 1em;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
	/* Above WP toolbar. */
}


.bx-shadow-sm {
	box-shadow: 0.1rem 0.20rem 0.15rem rgba(0, 0, 0, .090) !important;
}

.bx-border-light {
	border: solid 1px #eee !important;
}

.card-text p {
	font-size: 0.9rem !important;
	color: #191919 !important;

	/* Permette il ritorno a capo normale */
	white-space: normal !important;

	/* Gestione delle parole lunghe (es. indirizzi o link) */
	overflow-wrap: anywhere;
	word-wrap: break-word;

	/* Evita che le parole normali vengano spezzate a metà */
	word-break: normal;
	hyphens: none;
}

/* Applica la stessa logica ai link dentro i paragrafi */
.card-text p a {
	display: inline-block;
	/* Aiuta il wrapping nei link */
	max-width: 100%;
	/* Impedisce al link di superare il genitore */
	overflow-wrap: anywhere;
}

ul.column-3 {
	column-count: 3;
	column-width: 200px;
}

.img-cover-h450 {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
}

.alert-gialla {
	background-color: #f8c22e !important;
}

.alert-arancione {
	background-color: #f8931c !important;
}

.alert-arancione a,
.alert-gialla a {
	color: #161616 !important;
}

.alert-rossa {
	background-color: #b10707 !important;
	color: #fff !important;
}

.alert-rossa a {
	color: #fff !important;
}

.alert-image {
	width: 64px;
	height: 64px;
}

.alert-image img {
	width: 56px;
	height: 56px;
}

.cmp-list-card-img-hr .img-fluid.img-responsive {
	width: 100%;
	height: 100%;
	-o-object-fit: cover;
	object-fit: cover;
}

@media (max-width: 991.8px) {
	.cmp-list-card-img-hr .img-fluid.img-responsive.rounded-top {
		border-top-right-radius: 4px !important;
		border-bottom-right-radius: 4px !important;
		border-top-left-radius: unset !important;
		max-height: 160px;
	}
}

@media (min-width: 768px) {
	.cmp-list-card-img-hr .img-fluid.img-responsive {
		height: auto;
		max-height: 160px;
	}

}

.btn-outline-msg-white {
	color: white !important;
	border: solid 2px white !important;
}

.btn-outline-msg-white:hover {
	color: black !important;
	background-color: white !important;
}

.btn-outline-msg-black {
	color: black !important;
	border: solid 1px black !important;
}

.btn-outline-msg-black:hover {
	color: white !important;
	background-color: black !important;
}

/* 1. Assicuriamoci che di default l'invalid feedback nelle checkbox sia nascosto quando validato */
.was-validated fieldset.js-required-checkbox-group .invalid-feedback {
    display: none;
}

.was-validated fieldset.js-required-checkbox-group:has(input:invalid) .invalid-feedback {
    display: block !important; /* Forza la visualizzazione rispetto alle regole native */
    color: #d9364f;            /* Colore errore Design Comuni (text-danger) */
    font-size: 0.875rem;       /* Dimensione feedback standard */
    margin-top: 5px;           /* Spaziatura superiore */
}

/* 3. Spaziatura per i bottoni nella schermata di successo */
.style-gap-3 { 
	gap: 1rem; 
}

/* --------------------------------------
    MODIFICHE AGLI STILI ORIGINALI 
tema child viene caricato dopo tema principale, per la regola cascading di css viene considerato l'ultima classe caricata
-----------------------------------------*/

.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	transform-origin: 0 0;
	/**/
}

/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	user-select: none;
}

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.7);
	margin: 0;
	display: none;
}

/*positio e z-index evitano che l'elemento sotto si sovrapponga e impedisca di premere sui bottoni degli avvisi*/
.home-message.red,
.home-message.red .msg svg {
	background-color: #d1344c;
	color: #fff !important;
	fill: #fff !important;
	position: relative;
	z-index: 1000;
}

.home-message.purple,
.home-message.purple .msg svg {
	background-color: #b21dd0;
	color: #fff !important;
	fill: #fff !important;
	position: relative;
	z-index: 1000;
}

.home-message.green,
.home-message .msg svg {
	background-color: #0e8a5f;
	color: #fff !important;
	fill: #fff !important;
	position: relative;
	z-index: 1000;
}

.home-message.blue,
.home-message.blue .msg svg {
	background-color: #0d00ff;
	color: #fff !important;
	fill: #fff !important;
	position: relative;
	z-index: 1000;
}

.home-message.yellow,
.home-message.yellow .msg svg {
	background-color: #ffcc00;
	color: #333 !important;
	fill: #333 !important;
	position: relative;
	z-index: 1000;
}

.home-message.orange,
.home-message.orange .msg svg {
	background-color: #FF8000;
	color: #333 !important;
	fill: #333 !important;
	position: relative;
	z-index: 1000;
}

.btn-primary.focus,
.btn-primary:focus {
	box-shadow: inset 0 1px 0 hsla(0, 0%, 100%, .15), 0 1px 1px rgba(0, 0, 0, .075), 0 0 0 .25rem rgba(0, 122, 82, .5);
	outline: 2px solid #005a3c;
}

@media(min-width:576px) {

	body dl,
	body ol,
	body p,
	body ul {
		font-size: 1rem;
	}
}

.card-tematico-blu {
	background-color: #003399 !important
}

.card-tematico-indaco {
	background-color: #005e8e !important
}

.card-tematico-verde {
	background-color: #007a52 !important
}

.card-tematico-giallo {
	background-color: #FFBB33 !important
}

.card-tematico-rosso {
	background-color: #CC2929 !important
}

.card-tematico-fucsia {
	background-color: #CC3359 !important
}

/* ============================================================
   CARD PROGETTI
   ============================================================ */

.progetto-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: 1rem;
	overflow: hidden;
	border: 1px solid #e6e9f2;
	border-radius: 8px;
	background: #fff;
	text-align: center;
	transition: box-shadow 0.2s ease;
}

.progetto-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.progetto-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	min-width: 0;
	width: 100%;
	padding: 1.5rem 1rem;
	text-align: center;
}

/* Compatibilità con il precedente markup delle card progetto. */
.progetto-card-img,
.progetto-card .progetto-img-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 90px;
	margin-bottom: 1rem;
	overflow: hidden;
}

.progetto-card-img img,
.progetto-card .progetto-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.progetto-card-title {
	font-size: 0.95rem;
	line-height: 1.3;
}

.progetto-card .progetto-titolo {
	margin-top: auto;
	margin-bottom: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
	line-height: 1.35;
}

.progetto-card .progetto-titolo a {
	text-decoration: underline;
}

.progetti-row {
	display: flex;
	flex-wrap: wrap;
}

.progetti-row > [class*="col-"] {
	display: flex;
}

/* ============================================================
   LOGHI HEADER E FOOTER
   ============================================================ */

/* Brand footer e logo extra. */
.it-footer .it-brand-wrapper {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.it-footer .it-brand-extra-logo {
	order: -1;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
}

.it-footer .footer-extra-logo {
	display: block;
	width: auto;
	height: 48px;
	max-width: 160px;
	object-fit: contain;
}

/* Stemma: proporzioni sempre preservate. */
.stemma-ente-custom {
	display: block;
	width: auto;
	max-width: none;
	flex-shrink: 0;
	object-fit: contain;
}

.it-header-center-wrapper .stemma-ente-custom {
	height: 48px;
	margin-right: 8px;
}

.it-footer .stemma-ente-custom {
	height: 82px;
	max-height: none;
	margin-right: 16px;
}

@media (min-width: 768px) {
	.it-header-center-wrapper .stemma-ente-custom {
		height: 82px;
		margin-right: 16px;
	}
}

@media (max-width: 767.98px) {
	.it-footer .footer-extra-logo {
		height: 40px;
	}
}

/* ============================================================
   FOOTER — LAYOUT E CONTENUTI
   ============================================================ */

.it-footer {
	--cf-footer-row-gap: 2px;
	--cf-footer-line-height: 1.5;
}

.it-footer .cf-footer-grid {
	display: grid;
	grid-template-columns: repeat(var(--cf-footer-grid-columns, 4), minmax(0, 1fr));
	grid-auto-rows: auto;
	grid-auto-flow: row;
	column-gap: 24px;
	row-gap: 1.5rem;
	align-items: start;
}

.it-footer .cf-footer-block {
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Griglie interne condivise da link e testo libero. */
.it-footer .cf-footer-content-grid {
	--bs-gutter-y: 0;
	margin-bottom: 0;
}

.it-footer .cf-footer-content-grid > .col {
	min-width: 0;
	margin: 0;
	padding-top: 0;
	padding-bottom: 0;
}

/* Liste condivise da contatti e link. */
.it-footer .cf-footer-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Riga standard condivisa da contatti, link e testo libero. */
.it-footer .cf-footer-row {
	margin: 0;
	padding: 0;
	line-height: var(--cf-footer-line-height);
}

.it-footer .cf-footer-row + .cf-footer-row {
	margin-top: var(--cf-footer-row-gap);
}

.it-footer .cf-footer-row a {
	line-height: inherit;
}

/* Solo i contatti necessitano del layout icona + testo. */
.it-footer .footer-contact-item {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 28px;
}

.it-footer .footer-contact-item .icon {
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	margin: 0;
}

.it-footer .cf-footer-bottom-row {
	margin-top: 2rem;
}

@media (max-width: 767.98px) {
	.it-footer .cf-footer-grid {
		display: block;
	}

	.it-footer .cf-footer-block {
		margin-bottom: 1.5rem;
	}
}

.dci-back-to-top {
	--dci-back-to-top-bottom: 30px;
	--dci-back-to-top-right: 30px;

	position: fixed;
	right: var(--dci-back-to-top-right);
	bottom: var(--dci-back-to-top-bottom);
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--color-primary, #0066cc);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	color: #fff !important;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition:
		opacity 0.2s ease,
		visibility 0.2s ease,
		transform 0.2s ease,
		background-color 0.2s ease,
		bottom 0.2s ease,
		right 0.2s ease;
}

.dci-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.dci-back-to-top:hover {
	background-color: var(--color-primary-a11, #004d99);
	transform: scale(1.08);
}

.dci-back-to-top:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
	box-shadow:
		0 0 0 5px var(--color-primary-a11, #004d99),
		0 4px 12px rgba(0, 0, 0, 0.2);
}

.dci-back-to-top .icon,
.dci-back-to-top .icon use {
	width: 28px;
	height: 28px;
	margin: 0;
	color: #fff !important;
	fill: #fff !important;
}

@media (max-width: 767.98px) {
	.dci-back-to-top {
		--dci-back-to-top-bottom: 20px;
		--dci-back-to-top-right: 20px;
		width: 52px;
		height: 52px;
	}

	.dci-back-to-top .icon,
	.dci-back-to-top .icon use {
		width: 24px;
		height: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dci-back-to-top {
		transition: none;
	}
}
