/*
Theme Name: Hello Elementor Child
Template: hello-elementor
*/

/* ===========================================
   1. TIPOGRAFIA GLOBALE
=========================================== */
:root {
  /* Font-base */
  font-size: 16px;            /* 1rem = 16px */

  /* Scala tipografica */
  --fs-h1: 3rem;            /* 40px */
  --fs-h2: 2.5rem;              /* 32px */
  --fs-h3: 1.5rem;            /* 24px */
  --fs-section-title: 1.25rem;/* 20px */
  --fs-body: 1.2rem;            /* 16px */
  --fs-small: 0.875rem;       /* 14px */
  
 /* Colori di base */
  --color-primary: #04211A;
  --color-secondary: #084537;
  --color-accent: #c2380c;
  --color-bg: #faf7f3;
  --color-white: #ffffff;
}

@font-face {
  font-family: 'Montserrat Variable';
  src: url('/wp-content/themes/hello-elementor-child/fonts/montserrat-variable.woff2') format('woff2');
  font-weight: 100 900; /* se usi il variable da 100 a 900 */
  font-style: normal;
  font-display: swap;
}

/* ===========================================
   2. STILI BASE (sempre)
=========================================== */
body {
  font-family: 'Montserrat Variable', sans-serif;
  font-size: var(--fs-body); /* 1rem */
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--color-primary);
}

h1 {
  font-size: var(--fs-h1); /* 2.5rem */
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

h2 {
  font-size: var(--fs-h2); /* 2rem */
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  color: var(--color-primary);
}

h3 {
  font-size: var(--fs-h3); /* 1.5rem */
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h4, h5, h6 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1rem;
}

/* ===========================================
   3. RESPONSIVE: ADATTAMENTI MOBILE
=========================================== */
/* Tablet e schermi medi */
@media (max-width: 768px) {
  :root {
    font-size: 15px;  /* 1rem = 15px */
  }
}

/* Smartphone e schermi stretti */
@media (max-width: 480px) {
  :root {
    font-size: 15px;  /* 1rem = 14px */
  }
}

/* ===========================================
   2. LINK E INTERAZIONI
=========================================== */
a,
a:visited {
  color: #084537;
  text-decoration: none !important;
}
a:hover,
a:focus {
  color: #c2380c !important;
  text-decoration: none;
}

/* ===========================================
   3. BOTTONI E CTA
=========================================== */
button:not(.faq-question):not(.nav-toggle):not(.submenu-toggle),
.cta-button,
button,
input[type="submit"] {
  background: #04211A;
  color: #faf7f3;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-family: 'Montserrat Variable', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease;
  margin-top: 1rem;
}
button:not(.faq-question):not(.nav-toggle):not(.submenu-toggle):hover,
.cta-button:hover,
button:hover,
input[type="submit"]:hover {
  background: #c2380c;
  color: #ffffff !important;
}

/* ===========================================
   SCROLL
=========================================== */
html {
  scroll-behavior: smooth;
}

.elementor-post-content h2,
.entry-content h2,
.single-post-page h2 {
  scroll-margin-top: 55px;
}

@media (max-width: 768px) {
  .elementor-post-content h2,
  .entry-content h2,
  .single-post-page h2 {
    scroll-margin-top: 35px;
  }
}


/* ================================
   CONTAINER RESPONSIVO PRINCIPALE
================================== */
.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Mobile: larghezza 75% senza margini */
@media (max-width: 767px) {
  .container {
    width: 85%;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Tablet: contenuto più largo ma leggibile */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 720px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Desktop: larghezza fluida e leggibilità ottimale */
@media (min-width: 1025px) {
  .container {
    max-width: 1140px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ===========================================
   5. UTILITY RESPONSIVE
=========================================== */
.desktop-only {
  display: flex;
}
.mobile-only {
  display: none;
}
@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
    width: 100%;
  }
}

/* ===========================================
   6. ACCESSIBILITà
=========================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #04211A !important;
  color: #ffffff !important;
  padding: 0.5rem 1rem;
  z-index: 9999;
  text-decoration: none;
  font-weight: bold;
  transition: top 0.2s ease-in-out;
}

.skip-link:focus {
    background: #04211A;
  color: #ffffff !important;
  top: 0;
}
/* ============================
   HEADER – STRUTTURA E MENU
============================ */

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: #faf7f3;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  gap: 1.2rem;
}

.site-logo img {
  display: block;
}

/* Menu Desktop */
.primary-menu-desktop {
  display: flex;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-menu-desktop li {
  position: relative;
}

.primary-menu-desktop li a {
  display: inline-block;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  color: #04211A;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}

.primary-menu-desktop li a:hover {
  background: #c2380c;
  color: #faf7f3 !important;
}

.primary-menu-desktop li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #faf7f3;
  min-width: 200px;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 0.5rem 0;
  z-index: 10;
  list-style: none;   /* ✅ Elimina i pallini */
  margin: 0;           /* ✅ Elimina margine di default */
}


.primary-menu-desktop li ul li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #04211A;
  transition: background 0.3s, color 0.3s;
}

.primary-menu-desktop li ul li a:hover {
  background: #c2380c;
  color: #faf7f3;
}

@media (min-width: 1025px) {
  .primary-menu-desktop li:hover > ul {
    display: block;
  }
}

/* CTA */
.cta-button-wrapper.desktop-only .cta-button {
  display: inline-block;
  background: #04211A;
  color: #ffffff !important;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 6px;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
  white-space: nowrap;
}

.cta-button-wrapper.desktop-only .cta-button:hover {
  background: #c2380c;
  color: #ffffff !important;
}

/* ============================
   HAMBURGER MOBILE
============================ */

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1100;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: #04211A !important;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
  box-sizing: content-box;
  position: relative;
}

/* Linee distanziate */
.nav-toggle span:nth-child(2) {
  margin: 2px 0;
}

/* Hover */
.nav-toggle:hover span {
  background: #04211A !important;
}

/* Focus e accessibilità */
.nav-toggle:focus,
.nav-toggle:active,
.nav-toggle:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Stato "open" del toggle: trasforma in X */
.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive: mostra solo su mobile */
@media (max-width: 1024px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    margin-right: 3em;
  }

  .site-logo {
    margin-left: 1.5rem;
  }

  .site-logo img {
    max-height: 25px;
    width: auto;
  }
}

/* ============================
   MENU MOBILE A FISARMONICA
============================ */

.primary-menu-mobile {
  display: none;
  flex-direction: column;
  background: #faf7f3;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 999;
  position: fixed;
  top: 51px;
  left: 0;
  right: 0;
}

.primary-menu-mobile.open {
  display: flex;
}


.primary-menu-mobile li {
  position: relative;
  border-bottom: 1px solid #eee;
}

.primary-menu-mobile li a {
  display: block;
  padding: 1rem 2rem 1rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  color: #04211A;
  background: transparent;
  line-height: 1.4;
  transition: background 0.3s, color 0.3s;
}

.primary-menu-mobile li a:hover {
  background: #c2380c;
  color: #faf7f3 !important;
}

/* ============================
   VOCI ATTIVE E SOTTOMENU
============================ */

.primary-menu-mobile li.current-menu-item > a,
.primary-menu-mobile li.current_page_item > a {
  background-color: #04211A;
  color: #ffffff !important;
  font-weight: 700;
}

.primary-menu-mobile .sub-menu li.current-menu-item > a,
.primary-menu-mobile .sub-menu li.current_page_item > a {
  background-color: #04211A;
  color: #ffffff !important;
  font-weight: 700;
}

.primary-menu-mobile li.current-menu-ancestor > a {
  background-color: transparent;
  color: #04211A;
  font-weight: 700;
}

/* ============================
   FRECCIA SOTTOMENU MOBILE ▼
============================ */

/* 1. Default: freccia verde */
.primary-menu-mobile li.menu-item-has-children > .submenu-toggle {
  color: #084537;
}

/* 2. Hover generico: arancione */
.primary-menu-mobile li.menu-item-has-children > .submenu-toggle:hover {
  color: #c2380c !important;
}

/* 3. VOCE ATTIVA (pagina corrente) */
/* 3a. Freccia arancione se attiva ma NON aperta */
.primary-menu-mobile li.current-menu-item:not(.open) > .submenu-toggle,
.primary-menu-mobile li.current_page_item:not(.open) > .submenu-toggle {
  color: #c2380c !important;
}

/* 3b. Freccia bianca se attiva E aperta */
.primary-menu-mobile li.current-menu-item.open > .submenu-toggle,
.primary-menu-mobile li.current_page_item.open > .submenu-toggle {
  color: #ffffff !important;
}

/* 3c. Hover sulla freccia già bianca (evita che torni arancione) */
.primary-menu-mobile li.current-menu-item.open > .submenu-toggle:hover,
.primary-menu-mobile li.current_page_item.open > .submenu-toggle:hover {
  color: #ffffff !important;
}

/* 4. Ancestor: freccia sempre verde */
.primary-menu-mobile li.current-menu-ancestor > .submenu-toggle {
  color: #084537 !important;
}

/* 5. NON ATTIVA: freccia torna verde anche dopo interazioni */
.primary-menu-mobile li.menu-item-has-children:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.open) > .submenu-toggle {
  color: #084537 !important;
}

/* 6. Accessibilità (evita focus in stile arancio su dispositivi touch) */
.submenu-toggle:focus {
  color: inherit;
}

/* Toggle sottomenu mobile */
.primary-menu-mobile li.menu-item-has-children {
  position: relative;
}

.primary-menu-mobile li.menu-item-has-children > .submenu-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  background: none;
  border: none;
  color: #084537;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  transition: transform 0.3s ease;
  transform-origin: center center;
}

.primary-menu-mobile li.menu-item-has-children.open > .submenu-toggle {
  transform: rotate(180deg);
}

.primary-menu-mobile li.menu-item-has-children > .submenu-toggle:hover {
  color: #c2380c !important;
}

.primary-menu-mobile .sub-menu {
  display: none;
  flex-direction: column;
  background: #faf7f3;
  padding-left: 0;
  list-style: none;
}

.primary-menu-mobile li.open > .sub-menu {
  display: flex;
}

.primary-menu-mobile .sub-menu li a {
  padding: 0.9rem 2.5rem 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #04211A;
  background: #faf7f3;
  line-height: 1.4;
}

.primary-menu-mobile .sub-menu li a:hover {
  background: #c2380c;
  color: #faf7f3;
}

.nav-toggle,
.primary-menu-mobile .submenu-toggle {
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}

