/* ==========================
   HERO SECTION
========================== */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 90vh; /* evita taglio immagini */
    overflow: hidden;
}

.carousel-item {
    position: relative;
    min-height: 90vh;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain; /* desktop: immagine completa */
}

/* Mobile: riempi lo schermo */
@media (max-width: 768px) {
    .carousel-item {
        background-size: cover;
    }
}

/* ==========================
   HERO CAPTION
========================== */
.carousel-caption {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.85);
	
}

.carousel-caption h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.9),
        2px 2px 6px rgba(0,0,0,1);
}

.carousel-caption p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.carousel-caption .sub-caption {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow:
        2px 2px 3px rgba(0,0,0,0.9),
        2px 2px 6px rgba(0,0,0,1);
}

.carousel-caption .btn-light {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ==========================
   CAROUSEL FADE
========================== */
.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

/* ==========================
   NEWS CARDS
========================== */
.hero-news-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.hero-news-card:hover {
    transform: translateY(-5px);
}

.news-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.news-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
    overflow: hidden;
    line-height: 1.5;
    max-height: calc(1.5em * 7);
    position: relative;
}

.news-excerpt::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2.5em;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
}

.hero-news-card .card-body {
    display: flex;
    flex-direction: column;
}

.hero-news-card .btn {
    margin-top: auto;
}

.hero-news-card .card-body h5 a {
    color: #0c76a4;
    text-decoration: none;
}

.hero-news-card .btn-primary {
    background-color: #0c76a4;
    border: none;
}

/* ==========================
   CLASSIFICA COMPATTA
========================== */
.hero-table {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hero-table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(12,118,164,0.05);
}

.hero-table th,
.hero-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0.15rem 0.35rem;
    font-size: 0.78rem;
    line-height: 1.1;
}

.hero-table-card table.hero-table tbody tr {
    height: 24px;
}

.hero-table-card .card-body h3 {
    margin-bottom: 0.5rem;
}

/* ==========================
   SPONSOR CARD
========================== */
.hero-sponsor-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
}

.hero-sponsor-card h3.card-title {
    margin-bottom: 0.75rem;
}

.hero-sponsor-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ==========================
   CALENDARIO / CLASSIFICA / SPONSOR MOBILE
   (colonna singola)
========================== */
@media (max-width: 576px) {
    .hero-section-cards > .col-md-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }

    /* Annulla l'allineamento flex verticale delle colonne */
    .hero-section-cards > .col-md-4 {
        display: block !important;
        align-self: auto !important;
    }
}

/* ==========================
   MOBILE NEWS (due colonne)
========================== */
@media (max-width: 576px) {
    .hero-news-card .card-body {
        padding-top: 0.25rem !important;
        padding-bottom: 0.5rem !important;
    }

    .hero-news-card .card-body h5 {
        margin: 0 0 0.25rem 0 !important;
        font-size: 1rem;
    }

    .hero-news-card .card-body h6.news-meta {
        margin: 0 0 0.25rem 0 !important;
        font-size: 0.75rem;
    }

    .news-img-container {
        height: 110px;
    }

    .hero-news-card .news-excerpt {
        -webkit-line-clamp: 3;
        max-height: calc(1.5em * 3);
    }

    /* News mobile: due colonne */
    .row > .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .carousel-caption h1 {
        font-size: 1.5rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }
}

/* ==========================
   HERO TITLE & MOTTO
========================== */
.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow:
        2px 2px 4px rgba(0,0,0,0.9),
        0 0 12px rgba(0,0,0,0.7);
}

.hero-motto {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.2rem;
    font-style: italic;
    color: #9EEAF9;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.9),
        2px 2px 6px rgba(0,0,0,1);
}

/* Mobile */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
        letter-spacing: 0.05em;
    }

    .sub-caption {
        font-size: 1rem;
    }

    .hero-motto {
        font-size: 0.9rem;
    }
}

/* ==========================
   CAROUSEL CONTROLS
========================== */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3.5rem;
    height: 3.5rem;
    filter: invert(27%) sepia(94%) saturate(1800%) hue-rotate(185deg)
            brightness(90%) contrast(105%);
}

.carousel-control-prev,
.carousel-control-next {
    width: 8%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: transparent;
    transform: scale(1.15);
}