/**
 * CTA — shortcode [cta], widget sidebar, legacy #cta negli articoli.
 */

/* -------------------------------------------------------------------------
 * Pulsante: sempre verde (ignora ACF button_color / classi *-bkg)
 * ------------------------------------------------------------------------- */
.widget.cta .btn,
.single-article-text #cta a {
	background-color: #159848 !important;
	color: #fefefe !important;
	border: 2px solid transparent!important;
	transition:
		background-color 0.2s ease 0s,
		color 0.2s ease 0s,
		border-color 0.2s ease 0s;
}

.widget.cta .btn:hover,
.single-article-text #cta a:hover,
.single-article-text .widget.cta .btn:hover,
.single-article-text .widget.cta .btn:focus-visible {
	background-color: #ffffff !important;
	color: #159848 !important;
	border: 2px solid #159848 !important;
}

/* -------------------------------------------------------------------------
 * Struttura comune (.widget.cta)
 * ------------------------------------------------------------------------- */
.widget.cta {
	margin: 40px 0;
}

.widget.cta .cta-inner {
	max-width: 100%;
}

.widget.cta .cta-id {
	width: 100%;
	margin: 0;
	text-align: center;
}

.widget.cta h3,
.widget.cta .cta-title {
	margin: 0 0 0.5rem;
	padding: 0;
	font-weight: 700;
}

.widget.cta .cta-subtitle {
	margin: 0 0 0.75rem;
}

.widget.cta .cta-text {
	width: 80%;
	margin: 0 auto 1rem;
}

.widget.cta .cta-action {
	margin: 0;
}
.widget.cta .cta-action a{
	border-radius: 12px;
}

.widget.cta .btn {
	font-weight: bold;
	padding: 8px 28px;
	margin: 0 auto;
	display: inline-block;
	text-align: center !important;
	text-decoration: none;
}

.widget.cta .cta-text + .cta-action {
	margin-top: 10px;
}

.widget.cta.cta-left,
.widget.cta.cta-left * {
	text-align: left;
}

.widget.cta.cta-center,
.widget.cta.cta-center * {
	text-align: center;
}

.widget.cta.cta-left .cta-id,
.widget.cta.cta-center .cta-id {
	text-align: center;
}

/* -------------------------------------------------------------------------
 * Articoli — stile hero (legacy #cta + shortcode .widget.cta)
 * ------------------------------------------------------------------------- */
.single-article-text #cta,
.single-article-text .widget.cta {
	background-color: var(--color-content-bg-alt) !important;
	border: none !important;
	padding-top: 100px !important;
	padding-bottom: 100px !important;
	margin: 40px 0 !important;
	position: relative;
	background-image: url('/wp-content/uploads/2026/04/cartello-icona-sfondo-bianca.svg');
	background-repeat: no-repeat;
	background-position: bottom left;
	background-size: 25%;
}

.single-article-text #cta p,
.single-article-text .widget.cta p,
.single-article-text .widget.cta .cta-text {
	font-size: var(--font-m) !important;
}

.single-article-text #cta p:not(:last-child),
.single-article-text .widget.cta p:not(:last-child) {
	margin-bottom: 40px;
}

.single-article-text .widget.cta p.cta-id {
	margin-bottom: 20px !important;
}

.single-article-text .widget.cta .cta-text {
	margin-bottom: 40px;
}

.single-article-text #cta h2,
.single-article-text .widget.cta h2,
.single-article-text .widget.cta h3,
.single-article-text .widget.cta .cta-title {
	font-size: var(--font-xl) !important;
	font-weight: 700;
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.single-article-text #cta a,
.single-article-text .widget.cta a,
.single-article-text .widget.cta .btn {
	font-size: var(--font-s) !important;
}

/* -------------------------------------------------------------------------
 * Sidebar
 * ------------------------------------------------------------------------- */
#secondary .widget.cta {
	margin: 20px 0;
	border: 1px solid #bfbfbf;
	border-width: 1px 0;
	padding: 25px 0;
	background-image: none;
	background-color: transparent;
}

#secondary .widget:first-child {
	margin-top: 0 !important;
}

/* -------------------------------------------------------------------------
 * Homepage (.mod-cta_id)
 * ------------------------------------------------------------------------- */
.mod-cta_id h3 {
	background: transparent;
}

.mod-cta_id .widget.cta {
	margin: 0;
}

@media (min-width: 992px) {
	.mod-cta_id p {
		max-width: 60%;
	}

	.mod-cta_id .cta-center p {
		max-width: 60%;
		margin-left: auto;
		margin-right: auto;
	}
}

/* -------------------------------------------------------------------------
 * Accessibilità
 * ------------------------------------------------------------------------- */
.widget.cta .btn:focus-visible,
.single-article-text #cta .btn:focus-visible {
	outline: 2px solid #222222;
	outline-offset: 2px;
}

.widget.cta .btn:focus:not(:focus-visible),
.single-article-text #cta .btn:focus:not(:focus-visible) {
	outline: none;
}

/* -------------------------------------------------------------------------
 * Responsive — titoli CTA negli articoli
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.single-article-text #cta h2,
	.single-article-text .widget.cta h2,
	.single-article-text .widget.cta h3,
	.single-article-text .widget.cta .cta-title {
		font-size: var(--h1) !important;
	}
}
