/* Stile principale per "La Notte prima degli esami" */

/* Variabili */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --success-color: #198754;
    --danger-color: #dc3545;
}

/* Stili generali */
body {
    font-family: 'Roboto', sans-serif;
    color: var(--dark-color);
    padding-top: 0;
}

/* Navbar */
/* Navbar */
.navbar {
    background-color: rgba(33, 37, 41, 0.9);
    transition: all 0.3s ease;
    padding: 15px 0;
    z-index: 10;
}
.navbar.scrolled {
    padding: 8px 0;
    background-color: rgba(33, 37, 41, 1);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
}

/* Hero Section */
/* HERO CAROUSEL MODERNO */
.hero-section {
    width: 100vw;
    min-width: 100vw;
    max-width: 100vw;
    padding: 0 !important;
    margin: 0 !important;
    background: none;
    position: relative;
    color: #fff;
    overflow: hidden;
    z-index: 1;
}
.hero-carousel {
    width: 100vw;
    max-width: 100vw;
    min-height: 440px;
    height: 65vh;
    margin: 0;
    border-radius: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-carousel .swiper-slide {
    min-height: 440px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover !important;
    background-position: center !important;
    position: relative;
}
.hero-carousel .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.40); /* overlay scuro elegante */
    z-index: 1;
    border-radius: 0;
}
.hero-carousel .swiper-pagination {
    bottom: 25px !important;
}
.hero-content {
    background: rgba(0,0,0,0.24);
    border-radius: 18px;
    padding: 32px 48px;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 8px 24px 0 rgba(0,0,0,0.17);
    position: relative;
    z-index: 2;
}
.hero-carousel .hero-content h1 {
    font-size: 3.1rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.29);
    letter-spacing: -1px;
}
.hero-carousel .hero-content p {
    font-size: 1.45rem;
    margin-bottom: 1.6rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.16);
}
.hero-carousel .btn {
    font-size: 1.15rem;
    padding: 12px 36px;
    border-radius: 30px;
}
.hero-carousel .swiper-pagination-bullet {
    width: 14px;
    height: 14px;
    background: #fff;
    opacity: 0.32;
    margin: 0 4px !important;
}
.hero-carousel .swiper-pagination-bullet-active {
    background: #0d6efd;
    opacity: 1;
}
.hero-carousel .swiper-button-next,
.hero-carousel .swiper-button-prev {
    color: #fff;
    width: 58px;
    height: 58px;
    background: rgba(0,0,0,0.22);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}
.hero-carousel .swiper-button-next:hover,
.hero-carousel .swiper-button-prev:hover {
    background: rgba(0,0,0,0.38);
}

/* Page Hero */
.page-hero {
    background-color: var(--dark-color);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Numeri Section */
.numbers-section {
    padding: 80px 0;
    background-color: var(--light-color);
}

.counter-item {
    text-align: center;
    margin-bottom: 30px;
}

.counter-item .counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.counter-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* News Section */
.news-section {
    padding: 80px 0;
}

.news-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.news-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.news-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Events Section */
.events-section {
    padding: 80px 0;
    background-color: var(--light-color);
}

.event-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.event-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.event-date, .event-location {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Gallery Section */
.gallery-section {
    padding: 80px 0;
}

/* Album Card: nuova regola sostitutiva */
.album-card {
    height: 340px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.album-card .card-img-top {
    height: 65%;
    min-height: 0;
    object-fit: cover;
    width: 100%;
    border-top-left-radius: .5rem;
    border-top-right-radius: .5rem;
}

.album-card .card-body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.photo-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.photo-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
}

.contact-info .icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container {
    height: 450px;
    width: 100%;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 50px 0 20px;
}

.footer h5 {
    margin-bottom: 20px;
    font-weight: 600;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #fff;
}

.footer .social-links a {
    font-size: 1.5rem;
    margin-right: 15px;
}

/* Media Queries */
@media (max-width: 991.98px) {
    .hero-carousel,
    .hero-carousel .swiper-slide {
        min-height: 200px;
        height: 28vh;
    }
    .hero-content {
        padding: 18px 5vw;
        max-width: 95vw;
    }
    .hero-carousel .hero-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .counter-item .counter {
        font-size: 2.5rem;
    }
    
    .counter-item h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .page-hero h1 {
        font-size: 1.8rem;
    }
}


/* Margin top per hero-section solo su schermi medi e piccoli per evitare sovrapposizione con navbar fixed */
@media (max-width: 991.98px) {
    .hero-section {
        margin-top: 76px;
    }
}

/* Centra il contenuto del carosello hero */

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 15px;
}

/* ==========================================
   Gestione z-index e posizionamento Navbar
   ========================================== */
/* z-index già incluso nella regola principale .navbar */


/* Hero Static Section Migliorata (fix) */
.hero-static {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    margin: 40px 0;
}
.hero-static .hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    padding: 2.5rem 1rem 2.5rem 1rem;
    width: 100%;
    font-size: 2.3rem;
    font-weight: bold;
    text-shadow: 0 4px 18px rgba(0,0,0,0.30), 0 2px 4px rgba(0,0,0,0.14);
}
.hero-static::before {
    content: "";
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.45);
    z-index: 1;
    border-radius: 6px;
}
@media (max-width: 991.98px) {
    .hero-static {
        min-height: 32vh;
        margin: 30px 0;
    }
    .hero-static .hero-content {
        font-size: 1.5rem;
        padding: 1.5rem 0.5rem 1.5rem 0.5rem;
    }
}

/* Effetto epico comparsa testo nel carosello hero */
.hero-content {
    opacity: 0;
    transform: translateY(60px) scale(0.93);
    filter: blur(10px);
    animation: heroFadeInEpic 1.2s cubic-bezier(.61,0,.31,1.02) 0.25s forwards;
}
@keyframes heroFadeInEpic {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.93);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}
/* L’animazione si attiva solo sulla slide attiva! */
.swiper-slide-active .hero-content {
    opacity: 0;
    animation: heroFadeInEpic 1.3s cubic-bezier(.61,0,.31,1.02) 0.11s forwards;
}

/* Animazione fade-up per cards home */
@keyframes fadeUpCard {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
.news-card.animate-on-scroll, .event-card.animate-on-scroll, .album-card.animate-on-scroll, .photo-card.animate-on-scroll {
  opacity: 0;
  animation: fadeUpCard 0.95s cubic-bezier(.56,0,.26,1.08) both;
}
.news-card.animate-on-scroll, .event-card.animate-on-scroll, .album-card.animate-on-scroll {
  animation-delay: 0.15s;
}
.news-card.animate-on-scroll:nth-child(2), .event-card.animate-on-scroll:nth-child(2), .album-card.animate-on-scroll:nth-child(2) { animation-delay: 0.32s; }
.news-card.animate-on-scroll:nth-child(3), .event-card.animate-on-scroll:nth-child(3), .album-card.animate-on-scroll:nth-child(3) { animation-delay: 0.47s; }
.news-card.animate-on-scroll:nth-child(4), .event-card.animate-on-scroll:nth-child(4), .album-card.animate-on-scroll:nth-child(4) { animation-delay: 0.61s; }

/* Animazione button bounce in */
@keyframes btnBounceIn {
  0% { opacity:0; transform: scale(0.9) translateY(30px);}
  70% { transform: scale(1.08) translateY(-4px);}
  100% { opacity:1; transform: scale(1) translateY(0);}
}
.btn-outline-primary.animate-on-scroll, .btn-primary.animate-on-scroll {
  animation: btnBounceIn 0.75s cubic-bezier(.34,1.56,.64,1) 0.9s both;
}

/* Titolo sezioni slide up */
@keyframes sectionTitleIn {
  from { opacity: 0; transform: translateY(60px);}
  to { opacity: 1; transform: translateY(0);}
}
.numbers-section h2.animate-on-scroll, .news-section h2.animate-on-scroll, .events-section h2.animate-on-scroll, .gallery-section h2.animate-on-scroll {
  opacity: 0;
  animation: sectionTitleIn 1.1s cubic-bezier(.31,1.19,.36,1.01) 0.12s both;
}

/* Gallery section animazione slide da dx */
@keyframes galleryFadeIn {
  0% { opacity:0; transform: translateX(60px);}
  100% { opacity:1; transform: translateX(0);}
}
.gallery-carousel.animate-on-scroll, .gallery-section .col-12.animate-on-scroll {
  opacity: 0;
  animation: galleryFadeIn 0.88s cubic-bezier(.33,1.23,.5,1.02) 0.45s both;
}

/* Nuove classi per animazioni on-scroll */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.45s;
    animation-play-state: paused !important;
}
.animate-on-scroll.animated {
    opacity: 1;
    animation-play-state: running !important;
}
@media (max-width: 991.98px) {
    .footer .row > [class^="col-"] {
        text-align: center !important;
        justify-content: center;
        align-items: center;
        margin-bottom: 32px;
    }
    .footer .footer-logo {
        margin-left: auto;
        margin-right: auto;
        display: block;
        float: none;
    }
    .footer ul,
    .footer .social-links {
        justify-content: center !important;
        margin-left: auto;
        margin-right: auto;
    }
    .footer h5 {
        text-align: center;
    }
    .footer .text-white,
    .footer .text-muted {
        text-align: center;
    }
}