/**
 * Override Comuni-theme greens with Designers Italia “Blu Italia” (#0066CC).
 */

:root {
	--bs-primary: #0066cc !important;
	--bs-primary-rgb: 0, 102, 204 !important;
	--bs-link-color: #0066cc !important;
	--bs-link-hover-color: #004d99 !important;
	--bs-breadcrumb-divider-color: #5c6f82 !important;
	--bs-breadcrumb-item-active-color: #262626 !important;
}

/* Slim bar (top) */
.it-header-wrapper .it-header-slim-wrapper,
.it-header-slim-wrapper {
	background-color: #003366 !important;
}

.it-header-slim-wrapper .it-header-slim-wrapper-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.it-header-slim-wrapper .apsp-slim-phone {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem 0.75rem;
	padding: 0.35rem 0.85rem;
	border-radius: 4px;
	color: #fff !important;
	text-decoration: none !important;
	font-size: 0.875rem;
	line-height: 1.3;
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.35);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.it-header-slim-wrapper .apsp-slim-phone:hover,
.it-header-slim-wrapper .apsp-slim-phone:focus {
	background-color: #0059b3 !important;
	border-color: #fff !important;
	color: #fff !important;
	text-decoration: none !important;
}

.it-header-slim-wrapper .apsp-slim-phone__label {
	font-weight: 400;
	opacity: 0.9;
}

.it-header-slim-wrapper .apsp-slim-phone__number {
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* Brand band (logo + title) */
.it-header-wrapper .it-header-center-wrapper,
.it-header-center-wrapper {
	background-color: #0066cc !important;
}

.it-header-center-wrapper .it-brand-wrapper a,
.it-header-center-wrapper .it-brand-title,
.it-header-center-wrapper .it-brand-tagline {
	color: #fff !important;
}

/* Main navigation bar — full width on wrapper; inner .navbar stays transparent (see apsp-header-nav.css) */
.it-header-wrapper .it-header-navbar-wrapper,
.it-header-navbar-wrapper {
	width: 100%;
	max-width: 100%;
	background-color: #0066cc !important;
}

@media (min-width: 992px) {
	.it-header-wrapper .it-header-navbar-wrapper,
	.it-header-navbar-wrapper {
		background-color: #0066cc !important;
	}
}

.it-header-navbar-wrapper .nav-link,
.it-header-navbar-wrapper .navbar-nav > li > a,
.it-header-navbar-wrapper nav a {
	color: #fff !important;
}

.it-header-navbar-wrapper .nav-link:hover,
.it-header-navbar-wrapper .nav-link:focus,
.it-header-navbar-wrapper .nav-link.active {
	color: #fff !important;
	opacity: 0.9;
}

/* Breadcrumbs */
.breadcrumb-container .breadcrumb,
.breadcrumb-container .breadcrumb a,
.breadcrumb .breadcrumb-item a {
	color: #5c6f82 !important;
}

.breadcrumb .breadcrumb-item.active {
	color: #262626 !important;
}

/* Buttons & links site-wide */
.btn-primary {
	--bs-btn-bg: #0066cc;
	--bs-btn-border-color: #0066cc;
	--bs-btn-hover-bg: #004d99;
	--bs-btn-hover-border-color: #004d99;
}

.text-primary,
.t-primary {
	color: #0066cc !important;
}

.icon-primary,
.icon.icon-primary {
	fill: #0066cc !important;
	color: #0066cc !important;
}

/* Body/content links only — footer keeps theme light-on-dark colors */
main a:not(.nav-link):not(.btn):not(.apsp-section-card__link),
.apsp-comuni-page .entry-content a {
	color: var(--bs-link-color);
}

/* Footer: white links on dark grey band (override global link blue) */
.it-footer,
.it-footer-main,
.it-footer-small-prints {
	--bs-link-color: #fff;
	--bs-link-hover-color: #fff;
}

.it-footer a,
.it-footer-main a,
.it-footer-small-prints a,
.it-footer .footer-list a,
.it-footer .footer-list li a,
.it-footer .footer-bottom a,
.it-footer .footer-info a,
.it-footer .footer-info a.list-item,
.it-footer .link-list-wrapper a {
	color: #fff !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.it-footer a:hover,
.it-footer a:focus-visible,
.it-footer-main a:hover,
.it-footer .footer-list a:hover,
.it-footer .footer-bottom a:hover,
.it-footer .footer-info a:hover {
	color: #fff !important;
	opacity: 0.9;
	text-decoration: underline;
}

.it-footer .apsp-footer-pec-link,
.it-footer .apsp-footer-pec-link:hover {
	color: #fff !important;
}

/* Feedback / blocks that use Comuni green */
.it-header-block-title,
.cmp-rating,
.bg-primary {
	background-color: #0066cc !important;
}

/* AT sidebar — Blu Italia (#0066CC), not Comuni green (#007a52 hardcoded in bootstrap-italia-comuni) */
.apsp-at-comuni-nav {
	--apsp-at-menu-active: #0066cc;
	--apsp-at-menu-active-bg: rgba(0, 102, 204, 0.08);
}

/* Titolo accordion "Amministrazione Trasparente" */
.apsp-at-comuni-nav .accordion-header .accordion-button,
.apsp-at-comuni-nav .accordion-header .accordion-button:not(.collapsed),
.apsp-at-comuni-nav .accordion-header .accordion-button:hover,
.apsp-at-comuni-nav .accordion-header .accordion-button:focus {
	color: #0066cc !important;
	background-color: transparent !important;
	border-top-color: var(--bs-gray-200, #e6e6e6) !important;
	box-shadow: none !important;
}

.apsp-at-comuni-nav .accordion-header .accordion-button .icon {
	fill: #0066cc !important;
	color: #0066cc !important;
}

/* Sidebar AT — mai sottolineatura; barra solo su voce corrente L1 */
.apsp-at-comuni-nav .link-list .nav-link,
.apsp-at-comuni-nav .link-list .nav-link span,
.apsp-at-comuni-nav .link-list-wrapper ul li a,
.apsp-at-comuni-nav .link-list-wrapper ul li a span {
	text-decoration: none !important;
}

.apsp-at-comuni-nav .link-list > .nav-item.active > .nav-link.active,
.apsp-at-comuni-nav.navbar.it-navscroll-wrapper .link-list-wrapper > ul.link-list > li.active > a.active {
	border-left: 3px solid #0066cc !important;
	color: #0066cc !important;
	background: rgba(0, 102, 204, 0.06) !important;
}

.apsp-at-comuni-nav .link-list > .nav-item.ancestor > .nav-link {
	color: #0066cc !important;
	border-left-color: transparent !important;
	background: transparent !important;
}

/* L2/L3 attivi: barra laterale + alberatura (non annullare border-left) */
.apsp-at-comuni-nav .link-list-nested .nav-item.active > .nav-link.active,
.apsp-at-comuni-nav .link-list-nested .nav-link.active,
.apsp-at-comuni-nav .apsp-at-tree-item-level-2.active > .nav-link.active,
.apsp-at-comuni-nav .apsp-at-tree-item-level-3.active > .nav-link.active {
	border-left: 3px solid #0066cc !important;
	color: #0066cc !important;
	background: rgba(0, 102, 204, 0.08) !important;
}

.apsp-at-comuni-nav .link-list-nested.apsp-at-tree-level-2,
.apsp-at-comuni-nav .link-list-nested.apsp-at-tree-level-3 {
	border-left-color: #737373 !important;
	border-left-width: 2px !important;
}

.apsp-at-comuni-nav .nav-item.ancestor > .link-list-nested.apsp-at-tree-level-2,
.apsp-at-comuni-nav .nav-item.ancestor > .link-list-nested.apsp-at-tree-level-3,
.apsp-at-comuni-nav .link-list-nested.apsp-at-tree-level-2:has(> .nav-item.active),
.apsp-at-comuni-nav .link-list-nested.apsp-at-tree-level-3:has(> .nav-item.active),
.apsp-at-comuni-nav .link-list-nested.apsp-at-tree-level-2:has(> .nav-item.ancestor),
.apsp-at-comuni-nav .link-list-nested.apsp-at-tree-level-3:has(> .nav-item.ancestor) {
	border-left-color: #0066cc !important;
}

.apsp-at-comuni-nav .link-list-wrapper ul li a span,
.apsp-at-comuni-nav .link-list-wrapper.menu-link-list ul li a span {
	color: inherit !important;
	text-decoration: none !important;
}

/* Hub sezioni AT + documenti: .t-primary / .icon-primary del tema Comuni */
body.apsp-at-page .apsp-at-root-sections .card-title.t-primary,
body.apsp-at-page .cmp-icon-link-list.apsp-documents .t-primary,
body.apsp-at-page .cmp-icon-link-list.apsp-documents .icon-primary {
	color: #0066cc !important;
	fill: #0066cc !important;
}

/* Ensure logo visible on brand band */
.it-header-center-wrapper .site-logo {
	display: block;
	margin-right: 12px;
}
