/* ============================================
   MUSICAXUOMO.IT — CSS principale
   Palette dal logo: viola, giallo, blu, rosso, verde, notte
   Zero dipendenze esterne — PHP puro
   ============================================ */

:root {
  --viola:   #7B2FBE;
  --viola-d: #5a1f8e;
  --viola-l: #f0e6ff;
  --giallo:  #F5C518;
  --giallo-d:#b8940f;
  --blu:     #2563EB;
  --blu-d:   #1a45b0;
  --rosso:   #DC2626;
  --verde:   #16A34A;
  --notte:   #1a0933;
  --notte-m: #2d1554;

  --bianco:  #ffffff;
  --grigio1: #f8f7ff;
  --grigio2: #f0edf7;
  --grigio3: #e2daf0;
  --testo:   #1a0933;
  --testo-s: #5a4a7a;
  --testo-t: #9880b8;
  --bordo:   rgba(123,47,190,0.15);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;

  --ombra: 0 2px 20px rgba(123,47,190,0.08);
  --ombra-m: 0 4px 40px rgba(123,47,190,0.14);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--grigio1);
  color: var(--testo);
  line-height: 1.7;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--viola); text-decoration: none; }
a:hover { color: var(--viola-d); }

/* ---- TIPOGRAFIA ---- */
h1,h2,h3,h4 {
  font-family: Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--notte);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

.sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--notte);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--viola);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.navbar-logo {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-family: Georgia, serif;
  font-size: 1.2rem; font-weight: 700; letter-spacing: 0.02em;
}
.navbar-logo .chiave {
  width: 32px; height: 32px;
  background: var(--viola);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}
.navbar-logo span { color: var(--viola-l); font-weight: 400; }
.navbar-menu {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}
.navbar-menu a {
  color: rgba(255,255,255,0.75);
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  transition: background 0.15s, color 0.15s;
}
.navbar-menu a:hover,
.navbar-menu a.active {
  background: rgba(123,47,190,0.3);
  color: #fff;
}
.navbar-burger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; color: #fff;
}
.navbar-burger span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px; margin: 5px 0;
  transition: transform 0.2s;
}

/* ---- HERO SLIDER ---- */
.hero {
  position: relative;
  height: min(580px, 80vh);
  overflow: hidden;
  background: var(--notte);
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.7s ease;
  display: flex; align-items: flex-end;
}
.hero-slide.active { opacity: 1; }
.hero-slide-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(26,9,51,0.96) 0%,
    rgba(26,9,51,0.5) 40%,
    rgba(26,9,51,0.1) 100%);
}
.hero-slide-content {
  position: relative; z-index: 2;
  padding: 48px 56px;
  max-width: 700px;
}
.hero-cat {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 14px; border-radius: 20px;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.cat-concerti  { background: rgba(245,197,24,0.2);  color: #F5C518; border: 1px solid rgba(245,197,24,0.3); }
.cat-didattica { background: rgba(37,99,235,0.2);   color: #7bb3ff; border: 1px solid rgba(37,99,235,0.3); }
.cat-archivio  { background: rgba(22,163,74,0.2);   color: #6ee09a; border: 1px solid rgba(22,163,74,0.3); }
.cat-intervista{ background: rgba(123,47,190,0.25); color: #c89eff; border: 1px solid rgba(123,47,190,0.4); }
.cat-recensione{ background: rgba(220,38,38,0.2);   color: #fca5a5; border: 1px solid rgba(220,38,38,0.3); }

.hero-slide-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: #fff; margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero-slide-excerpt {
  font-size: 1rem; color: rgba(255,255,255,0.65);
  margin-bottom: 24px; max-width: 520px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.6;
}
.hero-slide-meta {
  font-size: 0.78rem; color: rgba(255,255,255,0.35);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  margin-top: 16px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; padding: 12px 24px;
  border-radius: 40px; border: none; cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-primary { background: var(--viola); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: #fff; border: 1px solid rgba(255,255,255,0.25);
}

/* Slider controls */
.hero-dots {
  position: absolute; bottom: 24px; right: 56px;
  display: flex; gap: 8px; z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none; cursor: pointer; padding: 0;
  transition: all 0.3s;
}
.hero-dot.active { background: var(--viola); width: 24px; border-radius: 4px; }
.hero-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.1); z-index: 10;
}
.hero-progress-fill {
  height: 100%; background: var(--viola);
  width: 0%; transition: width 0.1s linear;
}

/* ---- GRIGLIA ARTICOLI ---- */
.section { padding: 56px 0; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px;
}
.section-title {
  font-size: 1.5rem; color: var(--notte);
  position: relative;
  padding-left: 16px;
}
.section-title::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px; background: var(--viola); border-radius: 2px;
}
.section-link {
  font-size: 0.85rem; color: var(--viola);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Card articolo */
.card {
  background: var(--bianco);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--bordo);
  box-shadow: var(--ombra);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--ombra-m); }
.card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--grigio2);
  position: relative;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img img { transform: scale(1.04); }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--notte), var(--notte-m));
}
.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card-cat { margin-bottom: 8px; }
.card-title {
  font-size: 1rem; font-weight: 700; color: var(--notte);
  margin-bottom: 8px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-excerpt {
  font-size: 0.82rem; color: var(--testo-s); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  flex: 1;
}
.card-meta {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--bordo);
  font-size: 0.75rem; color: var(--testo-t);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* Card grande (featured) */
.card-featured { grid-column: span 2; flex-direction: row; }
.card-featured .card-img { aspect-ratio: auto; flex: 1; min-height: 220px; }
.card-featured .card-body { flex: 1; padding: 28px; }
.card-featured .card-title { font-size: 1.3rem; -webkit-line-clamp: 4; }

/* ---- STORIES MOBILE (solo telefono) ---- */
.stories-mobile { display: none; }

/* ---- SINGOLO ARTICOLO ---- */
.article-hero {
  height: min(480px, 65vw);
  position: relative;
  overflow: hidden;
  background: var(--notte);
}
.article-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--notte) 0%, rgba(26,9,51,0.4) 60%, transparent 100%);
}
.article-hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 48px;
}
.article-title {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  color: #fff; max-width: 800px;
}
.article-body { padding: 48px 0; }
.article-body p { margin-bottom: 1.5rem; font-size: 1.05rem; color: var(--testo-s); }
.article-body h2 { margin: 2rem 0 1rem; }
.article-body img { border-radius: var(--r-md); margin: 2rem 0; }

/* ---- ARCHIVIO ---- */
.filtri {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 20px 0; margin-bottom: 24px;
  border-bottom: 1px solid var(--bordo);
}
.filtro-btn {
  padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--bordo); background: var(--bianco);
  font-size: 0.82rem; cursor: pointer; color: var(--testo-s);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: all 0.15s; text-decoration: none;
}
.filtro-btn:hover, .filtro-btn.active {
  background: var(--viola); color: #fff; border-color: var(--viola);
}

/* ---- FOOTER ---- */
.footer {
  background: var(--notte);
  color: rgba(255,255,255,0.6);
  padding: 48px 0 24px;
  margin-top: 64px;
  border-top: 3px solid var(--viola);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 40px; }
.footer-brand h3 { color: #fff; font-size: 1.1rem; margin-bottom: 12px; }
.footer-brand p { font-size: 0.85rem; line-height: 1.7; max-width: 320px; }
.footer-col h4 { color: rgba(255,255,255,0.9); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 16px; font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.5); font-size: 0.875rem; font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; transition: color 0.15s; }
.footer-col a:hover { color: var(--viola-l); }
.footer-bottom {
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem;
}
.cinque-x-mille {
  background: linear-gradient(135deg, rgba(220,38,38,0.2), rgba(220,38,38,0.05));
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-top: 20px;
  display: inline-block;
}
.cinque-x-mille .cf { font-size: 1.1rem; font-weight: 700; color: #fca5a5; font-family: monospace; letter-spacing: 0.05em; }
.cinque-x-mille .cf-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* ---- GIOCHI BADGE ---- */
.giochi-strip {
  background: linear-gradient(90deg, var(--notte), var(--notte-m), var(--notte));
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid rgba(123,47,190,0.2);
  border-bottom: 1px solid rgba(123,47,190,0.2);
}
.giochi-strip .label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.giochi-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.gioco-btn {
  padding: 8px 20px; border-radius: 20px;
  border: 1px solid rgba(123,47,190,0.4);
  background: rgba(123,47,190,0.12);
  color: #c89eff; font-size: 0.82rem; font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.gioco-btn:hover { background: rgba(123,47,190,0.3); border-color: var(--viola); color: #fff; }

/* ---- STORIES MOBILE — attivate solo sotto 768px ---- */
@media (max-width: 768px) {
  .stories-mobile { display: block; }
  .hero { display: none; }

  .navbar-menu { display: none; }
  .navbar-burger { display: block; }
  .navbar-menu.open {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 62px; left: 0; right: 0;
    background: var(--notte); padding: 16px;
    border-bottom: 2px solid var(--viola);
    z-index: 99;
  }

  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .card-featured { flex-direction: column; grid-column: span 1; }
  .card-featured .card-img { min-height: 180px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-hero { height: 280px; }
  .article-hero-content { padding: 20px 20px; }

  .section { padding: 32px 0; }
  .container { padding: 0 16px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .hero-slide-content { padding: 24px 20px; }
}

/* ---- CACHE / PERFORMANCE ---- */
.lazy { opacity: 1; }
.lazy.loaded { opacity: 1; }

/* ---- ADMIN ---- */
.admin-bar {
  background: #1a0933; border-bottom: 2px solid var(--viola);
  padding: 8px 24px; display: flex; align-items: center; gap: 16px;
  font-size: 0.8rem; color: rgba(255,255,255,0.6);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.admin-bar a { color: var(--viola-l); }

.card-img { min-height: 200px; }
.card-img img { width:100%; height:100%; object-fit:cover; position:absolute; top:0; left:0; }
.card-img { position: relative; }

