/* ======================================================
   RESET & BASE
   ====================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Comfortaa', sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  /*background-image: url("../images/aerea_GR_sfondo.jpg");*/
  background-color: #FEF9C2;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* HEADER PRINCIPALE */

/* Overlay per migliorare la leggibilità */
.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  z-index: 0;
}

section,
header,
footer {
  position: relative;
  z-index: 1;
}

section {
  scroll-margin-top: 120px;
}

/* <weight>: Use a value from 300 to 700 +/
/* <uniquifier>: Use a unique and descriptive class name*/

.comfortaa-<uniquifier> {
  font-family: "Comfortaa", sans-serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
}

/* Desktop */
@media (min-width: 992px) {
  .text-justify {
    text-align: justify;
    hyphens: auto;
  }
}

/* Mobile */
@media (max-width: 991px) {
  .text-justify {
    text-align: left;
  }
}

/* ======================================================
   HEADER
   ====================================================== */

#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.3s ease;

  /* fallback */
  background-color: #ffffff;

  /* immagine header (se presente) */
  background-image: url("../images/cormiodomenico_header.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;

  /*min-height: 420px;*/
}

.header-inner {
  max-width: 1100px;
  margin: auto;
  padding: 30px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.logo-container img {
  max-height: 90px;
  width:auto;
  max-width: 100%;
  transition: all 0.3s ease;
}

#site-header.shrink .header-inner {
  padding: 8px 20px;
  justify-content: space-between;
}

#site-header.shrink .logo-container img {
  max-width: 380px;
  max-height: 65px;
}

/* Menu aperto: header più alto */
#site-header.menu-open .header-inner {
  align-items: flex-start;
  padding-bottom: 30px;
}

/*Menu sempre a destra*/
.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.main-nav details {
  position: relative;
}

.main-nav details ul {
  max-width: 90vw;
  box-sizing: border-box;
}

/* ======================================================
   NAVIGAZIONE (MENU A TENDINA)
   ====================================================== */

nav details summary {
  cursor: pointer;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid #ccc;
  display: inline-block;
  border-radius: 10px;
  background: #f5f7fa;
}

nav ul {
  list-style: none;
  padding: 0;
  margin-top: 12px;
}

nav li {
  margin: 8px 0;
}

nav a {
  text-decoration: none;
  color: #003366;
  font-weight: 500;
}

/* ======================================================
   SEZIONI GENERICHE
   ====================================================== */

section {
  padding: 60px 20px;
  max-width: 1100px;
  margin: auto;
}

h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #003366;
  font-weight: 700;
}

/* ======================================================
   BRAND – GRID A 4 COLONNE
   ====================================================== */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.brand {
  text-align: center;
}

.brand img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}

.brand h3 {
  margin-bottom: 10px;
  font-size: 1.0rem;
  color: #cf0303;
}

/* Responsive brand */
@media (max-width: 900px) {
  .brand-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   VANTAGGI
   ====================================================== */

#vantaggi ul {
  max-width: 700px;
  margin: 0 auto;
  padding-left: 20px;
}

/* ======================================================
   DOVE SIAMO – MAPPA
   ====================================================== */

.map-container {
  margin-top: 20px;
}

.map-container iframe {
  width: 100%;
  height: 450px;
  border: 0;
}

/* ======================================================
   CONTATTI – FORM
   ====================================================== */

#contatti {
  text-align: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  max-width: 420px;
  padding: 10px;
  margin-bottom: 12px;
  font-family: 'Comfortaa', sans-serif;
}

.contact-form textarea {
  min-height: 120px;
}

.contact-form button {
  padding: 12px 26px;
  font-weight: 700;
  font-family: 'Comfortaa', sans-serif;
  background: #003366;
  color: #ffffff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.privacy-label {
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.privacy-label a {
  color: #003366;
  text-decoration: underline;
}

/* ======================================================
   FOOTER
   ====================================================== */

footer {
  text-align: center;
  padding: 25px 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 0.9em;
  background: #ffffff;
}

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

footer a:hover {
  text-decoration: underline;
}

.azienda-info {
  margin-top: 15px;
}

/* ======================================================
   PAGINE LEGALI
   ====================================================== */
   
.legal-content {
  max-width: 820px;
  margin: auto;
  text-align: left;
}

.legal-content h2 {
  text-align: center;
}

.legal-content h3 {
  margin-top: 30px;
  color: #003366;
}

.legal-content p,
.legal-content li {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 768px) {

  .logo-container img {
    max-width: 300px;
  }
  
  .header-inner {
    padding: 16px 16px;
  }

  #site-header.shrink .logo-container img {
    max-width: 240px;
  }
  
  #site-header.shrink .header-inner {
    padding: 12px 20px;
  }
  
  .main-nav summary:not(.menu-toggle) {
    padding: 12px 18px;
    font-size: 1rem;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    padding: 8px;
  }

  .menu-toggle span {
    height: 3px;
  }
  
  .main-nav details ul {
    right: 0;
    left: auto;
    max-width: 92vw;
    padding-right: 12px;
  }
  
  .main-nav details[open] ul {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
  }
}

/* MOBILE LANDSCAPE – contenimento header */
@media (max-height: 500px) {

  .header-inner {
    padding: 10px 14px;
  }

  .logo-container img {
    max-height: 65px;
  }

  #site-header.shrink .logo-container img {
    max-height: 50px;
  }

}

/* ===========================
   HAMBURGER MENU
   =========================== */

.menu-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #f5f7fa;
  padding: 8px;
  list-style: none;
}

/* Rimuove il marker nativo di <summary> */
.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #003366;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.main-nav details[open] .menu-toggle span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.main-nav details[open] .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.main-nav details[open] .menu-toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}
