/* layout.css — header, navigazione, dropdown, hamburger mobile,
   separatore a ornamento, footer, banner annuncio. Il pannello mobile
   sotto i 720px era in un unico @media con regole di hero/prose-card/
   detail-grid non di sua competenza: quelle sono ora nei rispettivi
   file (components.css, pages/tournaments.css) in un loro @media
   separato con la stessa query — CSS li unisce comunque in cascata,
   niente di perso a tenerli fisicamente distinti. */

/* ── Header ─────────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: .85rem 2.5rem;
  background: var(--surface);
  border-bottom: var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.brand {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: .08em;
  color: var(--copper-bright);
  text-transform: uppercase;
  transition: color .2s;
}
.brand:hover { color: var(--gold); }

/* ── Navigation ─────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}

.site-nav > a,
.dropdown-toggle {
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .45rem .8rem;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}

/* .dropdown-toggle è un <button>: azzera il chrome nativo per farlo
   coincidere visivamente con le voci-<a> accanto. */
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: transparent;
  border: none;
  font: inherit;
  cursor: pointer;
}

.site-nav > a:hover,
.site-nav > a:focus-visible,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
  color: var(--copper-bright);
  background: var(--copper-glow);
  text-decoration: none;
}

.dropdown-caret {
  display: inline-block;
  font-size: .6rem;
  transition: transform .2s;
}

/* ── Dropdown ────────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  display: none;
  flex-direction: column;
  min-width: 210px;
  background: var(--surface-mid);
  border: var(--rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1000;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
}

.dropdown-menu a {
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .85rem 1.2rem;
  white-space: nowrap;
  /* transform, non padding-left: stesso indent al hover senza animare una
     proprietà di layout (impeccable: layout-transition). */
  transition: color .15s, background .15s, transform .15s;
  border-bottom: 1px solid rgba(200,121,65,0.08);
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  background: var(--copper-glow);
  color: var(--copper-bright);
  transform: translateX(.4rem);
  text-decoration: none;
}

/* Si apre a hover (mouse), a focus-within (Tab da tastiera) o via JS
   (.open, da click/Invio/Spazio — necessario su touch, dove :hover non
   scatta mai). focus-within tiene il pannello aperto mentre si tabula
   tra le voci al suo interno. */
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: flex;
}
.dropdown:hover .dropdown-caret,
.dropdown:focus-within .dropdown-caret,
.dropdown.open .dropdown-caret {
  transform: rotate(180deg);
}

/* ── Hamburger mobile ──────────────────────────
   Nascosto da desktop; il pannello che controlla (.site-nav) resta
   sempre visibile in riga finché non si scende sotto i 720px. */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--copper-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--copper-bright);
  border-radius: var(--radius-pill);
  transition: transform .25s ease, opacity .2s ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bar { transition: none; }
}

/* ── Ornamental divider ─────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: var(--section-gap) 0;
  color: var(--text-dim);
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
}
.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--copper-border), transparent);
}

/* ── Footer ──────────────────────────────────── */
.site-footer {
  flex-shrink: 0;
  margin-top: 4rem;
  background: var(--surface);
  border-top: var(--rule);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 5%,
    var(--copper-dim) 35%,
    var(--copper) 50%,
    var(--copper-dim) 65%,
    transparent 95%);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 2.5rem 1.5rem;
  flex-wrap: wrap;
}
.footer-brand-name {
  display: block;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--copper-bright);
  margin-bottom: .35rem;
  transition: color .2s;
  text-decoration: none;
}
.footer-brand-name:hover { color: var(--gold); }
.footer-tagline {
  font-family: 'Cinzel', serif;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}
.footer-nav {
  display: flex;
  gap: .15rem;
  flex-wrap: wrap;
  align-items: center;
}
.footer-nav a {
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .4rem .75rem;`n  display: inline-flex;`n  align-items: center;`n  min-height: 44px;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.footer-nav a:hover {
  color: var(--copper-bright);
  background: var(--copper-glow);
  text-decoration: none;
}
.footer-copy {
  font-family: 'Cinzel', serif;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
  text-align: right;
}

/* ── Utility ─────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.text-muted { color: var(--text-muted); }
.text-copper { color: var(--copper); }
/* Paragrafi lunghi in un contenitore stretto (es. .hero p) possono lasciare
   un'orfana corta sull'ultima riga col wrap default "riempi finché ci
   sta". text-wrap: balance distribuisce le righe in modo uniforme. */
.text-balance { text-wrap: wrap; }

/* ── Banner annuncio ─────────────────────────── */
.site-banner {
  background: var(--copper);
  color: var(--bg);
  text-align: center;
  padding: .55rem 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ── Mobile (≤720px) ───────────────────────────
   Solo header/nav/dropdown/footer — .hero, .prose-card, .container e
   .detail-grid hanno il loro stesso @media in components.css /
   pages/tournaments.css. */
@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    padding: .85rem 1.25rem;
    gap: .75rem;
  }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    order: 3;
    margin-top: .5rem;
    padding-top: .75rem;
    border-top: var(--rule);
  }

  .site-nav.is-open { display: flex; }

  .site-nav > a,
  .dropdown-toggle {
    width: 100%;
    padding: .85rem .25rem;
    font-size: .78rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(200,121,65,0.08);
    justify-content: space-between;
  }
  .site-nav > a:last-child { border-bottom: none; }

  .dropdown,
  .dropdown-toggle { width: 100%; }

  /* Il sottomenu OranguFest è una sezione che si espande dentro il
     pannello (tap/tastiera), non un flottante a hover. */
  .dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    margin: 0 0 .25rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--surface-mid);
  }
  .dropdown-menu::before { display: none; }

  .dropdown:hover .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu,
  .dropdown:focus-within .dropdown-menu {
    display: flex;
  }

  .dropdown-menu a { padding-left: 2rem; }

  .container { margin: 1.25rem auto; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; padding: 1.5rem 1.25rem; }
  .footer-copy { text-align: left; }
}
