/* ============================================================
   TESTOEACCORDI 2026 — STILE PAGINE LETTERA / ARTISTA
   Palette: navy #1a3d5c, amber #f5a623, bordeaux #7a1f2b
   Font: Playfair Display (display) + Inter (corpo)
   ============================================================ */

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

/* ---- TOKEN ---- */
:root {
  --primary:  #1a3d5c;
  --primary2: #112d44;
  --amber:    #f5a623;
  --amber2:   #e09310;
  --amber-tint: #fff3d6;
  --primary-tint: #eaf2f8;
  --sage:     #2d7d5e;
  --bordeaux: #7a1f2b;
  --bg:       #fafaf7;
  --surface:  #ffffff;
  --text:     #222222;
  --muted:    #4a5568;
  --border:   #e2e2dc;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ============================================================
   DIFESA — script di terze parti (Anchor ads e simili) a volte
   applicano un transform a <html>/<body> per gestire overlay
   fissi. Un transform su un antenato rompe "position: sticky"
   per qualunque elemento al suo interno (compreso il nostro
   header). Questa regola neutralizza il transform e mantiene
   l'header sempre davvero sticky, in ogni condizione.
   ============================================================ */
html, body {
  transform: none !important;
}

/* ============================================================
   HEADER — Grid a 3 colonne: logo | centro | menu+hamburger.
   Il logo resta sempre a sinistra e il blocco centrale resta
   sempre perfettamente centrato, indipendentemente dalla
   larghezza del logo o del menu (niente più "mirror" fragili).
   ============================================================ */
header {
  position: -webkit-sticky; /* Safari iOS: senza prefisso lo sticky può non attivarsi */
  position: sticky;
  top: 0;
  z-index: 900;
  background: #ffffff;
  padding: 0 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "logo center right";
  align-items: center;
  column-gap: 20px;
  height: 150px;
}
.site-brand {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-self: start;
}
.site-logo {
  height: 150px;
  width: auto;
  display: block;
}

/* ---- Colonna centrale: "Ricerca artista" ----
   Sempre visibile: su desktop è la colonna centrale dell'header,
   su mobile diventa una seconda riga a piena larghezza (vedi
   media query più sotto) invece di sparire. ---- */
.header-center {
  grid-area: center;
  justify-self: center;
  display: flex;
  align-items: center;
}
.quickjump-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.quickjump-wrap::after {
  content: '▾';
  position: absolute;
  right: 16px;
  font-size: 11px;
  color: var(--primary);
  pointer-events: none;
  transition: color .2s;
}
.artist-quickjump {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: 'Inter', Arial, sans-serif;
  padding: 11px 36px 11px 20px;
  border: 1.5px solid var(--primary);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, var(--primary-tint));
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26,61,92,.16);
  transition: background .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s;
}
.artist-quickjump:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,61,92,.30);
}
.quickjump-wrap:hover::after,
.quickjump-wrap:focus-within::after {
  color: #ffffff;
}
.artist-quickjump:focus-visible {
  outline: 2px solid var(--primary2);
  outline-offset: 2px;
}
.artist-quickjump:active {
  background: var(--primary2);
  color: #ffffff;
  border-color: var(--primary2);
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(17,45,68,.35);
}

/* ---- Colonna destra: menu principale + hamburger ---- */
.header-right {
  grid-area: right;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}
nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}
nav a {
  color: var(--primary);
  text-decoration: none;
  padding: 8px 13px;
  border: 1.5px solid var(--primary);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
nav a:hover {
  background: var(--primary);
  color: #fff;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  position: relative;
  z-index: 2;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   MENU MOBILE — nidificato DENTRO l'header (che è già un
   containing block valido grazie a position:sticky), quindi
   "top:100%" lo aggancia sempre esattamente sotto l'header,
   qualunque sia la sua altezza reale: niente più valori fissi
   che si disallineano. Apre/chiude con fade + slide fluido
   invece del vecchio display:none/block (non animabile).
   ============================================================ */
.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--primary);
  z-index: 850;
  padding: 16px 20px 20px;
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .25s ease, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear .25s;
}
.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .25s ease, transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear 0s;
}
.mobile-nav a {
  display: block;
  color: rgba(255,255,255,.92);
  text-decoration: none;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
  font-size: 16px;
  font-weight: 500;
  transition: color .15s, padding-left .15s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  color: var(--amber);
  padding-left: 4px;
}

/* ============================================================
   TITOLO ARTISTA (pagina artista, es. Ultimo)
   ============================================================ */
.artist-title-block {
  text-align: center;
  padding: 30px 20px 10px;
}
.artist-title-block h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(40px, 7vw, 64px);
  color: var(--bordeaux);
  line-height: 1.1;
}
.artist-title-block .artist-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--bordeaux);
  font-weight: 600;
  margin-top: 6px;
}

/* ============================================================
   HERO — ricerca Google
   ============================================================ */
.hero {
  background: var(--primary);
  padding: 52px 20px 28px;
  text-align: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  contain: layout paint;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 17px,
    rgba(255,255,255,.06) 17px,
    rgba(255,255,255,.06) 18px
  );
  pointer-events: none;
}

/* ---- SEZIONE ALFABETO — separata dalla ricerca ---- */
.alphabet-band {
  background: var(--primary);
  padding: 4px 20px 44px;
  text-align: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  contain: layout paint;
}
.alphabet-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 17px,
    rgba(255,255,255,.06) 17px,
    rgba(255,255,255,.06) 18px
  );
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}
.hero h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(26px, 5vw, 46px);
  color: #ffffff;
  margin-bottom: 28px;
  line-height: 1.15;
}
.gcse-search {
  width: 90%;
  margin: 20px auto;
  display: block;
}
.search-wrapper {
  width: 90%;
  max-width: 600px;
  margin: 20px auto 40px auto;
  display: block;
  overflow: hidden;
}
.search-wrapper .gcse-search {
  width: 100% !important;
  margin: 0 !important;
}

/* ---- Alfabeto: tonalità ambra invece del grigio traslucido ---- */
.alphabet {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 760px;
  margin: 0 auto;
}
.alphabet a {
  background: rgba(245,166,35,.16);
  border: 1px solid rgba(245,166,35,.35);
  color: #ffe9c2;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 14px;
  transition: background .18s, color .18s, border-color .18s, transform .15s;
  letter-spacing: .02em;
  min-width: 38px;
  text-align: center;
}
.alphabet a:hover {
  background: var(--amber);
  color: #1a1a1a;
  border-color: var(--amber);
  transform: translateY(-2px);
}
.alphabet a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.alphabet a.active {
  background: var(--amber);
  color: #1a1a1a;
  border-color: var(--amber);
  font-weight: 700;
}

/* ============================================================
   ADSENSE — spazio riservato + contenimento anti-overlay
   ============================================================ */
.banner {
  width: 100%;
  max-width: 728px;
  margin: 32px auto;
  padding: 0 16px;
  text-align: center;
  min-height: 100px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  contain: layout paint;
  background: #fdfdfd;
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
}
.banner ins.adsbygoogle {
  display: block;
  width: 100% !important;
  height: auto !important;
}
@media (min-width: 600px) {
  .banner { min-height: 250px; }
}
@media (min-width: 992px) {
  .banner { min-height: 280px; }
}

/* ============================================================
   STRUTTURA PAGINA LETTERA / ARTISTA
   ============================================================ */
.main-content-letter {
  max-width: 820px;
  margin: 32px auto;
  padding: 0 16px;
}
.main-content-letter h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  color: var(--primary);
  border-bottom: 2px solid var(--amber);
  padding-bottom: 10px;
  margin-bottom: 25px;
}

.artists-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 25px 0;
}
.artists-buttons-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 16px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  background-color: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 8px;
  text-align: center;
  transition: background-color .15s, color .15s;
}
.artists-buttons-grid a:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.75);
  padding: 32px 20px 24px;
  text-align: center;
  margin-top: 16px;
}
.site-footer p { margin-bottom: 10px; font-size: 14px; }
.site-footer a { color: var(--amber); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.legal-note {
  max-width: 860px;
  margin: 16px auto 0;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,.45);
}

/* ============================================================
   COOKIE BANNER
   ============================================================ */
#cookie-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 10000;
}
#cookie-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  background: #fff;
  color: #333;
  padding: 28px 24px;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  z-index: 10001;
}
#cookie-banner p { margin-bottom: 20px; font-size: 15px; line-height: 1.6; }
#cookie-banner a { color: var(--primary); text-decoration: underline; }
#cookie-banner button {
  padding: 11px 28px;
  cursor: pointer;
  background: var(--amber);
  color: #222;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  /* L'header passa da 1 a 2 righe: logo+hamburger sopra, il
     pulsante "Ricerca artista" sotto, a piena larghezza — così
     resta SEMPRE visibile anche su smartphone, senza dover
     aprire il menu, esattamente come richiesto. */
  header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo right"
      "center center";
    height: auto;
    min-height: 90px;
    row-gap: 12px;
    padding: 14px 16px 16px;
  }
  .header-center {
    justify-self: stretch;
  }
  .quickjump-wrap {
    width: 100%;
    justify-content: center;
  }
  .artist-quickjump {
    width: 100%;
    max-width: 340px;
  }
  .header-right nav { display: none; }
  .hamburger { display: flex; }
  .site-logo { height: 80px; }
}

@media (max-width: 768px) {
  .hero { padding: 36px 16px 20px; }
  .alphabet-band { padding: 4px 16px 32px; }
  .hero h2 { font-size: 22px; }

  .artists-buttons-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 480px) {
  .site-logo { height: 70px; }
  .alphabet a { padding: 8px 12px; font-size: 13px; }
}
