/**
 * CG Couleur et Granulat - Hero Block Styles
 * Bannière principale avec vidéo, image ou slider
 *
 * @package CG_Theme
 */

/* ==========================================================================
   HERO BASE
   ========================================================================== */

.cg-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--cg-black);
    width: 100%;
    margin-top: -80px; /* Compenser le header fixe */
    padding-top: 80px;
}

/* Hauteurs */
.cg-hero--full {
    min-height: 100vh;
}

.cg-hero--large {
    min-height: 80vh;
}

.cg-hero--medium {
    min-height: 60vh;
}

.cg-hero--small {
    min-height: 40vh;
}

/* ==========================================================================
   HERO MEDIA (Background)
   ========================================================================== */

.cg-hero__media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cg-hero__placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Image */
.cg-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Vidéo MP4 */
.cg-hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* YouTube wrapper */
.cg-hero__youtube-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cg-hero__youtube {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Poster fallback */
.cg-hero__poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* ==========================================================================
   SLIDER
   ========================================================================== */

.cg-hero__slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cg-hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.cg-hero__slide.is-active {
    opacity: 1;
}

.cg-hero__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dots navigation */
.cg-hero__slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.cg-hero__slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.cg-hero__slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.cg-hero__slider-dot.is-active {
    background-color: var(--cg-gold);
    border-color: var(--cg-gold);
    transform: scale(1.2);
}

/* ==========================================================================
   OVERLAY
   ========================================================================== */

.cg-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    z-index: 2;
    pointer-events: none;
}

/* ==========================================================================
   CONTENT - IMPORTANT: z-index must be higher than overlay
   ========================================================================== */

.cg-hero__content {
    position: relative;
    z-index: 5;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.cg-hero__content .container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.cg-hero__inner {
    max-width: 900px;
}

/* Alignement */
.cg-hero--align-left .cg-hero__inner {
    margin-right: auto;
    text-align: left;
}

.cg-hero--align-center .cg-hero__inner {
    margin: 0 auto;
    text-align: center;
}

.cg-hero--align-right .cg-hero__inner {
    margin-left: auto;
    text-align: right;
}

/* ==========================================================================
   SURTITRE
   ========================================================================== */

.cg-hero__surtitre {
    display: inline-block;
    font-family: var(--cg-font-secondary, 'Montserrat', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--cg-gold);
    margin-bottom: 1rem;
}

/* ==========================================================================
   TITRE
   ========================================================================== */

.cg-hero__titre {
    font-family: var(--cg-font-primary, 'Playfair Display', serif);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
}

/* ==========================================================================
   DESCRIPTION
   ========================================================================== */

.cg-hero__description {
    font-family: var(--cg-font-secondary, 'Montserrat', sans-serif);
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
}

.cg-hero--align-center .cg-hero__description {
    margin-left: auto;
    margin-right: auto;
}

.cg-hero--align-right .cg-hero__description {
    margin-left: auto;
}

/* ==========================================================================
   CTA BUTTONS
   ========================================================================== */

.cg-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cg-hero--align-center .cg-hero__cta {
    justify-content: center;
}

.cg-hero--align-right .cg-hero__cta {
    justify-content: flex-end;
}

/* Button styles */
.cg-hero .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--cg-font-secondary, 'Montserrat', sans-serif);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.cg-hero .btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

.cg-hero .btn-primary {
    background-color: var(--cg-gold);
    color: var(--cg-black, #1a1a1a);
    border-color: var(--cg-gold);
}

.cg-hero .btn-primary:hover {
    background-color: var(--cg-gold-light, #D4B44A);
    border-color: var(--cg-gold-light, #D4B44A);
}

.cg-hero .btn-white {
    background-color: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

.cg-hero .btn-white:hover {
    background-color: #ffffff;
    color: var(--cg-black, #1a1a1a);
}

/* ==========================================================================
   SCROLL INDICATOR
   ========================================================================== */

.cg-hero__scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.cg-hero__scroll-text {
    font-family: var(--cg-font-secondary, 'Montserrat', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
}

.cg-hero__scroll-icon {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.cg-hero__scroll-icon i {
    color: var(--cg-gold);
    font-size: 0.875rem;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.5;
    }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 992px) {
    .cg-hero {
        margin-top: -70px;
        padding-top: 70px;
    }
    
    .cg-hero__titre {
        font-size: clamp(1.75rem, 5vw, 3rem);
    }
    
    .cg-hero__description {
        font-size: 1rem;
    }
    
    .cg-hero__cta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cg-hero--align-center .cg-hero__cta,
    .cg-hero--align-right .cg-hero__cta {
        align-items: center;
    }
    
    .cg-hero .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .cg-hero__content {
        padding: 40px 15px;
    }
    
    .cg-hero__surtitre {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }
    
    .cg-hero__titre {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    
    .cg-hero__description {
        font-size: 0.9375rem;
    }
    
    .cg-hero__scroll {
        bottom: 20px;
    }
}

/* ==========================================================================
   GUTENBERG EDITOR FIXES
   ========================================================================== */

.editor-styles-wrapper .cg-hero {
    margin-top: 0;
    padding-top: 0;
}

.editor-styles-wrapper .cg-hero__content {
    padding: 40px 20px;
}
