/* ===================================
   Styles pour les pages avec Hero
   =================================== */

/* Page entière avec couleur de fond personnalisée */
.site-main.page-with-custom-bg {
    min-height: 100vh;
    /* La couleur de fond est définie inline via PHP */
}

/* S'assurer que tous les conteneurs enfants sont transparents */
.page-with-custom-bg .page-container,
.page-with-custom-bg .page-content,
.page-with-custom-bg article,
.page-with-custom-bg .page-intro {
    background-color: transparent !important;
}

/* Adapter les couleurs de texte pour fond sombre */
.page-with-custom-bg.dark-bg .page-container,
.page-with-custom-bg.dark-bg .page-content,
.page-with-custom-bg.dark-bg .page-intro {
    color: rgba(255, 255, 255, 0.9);
}

.page-with-custom-bg.dark-bg .page-content h1,
.page-with-custom-bg.dark-bg .page-content h2,
.page-with-custom-bg.dark-bg .page-content h3,
.page-with-custom-bg.dark-bg .page-content h4,
.page-with-custom-bg.dark-bg .page-content h5,
.page-with-custom-bg.dark-bg .page-content h6,
.page-with-custom-bg.dark-bg .page-intro h1,
.page-with-custom-bg.dark-bg .page-intro h2,
.page-with-custom-bg.dark-bg .page-intro h3 {
    color: rgba(255, 255, 255, 0.95) !important;
}

.page-with-custom-bg.dark-bg .page-content p,
.page-with-custom-bg.dark-bg .page-content li,
.page-with-custom-bg.dark-bg .page-intro p,
.page-with-custom-bg.dark-bg .intro-content p {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Adapter les couleurs de texte pour fond clair */
.page-with-custom-bg.light-bg .page-container,
.page-with-custom-bg.light-bg .page-content,
.page-with-custom-bg.light-bg .page-intro {
    color: #333;
}

.page-with-custom-bg.light-bg .page-content h1,
.page-with-custom-bg.light-bg .page-content h2,
.page-with-custom-bg.light-bg .page-content h3,
.page-with-custom-bg.light-bg .page-content h4,
.page-with-custom-bg.light-bg .page-content h5,
.page-with-custom-bg.light-bg .page-content h6,
.page-with-custom-bg.light-bg .page-intro h1,
.page-with-custom-bg.light-bg .page-intro h2,
.page-with-custom-bg.light-bg .page-intro h3 {
    color: #222 !important;
}

.page-with-custom-bg.light-bg .page-content p,
.page-with-custom-bg.light-bg .page-content li,
.page-with-custom-bg.light-bg .page-intro p,
.page-with-custom-bg.light-bg .intro-content p {
    color: #555 !important;
}

/* Hero Section - Style moderne */
.page-hero-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: right;
    /* Background hérite de la couleur du parent main */
    background-color: transparent;
}

/* Background avec image pleine largeur */
.page-hero-section .hero-background {
    position: absolute;
    top: 70px;
    left: 40px;
    right: 40px;
    bottom: 40px;
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    /* Utilise la couleur de fond héritée via les variables CSS */
    background-color: var(--hero-bg-color, --bg-dark);
}

.page-hero-section .hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.page-hero-section .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fond par défaut si pas d'image */
.page-hero-section .hero-default-bg {
    width: 100%;
    height: 100%;
    /* Utilise la couleur héritée du parent ou un gradient par défaut */
    background: inherit;
    /* Si pas de couleur définie, utilise un gradient subtil */
    background: linear-gradient(135deg, 
        var(--hero-bg-color, --bg-dark) 0%, 
        var(--hero-bg-color-dark, --bg-dark) 100%
    );
}

/* Overlay gradient sophistiqué */
/* .page-hero-section .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 2;
} */

/* Contenu Hero centré */
.page-hero-section .hero-content {
    position: relative;
    z-index: 3;
    text-align: right;
    color: white;
    transition: all var(--transition-speed) ease;
    margin-right: 10%;
    margin-bottom: 10%;
}

.page-hero-section .container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.page-hero-section .hero-title {
    font-size: clamp(2.0rem, 8vw, 3rem);
    font-weight: 700;
    padding: 5px 15px 5px 100px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background-color: var(--primary-color);
    color: var(--text-white);
    animation: fadeInUp 0.8s ease-out;
}

/* Permet de mettre certains mots en blanc */
.page-hero-section .hero-title span {
    color: #fff;
}

.page-hero-section .hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 300;
    margin-bottom: 1rem;
    opacity: 0.95;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

/* Container de la page */
.page-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* Section Introduction */
.page-intro {
    padding: 40px 20px;
    margin-bottom: 40px;
}

.page-intro .intro-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.page-intro h2 {
    margin-bottom: 20px;
    font-size: 2rem;
}

.page-intro p {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Contenu par défaut */
.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.page-content ul,
.page-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Compatibilité avec le menu unifié */
body.homepage-scroll .page-hero-section,
body.has-unified-menu .page-hero-section {
    margin-top: 0;
}

/* Layout principal */
#primary.site-main {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* Responsive Hero Section */
@media (max-width: 1024px) {
    .page-hero-section {
        height: 60vh;
        min-height: 400px;
    }
    
    .page-hero-section .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .page-hero-section .hero-subtitle {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }

    .page-hero-section .hero-background {
        position: absolute;
        top: 60px;
        left: 10px;
        right: 10px;
        bottom: 0px;
    }
}

@media (max-width: 768px) {
    .page-hero-section {
        height: 70vh;
        min-height: 350px;
    }
    
    .page-hero-section .hero-title {
        font-size: clamp(2.5rem, 6vw, 3rem);
        margin-bottom: 1rem;
    }
    
    .page-hero-section .hero-subtitle {
        font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    }
    
    .page-hero-section .hero-background {
        position: absolute;
        top: 60px;
        left: 10px;
        right: 10px;
        bottom: 0px;
    }

    .page-hero-section .hero-content {
        padding: 0 15px;
    }
    
    .page-container {
        padding: 0 15px 60px;
    }
}

@media (max-width: 480px) {
    .page-hero-section {
        height: 60vh;
        min-height: 300px;
        margin-bottom: 15px;
    }
    
    .page-hero-section .hero-title {
        font-size: 2rem;
        padding: 5px;
    }
    
    .page-hero-section .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .page-intro {
        padding: 30px 15px;
    }
}