/* ========== Base / Typography ========== */
:root{
  --navbar-height: 110px;        /* altezza iniziale */
  --navbar-height-small: 70px;  /* altezza ridotta allo scroll */
}

body {
    overflow-x: hidden;
    font-family: "new-order", sans-serif;
    font-weight: 400;
}

/* ========== Buttons ========== */
.btn-galatero {
    text-transform: uppercase;
    font-weight: 400;
    padding: 0.3rem 1.5rem;
    border-radius: 0;
    letter-spacing: 0.03rem;
}

/* ========== Navbar (smart shrink) ========== */
.navbar {
  height: var(--navbar-height);
  position: fixed;
  top: 0;
  width: 100%;
  transition: height .25s ease, box-shadow .25s ease, background-color .25s ease;
  will-change: height;
  z-index: 1020;
  background-color: rgba(255,255,255,0.95);
}

/* Bottone Galatero */
.navbar .btn-galatero {
  background-color: #396639;
  color: #fff;
  font-weight: 400;
}

/* Hover SOLO su dispositivi con hover reale (desktop, mouse) */
@media (hover: hover) and (pointer: fine) {
  .navbar .btn-galatero:hover,
  .contatti .btn-galatero:hover {
    background-color: #2E522E; /* più scuro per contrasto AA */
    color: #FFFFFF;
    font-weight: 600;
  }
}

/* Sui device touch, non mantenere lo stato hover dopo il tap */
@media (hover: none) and (pointer: coarse) {
  .navbar .btn-galatero:hover {
    background-color: #396639; /* colore base */
    color: #fff;
    font-weight: 400;
  }
  .navbar .btn-galatero {
    -webkit-tap-highlight-color: transparent; /* elimina flash grigio/blu */
  }
}

/* Già bene avere anche questi reset */
.navbar .btn-galatero:active,
.navbar .btn-galatero:focus {
  background-color: #396639;
  color: #fff;
  font-weight: 400;
  outline: none;
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
  color: #396639;
  display: inline-block;
  transition: transform .15s ease, color .15s ease;
}

.nav-link:hover {
  transform: scale(1.05);
  color: #0a4d2e;
}

.nav-link.active {
  transform: scale(1.05);
}

.nav-item {
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
}

/* Stato compattato allo scroll (aggiunto via JS) */
.navbar.navbar--shrink {
  height: var(--navbar-height-small);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  background-color: #ffffff;
}

/* --- LOGO --- */
.navbar .navbar-brand img {
  height: 85px;           /* logo esteso */
  width: auto;
  transition: height .25s ease, opacity .25s ease;
}

.navbar.navbar--shrink .navbar-brand img {
  height: 55px;           /* logo ridotto allo scroll */
}

/* --- Optional: preload swap smoother --- */
.navbar .navbar-brand img {
  will-change: height;
}

/* --- Responsive: riduci leggermente il logo sui dispositivi piccoli --- */
@media (max-width: 991px) {
  .navbar .navbar-brand img {
    height: 60px;
  }
  .navbar.navbar--shrink .navbar-brand img {
    height: 45px;
  }
}

/* Pulsante "Contattaci" */
.navbar .nav-cta {
  margin-left: 1rem;
  padding: 0.35rem 1rem;
}

.nav-link:focus-visible,
.btn-galatero:focus-visible,
.form-control:focus-visible,
a:focus-visible {
  outline: 3px solid #1A73E8;
  outline-offset: 2px;
}

/* Su mobile: riduci leggermente il logo e il bottone */
@media (max-width: 767px) {
  .logo-galatero {
    height: 60px;
  }

  .navbar .nav-cta {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
  }
}

/* ========== Hero video ========== */
.intro {
    position: relative;
    width: 100%;
    height: 700px;
    margin-top: var(--navbar-height); /* allineato alla nuova altezza */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Responsive --- */

@media (max-width: 1199px) {
  .intro {
    height: 550px;
  }
}

@media (max-width: 991px) {
  .intro {
    height: 420px;
  }
}

@media (max-width: 767px) {
  .intro {
    height: 350px;
  }
}

@media (max-width: 575px) {
  .intro {
    height: 300px;
  }
}

.intro video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -1;
}

/* ========== Claim ========== */
.claim {
    background: #396639;
    background: linear-gradient(90deg, rgba(57, 102, 57, 1) 0%, rgba(197, 119, 34, 1) 40%, rgba(220, 145, 27, 1) 50%, rgba(231, 177, 66, 1) 60%, rgba(162, 192, 55, 1) 100%);
}

.claim .title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.07rem;
}

.claim { position: relative; }
.claim::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  pointer-events: none;
}
.claim .title { position: relative; }

/* ========== Chi siamo ========== */
.chi-siamo .title {
    font-size: 1.8rem;
    color: #396639;
    font-weight: 600;
}

/* ========== Obiettivi ========== */
.obiettivi {
    background-color: #F3E3D2;
}

.obiettivi img {
    height: 70px;
}

.obiettivi .title {
    font-size: 1.5rem;
    letter-spacing: 0.04rem;
    font-weight: 500;
    color: #c57722;
}

/* ========== Attività ========== */
.attivita .title {
    color: #396639;
    font-size: 2.4rem;
    font-weight: 500;
}

.attivita .icon {
    width: 65px;
}

.attivita .sec-title {
    color: #396639;
    font-size: 1.7rem;
    font-weight: 500;
}

/* ========== Certificazioni ========== */
.certificazioni {
    background-color: #f4deba;
}

.certificazioni .btn-galatero {
    background-color: #dc911b;
    color: #fff;
    line-height: 1.1;
}

@media (hover: hover) and (pointer: fine) {
    .certificazioni .btn-galatero:hover {
        background-color: #fff;
        color: #dc911b;
    }
}

.certificazioni .title {
    font-size: 2.4rem;
    font-weight: 500;
    color: #dc911b;
    letter-spacing: 0.04rem;
}

/* ========== Contatti ========== */
.contatti ul {
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
}

.contatti ul li {
    padding: 0.2rem 0;
}

.contatti .title {
    font-size: 2rem;
    font-weight: 500;
    color: #396639;
    letter-spacing: 0.04rem;
}

.contatti strong {
    color: #396639;
}

.contatti .form-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #396639;
    letter-spacing: 0.04rem;
}

.contatti form {
    background-color: #C3D1C3;
    padding: 1.5rem;
}

.contatti form label {
    font-size: 0.9rem;
    letter-spacing: 0.02rem;
    color: #396639;
    margin-bottom: 0.3rem;
    line-height: 1;
    font-weight: 500;
}

.contatti a {
    color: #000;
    text-decoration: none;
}

.contatti a:hover {
    text-decoration: underline;
}

.contatti .form-control {
    border-radius: 0;
}

.contatti .btn-galatero {
    background-color: #396639;
    color: #fff;
}

.contatti .btn-galatero:hover {
    background-color: #fff;
    color: #396639;
}

.contatti .text {
    font-size: 0.85rem;
}

.contatti textarea{
    padding: 0.5rem;
}

.contatti textarea::placeholder{
    font-size: 0.85rem;
}

.contatti iframe {
  width: 100%;
  height: 600px;
  border: 0;
}

@media (max-width: 991px) {
  .contatti iframe {
    height: 450px;
  }
}

@media (max-width: 767px) {
  .contatti iframe {
    height: 350px;
  }
}

@media (max-width: 575px) {
  .contatti iframe {
    height: 300px;
  }
}

/* Nasconde il <br> su desktop */
.mobile-break {
  display: none;
}

/* Mostra il <br> solo su mobile */
@media (max-width: 767px) {
  .mobile-break {
    display: inline;
  }
}


/* ========== Footer ========== */
footer {
    background-color: #396639;
}

footer p {
    color: #fff;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: #fff;
}

/* ========== Anchor offset: evita che la navbar copra i titoli quando clicchi i link ========== */
#chi-siamo, #obiettivi, #attivita, #documenti, #contatti{
    scroll-margin-top: calc(var(--navbar-height-small) + 16px);
}

/* ========== Responsive ========== */
@media (max-width: 767.98px) {
    .claim .title {
        font-size: 6vw;
    }

    .chi-siamo .title {
        font-size: 7vw;
    }

    p {
        font-size: 4.1vw;
    }

    .obiettivi .title {
        font-size: 6.5vw;
    }

    .attivita .title {
        font-size: 9vw;
    }

    .attivita .sec-title {
        font-size: 7vw;
    }

    .certificazioni .title {
        font-size: 9vw;
    }

    .contatti .title {
        font-size: 8vw;
    }

    .contatti .form-title {
        font-size: 5vw;
    }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .intro video { display: none; }
}

.link-accessibilita {
  color: #a2c037;
  text-decoration: underline;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
}

.link-accessibilita:hover,
.link-accessibilita:focus {
  color: #a2c037;
  text-decoration: none;
}
