/* ======================================================
   VARIABILI
   ====================================================== */

:root{
  --nav-h: 100px;              /* desktop */
  --nav-blue: #102a47;         /* blu navbar */
  --doc-blue: #183554;         /* blu documento */
  --ivory: #fffaf0;            /* bianco avorio */
}

@media (max-width: 768px){
  :root{
    --nav-h: 51px;             /* mobile */
  }
}

/* ======================================================
   BASE
   ====================================================== */

body{
  font-family: Merriweather, serif;
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* ======================================================
   NAVBAR — BLU SCURO, EDITORIALE
   ====================================================== */

.navbar-custom{
  background: rgba(16,42,71,0.92);
  font-family: Merriweather, serif;
  font-size: 1.2rem;
  z-index: 9999;
  transition: background-color 220ms ease, backdrop-filter 220ms ease;
}

/* navbar trasparente allo scroll (classe via JS) */
.navbar-custom.is-scrolled{
  background: rgba(16,42,71,0);
  backdrop-filter: blur(4px);
}

/* voci principali */
.navbar-custom .navbar-nav > li > a{
  padding: 18px 26px;
  line-height: 1.45;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-decoration: none;
}

/* hover / focus → avorio */
.navbar-custom .navbar-nav > li > a:hover,
.navbar-custom .navbar-nav > li > a:focus{
  color: var(--ivory);
  background: rgba(255,255,255,0.12);
}

/* click / active → testo blu */
.navbar-custom .navbar-nav li.active > a,
.navbar-custom .navbar-nav > li > a:active{
  color: var(--nav-blue);
  background: rgba(255,255,255,0.22);
}

/* ======================================================
   OVERRIDE BOOTSTRAP — NIENTE ARANCIONE
   ====================================================== */

.navbar-custom .navbar-nav > .active > a,
.navbar-custom .navbar-nav > .active > a:hover,
.navbar-custom .navbar-nav > .active > a:focus,
.navbar-custom .navbar-nav > .open > a,
.navbar-custom .navbar-nav > .open > a:hover,
.navbar-custom .navbar-nav > .open > a:focus,
.navbar-custom .navbar-nav > li > a:active{
  background-color: rgba(255,255,255,0.22) !important;
  color: var(--nav-blue) !important;
}

/* ======================================================
   DROPDOWN MENU — AVORIO, BOLD, HOVER BLU
   ====================================================== */

.navbar-nav .dropdown-menu{
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--ivory);
  box-shadow: 0 4px 6px rgba(0,0,0,0.12);
  list-style: none;
  padding: 10px;
  margin: 0;
  z-index: 10000;
  min-width: 200px;
}

.navbar-nav .has-dropdown:hover .dropdown-menu,
.navbar-nav .has-dropdown:focus-within .dropdown-menu{
  display: block;
}

.navbar-nav .has-dropdown{
  position: relative;
}

.navbar-nav .dropdown-menu li{
  margin: 0;
}

/* sottomenu */
.navbar-nav .dropdown-menu li a{
  color: #111;
  text-decoration: none;
  padding: 10px 14px;
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 4px;
}

/* hover sottomenu → blu documento */
.navbar-nav .dropdown-menu li a:hover,
.navbar-nav .dropdown-menu li a:focus{
  background-color: var(--doc-blue);
  color: #ffffff;
}

/* sottomenu attivo */
.navbar-nav .dropdown-menu li.active > a{
  background-color: var(--ivory);
  color: var(--nav-blue);
}

/* ======================================================
   HEADER / HERO (DESKTOP)
   ====================================================== */

header{
  background: #fff url("../img/bg.png") top center / 95% no-repeat;
  width: 100%;
  min-height: 100vh;
  position: relative;
  box-sizing: border-box;
  margin-top: var(--nav-h);
}

.overlay{
  position: absolute;
  inset: 0;
  background-color: rgba(6,6,6,0.55);
  backdrop-filter: blur(1px);
}

/* testo hero */
.intro-text{
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.intro-text .name{
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: #000;
}

.intro-text p{
  font-weight: bolder;
  font-size: 1.1rem;
}

/* ======================================================
   HEADER / HERO — FIX MOBILE (overlay compatta)
   ====================================================== */

@media (max-width: 768px){

  header{
    min-height: auto;
    height: auto;
  }

  .overlay{
    position: relative;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .intro-text{
    position: static;
    transform: none;
    text-align: center;
  }
}

/* ======================================================
   CONTENUTO
   ====================================================== */

#sections{
  background-color: #fff;
  position: relative;
  margin-top: 0;
  width: 100%;
}

/* ancore non coperte */
section{
  scroll-margin-top: var(--nav-h);
}

/* ======================================================
   SEZIONI / TIPOGRAFIA
   ====================================================== */

/* ======================================================
   TITOLI SEZIONI — MAIUSCOLETTO EDITORIALE
   ====================================================== */

section h2{
  font-family: Merriweather, serif;
  font-variant: small-caps;
  font-size: 2.3rem !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;            /* ✔ interlinea aumentata */
  color: #a67460;
  margin-bottom: 1.5rem;
}

section h3{
  font-family: Merriweather, serif;
  font-variant: small-caps;
  font-size: 1.9rem !important;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;             /* ✔ un filo più ariosa di h2 */

  max-width: 82ch;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2.2rem;
}



section{
  padding: 6% 0;
  min-height: 800px;
}

/* testi lunghi */
section p,
section li{
  max-width: 82ch;
  line-height: 1.7;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
  hyphens: auto;
}

/* ripristino centratura */
.text-center p{
  max-width: none;
  text-align: center;
  hyphens: none;
}

section ol{
  padding-left: 1.5rem;
}

section li{
  margin-bottom: 1.2rem;
}

section h2{
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #a67460;
}

section h3{
  max-width: 86ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
}

/* ======================================================
   SEZIONI SU FONDO SCURO
   ====================================================== */

section.success{
  background-color: var(--doc-blue);
  color: #f2f4f6;
}

section.success h2{
  color: #ffffff;
}

section.success p,
section.success li{
  color: #f2f4f6;
}

section.success a{
  color: #e6b8a2;
}

section.success a:hover{
  color: #ffffff;
}

section ol > li::marker{
  font-weight: 600;
  color: #a67460;
}

hr.star-primary{
  border-color: var(--doc-blue);
}

/* ======================================================
   LINK (SOLO CONTENUTO)
   ====================================================== */

section a{
  color: #cc8268;
}

section a:hover,
section a:focus{
  color: #b56f57;
}

/* ======================================================
   ALERT INFO — BIANCO, SENZA BORDO
   ====================================================== */

.alert.alert-info,
.alert-info{
  background: transparent;
  border: none;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

/* ======================================================
   FOOTER
   ====================================================== */

footer .footer-above{
  background-color: var(--nav-blue);
}

/* ======================================================
   LOGHI ABOUT
   ====================================================== */

.row.logos{
  margin: 30px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.row.logos > .col-xs-6,
.row.logos > .col-sm-6,
.row.logos > .col-md-6{
  float: none !important;
  width: 50%;
  display: flex;
  flex-direction: column;
  padding-left: 22px;
  padding-right: 22px;
}

.row.logos > [class*="col-"] > a{
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 28px;
  padding-bottom: 28px;
  margin: 0;
}

.row.logos img{
  display: block;
  max-width: 150px;
  width: 100%;
  height: auto;
}

/* ======================================================
   RESPONSIVE EXTRA
   ====================================================== */

@media (max-width: 360px){
  body{
    font-size: 17px;
  }

  .navbar-custom{
    font-size: 1.1rem;
  }

  .navbar-custom .navbar-nav > li > a{
    padding: 14px 18px;
    letter-spacing: 0.03em;
  }

  .row.logos > [class*="col-"] > a{
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .row.logos img{
    max-width: 130px;
  }
}

/* mostra i dropdown quando Bootstrap mette .open (mobile + desktop) */
.navbar-custom .navbar-nav > li.open > .dropdown-menu{
  display: block !important;
}
