/* Stile migliorato per index.html ispirato a hp_elegante */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink:       #1a1714;
  --warm:      #2a2a2a;
  --muted:     #9e9589;
  --accent:    #8b6f47;
  --accent-lt: #c4a882;
  --border:    rgba(138,111,71,0.2);
  --serif:     'Cormorant Garamond', Georgia, serif;
  --sans:      'Raleway', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--warm);
  color: #f5f4e8;
  font-family: var(--sans);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── HEADER ─── */
.main-header {
  display: flex;
  flex-direction: column-reverse; /* Nav sopra i titoli su desktop */
  width: 100%;
  background: var(--warm);
}

.header-top-row {
  width: 100%;
}

.nav-toggle {
  display: none;
}

.header-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.header-content {
  padding: 2rem 2rem 0; /* Ridotto il padding desktop */
  text-align: center;
}

/* ─── HERO ─── */
.hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 2rem 4rem; /* Ripristinato un po' di padding superiore */
  text-align: center;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.6rem, 5.5vw, 6.2rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: #f5f4e8;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.35s forwards;
}

.hero-subtitle {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: #d5c6a2;
  margin-top: 1rem;
  margin-bottom: 2.8rem;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: fadeUp 0.9s 0.5s forwards;
}

.hero-image {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 3rem 0;
  opacity: 0;
  animation: fadeIn 1.2s 0.6s forwards;
}

.hero-image img {
  width: 100%;
  display: block;
  position: relative;
  filter: sepia(8%) contrast(1.03);
}

.hero-image-caption {
  position: absolute;
  top: -3rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: Arial, sans-serif;
  font-size: 1.6rem;
  color: #ff4fa3;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
  text-shadow:
    0 0 2px #ff4fa3,
    0 0 4px #ff4fa3,
    0 0 6px #ff4fa3,
    0 0 10px #ff4fa3,
    0 0 20px #ff2a6d,
    0 0 40px rgba(255, 42, 109, 0.8);
  animation: neon-flicker 3s infinite alternate;
  transition: all 0.3s ease;
}

.hero-image-caption:hover {
  color: #ffffff;
  text-shadow:
    0 0 4px #fff,
    0 0 6px #fff,
    0 0 8px #fff,
    0 0 12px #ff4fa3,
    0 0 20px #ff2a6d,
    0 0 30px rgba(255, 42, 109, 0.8);
  transform: translateX(-50%) translateY(-2px);
}

@keyframes neon-flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow:
      0 0 2px #ff4fa3,
      0 0 4px #ff4fa3,
      0 0 6px #ff4fa3,
      0 0 10px #ff4fa3,
      0 0 20px #ff2a6d,
      0 0 40px rgba(255, 42, 109, 0.8);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

/* ─── NAVIGAZIONE ─── */
.nav-container {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(42, 42, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 3rem;
  background: transparent;
  flex-wrap: wrap;
  gap: 1rem;
}

.topnav a {
  color: #f5f4e8;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  transition: color 0.3s;
  border: 1px solid transparent;
}

.topnav a:hover {
  color: #ffffff;
  border-color: var(--accent-lt);
  background: rgba(138,111,71,0.25);
  transform: translateY(-1px);
}

.topnav a.active {
  color: var(--ink);
  font-weight: 400;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: rgba(42, 42, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border: 1px solid var(--border);
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.dropdown.open .dropdown-content {
  display: block;
}

/* Rimuoviamo la regola hover per lasciare gestire tutto a JavaScript */

.dropbtn {
  background: transparent;
  color: #f5f4e8;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, transform 0.2s;
  font-family: var(--sans);
}

.dropbtn:hover {
  color: #ffffff;
  border-color: var(--accent-lt);
  background: rgba(138,111,71,0.25);
  transform: translateY(-1px);
}

.dropdown-content a {
  color: #f5f4e8;
  padding: 1rem 1.2rem;
  text-decoration: none;
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: none;
  border: none;
  text-align: left;
  transition: background 0.3s;
  font-weight: 400;
}

.dropdown-content a:hover {
  background: rgba(138,111,71,0.35);
  color: #ffffff;
  padding-left: 1.5rem;
}
.footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-text {
  font-size: 0.7rem;
  color: #d5c6a2;
  font-weight: 300;
  line-height: 1.6;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.3s;
}

.footer-link:hover {
  color: #f5f4e8;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column; /* Barra titolo+hamburger, poi menu sotto */
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(42, 42, 42, 0.85);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    width: 100%;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
  }

  .header-top-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem 0.5rem;
    border-bottom: 1px solid transparent;
  }

  .main-header:has(.topnav.responsive) .header-top-row {
    border-bottom-color: var(--border);
  }

  .header-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    width: auto;
    display: block;
    text-align: left;
  }

  .header-content .header-link {
    display: block;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    align-self: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #f5f4e8;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
  }

  .nav-toggle:focus-visible {
    outline: 2px solid var(--accent-lt);
    outline-offset: 2px;
  }

  .hero-title {
    font-size: clamp(2rem, 9vw, 3.25rem);
    margin-bottom: 0.2rem;
    text-align: left;
  }

  .hero-subtitle {
    margin-bottom: 0;
    margin-top: 0.35rem;
    text-align: left;
  }

  .nav-container {
    position: relative;
    top: auto;
    width: 100%;
    background: transparent;
    margin-top: 0;
    z-index: 0;
  }

  .topnav {
    display: block;
    padding: 0 1rem 0.35rem;
    text-align: left;
    width: 100%;
    overflow: hidden;
    min-height: 0;
  }

  .topnav.responsive {
    background: rgba(42, 42, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .topnav:not(.responsive) {
    padding-bottom: 0;
  }

  .topnav a, .topnav .dropbtn {
    display: none; 
    width: 100%;
    text-align: left;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }

  .topnav.responsive a, 
  .topnav.responsive .dropdown {
    display: block;
    width: 100%;
  }

  .topnav.responsive a:first-child {
    border-top: 1px solid var(--border); /* Aggiunge separazione quando aperto */
  }

  .topnav.responsive .dropbtn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }

  .dropdown {
    width: 100%;
    margin-bottom: 0;
  }
  
  .dropdown-content {
    position: static;
    display: none; 
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--accent);
    margin-top: 0;
    margin-left: 1rem;
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .dropdown.open .dropdown-content {
    display: block;
  }
  
  .hero {
      min-height: auto;
      padding: 1rem 1rem 3rem; /* Ridotto il padding superiore da 2rem a 1rem */
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      width: 100%;
    }
  
  .header-content .hero-title,
  .header-content .hero-subtitle {
    width: 100%;
    text-align: left;
  }
  
  .hero-image {
    max-width: 280px; /* Leggermente ridotto per sicurezza su schermi stretti */
    margin: 3rem auto;
    position: relative;
  }

  .hero-image-caption {
    position: absolute;
    right: 0;
    left: 0;
    top: -3.5rem;
    text-align: center;
    width: auto;
    max-width: 90%;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .hero-image-caption:hover {
    transform: translateX(-50%) translateY(-2px);
  }
}

/* Rimuoviamo le vecchie regole conflittuali */
@media (max-width: 768px) {
  /* Queste regole sono state integrate sopra per chiarezza */
}

@media (max-width: 600px) {
  /* Rimosso perché gestito sopra con .dropdown.open */
}
