/**
 * Lou Lindal - Custom Styles
 * Brand Guidelines compliant + Bootstrap Italia overrides
 * WCAG 2.1 AA accessible
 */

/* ==========================================================================
   CSS Custom Properties (Brand Colors)
   ========================================================================== */

:root {
  /* Colori primari */
  --lou-verde-scuro: #22563b;
  --lou-verde-lime: #C4D320;

  /* Colori ausiliari */
  --lou-turchese: #0093b2;
  --lou-verde-acqua: #00857d;
  --lou-viola: #43226d;
  --lou-arancione: #ff6f41;

  /* Grigi caldi */
  --lou-grigio-scuro: #5A4F47; /* WCAG 1.4.6 AAA: contrasto 7.88:1 su bianco (era 5.68:1 AA con #6E6259) */
  --lou-grigio-medio: #857B72;
  --lou-grigio-chiaro: #CBC4BC;

  /* Neutri */
  --lou-bianco: #ffffff;
  --lou-nero: #000000;

  /* Font families - Brand Guidelines: Helvetica (titoli), Atkinson Hyperlegible (testi) */
  --lou-font-titoli: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --lou-font-testi: 'Atkinson Hyperlegible', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Spacing */
  --lou-spacing-xs: 0.25rem;
  --lou-spacing-sm: 0.5rem;
  --lou-spacing-md: 1rem;
  --lou-spacing-lg: 1.5rem;
  --lou-spacing-xl: 2rem;
  --lou-spacing-xxl: 3rem;

  /* Border radius */
  --lou-radius-sm: 4px;
  --lou-radius-md: 8px;
  --lou-radius-lg: 16px;

  /* Transitions */
  --lou-transition: 0.3s ease-in-out;

  /* Override Bootstrap defaults — link nudi in palette brand (era hsl(210,100%,40%) blu BI) */
  --bs-link-color: var(--lou-verde-scuro);
  --bs-link-hover-color: #1a4430;
}

/* WCAG 2.2 AA — 2.4.11 Focus Not Obscured (Minimum):
   compensa l'altezza dell'header sticky (~148px) durante lo
   scroll automatico verso anchor link / skip link, evitando
   che il focus finisca nascosto dietro l'header. */
html {
  scroll-padding-top: 160px;
}

/* ==========================================================================
   Bootstrap Italia Color Overrides
   ========================================================================== */

/* Override primary color */
.btn-primary {
  --bs-btn-bg: var(--lou-verde-scuro);
  --bs-btn-border-color: var(--lou-verde-scuro);
  --bs-btn-hover-bg: #1a4430;
  --bs-btn-hover-border-color: #1a4430;
  --bs-btn-active-bg: #163a29;
  --bs-btn-active-border-color: #163a29;
}

.btn-outline-primary {
  --bs-btn-color: var(--lou-verde-scuro);
  --bs-btn-border-color: var(--lou-verde-scuro);
  --bs-btn-hover-color: var(--lou-bianco);
  --bs-btn-hover-bg: var(--lou-verde-scuro);
  --bs-btn-hover-border-color: var(--lou-verde-scuro);
  --bs-btn-active-color: var(--lou-bianco);
  --bs-btn-active-bg: #163a29;
  --bs-btn-active-border-color: #163a29;
  --bs-btn-focus-shadow-rgb: 34, 86, 59; /* WCAG: focus ring verde-scuro brand */
  box-shadow: inset 0 0 0 2px var(--lou-verde-scuro) !important; /* override BI inset #06c blu */
}

.btn-outline-primary:hover,
.btn-outline-primary:active {
  box-shadow: inset 0 0 0 2px var(--lou-verde-scuro) !important;
}

/* Icone SVG dentro qualsiasi .btn: ereditano il colore del testo del button.
   Override BI `.icon-primary { fill: #06c !important }` per coerenza visiva
   in tutti gli stati (default/hover/active/focus) via currentColor. */
.btn .icon {
  fill: currentColor !important;
}

/* ==========================================================================
   Typography
   ========================================================================== */

body {
  font-family: var(--lou-font-testi);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--lou-verde-scuro);
}

/* Max 55 caratteri per riga (Brand Guidelines) */
.content-text p,
.content-text li {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Skip Link (Accessibilita)
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -200px;
  left: 0;
  background: var(--lou-verde-scuro);
  color: var(--lou-verde-lime);
  padding: var(--lou-spacing-sm) var(--lou-spacing-md);
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
  transition: top var(--lou-transition);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--lou-verde-lime);
  outline-offset: 2px;
}

/* ==========================================================================
   Bootstrap Italia Header Customization
   ========================================================================== */

.it-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.it-header-center-wrapper {
  background-color: var(--lou-bianco);
  border-bottom: 3px solid var(--lou-verde-lime);
  padding: 1rem 0;
}

.it-header-center-wrapper .it-brand-wrapper a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.it-header-center-wrapper .it-brand-wrapper .icon,
.it-header-center-wrapper .it-brand-wrapper img {
  width: 60px;
  height: auto;
  margin-right: 1rem;
}

.it-header-center-wrapper .it-brand-text .it-brand-title {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--lou-verde-scuro);
  margin: 0;
}

.it-header-center-wrapper .it-brand-text .it-brand-tagline {
  font-size: 0.875em;
  color: var(--lou-grigio-scuro);
  margin: 0;
}

/* ==========================================================================
   Bootstrap Italia Navbar Customization
   ========================================================================== */

.it-header-navbar-wrapper {
  background-color: var(--lou-verde-scuro);
}

.it-header-navbar-wrapper .navbar {
  padding: 0;
}

.it-header-navbar-wrapper .navbar-nav .nav-link {
  color: var(--lou-bianco);
  padding: 1rem 1.25rem;
  font-weight: 600;
  transition: background-color var(--lou-transition), color var(--lou-transition);
}

.it-header-navbar-wrapper .navbar-nav .nav-link:hover,
.it-header-navbar-wrapper .navbar-nav .nav-link:focus-visible {
  background-color: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
}

.it-header-navbar-wrapper .navbar-nav .nav-link.active {
  background-color: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
}

.it-header-navbar-wrapper .dropdown-menu {
  background-color: #fff;
  border: 2px solid var(--lou-verde-lime);
  border-radius: var(--lou-radius-md);
  padding: 0.5rem 0;
}

.it-header-navbar-wrapper .dropdown-menu .dropdown-item,
.it-header-navbar-wrapper .dropdown-menu .list-item {
  color: var(--lou-verde-scuro);
  padding: 0.5rem 1.25rem;
}

.it-header-navbar-wrapper .dropdown-menu .dropdown-item:hover,
.it-header-navbar-wrapper .dropdown-menu .dropdown-item:focus-visible,
.it-header-navbar-wrapper .dropdown-menu .list-item:hover,
.it-header-navbar-wrapper .dropdown-menu .list-item:focus-visible {
  background-color: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
}

/* Fix dropdown link colors (override Bootstrap Italia defaults) */
.it-header-navbar-wrapper .dropdown-menu a.dropdown-item,
.it-header-navbar-wrapper .dropdown-menu a.list-item,
.it-header-navbar-wrapper .dropdown-menu a.dropdown-item:link,
.it-header-navbar-wrapper .dropdown-menu a.dropdown-item:visited,
.it-header-navbar-wrapper .dropdown-menu a.list-item:link,
.it-header-navbar-wrapper .dropdown-menu a.list-item:visited {
  color: var(--lou-verde-scuro) !important;
  text-decoration: none;
}

/* Span dentro a.dropdown-item: override BI #06c blu (default desktop; mobile override sotto) */
.it-header-navbar-wrapper .dropdown-menu a.dropdown-item span,
.it-header-navbar-wrapper .dropdown-menu a.list-item span {
  color: var(--lou-verde-scuro) !important;
}

.it-header-navbar-wrapper .dropdown-menu a.dropdown-item:hover,
.it-header-navbar-wrapper .dropdown-menu a.dropdown-item:focus-visible,
.it-header-navbar-wrapper .dropdown-menu a.list-item:hover,
.it-header-navbar-wrapper .dropdown-menu a.list-item:focus-visible {
  color: var(--lou-verde-scuro) !important;
  background-color: var(--lou-verde-lime) !important;
  text-decoration: underline;
}

/* Fix .active state nei dropdown nav (override Bootstrap Italia .list-item.active blu #06c) */
.it-header-navbar-wrapper .dropdown-menu a.dropdown-item.active,
.it-header-navbar-wrapper .dropdown-menu a.list-item.active {
  color: var(--lou-verde-scuro) !important;
  background-color: var(--lou-verde-lime) !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

.it-header-navbar-wrapper .dropdown-menu a.dropdown-item.active span,
.it-header-navbar-wrapper .dropdown-menu a.list-item.active span {
  color: var(--lou-verde-scuro) !important;
}

/* Mobile only: override span color dentro a.list-item (BI imposta #06c blu sullo span) */
@media (max-width: 991.98px) {
  .it-header-navbar-wrapper .dropdown-menu a.dropdown-item span,
  .it-header-navbar-wrapper .dropdown-menu a.list-item span {
    color: var(--lou-bianco) !important;
  }

  .it-header-navbar-wrapper .dropdown-menu a.dropdown-item:hover span,
  .it-header-navbar-wrapper .dropdown-menu a.dropdown-item:focus-visible span,
  .it-header-navbar-wrapper .dropdown-menu a.list-item:hover span,
  .it-header-navbar-wrapper .dropdown-menu a.list-item:focus-visible span {
    color: var(--lou-verde-scuro) !important;
  }
}

/* Mobile menu */
.it-header-navbar-wrapper .navbar-toggler {
  background: transparent;
  border: none;
  padding: 0.75rem; /* WCAG 2.5.5: aumentato da 0.5rem per target size */
  min-width: 44px;  /* WCAG 2.5.5: target size minimo */
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.it-header-navbar-wrapper .navbar-toggler .icon {
  fill: var(--lou-bianco);
  width: 24px;
  height: 24px;
}

/* Mobile menu overlay and close button */
@media (max-width: 991.98px) {
  .it-header-navbar-wrapper .navbar-collapse {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--lou-verde-scuro);
    z-index: 1050;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
  }

  .it-header-navbar-wrapper .navbar-collapse.show {
    left: 0;
  }

  /* Fix ritardo apertura: pannello sempre nel DOM, slide-in parte gia` durante BS collapsing */
  .it-header-navbar-wrapper .navbar-collapse:not(.show) {
    display: block; /* override BS .collapse:not(.show) { display: none } */
  }

  .it-header-navbar-wrapper .navbar-collapse.collapsing {
    height: 100vh !important; /* override BS height inline durante l'animazione height fasulla */
    left: 0; /* slide-in parte subito, parallela all'animazione BS */
  }

  .it-header-navbar-wrapper .navbar-collapse .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
  }

  .it-header-navbar-wrapper .navbar-collapse.show .overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .it-header-navbar-wrapper .close-div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.04rem;
    border-bottom: 3px solid var(--lou-verde-lime);
    opacity: 1; /* override BI opacity: 0 */
    pointer-events: auto; /* override BI pointer-events: none */
    position: static; /* override BI position: fixed (era top-right viewport) */
  }

  .it-header-navbar-wrapper .close-div-logo {
    display: flex;
    align-items: center;
  }

  .it-header-navbar-wrapper .close-div-logo img {
    height: 36px;
    width: auto;
    display: block;
  }

  .it-header-navbar-wrapper .close-div .close-menu {
    background: transparent;
    border: none;
    padding: 0.75rem; /* WCAG 2.5.5: aumentato da 0.5rem per target size */
    min-width: 44px;  /* WCAG 2.5.5: target size minimo */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--lou-verde-lime);
    font-weight: 600;
  }

  .it-header-navbar-wrapper .close-div .close-menu .icon {
    fill: var(--lou-verde-lime);
    width: 32px;
    height: 32px;
  }

  .it-header-navbar-wrapper .menu-wrapper {
    padding: 1rem 1.5rem;
  }

  .it-header-navbar-wrapper .navbar-nav {
    flex-direction: column;
  }

  .it-header-navbar-wrapper .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    margin: 2px 0.5rem;
    border-radius: 6px;
  }

  .it-header-navbar-wrapper .dropdown-menu {
    position: static;
    border: none;
    background: transparent;
    padding-left: 0;
  }

  /* Auto-expand del dropdown quando la pagina corrente e` una sub-page */
  .it-header-navbar-wrapper .nav-item.dropdown.has-active-child > .dropdown-menu {
    display: block;
  }

  /* Sub-items mobile: rimuovo padding orizzontale del link-list-wrapper (BI default 24px) */
  .it-header-navbar-wrapper .dropdown-menu .link-list-wrapper {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 0;
  }

  /* Sub-items: stesso pattern del nav-link parent (pillola arrotondata, margin esterno), indent visibile rispetto al parent */
  .it-header-navbar-wrapper .dropdown-menu .dropdown-item,
  .it-header-navbar-wrapper .dropdown-menu .list-item {
    width: auto; /* disattiva il width:100% di Bootstrap che sommato al margin causa overflow */
    padding: 0.5rem 1rem;
    margin: 2px 0.5rem 2px 1.5rem;
    border-radius: 6px;
  }
}

@media (min-width: 992px) {
  .it-header-navbar-wrapper .navbar-toggler {
    display: none;
  }

  .it-header-navbar-wrapper .close-div {
    display: none;
  }

  .it-header-navbar-wrapper .overlay {
    display: none;
  }

  /* Dropdown visibile con navigazione da tastiera - WCAG 2.1.1 */
  .it-header-navbar-wrapper .nav-item.dropdown:focus-within > .dropdown-menu {
    display: block;
  }
}

/* ==========================================================================
   Bootstrap Italia Hero Customization
   ========================================================================== */

.it-hero-wrapper {
  background-color: var(--lou-verde-scuro);
}

.it-hero-wrapper .it-hero-text-wrapper {
  padding: 3rem 2rem;
}

.it-hero-wrapper .it-hero-text-wrapper h1,
.it-hero-wrapper .it-hero-text-wrapper .it-hero-title {
  color: var(--lou-verde-lime);
  font-size: clamp(2em, 5vw, 3em);
  margin-bottom: 1rem;
}

.it-hero-wrapper .it-hero-text-wrapper p {
  color: var(--lou-bianco);
  font-size: 1.125em;
  max-width: 55ch;
}

.it-hero-wrapper .it-category,
.it-hero-wrapper .it-hero-category {
  color: var(--lou-verde-lime);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

.it-hero-wrapper .it-btn-container {
  margin-top: 1.5rem;
}

.it-hero-wrapper .it-btn-container .btn {
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

/* Hero small for internal pages */
.it-hero-wrapper.it-hero-small-size .it-hero-text-wrapper {
  padding: 2rem 1.5rem;
}

.it-hero-wrapper.it-hero-small-size h1 {
  font-size: clamp(1.5em, 4vw, 2.25em);
}

/* Hero with background image */
.it-hero-wrapper.it-hero-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.it-hero-wrapper.it-hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(34, 86, 59, 0.9) 0%, rgba(34, 86, 59, 0.7) 50%, rgba(34, 86, 59, 0.5) 100%);
  z-index: 1;
}

.it-hero-wrapper.it-hero-bg .container {
  position: relative;
  z-index: 2;
}

.it-hero-wrapper.it-hero-bg.it-hero-small-size::before {
  background: linear-gradient(to right, rgba(34, 86, 59, 0.95) 30%, rgba(34, 86, 59, 0.6) 100%);
}

/* Hero with video background */
.it-hero-wrapper.it-hero-video-bg {
  position: relative;
  overflow: hidden;
  z-index: 0; /* Crea stacking context per z-index negativi di video e overlay */
}

.it-hero-wrapper.it-hero-video-bg .hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: -2;
  object-fit: cover;
}

.it-hero-wrapper.it-hero-video-bg .hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right,
    rgba(34, 86, 59, 0.85) 0%,
    rgba(34, 86, 59, 0.7) 50%,
    rgba(34, 86, 59, 0.5) 100%);
  z-index: -1;
}

.it-hero-wrapper.it-hero-video-bg .container {
  position: relative;
  z-index: 1;
}

/* Accessibilita: rispetta prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .it-hero-wrapper.it-hero-video-bg .hero-video {
    display: none;
  }

  .it-hero-wrapper.it-hero-video-bg {
    background-image: url('/images/background/bg-ostana-drone-paese.jpg');
    background-size: cover;
    background-position: center;
  }
}

/* Mobile: immagine statica per performance */
@media (max-width: 768px) {
  .it-hero-wrapper.it-hero-video-bg .hero-video {
    display: none;
  }

  .it-hero-wrapper.it-hero-video-bg {
    background-image: url('/images/background/bg-ostana-drone-paese.jpg');
    background-size: cover;
    background-position: center;
  }

  .it-hero-wrapper.it-hero-video-bg .hero-video-overlay {
    background: linear-gradient(to bottom,
      rgba(34, 86, 59, 0.9) 0%,
      rgba(34, 86, 59, 0.8) 100%);
  }
}

/* ==========================================================================
   Bootstrap Italia Card Customization
   ========================================================================== */

.it-card {
  border: 2px solid var(--lou-grigio-chiaro);
  border-radius: var(--lou-radius-md);
  transition: border-color var(--lou-transition), box-shadow var(--lou-transition);
  height: 100%;
  background: var(--lou-bianco);
}

.it-card:hover,
.it-card:focus-within {
  border-color: var(--lou-verde-lime);
  box-shadow: 0 4px 16px rgba(34, 86, 59, 0.15);
}

.it-card .it-card-title {
  color: var(--lou-verde-scuro);
  font-weight: 700;
}

.it-card .it-card-title a {
  color: inherit;
  text-decoration: none;
}

.it-card .it-card-title a:hover,
.it-card .it-card-title a:focus {
  text-decoration: underline;
}

/* Home: card "Un'esperienza per tutti" — titolo su una sola riga */
section[aria-labelledby="highlights-title"] .it-card-title.h5 {
  font-size: 1.3em;
  line-height: 1.3;
  text-wrap: balance;
}

.it-card .it-card-body {
  padding: 1.5rem;
}

.it-card .it-card-text {
  color: var(--lou-grigio-scuro);
}

/* Card with icon */
.it-card .card-icon {
  width: 64px;
  height: 64px;
  /* margin-bottom: 1rem; */
  fill: var(--lou-verde-scuro);
}

/* Card with colored top border */
.it-card.it-card-bordered {
  border-top: 3px solid var(--lou-verde-lime);
}

/* Card with custom SVG icon image */
.card-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* Homepage "Un'esperienza per tutti" — uniforma icone (64x64) e altezza card */
.highlights-section .it-card-body .card-icon,
.highlights-section .it-card-body .card-icon-img {
  width: 64px;
  height: 64px;
  margin-bottom: 0;
  display: inline-block;
}

.highlights-section .it-card .it-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Card with image */
.it-card .it-card-image {
  overflow: hidden;
  border-radius: var(--lou-radius-md) var(--lou-radius-md) 0 0;
  aspect-ratio: 16 / 9;
}

.it-card .it-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--lou-transition);
}

.it-card:hover .it-card-image img {
  transform: scale(1.05);
}

/* ==========================================================================
   Bootstrap Italia Footer Customization
   ========================================================================== */

.it-footer {
  background-color: var(--lou-verde-scuro);
}

.it-footer-main {
  background-color: var(--lou-verde-scuro); /* override BI #004C99 blu istituzionale per brand coherence */
  padding: 3rem 0 2rem;
}

.it-footer .it-brand-wrapper a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.it-footer .it-brand-wrapper img {
  margin-right: 1rem;
}

.it-footer .it-brand-text .brand-title {
  color: var(--lou-bianco);
  font-size: 1.25em;
  font-weight: 700;
  margin: 0;
}

.it-footer .it-brand-text .brand-subtitle {
  color: var(--lou-verde-lime);
  font-size: 0.875em;
  margin: 0;
}

.it-footer .footer-col-title {
  color: var(--lou-verde-lime);
  font-size: 1em;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.it-footer .footer-col-title a {
  color: var(--lou-verde-lime);
  text-decoration: none;
}

.it-footer .footer-col-title a:hover,
.it-footer .footer-col-title a:focus {
  text-decoration: underline;
}

.it-footer .footer-list .list-item,
.it-footer .link-list .list-item {
  color: var(--lou-bianco);
  padding: 0.75rem 0.5rem; /* WCAG 2.5.5: aumentato da 0.25rem 0 per target size */
  min-height: 44px; /* WCAG 2.5.5: target size minimo */
  text-decoration: none;
  display: block;
  line-height: 1.5;
}

.it-footer .footer-list .list-item:hover,
.it-footer .footer-list .list-item:focus,
.it-footer .link-list .list-item:hover,
.it-footer .link-list .list-item:focus {
  color: var(--lou-verde-lime);
  text-decoration: underline;
}

.it-footer address {
  color: var(--lou-bianco);
  font-style: normal;
}

/* Back to top link - WCAG 2.4.1 */
.it-footer-back-to-top {
  background-color: var(--lou-verde-lime); /* terza fascia "alegre" brand tra main e small-prints */
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.it-footer-back-to-top .back-to-top-link {
  color: #000000; /* WCAG: nero su lime = 13:1 — specificita` 0,2,0 per battere BI .it-footer a { color:#fff } (0,1,1) */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  min-height: 44px; /* WCAG 2.5.5: target size minimo */
  font-weight: 600;
  transition: color var(--lou-transition);
}

.it-footer-back-to-top .back-to-top-link:hover,
.it-footer-back-to-top .back-to-top-link:focus {
  color: #000000;
  text-decoration: underline;
}

/* Icona "freccia su": eredita color del link via currentColor (override BI .icon-white) */
.back-to-top-link .icon {
  fill: currentColor !important;
}

/* Focus visibile su sfondo lime: outline verde-scuro invece del default lime */
.it-footer-back-to-top a:focus-visible {
  outline: 3px solid var(--lou-verde-scuro);
  outline-offset: 2px;
}

.it-footer-small-prints {
  background-color: #1a4430; /* stessa shade del back-to-top: base footer coerente, separata dal main */
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.it-footer-small-prints p,
.it-footer-small-prints .small {
  color: var(--lou-bianco); /* WCAG 1.4.3: contrasto 12.6:1 invece di var(--lou-grigio-scuro) 3.07:1 */
}

.it-footer-small-prints a {
  color: var(--lou-bianco);
  text-decoration: none;
}

.it-footer-small-prints a:hover,
.it-footer-small-prints a:focus {
  color: var(--lou-verde-lime);
  text-decoration: underline;
}

.it-footer-small-prints .list-inline-item:not(:last-child) {
  margin-right: 1.5rem;
}

/* ==========================================================================
   Content Sections
   ========================================================================== */

.section-spacing {
  padding: 3rem 0;
}

.section-spacing-lg {
  padding: 4rem 0;
}

.section-bg-light {
  background-color: #f8f9fa;
}

/* Sezione verde piena (tinta unita primaria) — fascia full-width classica per contenuti enfatizzati */
.section-bg-verde-solid {
  background-color: var(--lou-verde-scuro);
  color: var(--lou-bianco);
}

.section-bg-verde-solid h2,
.section-bg-verde-solid h3 {
  color: var(--lou-verde-lime);
}

/* CTA wrapper: sfondo neutro caldo che separa la card verde dal footer (stacco compositivo, non cromatico) */
.section-cta-wrapper {
  background-color: #F5F2EE; /* grigio caldo richiamo pietra borgate Ostana */
  padding: 5rem 0 6rem;
  position: relative;
}

.section-cta-wrapper::before {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: var(--lou-verde-lime);
  margin: 0 auto 3rem;
  border-radius: 2px;
}

/* CTA card galleggiante: verde scuro brand con accent lime, border-radius, ombra morbida */
.section-bg-verde {
  background-color: var(--lou-verde-scuro);
  background-image:
    linear-gradient(135deg, rgba(34,86,59,0.92) 0%, rgba(34,86,59,0.78) 100%),
    url('/images/background/bg-ostana-monviso.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--lou-bianco);
  border-radius: 16px;
  padding: 4rem 2rem;
  max-width: 1300px;
  margin: 0 auto;
  box-shadow:
    0 20px 50px -15px rgba(34,86,59,0.35),
    0 4px 12px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

/* Accent lime in alto della card (linea decorativa brand) */
.section-bg-verde::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg,
    var(--lou-verde-lime) 0%,
    var(--lou-verde-lime) 60%,
    transparent 100%);
}

.section-bg-verde h2,
.section-bg-verde h3 {
  color: var(--lou-verde-lime);
}

.section-bg-verde h2 {
  font-size: clamp(1.75em, 3vw, 2.5em);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.section-bg-verde .lead {
  font-size: 1.15em;
  max-width: 60ch;
  margin: 0 auto 2rem;
  opacity: 0.95;
}

@media (max-width: 768px) {
  .section-cta-wrapper {
    padding: 3rem 0 4rem;
  }

  .section-bg-verde {
    border-radius: 12px;
    padding: 3rem 1.5rem;
    margin: 0 1rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .section-bg-verde .btn {
    transition: transform 0.2s ease;
  }

  .section-bg-verde .btn:hover {
    transform: translateY(-2px);
  }
}

/* ==========================================================================
   Placeholders (Map, Device, etc.)
   ========================================================================== */

.placeholder-box {
  background-color: var(--lou-grigio-chiaro);
  border: 2px dashed var(--lou-grigio-medio);
  border-radius: var(--lou-radius-md);
  padding: 3rem;
  text-align: center;
  color: #333333; /* WCAG 1.4.3: contrasto 7:1 invece di var(--lou-grigio-scuro) 3.42:1 */
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-box-lg {
  min-height: 400px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group label {
  font-weight: 600;
  color: var(--lou-verde-scuro);
}

.form-control:focus {
  border-color: var(--lou-verde-scuro);
  box-shadow: 0 0 0 3px rgba(34, 86, 59, 0.25);
}

/* Override Bootstrap Italia form-select: ripristina stile classico
   (BI customizza per pattern floating-label che richiede struttura HTML diversa) */
.form-select {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  font-size: 1em;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.5;
  color: var(--lou-verde-scuro);
  background-color: var(--lou-bianco);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2322563b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid var(--lou-grigio-medio);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color var(--lou-transition), box-shadow var(--lou-transition);
}

.form-select:focus {
  border-color: var(--lou-verde-scuro);
  box-shadow: 0 0 0 3px rgba(34, 86, 59, 0.25);
  outline: 0;
}

.form-select:disabled {
  background-color: var(--lou-grigio-chiaro);
  opacity: 0.65;
  cursor: not-allowed;
}

.form-select.is-invalid {
  border-color: #c81d29;
}

.form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(200, 29, 41, 0.25);
}

/* Required field indicator */
.required::after {
  content: " *";
  color: #c81d29; /* WCAG 1.4.3: 5.5:1 invece di 4.47:1 (#dc3545) */
}

/* ==========================================================================
   Focus Visible (Accessibilita)
   ========================================================================== */

*:focus-visible {
  outline: 3px solid var(--lou-verde-scuro);
  outline-offset: 3px; /* WCAG 2.4.7: aumentato da 2px per migliore visibilità */
}

/* Focus su background scuro (header, sezioni verde) */
.it-header-navbar-wrapper a:focus-visible,
.section-bg-verde a:focus-visible,
.section-bg-verde-solid a:focus-visible,
.section-bg-verde-solid button:focus-visible,
.it-footer a:focus-visible {
  outline: 3px dashed var(--lou-bianco);
  outline-offset: 2px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-lou-verde {
  color: var(--lou-verde-scuro) !important;
}

.text-lou-lime {
  color: var(--lou-verde-lime) !important;
}

.bg-lou-verde {
  background-color: var(--lou-verde-scuro) !important;
}

.bg-lou-lime {
  background-color: var(--lou-verde-lime) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
  .it-header-center-wrapper .it-brand-text .it-brand-title {
    font-size: 1.25em;
  }

  .it-header-center-wrapper .it-brand-wrapper .icon,
  .it-header-center-wrapper .it-brand-wrapper img {
    width: 45px;
  }
}

@media (max-width: 768px) {
  .it-hero-wrapper .it-hero-text-wrapper {
    padding: 2rem 1rem;
  }

  .section-spacing {
    padding: 2rem 0;
  }

  .it-footer-main {
    padding: 2rem 0;
  }
}

/* ============================================================
   ACCESSIBILITY WIDGET — Protezione header/navbar
   Impedisce che font-scale, line-height, filter del widget
   rendano il menu inutilizzabile
   ============================================================ */

/* Reset font-size e line-height sull'header anche se dentro .aw-page-content */
body.aw-font-scaled .aw-page-content .it-header-wrapper,
body.aw-font-scaled .aw-page-content .it-header-wrapper * {
  font-size: revert !important;
}

body.aw-line-height-adjusted .aw-page-content .it-header-wrapper,
body.aw-line-height-adjusted .aw-page-content .it-header-wrapper * {
  line-height: revert !important;
}

/* Evita outline sui link di navigazione */
body.aw-links-outline .aw-page-content .it-header-wrapper a,
.aw-links-outline .it-header-wrapper a {
  outline: none !important;
}

/* Protezione skip-link dal widget accessibilità */
body.aw-font-scaled .skip-link:not(:focus) {
  font-size: revert !important;
}

body.aw-line-height-adjusted .skip-link:not(:focus) {
  line-height: revert !important;
}

body.aw-links-outline .skip-link:not(:focus) {
  outline: none !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .skip-link,
  .it-header-wrapper,
  .it-header-navbar-wrapper {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  .it-footer {
    background: #fff;
    color: #000;
  }
}

/* ==========================================================================
   Circular Decorative Images (zigzag layout)
   ========================================================================== */

.img-circle-wrapper {
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--lou-verde-lime);
  box-shadow: 0 8px 24px rgba(34, 86, 59, 0.2);
  margin: 0 auto;
}

.img-circle-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767.98px) {
  .img-circle-wrapper {
    max-width: 250px;
  }
}

/* ==========================================================================
   Card Accent Top (colored border)
   ========================================================================== */

.it-card.card-accent-top {
  border-top: 4px solid var(--lou-verde-scuro);
}

.card-accent-verde { border-top-color: var(--lou-verde-scuro) !important; }
.card-accent-lime { border-top-color: var(--lou-verde-lime) !important; }
.card-accent-turchese { border-top-color: var(--lou-turchese) !important; }
.card-accent-arancione { border-top-color: #d4451c !important; } /* WCAG 1.4.11: scurito da #ff6f41 (2.77:1) per UI ≥3:1 (ora 4.84:1) */

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: var(--lou-radius-md);
  text-decoration: none;
  min-height: 44px; /* WCAG 2.5.5: target size minimo */
}

.gallery-item img {
  transition: transform var(--lou-transition);
}

/* Riempie il container .ratio quadrato (override img-fluid { height: auto } che lascia spazio sotto) */
.gallery-item .ratio img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover img,
.gallery-item:focus img {
  transform: scale(1.05);
}

.gallery-item:focus {
  outline: 3px solid var(--lou-verde-lime);
  outline-offset: 2px;
}

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */

#lightboxModal .modal-dialog {
  max-width: none;
  width: auto;
  margin: 0 auto;
}

#lightboxModal .modal-content {
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none; /* lascia passare i click al .modal (backdrop click chiude) */
}

#lightboxModal .modal-body {
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#lightboxModal .lightbox-figure {
  position: relative;
  display: inline-block;
  max-width: 75vw;
  max-height: 70vh;
  pointer-events: auto; /* riabilita click su img + close button */
}

#lightboxModal .lightbox-figure img {
  display: block;
  max-width: 75vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#lightboxModal .btn-close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 10;
  width: 44px;  /* WCAG 2.5.5 target size */
  height: 44px;
  border-radius: 50%;
  background-color: #ffffff;
  background-image: none; /* override BS close icon via bg-image */
  border: 2px solid var(--lou-verde-scuro);
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#lightboxModal .btn-close::before {
  content: "×";
  color: var(--lou-verde-scuro);
  font-size: 1.75em;
  line-height: 1;
  font-weight: 300;
}

#lightboxModal .btn-close:hover,
#lightboxModal .btn-close:focus-visible {
  background-color: var(--lou-verde-scuro);
  outline: 3px solid var(--lou-verde-lime);
  outline-offset: 2px;
}

#lightboxModal .btn-close:hover::before,
#lightboxModal .btn-close:focus-visible::before {
  color: #ffffff;
}

/* Backdrop più scuro quando lightbox aperto (attualmente unico modal del sito) */
body.modal-open .modal-backdrop.show {
  opacity: 0.92;
}

/* ==========================================================================
   Full-Width Emotional Sections
   ========================================================================== */

.section-fullwidth-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  padding: 6rem 0;
}

.section-fullwidth-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(34, 86, 59, 0.7);
  z-index: 1;
}

.section-fullwidth-image .container {
  position: relative;
  z-index: 2;
}

.section-fullwidth-image h2,
.section-fullwidth-image h3 {
  color: var(--lou-verde-lime);
}

.section-fullwidth-image p,
.section-fullwidth-image .lead {
  color: var(--lou-bianco);
}

/* ==========================================================================
   Responsive Enhancements
   ========================================================================== */

@media (max-width: 768px) {
  /* Hero mobile optimization */
  .it-hero-wrapper.it-hero-bg {
    min-height: 280px;
  }

  .it-hero-wrapper.it-hero-bg::before {
    background: linear-gradient(to bottom, rgba(34, 86, 59, 0.9) 0%, rgba(34, 86, 59, 0.8) 100%);
  }

  /* Full-width sections mobile */
  .section-fullwidth-image {
    padding: 4rem 0;
  }

  /* Gallery mobile */
  .gallery-item {
    margin-bottom: 0.5rem;
  }
}

.it-header-center-wrapper .it-header-center-content-wrapper .it-brand-wrapper a .icon {
  height: 50px;
  width: auto;
}


.it-hero-wrapper-home {
	min-height: 500px;
}

@media (min-width: 992px) {
    .it-hero-wrapper-home {
        min-height: 800px;
    }
}

/* ==========================================================================
   Accordion Lou Lindal
   ========================================================================== */

/* Override BI chevron icons: SVG inline brand-colored (chiuso verde-scuro, aperto lime) */
.accordion-lou {
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2322563b'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23C4D320'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Ogni item separato, aspetto "mini-card" */
.accordion-lou .accordion-item {
  border: 2px solid var(--lou-grigio-chiaro);
  border-radius: var(--lou-radius-md);
  background: var(--lou-bianco);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color var(--lou-transition), box-shadow var(--lou-transition);
}

.accordion-lou .accordion-item:last-child {
  margin-bottom: 0;
}

/* Hover sull'intero item: bordo lime + ombra, come le card */
.accordion-lou .accordion-item:hover {
  border-color: var(--lou-verde-lime);
  box-shadow: 0 4px 16px rgba(34, 86, 59, 0.15);
}

/* Button: sfondo bianco, testo verde scuro bold come it-card-title */
.accordion-lou .accordion-button {
  background-color: var(--lou-bianco);
  color: var(--lou-verde-scuro);
  font-weight: 700;
  padding: 1.25rem 1.5rem;
  border: none;
  box-shadow: none;
}

.accordion-lou .accordion-button:hover {
  background-color: var(--lou-bianco);
  color: var(--lou-verde-scuro);
}

/* Aperto: leggero bordo inferiore grigio per separare header da body */
.accordion-lou .accordion-button:not(.collapsed) {
  background-color: var(--lou-bianco);
  color: var(--lou-verde-scuro);
  box-shadow: none;
  border-bottom: 1px solid var(--lou-grigio-chiaro);
}

/* Badge tondo lime con icona dentro (chiuso) */
.accordion-lou .accordion-button .icon {
  width: 48px;
  height: 48px;
  padding: 12px;
  margin-right: 1rem !important;
  background-color: var(--lou-verde-lime);
  border-radius: 50%;
  fill: var(--lou-verde-scuro) !important;
  box-sizing: border-box;
  transition: background-color var(--lou-transition), fill var(--lou-transition);
}

/* Badge tondo verde-scuro con icona bianca (aperto) */
.accordion-lou .accordion-button:not(.collapsed) .icon {
  background-color: var(--lou-verde-scuro);
  fill: var(--lou-bianco) !important;
}

/* Focus visible WCAG 2.4.7 */
.accordion-lou .accordion-button:focus-visible {
  outline: 3px solid var(--lou-verde-lime);
  outline-offset: 2px;
  box-shadow: none;
}

/* Body: padding generoso, testo grigio come card-text */
.accordion-lou .accordion-body {
  padding: 1.25rem 1.5rem;
  color: var(--lou-grigio-scuro);
}

/* Icone SVG nei button: fill verde scuro */
.accordion-lou .accordion-button .icon-white {
  fill: var(--lou-verde-scuro);
}

.accordion-lou .accordion-button:not(.collapsed) .icon-white {
  fill: var(--lou-verde-lime);
}

/* ============================================================================
   LEAFLET MAPS - Mappe interattive accessibili
   ============================================================================ */

/* Map containers */
.map-container {
  width: 100%;
  border-radius: var(--lou-radius-md);
  overflow: hidden;
  background-color: var(--lou-grigio-chiaro);
}

/* Height variants */
.map-container-sm {
  height: 250px;
}

.map-container-md {
  height: 350px;
}

.map-container-lg {
  height: 450px;
}

/* Itinerary map - taller for route visualization */
#map-itinerario {
  height: 500px;
}

/* Custom markers with brand colors */
.marker-lou {
  background: transparent;
  border: none;
}

.marker-lou-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--lou-verde-scuro);
  border: 3px solid var(--lou-verde-lime);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  color: var(--lou-bianco);
  font-weight: 700;
  font-size: 0.875em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.marker-lou-inner > * {
  transform: rotate(45deg);
}

/* Default marker (no number) */
.marker-lou-default .marker-lou-inner {
  padding: 4px;
}

.marker-lou-default .marker-lou-inner svg {
  transform: rotate(45deg);
  color: var(--lou-bianco);
}

/* Marker punto di interesse — cerchio verde con numero */
.marker-poi {
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  background: var(--lou-verde-scuro);
  border: 2px solid var(--lou-verde-lime);
  border-radius: 50%;
  color: var(--lou-bianco);
  font-family: var(--lou-font-titoli);
  font-weight: 700;
  font-size: 0.95em;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.marker-poi:hover,
.marker-poi:focus {
  background: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
  outline: none;
}

.marker-poi-num {
  display: inline;
  vertical-align: baseline;
}

/* Card POI (sezione "I punti di interesse" su /itinerario.php):
   pulsante cliccabile che porta al marker corrispondente sulla mappa.
   Layout orizzontale compatto: badge a sinistra + titolo a destra. */
.poi-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  width: 100%;
  height: 100%;
  min-height: 60px;
  background: var(--lou-bianco);
  border: 1px solid var(--lou-grigio-chiaro);
  border-radius: var(--lou-radius-md);
  font: inherit;
  color: var(--lou-verde-scuro);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.poi-card:hover,
.poi-card:focus-visible {
  border-color: var(--lou-verde-lime);
  box-shadow: 0 4px 16px rgba(34, 86, 59, 0.18);
  transform: translateY(-2px);
  outline: none;
}

.poi-card-badge {
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  background: var(--lou-verde-scuro);
  border: 2px solid var(--lou-verde-lime);
  border-radius: 50%;
  color: var(--lou-bianco);
  font-family: var(--lou-font-titoli);
  font-weight: 700;
  font-size: 0.875em;
  line-height: 26px;
  text-align: center;
  flex-shrink: 0;
}

.poi-card-title {
  font-family: var(--lou-font-titoli);
  font-weight: 600;
  font-size: 0.8125em;
  line-height: 1.25;
  color: var(--lou-verde-scuro);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Focus styles for accessibility - WCAG 2.4.7 */
.map-container:focus-visible {
  outline: 3px solid var(--lou-verde-lime);
  outline-offset: 2px;
}

/* Leaflet control buttons accessibility */
.leaflet-control-zoom a:focus-visible {
  outline: 3px solid var(--lou-verde-lime);
  outline-offset: 1px;
}

/* === Popup Leaflet — stile brand card === */

/* Balloon wrapper: sfondo bianco, angoli arrotondati, accento lime in alto via ::before */
.leaflet-popup-content-wrapper {
  background: var(--lou-bianco);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(34, 86, 59, 0.18);
  padding: 0;
  position: relative;
  overflow: hidden;
  min-width: 180px;
}

.leaflet-popup-content-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--lou-verde-lime);
}

/* Padding interno piu ampio e font brand */
.leaflet-popup-content {
  margin: 0.5rem 1.25rem 0.875rem;
  font-family: var(--lou-font-testi);
  line-height: 1.4;
}

/* Punta del balloon in verde lime per coerenza con la banda */
.leaflet-popup-tip {
  background: var(--lou-verde-lime);
  box-shadow: 0 4px 16px rgba(34, 86, 59, 0.18);
}

/* X di chiusura: spostata sotto la banda lime, colore brand */
.leaflet-popup-close-button {
  top: 8px !important;
  right: 10px !important;
  color: var(--lou-verde-scuro) !important;
  font-size: 18px !important;
}

.leaflet-popup-close-button:hover,
.leaflet-popup-close-button:focus {
  color: var(--lou-verde-lime) !important;
}

/* Contenuto */
.popup-lou strong {
  display: block;
  margin-top: 0;
  font-family: var(--lou-font-titoli);
  font-weight: 700;
  font-size: 0.875em;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--lou-verde-scuro);
}

.popup-lou p {
  margin: 0.125rem 0 0;
  font-size: 0.95em;
  color: var(--lou-grigio-scuro);
}

.popup-lou p small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8em;
  color: var(--lou-grigio-scuro);
}

/* Attribution styling */
.leaflet-control-attribution {
  font-size: 0.75em;
  background-color: rgba(255, 255, 255, 0.9);
}

.leaflet-control-attribution a {
  color: var(--lou-verde-scuro);
}

/* Responsive map heights */
@media (max-width: 768px) {
  #map-itinerario {
    height: 400px;
  }

  .map-container-lg {
    height: 350px;
  }

  .map-container-md {
    height: 300px;
  }
}

/* Legenda mappa: tipi di fondo del tracciato */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  background-color: var(--lou-bianco);
  border: 1px solid var(--lou-grigio-chiaro);
  border-radius: var(--lou-radius-md);
}

.map-legend > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
}

.map-legend dt {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--lou-verde-scuro);
}

.map-legend dd {
  margin: 0;
  font-size: 1.125em;
  font-weight: 700;
  color: var(--lou-verde-scuro);
}

.map-legend .legend-swatch {
  display: inline-block;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.map-legend .legend-swatch--asfalto {
  background-color: #cc1100;
}

/* ==========================================================================
   Pagination & Breadcrumb — override BI blu #06c verso palette brand
   ========================================================================== */

.pagination {
  --bs-pagination-color: var(--lou-grigio-scuro);
  --bs-pagination-hover-color: var(--lou-verde-scuro);
  --bs-pagination-hover-bg: rgba(34, 86, 59, 0.08);
  --bs-pagination-focus-color: var(--lou-verde-scuro);
  --bs-pagination-focus-bg: rgba(34, 86, 59, 0.12);
  --bs-pagination-active-color: var(--lou-verde-scuro);
  --bs-pagination-active-bg: transparent;
  --bs-pagination-active-border-color: var(--lou-verde-scuro);
}

.page-item .page-link[aria-current] {
  border: 1px solid var(--lou-verde-scuro) !important;
  color: var(--lou-verde-scuro) !important;
}

.page-item .page-link:hover {
  color: var(--lou-verde-scuro);
}

.page-item .page-link:hover .icon {
  fill: var(--lou-verde-scuro);
}

.breadcrumb-item a {
  color: var(--lou-verde-scuro);
}

.breadcrumb-item a:hover {
  color: #1a4430;
  text-decoration: underline;
}

.map-legend .legend-swatch--sterrato {
  background-image: repeating-linear-gradient(
    to right,
    #cc1100 0 6px,
    transparent 6px 16px
  );
  height: 3px;
  margin-top: 1px;
}

/* ==========================================================================
   News listing + single
   ========================================================================== */

/* Card news (listing) */
.card-news {
  border: 1px solid var(--lou-grigio-chiaro);
  transition: box-shadow var(--lou-transition), transform var(--lou-transition);
}

.card-news:hover,
.card-news:focus-within {
  box-shadow: 0 12px 28px rgba(34, 86, 59, 0.15);
  transform: translateY(-4px);
}

.card-news .it-card-body {
  padding: 1.5rem;
}

.card-news .it-card-image + .it-card-body {
  padding-top: 2rem;
}

.card-news .it-card-title a {
  color: var(--lou-verde-scuro);
  text-decoration: none;
  transition: color var(--lou-transition);
}

.card-news .it-card-title a:hover,
.card-news .it-card-title a:focus {
  color: var(--lou-verde-scuro);
  text-decoration: underline;
  text-decoration-color: var(--lou-verde-lime);
  text-decoration-thickness: 2px;
}

/* News meta info row (data, autore, categoria) */
.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  font-size: 0.875em;
  color: var(--lou-grigio-scuro);
  margin-bottom: 0.75rem;
}

.news-meta .news-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1.2;
}

.news-meta .news-meta-item .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Badge categoria brand (pill) */
.badge-news-cat {
  display: inline-block;
  background-color: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
  font-weight: 600;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35em 0.85em;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.2;
}

a.badge-news-cat:hover,
a.badge-news-cat:focus {
  background-color: var(--lou-verde-scuro);
  color: var(--lou-bianco);
  text-decoration: none;
}

/* News article body (single — tipografia editoriale) */
.news-article-body {
  font-size: 1.0625em;
  line-height: 1.75;
  color: var(--lou-grigio-scuro);
  max-width: 70ch;
}

.news-article-body > p:first-of-type {
  font-size: 1.1875em;
  font-weight: 500;
  color: var(--lou-verde-scuro);
  line-height: 1.6;
}

.news-article-body h2,
.news-article-body h3,
.news-article-body h4 {
  color: var(--lou-verde-scuro);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.news-article-body h2 { font-size: 1.5em; }
.news-article-body h3 { font-size: 1.25em; }

.news-article-body blockquote {
  border-left: 4px solid var(--lou-verde-lime);
  padding: 0.5rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--lou-verde-scuro);
  background-color: rgba(195, 210, 30, 0.08);
}

.news-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--lou-radius-md);
  margin: 1.5rem 0;
}

.news-article-body a {
  color: var(--lou-verde-scuro);
  text-decoration: underline;
  text-decoration-color: var(--lou-verde-lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.news-article-body a:hover,
.news-article-body a:focus {
  color: var(--lou-verde-scuro);
  text-decoration-color: var(--lou-verde-scuro);
}

.news-article-body ul,
.news-article-body ol {
  margin-bottom: 1.25rem;
}

.news-article-body li {
  margin-bottom: 0.5rem;
}

/* Share buttons (single) */
.news-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--lou-grigio-chiaro);
}

.news-share-label {
  font-weight: 600;
  color: var(--lou-verde-scuro);
  margin-right: 0.25rem;
}

.news-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--lou-verde-scuro);
  color: var(--lou-bianco);
  text-decoration: none;
  border: 2px solid var(--lou-verde-scuro);
  transition: background-color var(--lou-transition), border-color var(--lou-transition), color var(--lou-transition), transform var(--lou-transition);
}

.news-share-btn .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.news-share-btn:hover,
.news-share-btn:focus {
  background-color: var(--lou-verde-lime);
  border-color: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Sidebar ultime news con thumbnail */
.sidebar-news-item {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--lou-grigio-chiaro);
}

.sidebar-news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.sidebar-news-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: var(--lou-radius-sm, 6px);
  overflow: hidden;
  background-color: var(--lou-grigio-chiaro);
}

.sidebar-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-news-content {
  flex: 1;
  min-width: 0;
}

.sidebar-news-content a {
  color: var(--lou-verde-scuro);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375em;
  line-height: 1.3;
  display: block;
}

.sidebar-news-content a:hover,
.sidebar-news-content a:focus {
  text-decoration: underline;
  text-decoration-color: var(--lou-verde-lime);
}

.sidebar-news-content .sidebar-news-date {
  display: block;
  font-size: 0.75em;
  color: var(--lou-grigio-scuro);
  margin-top: 0.25rem;
}

/* Tag pills (single) */
.tag-pill {
  display: inline-block;
  background-color: var(--lou-grigio-chiaro);
  color: var(--lou-verde-scuro);
  font-size: 0.8125em;
  font-weight: 500;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  margin: 0 0.25rem 0.25rem 0;
  text-decoration: none;
  transition: background-color var(--lou-transition);
}

a.tag-pill:hover,
a.tag-pill:focus {
  background-color: var(--lou-verde-lime);
  color: var(--lou-verde-scuro);
  text-decoration: none;
}

/* Empty state news */
.news-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--lou-grigio-scuro);
}

.news-empty-state .icon {
  width: 64px;
  height: 64px;
  fill: var(--lou-verde-lime);
  margin-bottom: 1rem;
  opacity: 0.7;
}

.news-empty-state p {
  font-size: 1.0625em;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Mobile: padding container maggiorato per respiro ai bordi
   ========================================================================== */
@media (max-width: 575.98px) {
  .container,
  .container-fluid,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* ==========================================================================
   Footer: loghi istituzionali (PNRR partners)
   ========================================================================== */
.footer-loghi-istituzionali {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .footer-loghi-istituzionali {
    justify-content: flex-end;
  }
}

.footer-loghi-istituzionali a,
.footer-loghi-istituzionali > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.25rem;
  border-radius: var(--lou-radius-sm, 4px);
  transition: opacity var(--lou-transition);
  text-decoration: none;
}

.footer-loghi-istituzionali a:hover,
.footer-loghi-istituzionali a:focus {
  opacity: 0.75;
}

.footer-loghi-istituzionali a:focus-visible {
  outline: 3px dashed var(--lou-bianco);
  outline-offset: 2px;
}

.footer-loghi-istituzionali img {
  height: 50px;
  width: auto;
  max-width: 100%;
  display: block;
}

@media (max-width: 575.98px) {
  .footer-loghi-istituzionali img {
    height: 40px;
  }
}

/* Footer: separatore tra brand+loghi e navigation */
.footer-brand-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Footer: dicitura PNRR richiesta dal bando */
.footer-pnrr-disclosure {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 1rem;
}

.footer-pnrr-disclosure p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  font-size: 0.8125em;
}

.footer-pnrr-disclosure p strong {
  color: var(--lou-verde-lime);
}

/* ==========================================================================
   Accessibility Widget (Equalweb) — adattamenti mobile
   Issue: su smartphone il pannello copriva quasi tutto lo schermo
   ========================================================================== */
@media (max-width: 575.98px) {
  .aw-panel {
    width: calc(100vw - 32px) !important;
    max-width: 320px !important;
    max-height: 60vh !important;
    bottom: 80px !important;
    right: 16px !important;
    left: auto !important;
  }

  .aw-panel__content {
    max-height: calc(60vh - 120px) !important;
    overflow-y: auto !important;
  }
}

/* ==========================================================================
   Override Bootstrap Italia: font-size em invece di rem
   per supportare il widget Accessibility "Testo grande" (WCAG 1.4.4 Resize Text).

   Bootstrap Italia usa font-size in rem (assoluto rispetto al root) su molti
   componenti: questo interrompe la catena di eredita` quando il widget Equalweb
   imposta font-size scalato su .aw-page-content. Convertendo a em (relativo
   al parent) il testo scala correttamente con il widget.
   ========================================================================== */

/* Card */
.it-card-text,
article.it-card .it-card-body .it-card-text {
  font-size: 1em;
}

.it-card-body .it-card-subtitle,
article.it-card .it-card-body .it-card-subtitle {
  font-size: 1.25em;
}

@media (min-width: 992px) {
  .it-card-body .it-card-subtitle,
  article.it-card .it-card-body .it-card-subtitle {
    font-size: 1.5em;
  }
}

/* Lead paragraph */
.lead {
  font-size: 1.25em;
}

@media (min-width: 992px) {
  .lead {
    font-size: 1.5em;
  }
}

/* Hero text wrapper */
.it-hero-text-wrapper .it-category {
  font-size: 1em;
}

.it-hero-text-wrapper p,
.it-hero-wrapper .it-hero-text-wrapper p {
  font-size: 1em;
}

.it-hero-text-wrapper h1,
.it-hero-wrapper .it-hero-text-wrapper .h1,
.it-hero-text-wrapper h2,
.it-hero-wrapper .it-hero-text-wrapper .h2 {
  font-size: 2.5em;
}

@media (min-width: 992px) {
  .it-hero-text-wrapper h1,
  .it-hero-wrapper .it-hero-text-wrapper .h1,
  .it-hero-text-wrapper h2,
  .it-hero-wrapper .it-hero-text-wrapper .h2 {
    font-size: 3em;
  }
}

/* ==========================================================================
   Accessibility Widget toggle — bordo bianco + ombra per visibilita`
   su qualsiasi sfondo (footer verde-scuro, CTA verde, hero, ecc.)
   ========================================================================== */
.aw-toggle {
  /* Bordo bianco esterno (mantiene dimensione totale con box-sizing) */
  border: 3px solid var(--lou-bianco) !important;
  box-sizing: border-box !important;

  /* Ombra rinforzata per stacco su qualsiasi sfondo */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.18) !important;
}

/* Hover: ombra leggermente piu` enfatica */
.aw-toggle:hover {
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.25) !important;
}

/* Focus visible: outline ad alto contrasto */
.aw-toggle:focus-visible {
  outline: 3px solid var(--lou-verde-lime) !important;
  outline-offset: 3px !important;
}

/* ==========================================================================
   Accessibility Widget profili — stato attivo sempre visibile subito
   (mobile + desktop). Annulliamo l'effetto :hover del vendor (background
   grigio chiaro) sia su touch sia su mouse: lo stato attivo verde-scuro
   --active e` sufficiente come affordance. Ribadiamo lo stato attivo con
   specificita` maggiore (2 classi) per blindare il colore anche con :hover
   residuo del mouse o sticky su touch.
   ========================================================================== */
.aw-profile:hover {
  background: transparent !important;
}

/* Border-color del vendor #404040 (dark) e #e9ecef (light) sui profili
   non-attivi appare come "bordo biancastro" su pannello dark per il delta
   di luminosita`. Lo rendiamo trasparente: i profili diventano "tile" pieni
   senza contorno, lo stato attivo verde-scuro resta l'unico delimitatore. */
.aw-profile:not(.aw-profile--active) {
  border-color: transparent !important;
}

.aw-profile.aw-profile--active,
.aw-profile.aw-profile--active:hover {
  background: var(--aw-primary) !important;
  color: #fff !important;
  border-color: var(--aw-primary) !important;
}

/* Rimuoviamo l'alone box-shadow del :focus-visible del vendor (alone
   semi-trasparente 15% di --aw-primary) che persiste dopo il tap mobile
   e appare biancastro sullo stato attivo verde-scuro, dando l'impressione
   di selezionare piu` profili. Manteniamo l'outline 2px del vendor per la
   navigazione da tastiera (WCAG 2.4.7). */
.aw-profile:focus-visible {
  box-shadow: none !important;
}
