/* === LAYOUT CSS – Mood Academy TCG === */
/* Versione 1.0 - compatibile con access.js & cards.js */

:root {
  --container-max: 1180px;
  --padding-x: 1rem;
}

/* Reset base */
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  margin: 0;
  overflow-x: hidden;
  transition: background 0.3s ease;
  padding-top: 80px; /* offset per navbar fissa */
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* === NAVBAR FISSA === */
.navbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--container-max);
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: #111;
  text-decoration: none; /* ← aggiungi questa riga */
  cursor: pointer; /* ← e questa */
}

.nav-logo img {
  height: 48px;
  width: auto;
  border-radius: 8px;
}

.nav-logo:hover {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: #111;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: #667eea;
  color: white;
}

/* === MENU MOBILE === */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 65px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    width: 200px;
    padding: 1rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  }

  .nav-links.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* === HERO SECTION (FULL WIDTH) === */
#hero {
  position: relative;
  width: 100vw;
  min-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  
  /* Formula corretta per full-width */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  
  background: radial-gradient(
    circle at 40% 50%,
    #e2e3e7 0%,
    #d4d6dc 35%,
    #bfc1c7 70%,
    #a6a8ae 100%
  );
  background-size: 200% 200%;
  animation: heroFlow 15s ease-in-out infinite alternate;
}

/* Anima leggermente il gradiente */
@keyframes heroFlow {
  0% { background-position: 30% 50%; }
  50% { background-position: 70% 60%; }
  100% { background-position: 40% 40%; }
}

/* === HERO BACKGROUND (immagine sfocata + overlay) === */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("assets/banner.png") center/cover no-repeat;
  filter: blur(10px) brightness(0.8) saturate(0.9);
  opacity: 0.6;
  z-index: 1;
  transform: scale(1.05);
}

/* === CONTENUTO HERO === */
.hero-content {
  position: relative;
  z-index: 2;
  color: #111;
  text-shadow: 0 1px 3px rgba(255,255,255,0.7);
  padding: 2rem;
  max-width: 900px;
}

.hero-logo {
  width: 450px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.2));
}

#hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 1.2rem;
}

.hero-btn {
  display: inline-block;
  padding: 0.9rem 1.4rem;
  border-radius: 10px;
  background: linear-gradient(90deg, #4a4a4a, #6f6f6f);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s ease, background 0.4s ease;
}

.hero-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #6f6f6f, #4a4a4a);
}

/* Responsive hero */
@media (max-width: 700px) {
  #hero {
    min-height: 50vh;
  }

  #hero h1 {
    font-size: 1.8rem;
  }

  .hero-logo {
    width: 280px;
  }
}

/* === HEADER === */
header {
  background: var(--card-bg);
  border-bottom: 1px solid #e2e4ec;
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.9rem;
  margin-bottom: 0.3rem;
}

header .note {
  color: #555;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Navigation */
nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

nav a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

nav a:hover {
  background: var(--accent-light);
  color: #fff;
  border-color: var(--accent-light);
}

header nav a {
  text-decoration: none;
}

/* === SECTIONS === */
main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem var(--padding-x) 4rem;
  overflow-x: hidden;
}

section {
  max-width: var(--container-max);
  margin: 0 auto 3rem;
  padding-inline: var(--padding-x);
  box-sizing: border-box;
}

/* === CARTE === */
.carte-grid {
  margin-top: 1.5rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  border: 1px solid #eee;
  border-radius: .75rem;
  padding: 1rem;
}

.anim-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.anim-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.carta-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.carta-svg {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* === REGOLE & CONTATTI === */
#regolamento ul {
  list-style: disc;
  padding-left: 1.5rem;
}

#contatti a {
  color: var(--accent);
  font-weight: bold;
  text-decoration: none;
}

/* === FOOTER === */
footer {
  background: #1e1e1e;
  color: #f0f0f0;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
  border-top: 3px solid var(--accent);
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  .hero-btn {
    font-size: 1rem;
  }
  nav a {
    padding: 0.4rem 0.8rem;
  }
}

@media (min-width: 1440px) {
  :root {
    --container-max: 1320px;
  }
}

/* === SEZIONI CON ARTWORK LATERALI (VERSIONE 2.0) === */
.section-art {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #0d0d0d;
  color: #fff;
  box-sizing: border-box;
}

.section-art .content-box {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 85%;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 25px rgba(0,0,0,0.3);
}

.section-art .content-box h2 {
  font-size: 2.4rem;
  margin-bottom: 1.2rem;
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.section-art .content-box p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #eee;
}

/* Immagini laterali */
.section-art img.art-left,
.section-art img.art-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.85;
  filter: brightness(0.9);
  transition: transform 10s ease-in-out;
}

/* Effetto parallax dolce */
.section-art:hover img.art-left {
  transform: scale(1.05) translateX(-10px);
}
.section-art:hover img.art-right {
  transform: scale(1.05) translateX(10px);
}

.section-art img.art-left { left: 0; }
.section-art img.art-right { right: 0; }

/* === MOBILE === */
@media (max-width: 768px) {
  .section-art img.art-left,
  .section-art img.art-right {
    display: none;
  }
  .section-art .content-box {
    width: 90%;
    padding: 1.5rem;
    background: rgba(0,0,0,0.7);
  }
}

/* === SEZIONI A ZIG-ZAG CON IMMAGINI E TESTO === */
.section-zigzag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 100vh;
  padding: 4rem 5%;
  box-sizing: border-box;
  background: #0d0d0d;
  color: #fff;
  gap: 4rem;
}

.section-zigzag:nth-child(even) {
  flex-direction: row-reverse;
}

.section-zigzag img {
  width: 45%;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.section-zigzag img:hover {
  transform: scale(1.03);
  box-shadow: 0 0 40px rgba(255,255,255,0.15);
}

/* Video quadrati: dimensioni diverse dalle immagini */
.section-zigzag video {
  width: 50%; /* più largo del 45% delle immagini */
  max-width: 500px; /* limite massimo */
  height: auto;
  aspect-ratio: 1 / 1; /* forza proporzioni quadrate */
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.section-zigzag video:hover {
  transform: scale(1.03);
  box-shadow: 0 0 40px rgba(255,255,255,0.15);
}

.section-zigzag .text-box {
  width: 50%;
  max-width: 650px;
}

.section-zigzag .text-box h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(255,255,255,0.25);
}

.section-zigzag .text-box p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #ddd;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .section-zigzag {
    flex-direction: column !important;
    text-align: center;
    gap: 1rem;
    padding: 2rem 2%;
  }
  
  .section-zigzag img,
  .section-zigzag .text-box {
    width: 100%;
  }
  
  /* VIDEO MOBILE: MASSIMA GRANDEZZA */
  .section-zigzag video {
    width: 95% !important;
    max-width: 500px !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border-radius: 16px !important;
    box-shadow: 0 0 40px rgba(0,0,0,0.5) !important;
    margin: 0 auto !important;
    display: block !important;
    height: auto !important;
  }
}
/* === FORZA HERO FULL WIDTH - FIX FINALE === */
#hero {
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
  left: 0 !important;
  right: 0 !important;
  position: relative !important;
}

/* Fix per contenuto interno hero */
.hero-content {
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 2rem !important;
}
/* Fix padding hero per navbar fissa */
.page-hero {
  padding-top: 100px;
}

@media (max-width: 768px) {
  .page-hero {
    padding-top: 120px;
  }
}
