/* ==========================================================================
   GD Video Header — Styles scopés (.gd-video-*)
   Compatible Kadence — aucune collision de sélecteurs globaux
   v0.2.0
   ========================================================================== */

/* ── Variables ─────────────────────────────────────────────────── */
.gd-video-header {
    --gd-vh-height:          60vh;
    --gd-vh-min-height:      380px;
    --gd-vh-overlay-color:   rgba(0, 0, 0, 0.30);
    --gd-vh-badge-bg:        #3cbcb0;
    --gd-vh-badge-color:     #fff;
    --gd-vh-text-color:      #fff;
    --gd-vh-btn-bg:          rgba(255,255,255,.18);
    --gd-vh-btn-bg-hover:    rgba(255,255,255,.35);
    --gd-vh-excerpt-opacity: .88;
    --gd-vh-radius:          14px;
    --gd-vh-font-title:      inherit;
}

/* ── Breakout pleine largeur ────────────────────────────────────── */
.gd-video-header {
    position:      relative;
    left:          50%;
    right:         50%;
    width:         100vw;
    margin-left:   -50vw;
    margin-right:  -50vw;

    height:        var(--gd-vh-height);
    min-height:    var(--gd-vh-min-height);
    overflow:      hidden;
    background:    #111;
    color:         var(--gd-vh-text-color);
    margin-bottom: 0px !important;
}

/* Évite le scroll horizontal généré par le breakout */
body { overflow-x: hidden; }

.gd-video-header--archive {
    margin-bottom: 40px;
}

/* Page : pas de spécificité supplémentaire pour l'instant,
   modificateur disponible pour surcharges thème si besoin. */
.gd-video-header--page {}

/* ── Poster ─────────────────────────────────────────────────────── */
.gd-video-header__poster {
    position:            absolute;
    inset:               0;
    background-size:     cover;
    background-position: center;
    background-repeat:   no-repeat;
    transition:          opacity .6s ease;
    z-index:             1;
}

.gd-video-header__poster[aria-hidden="true"] {
    opacity:        0;
    pointer-events: none;
}

/* ── Fond vidéo ────────────────────────────────────────────────── */
.gd-video-header__bg {
    position: absolute;
    inset:    0;
    overflow: hidden;
    z-index:  0;
}

/* Iframe YT — cover 16:9 centré */
.gd-video-header__bg iframe {
    position:   absolute;
    top:        50%;
    left:       50%;
    width:      calc(100% + 2px);
    height:     calc(100% + 2px);
    min-width:  calc(177.78vh + 2px);
    min-height: calc(56.25vw + 2px);
    transform:  translate(-50%, -50%);
    border:     0;
    pointer-events: none;
}

.gd-video-header__player {
    position:   absolute;
    inset:      0;
    background: transparent;
}

/* ── Overlay dégradé ────────────────────────────────────────────── */
.gd-video-header__overlay {
    position:       absolute;
    inset:          0;
    z-index:        2;
    background:     linear-gradient(
        to bottom,
        rgba(0,0,0,.10) 0%,
        rgba(0,0,0,.20) 50%,
        rgba(0,0,0,.55) 100%
    );
    pointer-events: none;
}

/* ── Contenu ───────────────────────────────────────────────────── */
.gd-video-header__content {
    position:        absolute;
    inset:           0;
    z-index:         3;
    display:         flex;
    justify-content: center;   /* centre __inner horizontalement */
    box-sizing:      border-box;
}

/* Contrainte largeur + layout vertical identique à l'ancien __content */
.gd-video-header__inner {
    width:           100%;
    max-width:       800px;
    display:         flex;
    flex-direction:  column;
    justify-content: space-between;
    padding:         28px 0px 36px;
    box-sizing:      border-box;
}

/* ── Ligne haute ───────────────────────────────────────────────── */
.gd-video-header__top-row {
    display:         flex;
    align-items:     flex-start;
    justify-content: space-between;
    gap:             12px;
}

/* ── Badge catégorie ───────────────────────────────────────────── */
.gd-video-header__badge {
    display:         inline-block;
    background:      var(--gd-vh-badge-bg);
    color:           var(--gd-vh-badge-color);
    font-size:       11px;
    font-weight:     700;
    letter-spacing:  .08em;
    text-transform:  uppercase;
    text-decoration: none;
    padding:         6px 18px;
    border-radius:   var(--gd-vh-radius);
    line-height:     1;
    white-space:     nowrap;
    transition:      opacity .2s;
}

.gd-video-header__badge:hover {
    opacity: .85;
    color:   var(--gd-vh-badge-color);
}

/* ── Boutons ───────────────────────────────────────────────────── */
.gd-video-header__controls {
    display:     flex;
    gap:         8px;
    align-items: center;
    flex-shrink: 0;
}

.gd-video-header__btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           60px;
    height:          60px;
    border-radius:   50%;
    background:      var(--gd-vh-btn-bg);
    /*border:          1px solid rgba(255,255,255,.35);*/
    color:           #fff;
    cursor:          pointer;
    text-decoration: none;
    transition:      background .2s, border-color .2s, transform .15s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding:         0;
    line-height:     1;
}

.gd-video-header__btn:hover,
.gd-video-header__btn:focus-visible {
    background:   var(--gd-vh-btn-bg-hover);
    border-color: rgba(255,255,255,.7);
    color:        #fff;
    outline:      none;
    transform:    scale(1.08);
}

.gd-video-header__btn svg {
    display:     block;
    flex-shrink: 0;
}

/* ── Zone texte basse ──────────────────────────────────────────── */
.gd-video-header__body {
    max-width: 760px;
}

.gd-video-header__title-link {
    text-decoration: none;
    color:           inherit;
}

.gd-video-header__title-link:hover .gd-video-header__title {
    text-decoration: underline;
}

.gd-video-header__title {
    /*font-family: var(--gd-vh-font-title);*/
    font-size:   clamp(1.8rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.15;
    margin:      0 0 12px;
    color:       var(--gd-vh-text-color);
    text-shadow: 0 2px 10px rgba(0,0,0,.5);
}

.gd-video-header__meta {
    display:   flex;
    gap:       20px;
    margin:    0 0 12px;
    font-size: .85rem;
    opacity:   .9;
}

.gd-video-header__meta-item {
    display:     inline-flex;
    align-items: center;
    gap:         5px;
}

.gd-video-header__excerpt {
    display: none!important;
    /*margin:      0;
    font-size:   clamp(1.3rem, 2.1vw, 2.5rem);
    line-height: 1.55;
    opacity:     var(--gd-vh-excerpt-opacity);
    display:     -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow:    hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,.3);*/
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .gd-video-header {
        --gd-vh-height:     70vw;
        --gd-vh-min-height: 280px;
    }

    .gd-video-header__inner {
        padding: 18px 20px 24px;
    }

    .gd-video-header__title {
        font-size: clamp(3rem, 6vw, 2rem);
    }

    .gd-video-header__meta {
        gap:       12px;
        font-size: .8rem;
    }
}

@media (max-width: 480px) {
    .gd-video-header__controls { gap: 6px; }

    .gd-video-header__btn {
        width:  30px;
        height: 30px;
    }

    .gd-video-header__btn svg {
        width:  14px;
        height: 14px;
    }
}

/* ── Compat Kadence ─────────────────────────────────────────────── */
.gd-video-header a,
.gd-video-header a:visited {
    color: inherit;
}
