/*
Theme Name: CH2E
Description: Theme WordPress pour CH2E - BTP / Energies Renouvelables
Version: 1.0.0
Text Domain: ch2e-theme
*/

/* ============================================
   VARIABLES CSS - PALETTE CH2E
   ============================================ */
:root {
    /* Couleurs principales CH2E */
    --bs-primary: #036536;      /* Vert fonce */
    --bs-secondary: #049F49;    /* Vert clair */
    --bs-success: #049F49;      /* Vert clair */
    --bs-danger: #DC2626;
    --bs-warning: #F59E0B;
    --bs-info: #ABD380;         /* Vert pastel */
    --bs-light: #FFFAFA;        /* Blanc snow */
    --bs-dark: #173B75;         /* Bleu fonce */

    /* Grays */
    --bs-gray-100: #F9FAFB;
    --bs-gray-200: #F3F4F6;
    --bs-gray-300: #E5E7EB;
    --bs-gray-400: #D1D5DB;
    --bs-gray-500: #9CA3AF;
    --bs-gray-600: #6B7280;
    --bs-gray-700: #374151;
    --bs-gray-800: #1F2937;
    --bs-gray-900: #1E191A;     /* Noir CH2E */

    /* RGB pour opacite */
    --bs-primary-rgb: 3, 101, 54;
    --bs-secondary-rgb: 4, 159, 73;
    --bs-info-rgb: 171, 211, 128;
    --bs-dark-rgb: 23, 59, 117;
    --bs-light-rgb: 255, 250, 250;
}

/* ============================================
   SURCHARGE BOOTSTRAP - BOUTONS
   ============================================ */
.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #024a27 !important;
    border-color: #024a27 !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: var(--bs-secondary) !important;
    border-color: var(--bs-secondary) !important;
    color: #ffffff !important;
}
.btn-secondary:hover, .btn-secondary:focus {
    background-color: #037a38 !important;
    border-color: #037a38 !important;
}

.btn-outline-primary {
    border-color: var(--bs-primary) !important;
    color: var(--bs-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

/* ============================================
   ACCESSIBILITE - WCAG AA COMPLIANCE
   ============================================ */

/* CRITIQUE: btn-info avec texte SOMBRE */
.btn-info {
    background-color: var(--bs-info) !important;
    border-color: var(--bs-info) !important;
    color: #0F172A !important;
}
.btn-info:hover, .btn-info:focus {
    background-color: #8BC34A !important;
    border-color: #8BC34A !important;
    color: #0F172A !important;
}

/* Badges sur fond info */
.badge.bg-info,
.bg-info .badge {
    color: #0F172A !important;
}

/* CRITIQUE: text-muted assez fonce */
.text-muted {
    color: var(--bs-gray-600) !important;
}

/* CRITIQUE: text-secondary assez fonce */
.text-secondary {
    color: #374151 !important;
}

/* CRITIQUE: Titres sur fonds sombres TOUJOURS blancs */
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6 {
    color: #ffffff !important;
}

/* Focus visible obligatoire */
:focus-visible {
    outline: 3px solid var(--bs-secondary) !important;
    outline-offset: 2px;
}

/* Liens dans zones sombres */
.bg-dark a:not(.btn):not(.nav-link),
.bg-primary a:not(.btn):not(.nav-link) {
    color: var(--bs-info) !important;
}
.bg-dark a:not(.btn):not(.nav-link):hover,
.bg-primary a:not(.btn):not(.nav-link):hover {
    color: #C5E1A5 !important;
}

/* Skip link pour navigation clavier */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bs-primary);
    color: white;
    padding: 8px;
    z-index: 9999;
}
.skip-link:focus {
    top: 0;
}

/* CRITIQUE: Navbar links sur fond sombre */
.navbar.bg-primary .nav-link,
.navbar.bg-dark .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}
.navbar.bg-primary .nav-link:hover,
.navbar.bg-dark .nav-link:hover {
    color: #ffffff !important;
}

/* CRITIQUE: text-secondary sur fond sombre (footer) - WCAG AA ratio > 4.5:1 */
.bg-dark .text-secondary,
footer .text-secondary {
    color: #B0B7C3 !important;  /* Augmenté pour ratio > 4.5:1 sur #173B75 */
}

/* CRITIQUE: Badge bg-success - texte sombre */
.badge.bg-success {
    color: #052e16 !important;
}

/* ============================================
   SURCHARGE BACKGROUNDS
   ============================================ */
.bg-primary { background-color: var(--bs-primary) !important; }
.bg-secondary { background-color: var(--bs-secondary) !important; }
.bg-info { background-color: var(--bs-info) !important; }
.bg-light { background-color: var(--bs-light) !important; }
.bg-dark { background-color: var(--bs-dark) !important; }

.text-primary { color: var(--bs-primary) !important; }
.text-secondary { color: var(--bs-secondary) !important; }
.text-info { color: var(--bs-info) !important; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 70vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(3, 101, 54, 0.85), rgba(23, 59, 117, 0.75));
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Hero sans image de fond (plus petit) */
.hero.bg-primary {
    min-height: 35vh;
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--bs-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* Logo responsive - réduit de 30% */
.navbar-brand .logo-image {
    height: 35px;
    max-width: 140px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .navbar-brand .logo-image {
        height: 40px;
        max-width: 180px;
    }
}

@media (min-width: 1024px) {
    .navbar-brand .logo-image {
        height: 45px;
        max-width: 220px;
    }
}
.navbar-nav {
    gap: 0.5rem;
}
.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    color: var(--bs-gray-700);
    transition: color 0.2s ease;
    white-space: nowrap;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--bs-primary);
}

/* Mobile menu toggle */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
}
.navbar-toggler:focus {
    box-shadow: none;
}

/* ============================================
   CARDS PRESTATIONS
   ============================================ */
.card-prestation {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
.card-prestation:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
.card-prestation .card-img-top {
    height: 200px;
    object-fit: cover;
}
.card-prestation .card-body {
    padding: 1.5rem;
}
.card-prestation .card-title {
    color: var(--bs-dark);
    font-weight: 700;
}

/* ============================================
   GALERIE REALISATIONS
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.gallery-item {
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 4/3;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}

/* ============================================
   BLOC RASSURANCE
   ============================================ */
.rassurance-item {
    text-align: center;
    padding: 2rem;
}
.rassurance-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(171, 211, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.rassurance-icon i {
    font-size: 2rem;
    color: var(--bs-primary);
}

/* ============================================
   AVIS CLIENTS
   ============================================ */
.avis-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 100%;
}
.avis-stars {
    color: #F59E0B;
    margin-bottom: 0.5rem;
}
.avis-text {
    font-style: italic;
    color: var(--bs-gray-700);
    margin-bottom: 1rem;
}
.avis-author {
    font-weight: 600;
    color: var(--bs-dark);
}

/* ============================================
   LOGOS MEDIAS
   ============================================ */
.media-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}
.media-logo {
    max-height: 50px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}
.media-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--bs-dark);
    color: rgba(255,255,255,0.87);  /* WCAG AA: ratio > 4.5:1 */
}
.site-footer a {
    color: rgba(255,255,255,0.87);  /* WCAG AA: ratio > 4.5:1 */
    transition: color 0.2s ease;
}
.site-footer a:hover {
    color: var(--bs-info);
}
.footer-logo img {
    max-height: 60px;
    margin-bottom: 1rem;
}
.widget-title {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* ============================================
   SECTIONS
   ============================================ */
.section-title {
    font-weight: 700;
    color: var(--bs-dark);
    margin-bottom: 0.5rem;
}
.section-subtitle {
    color: var(--bs-gray-600);
    font-size: 1.1rem;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-dark));
    color: #ffffff;
    padding: 4rem 0;
}
.cta-section h2 {
    color: #ffffff !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .hero {
        min-height: 60vh;
    }
    .navbar-collapse {
        background: var(--bs-light);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }
}

@media (max-width: 767.98px) {
    .hero {
        min-height: 50vh;
    }
    .hero h1 {
        font-size: 1.75rem;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
