/*
Theme Name:   Armony Media Child
Theme URI:    https://armonymedia.it
Description:  Child theme per Armony Media – Agenzia Creativa Lecce
Author:       Armony Media
Author URI:   https://armonymedia.it
Template:     twentytwentyfour
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  armony-child
Tags:         creative, agency, animation, particles
*/

/* =========================================================
   VARIABILI CSS – SISTEMA DI DESIGN ARMONY MEDIA
   ========================================================= */
:root {
  /* Palette cromatica */
  --color-bg:         #080810;
  --color-electric:   #00C3FF;
  --color-magenta:    #FF2D78;
  --color-coral:      #FF6B4A;
  --color-yellow:     #FFE44D;
  --color-neon:       #39FF14;
  --color-white:      #F5F5F7;
  --color-white-dim:  rgba(245,245,247,0.6);
  --color-surface:    rgba(255,255,255,0.04);
  --color-border:     rgba(255,255,255,0.08);

  /* Tipografia */
  --font-display:     'Playfair Display', Georgia, serif;
  --font-body:        'DM Sans', system-ui, sans-serif;
  --font-mono:        'JetBrains Mono', monospace;

  /* Spaziatura */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  8rem;

  /* Effetti */
  --transition-fast:   0.2s cubic-bezier(0.23, 1, 0.32, 1);
  --transition-smooth: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  --transition-slow:   1.2s cubic-bezier(0.23, 1, 0.32, 1);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-full: 9999px;

  /* Z-index */
  --z-bg:      0;
  --z-canvas:  1;
  --z-content: 10;
  --z-nav:     100;
  --z-cursor:  9999;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Previene scroll orizzontale globale */
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  /* cursor gestito per pagina — vedi body.has-custom-cursor */
  /* Garantisce che nulla ecceda la larghezza del viewport */
  max-width: 100vw;
}

/* Cursore custom solo sulla homepage */
body.has-custom-cursor {
  cursor: none;
}
body.no-custom-cursor {
  cursor: auto;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Nascondi cursor solo dove il cursore custom è attivo */
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor [role="button"] {
  cursor: none;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* =========================================================
   LAYOUT GLOBALE
   ========================================================= */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: 1.5rem var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  transition: background 0.4s ease, backdrop-filter 0.4s ease,
              padding 0.3s ease, border-bottom 0.4s ease;
}

.site-header.scrolled {
  background: rgba(6, 6, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 1rem var(--space-md);
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--color-electric), var(--color-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
}

/* Immagine logo caricata da WordPress */
.site-logo__img {
  height: 36px;
  width: auto;
  max-width: 160px;
  display: block;
  object-fit: contain;
  /* Annulla il gradient del testo — l'immagine ha i suoi colori */
  -webkit-text-fill-color: initial;
  background: none;
}
@media (max-width: 768px) {
  .site-logo__img { height: 30px; max-width: 130px; }
}

.site-nav {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

/* ── DROPDOWN SOTTOMENU ── */
.site-nav li {
  position: relative;
}

/* Voce con figli — mostra freccia e padding extra */
.site-nav li.menu-item-has-children > a::before {
  content: ' ▾';
  font-size: 0.6rem;
  vertical-align: middle;
  opacity: 0.6;
}
.site-nav li.menu-item-has-children > a {
  padding-bottom: 12px;
  margin-bottom: -12px;
}

/* Sottomenu nascosto di default */
.site-nav .sub-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,24,0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.5rem;
  min-width: 200px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  pointer-events: none;
  /* Ponte invisibile sopra il gap tra voce e menu */
  margin-top: 0;
}

/* Ponte invisibile che copre il gap — evita che il menu sparisca */
.site-nav .sub-menu::after {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
}

/* Mostra al hover */
.site-nav li.menu-item-has-children:hover > .sub-menu,
.site-nav li.menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Voci del sottomenu */
.site-nav .sub-menu a {
  display: block;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(245,245,247,0.65);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-nav .sub-menu a:hover {
  color: #00C3FF;
  background: rgba(0,195,255,0.07);
}

.site-nav .sub-menu a::after {
  display: none;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-white-dim);
  transition: color var(--transition-fast);
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-electric);
  transition: width var(--transition-smooth);
}

.site-nav a:hover {
  color: var(--color-white);
}

.site-nav a:hover::after {
  width: 100%;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-white) !important;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.nav-cta:hover {
  border-color: var(--color-electric) !important;
  background: rgba(0, 195, 255, 0.08);
}

.nav-cta::after {
  display: none !important;
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-header { padding: 1.2rem var(--space-sm); }
}

/* ── MENU MOBILE ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1001;
}
.nav-toggle:hover { background: rgba(255,255,255,0.06); }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #F5F5F7;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}
/* Animazione X quando aperto */
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }

  /* Menu mobile overlay */
  .site-nav {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6,6,14,0.98);
    backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 6rem 2rem 3rem;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    overflow-y: auto;
  }
  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .site-nav > li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .site-nav > li:last-child { border-bottom: none; }
  .site-nav > li > a {
    display: block;
    padding: 1.1rem 0;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: rgba(245,245,247,0.85);
  }
  .site-nav > li > a:hover { color: #00C3FF; }
  .site-nav > li > a::after { display: none; }

  /* Sottomenu mobile — visibile sempre (no hover) */
  .site-nav .sub-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: rgba(255,255,255,0.03);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0.25rem 0 0.75rem;
    min-width: unset;
    width: 100%;
  }
  .site-nav .sub-menu::after { display: none; }
  .site-nav .sub-menu a {
    font-size: 0.82rem;
    color: rgba(245,245,247,0.5);
    padding: 0.45rem 0;
    text-align: center;
    border-radius: 0;
  }
  .site-nav .sub-menu a:hover {
    color: #00C3FF;
    background: none;
  }
  /* Freccia ▾ → nascosta su mobile (il sottomenu è sempre aperto) */
  .site-nav li.menu-item-has-children > a::before { display: none; }
  .site-nav li.menu-item-has-children > a { padding-bottom: 0.5rem; margin-bottom: 0; }

  /* Fix form overflow su mobile */
  .contact-form__row {
    grid-template-columns: 1fr !important;
  }
  .contact-form,
  .contact-page-form,
  .cpf-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 1.5rem !important;
    overflow: hidden !important;
  }
  .contact-form__field input,
  .contact-form__field textarea,
  .contact-form__field select,
  .cf-select,
  .cpf-field input,
  .cpf-field textarea,
  .cpf-field select {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Fix container overflow generale */
  .container {
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
    overflow-x: hidden !important;
  }
}

/* =========================================================
   SCROLLBAR PERSONALIZZATA
   ========================================================= */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--color-electric), var(--color-magenta));
  border-radius: 2px;
}

/* =========================================================
   SEZIONI POST-HERO
   ========================================================= */
.section {
  padding: var(--space-xl) 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-electric);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--space-md);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  padding: var(--space-lg) 0 var(--space-md);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-white-dim);
}

/* =========================================================
   ACCESSIBILITÀ – FOCUS VISIBLE
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--color-electric);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* =========================================================
   PREFERS-REDUCED-MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
