/*
Theme Name: EZThemeNew
Theme URI: https://elenazarino.it
Author: ez
Author URI: https://elenazarino.it
Description: Tema WordPress personalizzato con design pulito e professionale, ottimizzato per Elementor e PHP 8.2+. Include pannello Customizer per la gestione dinamica dei colori.
Version: 3.0
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ezthemenew
Tags: blog, portfolio, elementor, responsive, customizable
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES — gestite anche da WordPress Customizer
   ============================================================ */
:root {
  --color-primary:      #0052CC;
  --color-primary-alt:  #0048FE;
  --color-primary-mid:  #2663EB;
  --color-text:         #020817;
  --color-text-sec:     #475467;
  --color-text-ter:     #63697C;
  --color-background:   #ffffff;
  --color-bg-hero:      #DEF2FF;
  --color-bg-card:      #DBEAFE;
  --color-link-hover:   #0048FE;
  --color-border:       #E2E8F0;
  --color-accent:       #DEF2FF;
  --color-input-bg:     #ffffff;
  --color-table-stripe: rgba(0, 82, 204, 0.04);
  --color-dark:         #020817;
  --color-dark-alt:     #0A1530;
  --color-stats-bg:     #13121E;
  --color-banner-bg:    #1F43B6;

  --content-width:      1200px;

  --font-primary:       'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-weight-regular:   400;
  --font-weight-medium:    500;
  --font-weight-semibold:  600;
  --font-weight-bold:      700;
  --font-weight-extrabold: 800;
  --line-height-headings:  1.25;
  --line-height-body:      1.65;
  --letter-spacing-normal: 0;
  --letter-spacing-label:  0.1em;

  /* WordPress block alignment */
  --wp--style--global--content-size: var(--content-width);
  --wp--style--global--wide-size:    100%;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  margin-block-start: 0.5rem;
  margin-block-end: 1rem;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-headings);
  color: inherit;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-block-start: 0; margin-block-end: 0.9rem; }

a {
  background-color: transparent;
  color: inherit;
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; }
a:not([href]):not([tabindex]) { color: inherit; text-decoration: none; cursor: default; }
a:not([href]):not([tabindex]):hover,
a:not([href]):not([tabindex]):focus { color: inherit; text-decoration: none; outline: none; }

abbr[title] { border-bottom: none; text-decoration: underline dotted; }
b, strong { font-weight: bolder; }
code, kbd, samp { font-family: monospace, monospace; font-size: 1em; }
small { font-size: 80%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sub { bottom: -0.25em; }
sup { top: -0.5em; }

hr { box-sizing: content-box; height: 0; overflow: visible; }

pre {
  font-family: monospace, monospace;
  font-size: 1em;
  white-space: pre-wrap;
}

figcaption {
  font-size: 0.875rem;
  color: var(--color-text-sec);
  line-height: 1.4;
  font-style: italic;
  font-weight: var(--font-weight-regular);
}

/* ============================================================
   IMAGES
   ============================================================ */
img {
  border-style: none;
  height: auto;
  max-width: 100%;
  display: block;
}

/* ============================================================
   MISC ELEMENTS
   ============================================================ */
details { display: block; }
summary { display: list-item; }
template, [hidden] { display: none; }

/* ============================================================
   FORMS
   ============================================================ */
label { display: inline-block; line-height: 1; vertical-align: middle; }

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

input[type=text],
input[type=date],
input[type=email],
input[type=number],
input[type=password],
input[type=search],
input[type=tel],
input[type=url],
select,
textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  background-color: var(--color-input-bg);
  transition: border-color 0.2s;
}
input[type=text]:focus,
input[type=date]:focus,
input[type=email]:focus,
input[type=number]:focus,
input[type=password]:focus,
input[type=search]:focus,
input[type=tel]:focus,
input[type=url]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  outline: none;
}

button, input { overflow: visible; }
button, select { text-transform: none; }

button,
[type=button],
[type=reset],
[type=submit] {
  width: auto;
  -webkit-appearance: button;
  display: inline-block;
  font-weight: var(--font-weight-semibold);
  text-align: center;
  white-space: nowrap;
  user-select: none;
  background-color: transparent;
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  border-radius: 50px;
  transition: all 0.2s;
  cursor: pointer;
}
button:focus:not(:focus-visible),
[type=submit]:focus:not(:focus-visible),
[type=button]:focus:not(:focus-visible) { outline: none; }
button:hover, button:focus,
[type=submit]:hover, [type=submit]:focus,
[type=button]:hover, [type=button]:focus { text-decoration: none; }

fieldset { padding: 0.35em 0.75em 0.625em; }
legend { box-sizing: border-box; color: inherit; display: table; max-width: 100%; padding: 0; white-space: normal; }
progress { vertical-align: baseline; }
textarea { overflow: auto; resize: vertical; }
[type=checkbox], [type=radio] { box-sizing: border-box; padding: 0; }
[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button { height: auto; }
[type=search] { -webkit-appearance: textfield; outline-offset: -2px; }
[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; }
select { display: block; }

/* ============================================================
   TABLES
   ============================================================ */
table {
  background-color: transparent;
  width: 100%;
  margin-bottom: 15px;
  font-size: 0.9em;
  border-spacing: 0;
  border-collapse: collapse;
}
table th, table td {
  padding: 12px 15px;
  line-height: 1.5;
  vertical-align: top;
  border: 1px solid var(--color-border);
}
table th { font-weight: var(--font-weight-bold); }
table thead th, table tfoot th { font-size: 1em; }
table tbody > tr:nth-child(odd) > td,
table tbody > tr:nth-child(odd) > th { background-color: var(--color-table-stripe); }
table tbody tr:hover > td,
table tbody tr:hover > th { background-color: var(--color-accent); }
table tbody + tbody { border-top: 2px solid var(--color-border); }

@media (max-width: 767px) {
  table { font-size: 0.8em; }
  table th, table td { padding: 8px; }
}

/* ============================================================
   LISTS
   ============================================================ */
dl, dt, dd, ol, ul, li {
  margin-block-start: 0;
  margin-block-end: 0;
  border: 0;
  outline: 0;
  font-size: 100%;
  vertical-align: baseline;
  background: transparent;
}

/* ============================================================
   BLOCK ALIGNMENT
   ============================================================ */
.alignwide {
  width: 100%;
  max-width: 100%;
}
.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}
.alignleft { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.skip-link.screen-reader-text {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link.screen-reader-text:focus {
  left: 6px;
  top: 6px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--color-primary);
  color: #fff;
  font-weight: var(--font-weight-semibold);
  border-radius: 4px;
  z-index: 9999;
  text-decoration: none;
}

/* ============================================================
   SITE HEADER — floating pill navbar
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
  pointer-events: none;
}

.navbar-pill {
  pointer-events: all;
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 7px 0px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 6px;
  height: 64px;
  transition: box-shadow 0.2s;
}
.navbar-pill:hover { box-shadow: rgba(0, 0, 0, 0.18) 0px 8px 20px 0px; }

/* Logo */
.navbar-logo { flex-shrink: 0; }
.navbar-logo img { height: 38px; width: auto; display: block; }
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-brand-name {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  color: var(--color-dark);
  letter-spacing: 0.02em;
}
.navbar-brand-name strong {
  font-weight: var(--font-weight-extrabold);
  color: var(--color-dark);
}

/* Nav list */
.navbar-nav { flex: 1; }
.navbar-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 38px; /* margine prima dell'inizio del menu (azzerato su mobile) */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  flex-wrap: wrap;
}
.navbar-nav .nav-list li { margin: 0; }
/* voci di primo livello allineate a sinistra */
.navbar-nav .nav-list > li { display: flex; align-items: center; }
.navbar-nav .nav-list a {
  display: block;
  padding: 4px 4px;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--color-text);
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.navbar-nav .nav-list a:hover,
.navbar-nav .nav-list .current-menu-item > a,
.navbar-nav .nav-list .current_page_item > a {
  background: var(--color-bg-card);
  color: var(--color-primary);
  /* grassetto simulato: ispessisce il testo senza cambiarne la larghezza,
     così le voci lunghe non vanno a capo al passaggio del mouse */
  text-shadow: 0.4px 0 0 currentColor, -0.4px 0 0 currentColor;
  text-decoration: none;
}

/* Dropdown — desktop */
.navbar-nav .nav-list .menu-item-has-children {
  position: relative;
}
.navbar-nav .nav-list .menu-item-has-children > a {
  padding-right: 10px;
}

/* Freccia indicatrice sui voci di PRIMO livello con sottomenu (desktop):
   punta in basso e ruota verso l'alto quando il dropdown è aperto */
.navbar-nav .nav-list > .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.6;
  transition: transform 0.2s ease;
}
.navbar-nav .nav-list > .menu-item-has-children:hover > a::after,
.navbar-nav .nav-list > .menu-item-has-children:focus-within > a::after,
.navbar-nav .nav-list > .menu-item-has-children.submenu-hover > a::after {
  transform: translateY(1px) rotate(-135deg);
}

.submenu-toggle {
  display: none; /* visible only on mobile */
}

.navbar-nav .nav-list .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11);
  padding: 6px;
  list-style: none;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
}
.navbar-nav .nav-list .sub-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
}
.navbar-nav .nav-list .menu-item-has-children:hover > .sub-menu,
.navbar-nav .nav-list .menu-item-has-children:focus-within > .sub-menu,
.navbar-nav .nav-list .menu-item-has-children.submenu-hover > .sub-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.navbar-nav .nav-list .sub-menu a {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  border-radius: 10px;
  padding: 8px 14px;
  white-space: nowrap;
  color: var(--color-text);
}
.navbar-nav .nav-list .sub-menu a:hover {
  background: var(--color-bg-card);
  color: var(--color-primary);
  /* grassetto simulato per non variare la larghezza (vedi primo livello) */
  text-shadow: 0.4px 0 0 currentColor, -0.4px 0 0 currentColor;
}

/* Dropdown annidati (3° e 4° livello) — flyout laterale su desktop */
.navbar-nav .nav-list .sub-menu .menu-item-has-children {
  position: relative;
}
.navbar-nav .nav-list .sub-menu .menu-item-has-children > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
/* chevron a destra che segnala la presenza di un sottomenu annidato */
.navbar-nav .nav-list .sub-menu .menu-item-has-children > a::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  flex-shrink: 0;
}
/* il sottomenu annidato esce a destra del proprio elemento padre */
.navbar-nav .nav-list .sub-menu .sub-menu {
  top: -7px;
  left: 100%;
  right: auto;
  margin-left: 6px;
  z-index: 201;
}
/* il "ponte" invisibile per l'hover passa a sinistra (copre il gap del flyout) */
.navbar-nav .nav-list .sub-menu .sub-menu::before {
  top: 0;
  bottom: 0;
  left: -6px;
  right: auto;
  width: 6px;
  height: auto;
}
/* apertura verso sinistra quando il flyout uscirebbe dal bordo destro */
.navbar-nav .nav-list .sub-menu .menu-item-has-children.submenu-flip-left > .sub-menu {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 6px;
}
.navbar-nav .nav-list .sub-menu .menu-item-has-children.submenu-flip-left > .sub-menu::before {
  left: auto;
  right: -6px;
}

/* Actions */
.navbar-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Selettore lingua (placeholder) */
.navbar-lang {
  position: relative;
  flex-shrink: 0;
}
.navbar-lang-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: 9999px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.navbar-lang-toggle::-webkit-details-marker { display: none; } /* nasconde il triangolo nativo */
.navbar-lang-toggle:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-card);
  color: var(--color-primary);
}
.navbar-lang-caret { transition: transform 0.2s ease; }
.navbar-lang[open] .navbar-lang-caret { transform: rotate(180deg); }
.navbar-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11);
  z-index: 300;
}
.navbar-lang-menu a {
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.navbar-lang-menu a:hover {
  background: var(--color-bg-card);
  color: var(--color-primary);
}
.navbar-lang-menu a[aria-current="true"] {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

/* Search button */
.navbar-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: 9999px;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
}
.navbar-search-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-card);
  color: var(--color-primary);
}

/* Search modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal[hidden] { display: none; }

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-modal-box {
  position: relative;
  width: min(680px, 92vw);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  padding: 28px 28px 20px;
  animation: searchModalIn 0.2s ease;
}

@keyframes searchModalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.search-modal-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-modal-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--color-input-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-modal-field:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.search-modal-icon {
  flex-shrink: 0;
  color: var(--color-text-sec);
}

.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  background: transparent;
  padding: 0;
}
.search-modal-input::placeholder { color: var(--color-text-ter); }

.search-modal-submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  background: linear-gradient(102deg, #1b6ec2, #133768);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, box-shadow 0.15s;
}
.search-modal-submit:hover {
  opacity: 0.9;
  box-shadow: 0 4px 16px rgba(0, 82, 204, 0.35);
}

.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.search-modal-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--color-text-ter);
}

.search-modal-close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  color: var(--color-text-sec);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.search-modal-close:hover { background: var(--color-border); color: var(--color-text); }

body.search-modal-open { overflow: hidden; }

/* Hamburger toggle — hidden on desktop */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 0;
  cursor: pointer;
}
.toggle-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav */
@media (max-width: 860px) {
  .navbar-nav { display: none; }
  .navbar-toggle { display: flex; }

  .nav-open .navbar-pill {
    border-radius: 16px;
    flex-wrap: wrap;
    height: auto;
    padding-bottom: 12px;
    align-items: flex-start;
  }
  .nav-open .navbar-logo,
  .nav-open .navbar-actions {
    padding-top: 12px;
  }
  .nav-open .navbar-nav {
    display: block;
    width: 100%;
    /* annulla il flex:1 di base (flex-basis:0): senza questo il nav resta
       sulla stessa riga di logo/azioni invece di andare a capo a tutta larghezza */
    flex: 1 1 100%;
    order: 3;
    padding: 8px 0 4px;
    /* il menu diventa un contenitore scrollabile: con tutti i livelli aperti
       le voci in eccesso restano raggiungibili invece di finire fuori schermo */
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-open .navbar-nav .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-left: 0; /* su mobile niente indentazione del menu */
  }
  .nav-open .navbar-nav .nav-list > li {
    display: block;
    width: 100%;
  }
  .nav-open .navbar-nav .nav-list > li + li::before { display: none; }
  .nav-open .navbar-nav .nav-list a {
    padding: 8px 16px;
    width: 100%;
    white-space: normal; /* le etichette lunghe vanno a capo invece di sbordare */
    overflow-wrap: anywhere;
  }
  .nav-open .navbar-toggle .toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .navbar-toggle .toggle-bar:nth-child(2) { opacity: 0; }
  .nav-open .navbar-toggle .toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Mobile submenu: accordion */
  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-sec);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.15s;
    margin-left: 4px;
  }
  .submenu-open > .submenu-toggle {
    background: var(--color-bg-card);
    color: var(--color-primary);
  }
  .submenu-toggle svg {
    display: block;
    flex-shrink: 0;
    stroke: var(--color-text-sec);
  }
  .submenu-open > .submenu-toggle svg {
    transform: rotate(180deg);
  }

  .nav-open .navbar-nav .nav-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-open .navbar-nav .nav-list li > a {
    flex: 1;
  }

  .nav-open .navbar-nav .nav-list .sub-menu {
    position: static;
    opacity: 1;
    pointer-events: all;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--color-border);
    border-radius: 0;
    padding: 4px 0 4px 12px;
    width: 100%;
    min-width: 0; /* annulla i 210px desktop: niente sbordamento ai livelli annidati */
    display: none;
    background: transparent;
  }
  .nav-open .navbar-nav .nav-list .submenu-open > .sub-menu {
    display: block;
  }
  .nav-open .navbar-nav .nav-list .sub-menu a {
    font-size: 0.94rem;
    color: var(--color-text-sec);
    border-radius: 8px;
  }

  /* su mobile l'accordion usa il pulsante .submenu-toggle: niente chevron CSS */
  .navbar-nav .nav-list .sub-menu .menu-item-has-children > a::after,
  .navbar-nav .nav-list > .menu-item-has-children > a::after {
    display: none;
  }
  .navbar-nav .nav-list .sub-menu .menu-item-has-children > a {
    display: block;
  }
  /* indentazione progressiva dei livelli annidati (3° e 4°) */
  .nav-open .navbar-nav .nav-list .sub-menu .sub-menu {
    padding-left: 14px;
    border-left-color: var(--color-bg-card);
  }
}

/* Portatili piccoli (menu orizzontale ma spazio ridotto): font del menu -1px */
@media (min-width: 861px) and (max-width: 1280px) {
  .navbar-nav .nav-list a {
    font-size: 13px;
  }
  .navbar-nav .nav-list {
    gap: 2px;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.75);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 60px 24px 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 40px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.footer-logo-text {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: #fff;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
}
.footer-logo-text:hover { text-decoration: none; color: var(--color-bg-hero); }

.footer-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 4px;
}
.footer-brand-link:hover { text-decoration: none; }
.footer-brand-logo {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}
.footer-brand-name {
  font-size: 1.15rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.06em;
}
.footer-brand-name strong {
  font-weight: 800;
  color: #fff;
}
.footer-brand-link:hover .footer-brand-name { color: var(--color-bg-hero); }

.footer-nav { flex-shrink: 0; }
.footer-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.footer-nav-list a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-nav-list a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.footer-brand-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 10px 0 0;
  line-height: 1.5;
}

.footer-contact-label {
  display: block;
  font-size: 0.7rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 12px;
}

.footer-contact {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer-contact a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-contact a:hover { color: #fff; }

.footer-social-icons {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 16px;
}
.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
}
.footer-social-link svg {
  width: 17px;
  height: 17px;
}

.footer-form-col { display: flex; flex-direction: column; }

.footer-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-form-row {
  display: flex;
  gap: 8px;
}
.footer-form-row .footer-form-input { flex: 1; }
.footer-form-input {
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  box-shadow: inset 0 0 0 9999px #0d1829;
  border: none;
  border-radius: 4px;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: 0.82rem;
  padding: 1px 8px;
  height: 28px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  box-sizing: border-box;
}
.footer-form-input:-webkit-autofill,
.footer-form-input:-webkit-autofill:hover,
.footer-form-input:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 9999px #0d1829;
  -webkit-text-fill-color: #fff;
}
.footer-form-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.footer-form-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 9999px #12203a;
}
.footer-form-textarea { resize: none; height: auto; min-height: 48px; }

.footer-form-gdpr {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}
.footer-form-gdpr input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  min-width: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  background-color: #0d1829;
  cursor: pointer;
  margin-top: 2px;
  position: relative;
  transition: background-color 0.15s, border-color 0.15s;
}
.footer-form-gdpr input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.footer-form-gdpr input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.footer-form-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: var(--font-weight-bold);
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.footer-form-btn:hover { background: #2663EB; }
.footer-form-notice {
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 5px;
  margin-bottom: 8px;
}
.footer-form-notice--ok    { background: rgba(40,167,69,0.15); color: #7ddc9a; }
.footer-form-notice--error { background: rgba(220,53,69,0.15); color: #f18a94; }

.footer-legal {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.footer-legal a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-legal a:hover { color: rgba(255, 255, 255, 0.75); }
.footer-legal span { color: rgba(255, 255, 255, 0.2); }

@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-form-col { grid-column: span 2; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-form-col { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
#wrapper { min-height: 100vh; display: flex; flex-direction: column; }
#container { flex: 1; }

/* ============================================================
   TEMPLATE — Page & Post
   ============================================================ */
.page-content,
.post-content {
  width: 100%;
}

.page-links {
  margin: 20px 0;
  text-align: center;
}

/* ============================================================
   TEMPLATE — Archive & Index
   ============================================================ */
.archive-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px;
}

.archive-content article {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}
.archive-content article:last-of-type { border-bottom: none; }

.post-title {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: var(--font-weight-bold);
}
.post-title a { color: var(--color-text); text-decoration: none; }
.post-title a:hover { color: var(--color-primary); text-decoration: none; }

.entry-summary {
  color: var(--color-text-sec);
  line-height: 1.7;
  margin: 0;
}

/* Pagination */
.wp-block-query-pagination,
.page-links,
nav.pagination {
  margin: 40px 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-primary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.15s;
}
.page-numbers:hover { background: var(--color-bg-card); border-color: var(--color-primary); text-decoration: none; }
.page-numbers.current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.page-numbers.dots { border-color: transparent; color: var(--color-text-ter); }

/* ============================================================
   ENTRY CONTENT (Gutenberg / classic editor blocks)
   ============================================================ */
.entry-content { line-height: 1.8; }
.entry-content p { margin-bottom: 20px; }
.entry-content h1, .entry-content h2, .entry-content h3 { margin: 2rem 0 1rem; }
.entry-content h1:first-child, .entry-content h2:first-child, .entry-content h3:first-child { margin-top: 0; }
.entry-content ul, .entry-content ol { margin: 20px 0; padding-left: 30px; }
.entry-content li { margin-bottom: 8px; }
.entry-content blockquote {
  margin: 30px 0;
  padding: 20px 24px;
  background: var(--color-accent);
  border-left: 4px solid var(--color-primary);
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  .site-header, #footer { display: none; }
  a[href]::after { content: " (" attr(href) ")"; }
  abbr[title]::after { content: " (" attr(title) ")"; }
  a[href^="#"]::after, a[href^="javascript:"]::after { content: ""; }
  pre, blockquote { break-inside: avoid; border: 1px solid #999; }
  thead { display: table-header-group; }
  tr, img { break-inside: avoid; }
  p, h2, h3 { orphans: 3; widows: 3; }
  h2, h3 { break-after: avoid; }
}
