body{ background: #49627c80; }
.bg-dark {
    background-color: rgb(207 230 255) !important;
}    
/* Wrapper per main e sidebar in layout flex */
.content-wrapper {
    display: flex;
    gap: 20px; /* Spazio tra le colonne */
}
.main-content {
    width: 70%;
}
.sidebar {
    width: 30%;
}

/* =========================
   Header / Navbar dropdown
   (background e apertura: invariati)
   ========================= */
.dropdown-menu {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  /* Gradient che parte da un blu medio a un blu molto scuro, in armonia con .bg-dark */
  background: linear-gradient(145deg, #d1e7ff, #95b0cc);
  margin-top: 0.5rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* =========================
   NAV: hover & focus (desktop + mobile)
   – niente underline
   – stessi feedback su tutti i device
   ========================= */

/* Base */
.navbar .nav-link,
.dropdown-item {
  color: rgb(2 21 45 / 92%);
  text-decoration: none;
  border-radius: 10px;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease;
}

/* NAV LINK (HUB) */
.navbar .nav-link {
  padding-inline: .75rem;
}

/* Hover / Focus / Active */
.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link:active {
  color: #0180ef;
  background-color: rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  outline: none;
}

/* Stato “aperto” (dropdown attivo) */
.dropdown.show > .nav-link,
.navbar .nav-link[aria-expanded="true"] {
  color: #0180ef;
  background-color: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

/* Focus visibile accessibile (tastiera) */
.navbar .nav-link:focus-visible {
  outline: 2px solid #ffd24d;
  outline-offset: 2px;
  background-color: rgba(255,255,255,.10);
}

/* DROPDOWN ITEM */
.dropdown-item {
  border-radius: 8px;
  padding: .55rem .9rem;
}

/* Hover / Focus / Active sui dropdown item
   (mettiamo !important per battere eventuali override mobile trasparenti) */
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:active {
  color: #0180ef !important;
  background-color: rgba(255,255,255,.12) !important;
  box-shadow: inset 0px 0px 11px 3px rgba(255,255,255,.06);
  outline: none;
}

/* Focus visibile accessibile per item */
.dropdown-item:focus-visible {
  outline: 2px solid #ffd24d;
  outline-offset: 2px;
}

/* Niente pseudo-underline Bootstrap */
.navbar .nav-link::after { display: none !important; }

/* Mobile: evita piccoli “salti” al tap */
@media (max-width: 991.98px) {
  .navbar .nav-link:hover,
  .navbar .nav-link:focus,
  .navbar .nav-link:active,
  .dropdown-item:hover,
  .dropdown-item:focus,
  .dropdown-item:active {
    transform: none;
  }
}

/* =========================
   Sidebar
   ========================= */
.sidebar {
  background: #203e5e;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  overflow-y: auto;
}

/* Stile per ciascun widget */
.sidebar .widget {
  margin-bottom: 20px;
  padding: 20px;
  background: #e3ecf8;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.sidebar .widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Titoli dei widget */
.sidebar .widget-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #343a40;
  border-bottom: 2px solid #002bff;
  display: inline-block;
  padding-bottom: 5px;
}

/* Lista dei post recenti */
.sidebar .list-unstyled li a {
  color: #343a40;
  text-decoration: none;
  display: block;
  padding: 8px 0;
  transition: color 0.3s ease;
}
.sidebar .list-unstyled li a:hover {
  color: #002bff;
}

/* Stile per l’input della newsletter */
.sidebar .input-group .form-control {
  border: 1px solid #ced4da;
  border-radius: 0.25rem 0 0 0.25rem;
}
.sidebar .input-group .btn {
  border-radius: 0 0.25rem 0.25rem 0;
}

/* Stile per la tag cloud */
.sidebar .tag-cloud a {
  margin: 5px 5px 0 0;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
  background-color: rgb(32 62 94) !important;
}
.sidebar .tag-cloud a:hover {
  background: #002bff;
  color: #ffffff;
}

:root {
  --footer-bg: #203e5e;
  --footer-text: #ffffff;
  --footer-text-light: rgba(255, 255, 255, 0.8);
  --footer-link: rgba(255, 255, 255, 0.9);
  --footer-link-hover: #ffd700;
  --footer-padding: 3rem 1rem;
  --footer-gap: 1.5rem;

  /* breadcrumb vars */
  --breadcrumb-bg: #f7f9fb;
  --breadcrumb-border: #dde3e8;
  --breadcrumb-color: #495057;
  --breadcrumb-link: #30567c;
  --breadcrumb-link-hover: #002bff;
  --breadcrumb-separator: url("data:image/svg+xml,%3Csvg width='8' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 5-6 5' stroke='%23666' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
}

footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 3rem;
  font-family: "Open Sans", Arial, "Helvetica Neue", system-ui, sans-serif;
}

footer h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

footer p {
  font-size: 0.9rem;
  color: var(--footer-text-light);
  line-height: 1.5;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer li + li {
  margin-top: 0.5rem;
}

footer a {
  color: var(--footer-link);
  font-size: 0.9rem;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

footer a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: currentColor;
  transition: width 0.3s ease;
}

footer a:hover,
footer a:focus {
  color: var(--footer-link-hover);
}
footer a:hover::after,
footer a:focus::after {
  width: 100%;
}
footer hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 2rem 0;
}

footer .bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

@media (max-width: 576px) {
  footer .bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (min-width: 1600px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
      max-width: 1520px;
  }
}

@media (min-width: 1800px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
      max-width: 1620px;
  }
}

/* ---------- RESPONSIVITY EXTRA (opzionale) ---------- */
/* Se vuoi diminuire l'altezza dell'immagine su smartphone */
@media (max-width: 576px) {
  .home-category-image {
    height: 140px;
  }
}
/* ---------- RESPONSIVE: su schermi < 576px, metti aside sotto main ---------- */
@media (max-width: 992px) {
  .content-wrapper {
    flex-direction: column; /* passa da “riga” a “colonna” */
  }
  .main-content,
  .sidebar {
    width: 100% !important; /* occupano tutta la larghezza */
  }
  /* Facoltativo: se vuoi un po’ di margine tra main e aside */
  .sidebar {
    margin-top: 20px;
  }
}

@media (max-width: 991.98px) {
  .navbar .navbar-toggler {
    margin-left: auto !important;
  }
}

/* ====== Breadcrumb Professional Style ====== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--breadcrumb-bg);
  border: 1px solid var(--breadcrumb-border);
  border-radius: 0.375rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Ogni elemento tranne l'ultimo */
.breadcrumb-item {
  position: relative;
  color: var(--breadcrumb-color);
  padding: 0 0.75rem 0 0;
}

/* Separatore come background-image */
.breadcrumb-item + .breadcrumb-item {
  padding-left: 1.25rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 12px;
  background-image: var(--breadcrumb-separator);
  background-repeat: no-repeat;
  background-size: contain;
}

/* Link interno */
.breadcrumb-item a {
  color: var(--breadcrumb-link);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  
}

.breadcrumb-item a:hover {
  color: var(--breadcrumb-link-hover);
  
}

/* Voce corrente */
.breadcrumb-item.active {
  color: var(--breadcrumb-color);
  font-weight: 600;
}

/* Responsive: compatto su mobile */
@media (max-width: 576px) {
  .breadcrumb {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  .breadcrumb-item {
    padding: 0 0.5rem 0 0;
  }
  .breadcrumb-item + .breadcrumb-item {
    padding-left: 1rem;
  }
}

/* ===== OVERLAY MOBILE FULLSCREEN per #navbarMain ===== */
@media (max-width: 991.98px) {
  /* Trasforma il collapse in overlay a tutto schermo */
  #navbarMain.navbar-collapse {
    position: fixed;
    inset: 0;                /* top/right/bottom/left:0 */
    width: 100vw;
    height: 100vh;
    background: #011932;        /* sfondo scuro pulito */
    padding: calc(var(--header-h) + 12px) 24px 32px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 1040;           /* sopra l’header */
  }
  #navbarMain.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Voci grandi, leggibili al tap */
  #navbarMain .nav-link {
    color: #fff;
    padding: 12px 4px;
    font-size: 1.15rem;
  }

  /* Dropdown SEMPRE a colonna, senza effetti */
  #navbarMain .dropdown-menu {
    position: static !important;
    float: none !important;
    display: none; /* chiuso di default */
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 0 6px 10px !important;
    margin: 0 0 10px 0 !important;
  }
  #navbarMain .dropdown.show > .dropdown-menu { display: block; }

  #navbarMain .dropdown-item {
    color: #fff;
    padding: 10px 2;
    background: transparent !important;
  }

  /* Separatore leggero tra HUB */
  #navbarMain .navbar-nav > .nav-item + .nav-item {
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: 8px;
    padding-top: 8px;
  }

  /* Bottone X in alto a destra */
  .navbar-close {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 36px;
    line-height: 1;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 4px 8px;
    cursor: pointer;
  }

}

/* Blocca lo scroll del body quando l’overlay è aperto */
body.nav-open { overflow: hidden; }

/* Riduci motion per chi la preferisce */
@media (prefers-reduced-motion: reduce) {
  #navbarMain.navbar-collapse { transition: none !important; }
}


/* Hamburger blu scuro SOLO su mobile */
@media (max-width: 991.98px) {
  /* bordo del bottone (opzionale) */
  .navbar-dark .navbar-toggler {
    border-color: #0b2e59; /* blu scuro */
  }

  /* icona hamburger blu scuro */
  .navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(11,46,89,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }

  /* focus ring (opzionale, accessibilità) */
  .navbar-toggler:focus {
    box-shadow: 0 0 0 .25rem rgba(11,46,89,.25);
  }
}


/* ---- Header stabile + logo unico ---- */
:root { --header-h: 72px; }          /* altezza target header (puoi alzare a 80–88px se serve) */

header[role="banner"] .row.align-items-center {
  min-height: var(--header-h);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

header[role="banner"] .logo img {
  height: auto;   /* il file è già alto 50px */
  width: auto;
  display: block;
}


/* Header fisso (solo desktop) + menu che non va a capo */
@media (min-width: 992px) {
  
  header[role="banner"] .row.align-items-center {
    height: var(--header-h);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Evita che le voci del menu vadano a capo */
  header[role="banner"] .navbar-nav.d-lg-flex {
    white-space: nowrap;
  }
}


/* ----- Offset per link con #id sotto header sticky ----- */
html { scroll-behavior: smooth; } /* opzionale: smooth nativo */

[id] { 
  scroll-margin-top: calc(var(--header-h) + 8px); /* margine extra per respiro */
}

/* Fallback per browser senza scroll-margin-top */
@supports not (scroll-margin-top: 1px) {
  [id]::before {
    content: "";
    display: block;
    height: var(--header-h);
    margin-top: calc(-1 * var(--header-h));
    visibility: hidden;
  }
}



.visually-hidden-focusable {
  position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;
}
.visually-hidden-focusable:focus,
.visually-hidden-focusable:active {
  position:static;width:auto;height:auto;padding:.5rem .75rem;margin:.5rem;
  background:#fff;border:2px solid #0d6efd;border-radius:.5rem;z-index:10000;
}


@media (max-width: 576px) {
  .container.content-wrapper {
    padding: 0 !important;
  }
}