/* =========================================================
   ROOT VARIABLES (Bootstrap Overrides)
   ========================================================= */
:root {
    --bs-primary: #4caf50;
    --bs-secondary: #ffd60a;
    --bs-info: #009ffd;
    --bs-light: #fff4d6;

    --bs-success: #4caf50;
    --bs-warning: #ffd60a;
    --bs-danger: #ff5733;
    --bs-dark: #343a40;
    --bs-body-color: #212529;
}

/* =========================================================
   GLOBAL STYLES
   ========================================================= */
html {
    scroll-behavior: smooth;
}

   body {
    padding-top: 112px; /* Required for stacked navbars */
    padding-bottom: 3rem; /* Footer spacing */
    color: rgb(var(--bs-tertiary-color-rgb));
}

/* =========================================================
   LINKS
   ========================================================= */
a {
    color: #6ec071;
    text-decoration: none;
}

a:hover {
    color: #4caf50;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-primary,
.btn-secondary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn:hover {
    background-color: #6ec071 !important;
    border-color: #6ec071 !important;
}

.btn-outline-secondary {
    border-color:#fff;
}

.btn-info {
    background-color: var(--bs-info) !important;
    border-color: var(--bs-info) !important;
}

/* =========================================================
   NAVBAR COLORS (ORIGINAL PALETTE)
   ========================================================= */

/* Dark navbar (unchanged) */
.navbar-dark {
    background-color: #4caf50;
    color: white !important;
}

/* Shared link styles */
.navbar .nav-link {
    color: #fefefe !important;
}

.navbar .nav-link:hover {
    color: #ffffff !important;
}

/* Shared link styles */
.navbar-main .nav-link {
    color: #cecece !important;
}

/* Active section link */
.navbar-main .nav-link.active {
    color: #ffffff !important;
}

/* Brand */
.navbar-brand {
    color: #ffffff !important;
}

/* =========================================================
   FIXED STACKED NAVBARS
   ========================================================= */

#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1050;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; 
}

.navbar-main {
    position: fixed;
    top: calc(var(--top-navbar-height, 56px));
    width: 100%;
    z-index: 1049;
    transition: top 0.3s ease-in-out;
    background-color: #212529;
}

/* TRUCCO ANTI-TRASPARENZA: Crea un'estensione dello sfondo verso l'alto */
.navbar-main::before {
    content: "";
    position: absolute;
    top: -60px; /* Alti quanto la top-navbar per coprire tutto il vuoto */
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #4caf50; /* Lo stesso identico colore della tua navbar principale */
    z-index: -1; /* Lo tiene dietro i testi della navbar */
}

/* =========================================================
   STATO: SCORRIMENTO VERSO IL BASSO (TOPBAR NASCOSTA)
   ========================================================= */
body.topbar-hidden #navbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
}

body.topbar-hidden .navbar-main {
    top: 0;
    z-index: 1051;
}

/* =========================================================
   MEDIA QUERIES MOBILE
   ========================================================= */
@media (max-width: 380px) {
  /* 1. Rimpicciolisci leggermente il brand per guadagnare spazio prezioso */
  .navbar-main .navbar-brand {
    font-size: 1.1rem; 
    margin-right: 5px;
  }

  /* 2. Riduci la distanza tra le icone social */
  .navbar-main .order-2 .nav-item {
    margin-left: 2px !important;
    margin-right: 2px !important;
  }
  
  /* 3. Riduci il padding dei link social per stringere il blocco centrale */
  .navbar-main .order-2 .nav-link {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero-section{
  position: relative;
  overflow: hidden;
  color: white;
}

.hero-bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.hero-content{
  position: relative;
  z-index: 2;
}


/* =========================================================
   CAROUSEL
   ========================================================= */
   .carousel {
    margin-bottom: 4rem;
}

#myCarousel .carousel-caption {
    bottom: 3rem;
    z-index: 10;
}

#myCarousel .carousel-item {
    height: 32rem;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption p {
    color: dimgrey;
}

#testimonials .carousel-item h3 {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 3rem;
  padding-right: 3rem;
}

#certificazioni .carousel-inner {
  padding: 0 3rem;
}

#certificazioni .carousel-control-prev {
  left: -5%;
}

#certificazioni .carousel-control-next {
  right: -5%;
}

#certificazioni .carousel-inner {
  display: flex;           /* stack items side by side for flex sizing */
  align-items: center;     /* vertical center */
}
#certificazioni .carousel-item {
  flex: 0 0 100%;          /* full width */
  display: flex;
  align-items: center;
  justify-content: center;
}
#certificazioni img {
  max-height: 500px;
  width: auto;
  margin: auto;
}

#testimonials .carousel-inner {
  min-height: 220px; /* adjust for your tallest testimonial */
  display: block;    /* keep Bootstrap’s default */
}

.testimonials-heading {
  max-width: 750px;
  margin: auto;
}

/* =========================================================
   MARKETING CONTENT
   ========================================================= */
.marketing .col-lg-4 {
    margin-bottom: -14rem;
    text-align: center;
}

/* rtl:begin:ignore */
.marketing .col-lg-4 p {
    margin-right: 0.75rem;
    margin-left: 0.75rem;
}
/* rtl:end:ignore */

/* =========================================================
   FEATURETTES
   ========================================================= */
.featurette-divider {
    margin: 5rem 0;
}

/* rtl:begin:remove */
.featurette-heading {
    letter-spacing: -0.05rem;
}

@media (max-width: 767px) {
    .featurette-heading {
        margin-bottom: 1rem;
    }
}

.featurette-text-up {
    margin-top: -7rem;
}

@media (max-width: 767px) {
    .featurette-text-up {
        margin-top: 1rem;
    }
}

.navbar-nav .bi {
  vertical-align: middle;
}

.navbar-nav .bi-envelope-open {
  filter: drop-shadow(0 0 0.5px currentColor);
}

/* =========================================================
   WAVY BACKGROUND SECTIONS
   ========================================================= */
.wavy-container {
    position: relative;
    background: #fff;
    overflow: hidden;
    z-index: 1;
}

.wavy-container::before,
.wavy-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: -1; /* behind content */
}

.wavy-container::before {
    left: -45%; /* left wave */
    background-image: url("../img/wave-left.svg");
    background-position: left top;
}

.wavy-container::after {
    right: -45%; /* right wave */
    background-image: url("../img/wave-right.svg");
    background-position: right top;
}

/* Mobile: hide waves */
@media (max-width: 768px) {
    .wavy-container::before,
    .wavy-container::after {
        display: none;
    }
}



/* =========================================================
   UTILITIES & MISC
   ========================================================= */
.stars {
    color: #f3969a;
    font-size: 15px;
}

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    user-select: none;
}

.img-formazione {
    width: 70%; 
    height: auto; 
    display: block;
}

@media (max-width: 768px) {
    .img-formazione {
    width: 100%;
}
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

.card-body {
    margin-bottom:1rem;
}

/* Default → unstyled */
.custom-list {
  list-style: none;
  padding-left: 0;
}

/* md and up → styled */
@media (min-width: 768px) {
  .custom-list {
    list-style: disc;
    padding-left: 1.5rem;
  }
}
/* =========================================================
   SCROLL OFFSET FOR ANCHORS
   ========================================================= */
/* Default scroll offset for most sections */
#chisono,
#metodo,
#consulenze,
#diete,
#formazione,
#percorso-intestino,
#percorsi,
#contatti,
#dove {
    scroll-margin-top: 120px; /* Nota: 500px è tantissimo, di solito bastano 100-150px */
}

/* =========================================================
   RESPONSIVE TYPOGRAPHY
   ========================================================= */
@media (min-width: 40em) {
    .carousel-caption p {
        margin-bottom: 1.25rem;
        font-size: 1.25rem;
        line-height: 1.4;
    }

    .featurette-heading {
        font-size: 50px;
    }

    .testimonials-heading {
        font-size: 30px;
    }
}

@media (min-width: 62em) {
    .featurette-heading {
        margin-top: 7rem;
    }
}

#map-placeholder {
  /* Overlay molto scuro (0.85) per far risaltare al massimo il testo */
  background-image: linear-gradient(rgba(0, 0, 0, 0.80), rgba(0, 0, 0, 0.80)), url('/img/map-mobile.webp');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  height: 55vh;
  
  /* Sfocatura aumentata a 8px (puoi spingerti fino a 10px o 12px se vuoi un effetto 'vetro satinato' totale) */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
  #map-placeholder {
    background-image: linear-gradient(rgba(0, 0, 0, 0.80), rgba(0, 0, 0, 0.80)), url('/img/map-desktop.webp');
  }
}

@media (min-width: 1400px) {
  #map-placeholder {
    background-image: linear-gradient(rgba(0, 0, 0, 0.80), rgba(0, 0, 0, 0.80)), url('/img/map-desktop-large.webp');
  }
}

/* Blocca le proporzioni della foto dei contatti evitando il salto di layout */
.featurette-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Forza il browser a calcolare un quadrato perfetto (500x500) prima del caricamento */
    background-color: #f8f9fa; /* Opzionale: crea un leggero box grigio neutro mentre la foto carica */
}

/* Applica l'effetto rounded-3 a tutte le immagini, escludendo la grafica vettoriale SVG */
img:not([src$=".svg"]) {
    border-radius: 0.5rem !important; /* L'important garantisce che sovrascriva altri stili pregressi */
}