/*
 * Hero homepage — slider verticale full-viewport.
 *
 * Namespace cgtv-hero__* tenuto isolato per non collidere con il
 * carosello v2 e con il vecchio template parallax.
 *
 * Struttura:
 *   <section.cgtv-hero>
 *     <div.swiper.cgtv-hero__swiper>
 *       <div.swiper-wrapper.cgtv-hero__wrapper>
 *         <div.swiper-slide.cgtv-hero__slide>
 *           <a.cgtv-hero__link>
 *             <picture.cgtv-hero__picture><img.cgtv-hero__image>
 *             <div.cgtv-hero__overlay>
 *               <img.cgtv-hero__title-image>
 *               <div.cgtv-hero__cta> [icon + text]
 *       <div.cgtv-hero__dots>
 */

/* ============================================================
 * Container
 * ============================================================ */
.cgtv-hero {
    position: relative;
    width: 100%;
    /* 100svh evita il bug della address bar Safari iOS, che con 100vh
     * lascerebbe la slide più alta del viewport reale. Fallback 100vh
     * per browser più vecchi. */
    height: 100vh;
    height: 100svh;
    background: #000;
    overflow: hidden;
}

/* Quando il JS rilascia l'ultima slide al footer (vedi cgtv-hero.js),
 * sovrascriviamo il touch-action: pan-x che Swiper applica di default,
 * così lo swipe verticale scrolla la pagina nativamente. */
.cgtv-hero--touch-release .swiper,
.cgtv-hero--touch-release .swiper-wrapper,
.cgtv-hero--touch-release .cgtv-hero__swiper {
    touch-action: pan-y !important;
}

/* Header trasparente sopra la prima slide (riuso del comportamento del
 * vecchio template parallax). Scope ristretto al body class del template
 * hero per non toccare le altre pagine.
 *
 *   - .navbar background trasparente
 *   - header netube z-index alto, position inherit (non fixed)
 *   - content-wrapper margin-top negativo, l'header galleggia sull'hero
 */
.page-template-dby-hero-homepage .navbar {
    background: transparent !important;
}
.page-template-dby-hero-homepage header.netube-header {
    z-index: 9999;
    position: inherit;
}
.page-template-dby-hero-homepage .netube-content-wrapper {
    clear: both;
    margin-top: -110px;
}

/* ============================================================
 * Swiper container + slides
 * ============================================================ */
.cgtv-hero__swiper {
    width: 100%;
    height: 100%;
}

.cgtv-hero__wrapper {
    height: 100%;
}

.cgtv-hero__slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cgtv-hero__link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    color: #fff;
    text-decoration: none;
}
.cgtv-hero__link:hover,
.cgtv-hero__link:focus {
    color: #fff;
    text-decoration: none;
    outline: none;
}

/* ============================================================
 * Immagine di fondo (desktop/mobile via <picture>)
 * ============================================================ */
.cgtv-hero__picture {
    display: block;
    width: 100%;
    height: 100%;
}

.cgtv-hero__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* ============================================================
 * Overlay con titolo logo + CTA
 * ============================================================ */
.cgtv-hero__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Sfumatura leggera in basso per leggibilità su immagini chiare. */
    background: linear-gradient(180deg, transparent 0%, transparent 40%, rgba(0,0,0,0.45) 100%);
    /* pointer-events:none qui per lasciare il click libero al link
     * sottostante; lo riattiviamo solo sul bottone CTA. */
    pointer-events: none;
}

.cgtv-hero__title-image {
    display: block;
    max-width: min(80vw, 700px);
    max-height: 40vh;
    height: auto;
    width: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6));
}

/* ============================================================
 * CTA bottone (2 linee di testo + icona a destra).
 * Hover: rosso CGTV pieno + lieve sollevamento.
 * ============================================================ */
.cgtv-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(220, 13, 29, 0.9);
    border-radius: 8px;
    color: #fff;
    pointer-events: auto;
    transition: background 200ms ease, transform 200ms ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.cgtv-hero__link:hover .cgtv-hero__cta {
    background: rgba(255, 14, 31, 1);
    transform: translateY(-2px);
}

.cgtv-hero__cta-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}
.cgtv-hero__cta-l1 {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}
.cgtv-hero__cta-l2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cgtv-hero__cta-icon img {
    display: block;
    max-height: 42px;
    width: auto;
}

/* Mobile: titolo logo più contenuto, CTA più compatta. */
@media (max-width: 599px) {
    .cgtv-hero__title-image {
        max-height: 30vh;
        margin-bottom: 20px;
    }
    .cgtv-hero__cta {
        padding: 12px 18px;
        gap: 12px;
    }
    .cgtv-hero__cta-l1 { font-size: 12px; }
    .cgtv-hero__cta-l2 { font-size: 18px; }
    .cgtv-hero__cta-icon img { max-height: 34px; }
}

/* ============================================================
 * Indicatori di paginazione (dots verticali a destra).
 * Usiamo classnames custom .cgtv-hero__dot* per non ereditare
 * lo stile orizzontale di .swiper-pagination-bullet del bundle.
 * ============================================================ */
.cgtv-hero__dots {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 599px) {
    .cgtv-hero__dots {
        right: 12px;
        gap: 8px;
    }
}

/* Reset completo del <button> (alcuni UA aggiungono padding/border
 * di default che renderebbero ovale il dot). */
button.cgtv-hero__dot {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    line-height: 0;
}
.cgtv-hero__dot {
    box-sizing: border-box;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
    display: block;
}
.cgtv-hero__dot:hover {
    background: rgba(255, 255, 255, 0.8);
}
.cgtv-hero__dot--active {
    background: #fff;
    transform: scale(1.4);
}

@media (prefers-reduced-motion: reduce) {
    .cgtv-hero__dot,
    .cgtv-hero__cta,
    .cgtv-hero__link:hover .cgtv-hero__cta {
        transition: none;
        transform: none;
    }
}
