/*
Theme Name: tvv_1.0
Theme URI: https://example.com/
Description: Tema WordPress con hero parallax e sidebar social
Author: Il tuo nome
Version: 1.0
License: GPL v2 or later
Text Domain: manifestazione
*/

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: #fafafa;
  color: #333;
}

section h2 {
  text-align: center;
  text-transform: uppercase;
}

/* === HERO HEADER PARALLAX === */
.hero-header {
  position: relative;
  width: 100%;
  height: 450px;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.hero-header .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.4)
  );
  z-index: 1;
}

.hero-header .hero-content {
  position: relative;
  z-index: 2;
  padding: 20px;
}

.hero-header h1 {
  font-size: 3rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero-header .tagline {
  font-size: 1.3rem;
  margin-top: 10px;
  font-weight: 300;
}

/* === NAV === */
.main-nav {
  background-color: #b30000;
  text-align: center;
  position: relative;
  z-index: 1000; /* un valore più alto del div sottostante */
}

.main-nav a {
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  display: inline-block;
}

.main-nav a:hover {
  background: #8c0000;
}

.main-nav .nav-container {
    display: flex;
    align-items: center;   /* centra verticalmente */
    justify-content: space-between; /* logo a sinistra, menu/hamburger a destra */
}

.nav-logo {
  grid-column: 1 / 2;
  justify-self: start;
}

.nav-logo a:hover {
  opacity: 1;
}

/* === NAVIGAZIONE RESPONSIVE === */
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  padding: 30px 20px;
  z-index: 1000;
  opacity: 1;
  display: flex;
  align-items: center;   /* centra verticalmente */
  justify-content: space-between; /* logo a sinistra, menu/hamburger a destra */
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;

  transition: all 0.4s ease;
}

.menu li {
  display: inline-block;
}

.menu a {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  display: block;
  -webkit-text-fill-color: #ffffff; /* forza il colore su iOS */
}

.menu a:hover {
  background: #8c0000;
}

/* === PULSANTE HAMBURGER === */
.menu-toggle {
  width: 30px;
  height: 30px;
  right: 20px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 2000;

  display: none; /* nascosto su desktop */

  flex-direction: column;
  justify-content: space-between; /* distribuisce le barre verticalmente */
  align-items: center;
  padding: 0;
  margin: 0;

  position: relative;

  -webkit-tap-highlight-color: transparent;
}

.menu-toggle .bar {
  display: block;
  width: 100%;
  height: 4px;
  margin: 0;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.4s ease;
  gap: 4px;

  /* 🔥 FIX per Safari iOS */
  position: relative;
  z-index: 2;
  isolation: isolate;
}

/* === STATO ATTIVO === */
.menu-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}


/* === MENU MOBILE === */
@media (max-width: 768px) {
  .menu {
    flex-direction: column;
    background-color: #b30000;
    position: absolute;
    top: 50px;
    right: 0;
    left: 0;
    padding: 10px 0;

    display: flex; /* sempre flex, non display:none */
    pointer-events: none; /* impedisce click quando nascosto */

  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  }

  .menu a {
    color: white;
  }

  .menu.active {
    display: flex;
    opacity: 0.8;
  pointer-events: auto; /* riabilita click */
  transform: scaleY(1);
  }

  .menu-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
  }

  .menu-toggle .bar {
    position: relative;
    z-index: 2;
    isolation: isolate;
  }
}



/* === LAYOUT === */
main {
  display: flex;
  max-width: 1200px;
  margin: 40px auto;
  gap: 30px;
  padding: 0 20px;
}

.content {
  flex: 3;
}

.sidebar {
  flex: 1;
  background: #fff;
  padding: 20px;
  border-left: 3px solid #b30000;
}

.widget {
  margin-bottom: 20px;
}

/* === FOOTER === */
footer {
  background: #222;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-header {
    height: 300px;
    background-attachment: scroll;
  }

  .hero-header h1 {
    font-size: 2rem;
  }

  main {
    flex-direction: column;
  }
}

/* === TITOLO CLICCABILE === */
.site-title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-title a:hover {
  color: #ffcc00;
}

.site-logo-link {
  display: inline-block;
  max-width: 300px;
}

.site-logo-header {
  display: inline-block;
  max-width: 200px;
  transition: transform 0.3s ease;
}

.site-logo {
  width: 500px;
  height: auto;
  display: block;
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* LANDING */
.landing {
    width: 100%;
    height: 80vh;
    background-size: cover;
    background-position: center;
    position: relative;
    filter: blur(4px);
    animation: clearBlur 1.2s ease-out forwards;

  display: flex;
  flex-direction: column;
  align-items: center; /* centra orizzontalmente */

  padding-top: 80px;

  position: relative;
  z-index: 1;
}

@keyframes clearBlur {
    to {
        filter: blur(0);
    }
}

.scroll-btn {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    font-size: 14px;
    background-color: rgba(179,0,0,0.7);
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
    color: white;
}

.scroll-btn:hover {
    background-color: rgba(179,0,0,1);
}


/* LINK HOME */
/* Posiziona il link prima del menu */
.home-link {
    display: inline-block;
    #margin-right: 20px; /* spazio tra logo e menu */
}

/* Logo/Home link */
.home-link img {
    width: 90px;       /* dimensione logo */
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    opacity: 1;
}

/* Piccola animazione al passaggio del mouse */
.home-link:hover img {
    transform: scale(1.2);
}




/* SIDEBAR */
/* Container della sidebar */
.custom-sidebar {
    padding: 20px;
    background: #ecc673;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 200px;
    opacity: 0.9;
}

/* Lista senza bullet */
.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px; /* spazio tra le voci */
}

/* Ogni voce */
.sidebar-links li {
    display: flex;
    justify-content: center; /* centra orizzontalmente */
}

/* Ogni link */
.sidebar-links li a {
    display: flex;
    justify-content: center; /* centra il contenuto del link */
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
}

/* Immagine link */
.sidebar-links li img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 3px;        /* evita che immagini non quadrate “tocchino” */
    background: #fff0;   /* opzionale */
}

/* Hover animato */
.sidebar-links li a:hover {
    background: rgba(0, 0, 0, 0.07);
}

/* Immagine animata sull'hover */
.sidebar-links li a:hover img {
    transform: scale(1.1); /* zoom immagine */
}

.avatar {
    width: 80px;             /* dimensione */
    height: 80px;
    border-radius: 50%;      /* rende l'immagine rotonda */
    object-fit: cover;       /* la ritaglia correttamente */
    background: #ffffff;     /* colore di sfondo */
    padding: 6px;            /* spazio tra immagine e sfondo */
}


/* SLIDER */
.slider {
    overflow: hidden;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px; /* opzionale */
    padding: 20px 0;
    background-color: #eeeeee;
}

.slider img {
    height: 80px;          /* dimensione immagini */
    margin-right: 40px;    /* spazio tra immagini */
}

.slide-track {
    display: flex;
    flex-wrap: nowrap;
    transition: none !important;
}


/* Ogni immagine + didascalia */
.slide-item {
    display: flex;
    flex-direction: column; /* immagine sopra, testo sotto */
    align-items: center;
    margin-right: 40px;
    flex-shrink: 0; /* impedisce di ridurre la larghezza */
}

.slide-item img {
    display: block;           /* evita spazi bianchi sotto l'immagine */
    height: 80px;
    object-fit: contain;
    margin: 0 auto;        /* fallback */
    border-radius: 8px; /* opzionale */
}

/* Didascalia */
.caption {
    margin-top: 6px;         /* spazio tra immagine e testo */
    color: #fff;             /* colore testo */
    font-size: 11pt;
    text-align: center;
    white-space: nowrap;      /* testo su una riga */
    width: 100%;              /* importante: occupa tutta la larghezza del container */
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    background-color: #b30000;
    border-radius: 8px;
    opacity: 0.75;
}

.separator {
  width: 8px;
  background: rgba(179,0,0,0.4);
  margin: 0 20px;
  flex-shrink: 0;
}

.icon-maps {
  background: rgba(200,200,200,0.8);
  border-radius: 50%;
}


/* Animazione img */
.gentle-swing {
    display: inline-block;
    animation: gentle 8s ease-in-out infinite;
    transform-origin: center top;
}

@keyframes gentle {
    0%   { transform: rotate(3deg); }
    50%  { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}


.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-out {
    opacity: 1;
    animation: fadeOut 1s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}


/* CARD per frase */
.card-container {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  width: 280px;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  cursor: pointer;
}

.card.is-flipped {
  transform: rotateY(180deg);
}

.card > div {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-family: 'Caveat';
  font-size: 18pt;
}

.front {
  background: #b30000;
  color: #fff;
}

.back {
  background: #fff;
  color: #b30000;
  transform: rotateY(180deg);
}


/* COUNTDOWN TIMER */
.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    font-family: "Segoe UI", Arial, sans-serif;
    text-align: center;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.number {
    font-size: 28px;
    font-weight: bold;
    background: #eee;
    padding: 10px 15px;
    border-radius: 10px;
    min-width: 60px;
    background-image: url("images/balla.png"); /* tua immagine */
    background-size: cover;
    background-position: center;
    color: #b30000;
    opacity: 0.9;
}

.label {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

/* 📱 Mobile responsive */
@media (max-width: 480px) {
    .countdown-container {
        gap: 8px;
    }
    .number {
        font-size: 22px;
        padding: 8px 10px;
        min-width: 45px;
    }
    .label {
        font-size: 12px;
    }
}





/* Centrare tutti gli embed nei post/pagine */
iframe,
embed,
object,
video {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    #height: auto;
}


/* Mobile: sidebar full width */
@media screen and (max-width: 768px) {
    .custom-sidebar {
        width: 100%;
        background: #ffffff;
    }

    .sidebar-links li img {
        width: 80px;
        height: 80px;
    }

    .site-logo {
      width: 90%;
      position: none;
    }

    .site-logo-header {
      display: inline-block;
      max-width: 50%;
      transition: transform 0.3s ease;
    }

    .avatar {
        width: 40px;             /* dimensione */
        height: 40px;
    }

    /* Logo/Home link */
    .home-link img {
        width: 60px;       /* dimensione logo */
        height: auto;
        margin-right: 2px; /* spazio tra logo e menu */
    }
}

@media screen and (max-width: 500px) {
    .site-logo-header {
      max-width: 150px;
    }
}


// Counters
.stats-section {
  background: #f6f6f6;
  padding: 60px 20px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-box {
  background: #ecc673;
  opacity: 0.9;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;       /* <-- garantisce centratura */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;      /* <-- centratura perfetta */
}


.stat-number {
  font-size: 42px;
  font-weight: 650;
  color: #b30000;
  display: block;
  font-family: "Caveat", sans-serif;
}

.stat-box p {
    margin-top: 6px;         /* spazio tra immagine e testo */
    color: #fff;             /* colore testo */
    font-size: 11pt;
    text-align: center;
    white-space: nowrap;      /* testo su una riga */
    width: 100%;              /* importante: occupa tutta la larghezza del container */
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    background-color: #0000FF;
    border-radius: 8px;
    opacity: 0.7;
    height: 30px;
    display: inline-flex;     /* per centratura verticale */
    justify-content: center; 
    align-items: center;
}

/* 📱 Mobile 1 colonna */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
    justify-items: center; /* centrare gli elementi */
  }

  .stat-box {
    width: 70%;
  }

  .stat-number {
    font-size: 38px;
    font-weight: 600;
  }
}

/* 📱📱 Tablet 2 colonne */
@media (min-width: 601px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center; /* centrare gli elementi */
  }

  .stat-box {
    width: 70%;
  }

  .stat-number {
    font-size: 40px;
    font-weight: 600;
  }
}


.maps-box {
    margin-top: 6px;         /* spazio tra immagine e testo */
    color: #fff;             /* colore testo */
    font-size: 11pt;
    text-align: center;
    white-space: nowrap;      /* testo su una riga */
    width: 200px;              /* importante: occupa tutta la larghezza del container */
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    background-color: #0000FF;
    border-radius: 8px;
    opacity: 0.7;
    height: 30px;
    display: inline-flex;     /* per centratura verticale */
    justify-content: center; 
    align-items: center;
}

.maps-box a {
    color: #fff;             /* colore testo */
    font-size: 11pt;
    text-decoration: none;
}