/* ==========================================================================
   1. GLOBAL RESET & CONFIGURATION (WARM MARITIME PALETTE)
   ========================================================================== */

:root {
    /* Main Brand Colors */
    --primary-dark: #452e14;        /* Brown Derby (Rich Grounding Base) */
    --secondary-blue: #2780bd;      /* Mariner (Deep Core Accent Blue) */
    --light-blue: #79afdb;          /* Viking (Soft Highlight Blue) */
    --warm-sand: #dca663;           /* Di Serria (Warm Earth Accent) */
    
    /* Neutrals Scales */
    --dark-text: #2c251e;           /* High Contrast Dark Brown-Charcoal */
    --muted-text: #596573;          /* Soft Corporate Slate for Body copy */
    --light-bg: #fdfbfa;            /* Warm Off-White Canvas */
    --white: #ffffff;
    --gray-border: #e9e4df;         /* Warm Tinted Clean Divider */
    
    /* Layout Foundations */
    --max-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--dark-text);
    background-color: var(--light-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main {
    min-height: calc(100vh - 160px);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ==========================================================================
   2. GLOBAL TYPOGRAPHY COMPONENTS (BROWN DERBY COMPONENT STYLE)
   ========================================================================== */

.page-section-title {
    font-size: 2.2rem;
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.page-section-title.centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.page-section-subtitle {
    font-size: 1.15rem;
    color: var(--muted-text);
    max-width: 750px;
    line-height: 1.75;
    margin-bottom: 2.5rem;
}

.page-section-subtitle.centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.page-section-badge {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--secondary-blue);
    font-weight: 700;
    margin-bottom: 0.75rem;
    background-color: rgba(39, 128, 189, 0.08);
    padding: 0.3rem 1.2rem;
    border-radius: 20px;
}

/* ==========================================================================
   3. CORE STRUCTURAL LAYOUT & NAVIGATION
   ========================================================================== */

header {
    background-color: var(--white);
    border-bottom: 2px solid var(--warm-sand);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
}

nav .logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    text-decoration: none;
    letter-spacing: -0.05em;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    transition: var(--transition);
}

nav ul a:hover {
    color: var(--secondary-blue);
}

.breadcrumb-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-border);
    padding: 0.75rem 2rem;
}

.breadcrumb-nav .container {
    padding: 0;
}

.breadcrumb-nav a {
    color: var(--secondary-blue);
    text-decoration: none;
}

footer {
    background-color: var(--primary-dark);
    color: var(--white);
    text-align: center;
    padding: 2.5rem 2rem;
    margin-top: auto;
    border-top: 4px solid var(--warm-sand);
}

/* ==========================================================================
   4. MEDIA COMPONENTS & SPLIT LAYOUTS
   ========================================================================== */

.responsive-img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(69, 46, 20, 0.08);
}

.about-split {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    color: var(--muted-text);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.about-image {
    flex: 1;
    min-width: 300px;
}

/* ==========================================================================
   5. CINEMATIC VIDEO HERO SECTION (HOME)
   ========================================================================== */

.transparent-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.transparent-header nav .logo a,
.transparent-header nav ul a {
    color: var(--white);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.transparent-header nav ul a:hover {
    color: var(--light-blue);
}

.video-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    background-color: var(--primary-dark);
    overflow: hidden;
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(69, 46, 20, 0.55) 0%, 
        rgba(39, 128, 189, 0.45) 100
    );
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
}

.hero-center-content {
    color: var(--white);
}

.animated-brand-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: fadeInTitle 1.5s ease-out forwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-sand);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.home-intro-clean {
    text-align: center;
    max-width: 800px;
    margin: 4rem auto;
}

.home-intro-clean p {
    font-size: 1.2rem;
    color: var(--dark-text);
    line-height: 1.8;
}

@keyframes fadeInTitle {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .animated-brand-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 0.9rem; }
}

/* ==========================================================================
   6. INTERACTIVE ACCESSIBLE FORMS & BUTTONS
   ========================================================================== */

form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--gray-border);
    max-width: 600px;
    margin: 2rem auto 0 auto;
    box-shadow: 0 4px 10px rgba(69, 46, 20, 0.04);
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

form input[type="text"],
form input[type="email"],
form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    color: var(--dark-text);
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(39, 128, 189, 0.15);
}

form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Premium Solid Actions Buttons */
form button[type="submit"],
.btn-premium {
    background-color: var(--secondary-blue);
    color: var(--white);
    border: none;
    padding: 0.9rem 2.2rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(39, 128, 189, 0.25);
    display: inline-block;
    text-align: center;
}

form button[type="submit"]:hover,
.btn-premium:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(69, 46, 20, 0.3);
    color: var(--white);
}

form button[type="submit"]:active,
.btn-premium:active {
    transform: translateY(0);
}

.status-msg {
    max-width: 600px;
    margin: 1rem auto;
    border-radius: 4px;
}

/* ==========================================================================
   7. INTERACTIVE TESTIMONIALS SLIDER SECTION
   ========================================================================== */

.testimonials-section {
    text-align: center;
    padding: 4rem 1rem; 
    background-color: #fdf8f2; /* Premium Smooth Textured Background */
    border-top: 1px solid rgba(220, 166, 99, 0.25);
    border-bottom: 1px solid rgba(220, 166, 99, 0.25);
    margin-top: 2rem;
    width: 100%;
}

.carousel-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    padding: 1rem 0;
}

/* The track height adapts dynamically based on active content layout */
.carousel-track {
    position: relative;
    height: auto;
    min-height: 400px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative; /* Crucial for parent container height calculations */
}

/* Circular portrait frame */
.client-logo-box {
    width: 120px;         
    height: 120px;        
    margin: 0 auto 20px auto;  
    border-radius: 50%;   
    overflow: hidden;     
    border: 3px solid var(--warm-sand); 
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff; 
    box-shadow: 0 4px 10px rgba(69, 46, 20, 0.1);
}

.client-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;    
    display: block;
}

/* Quote typography */
.client-quote {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--dark-text);
    font-style: italic;
    margin: 0 auto 2rem auto;
    max-width: 750px;
    padding: 0 40px; /* Leave side clearance for desktop arrows */
    box-sizing: border-box;
}

/* Endorsement signature blocks mapping to the PHP template structure */
.testimonial-author h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.testimonial-author p {
    font-size: 0.95rem;
    color: var(--muted-text);
}

.testimonial-author .company-link {
    color: var(--secondary-blue);
    font-weight: 600;
}

/* Circular elevated controls buttons */
.carousel-btn {
    color: var(--secondary-blue);
    background: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(69, 46, 20, 0.1);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    flex-shrink: 0; /* Prevents arrows from warping/shrinking on mobile */
}

.carousel-btn:hover {
    color: var(--white);
    background-color: var(--secondary-blue);
}


/* ==========================================================================
   8. SPECIFIC SUB-SECTIONS (HISTORY BLOCKS)
   ========================================================================== */

.history-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid var(--gray-border);
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.history-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.history-content p {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--muted-text);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.history-content strong {
    color: var(--primary-dark);
    font-weight: 600;
}


/* ==========================================================================
   9. DESKTOP HAMBURGER CONTROLS (HIDDEN BY DEFAULT)
   ========================================================================== */
.hamburger-btn {
    display: none; /* Hidden on large desktop structures */
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.hamburger-btn .bar {
    width: 25px;
    height: 3px;
    background-color: var(--warm-sand); 
    transition: all 0.3s ease;
}


/* ==========================================================================
   10. GLOBAL BILINGUAL LANGUAGE SWITCHER
   ========================================================================== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: auto;      
    margin-right: 2rem;     
}

/* --- STYLE PAR DÉFAUT (Pour les pages internes : Texte sombre sur fond clair) --- */
header nav .lang-switcher a {
    text-decoration: none !important;
    color: #1a1a1a !important; /* Force le texte en noir/sombre pour contrer le blanc générique */
    transition: all 0.3s ease !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
}

header nav .lang-switcher a:hover {
    color: var(--secondary-blue, #0056b3) !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* État actif sur page interne (Bouton sombre, texte blanc) */
header nav .lang-switcher a.active-lang {
    color: #ffffff !important;
    background-color: #1a1a1a !important;
    pointer-events: none !important; 
}

header nav .lang-separator {
    color: #666666 !important; /* Séparateur sombre */
}

/* --- ACCORD AVEC LE HEADER TRANSPARENT (Pour l'Index : Texte blanc sur fond sombre) --- */
header.transparent-header nav .lang-switcher a {
    color: #ffffff !important; /* Force les liens non actifs en blanc sur l'accueil */
}

header.transparent-header nav .lang-switcher a:hover {
    color: var(--secondary-blue, #cbdffa) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* État actif sur l'accueil (Bouton blanc, texte sombre pour trancher sur le fond vidéo) */
header.transparent-header nav .lang-switcher a.active-lang {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
    pointer-events: none !important;
}

header.transparent-header nav .lang-separator {
    color: rgba(255, 255, 255, 0.4) !important;
}


/* ==========================================================================
   11. MOBILE RESPONSIVE ENGINE (MEDIA QUERY < 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    /* Overrides container spacing constraints exclusively for mobile screens */
    .container {
        padding: 1.5rem 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    /* --- MOBILE HEADER & NAVIGATION --- */
    header nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        padding: 12px 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .logo a {
        font-size: 1.1rem !important; 
        white-space: normal;
        display: block;
        max-width: 80%;
        line-height: 1.3;
    }

    /* Activates hamburger toggle button display on viewports < 768px */
    .hamburger-btn {
        display: flex;
    }

    /* Restructures native UL elements into a floating dropdown layout stack */
    header nav ul {
        display: none; /* Collapsed out of sight until triggered */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Sits flush right underneath the sticky navbar */
        left: 0;
        width: 100%;
        background-color: #ffffff; 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        margin: 0;
        list-style: none;
        z-index: 1000;
    }

    /* Class injected dynamically by JavaScript listeners on toggle */
    header nav ul.active {
        display: flex;
    }

    header nav ul li {
        width: 100%;
        text-align: center;
    }

    header nav ul li a {
        display: block;
        padding: 14px 0 !important;
        color: var(--dark-text) !important; 
        border-bottom: 1px solid var(--gray-border);
        width: 100%;
        font-size: 1rem;
    }
    
    header nav ul li:last-child a {
        border-bottom: none;
    }

    /* --- MOBILE LANGUAGE SWITCHER ALIGNMENT --- */
    .lang-switcher {
        margin-left: auto;   /* Perfectly centers switcher between brand logo and menu controls */
        margin-right: 15px;  /* Safety buffer space right before the hamburger button */
        font-size: 0.85rem;
    }

    /* --- MOBILE TESTIMONIAL CAROUSEL FIXES --- */
    .testimonials-section {
        padding: 2rem 0 !important;
        margin-top: 1rem;
    }

    .carousel-wrapper {
        padding: 0 5px;
    }

    /* Overrides static heights to completely resolve layout truncation issues */
    .carousel-container, 
    .carousel-track {
        height: auto !important;
        min-height: 480px !important;
        overflow: visible !important;
    }

    .carousel-slide {
        position: absolute; /* Maintained for the structural animation flow */
        width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box;
    }
    
    .carousel-slide.active {
        position: relative !important; /* Forces DOM rendering to dynamically compute wrapper heights */
    }

    /* Eradicates text squeezing (allows full mobile width display) */
    .client-quote {
        font-size: 0.95rem !important;  
        line-height: 1.6 !important;     
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 15px !important;      
        margin: 0 auto 20px auto !important;
    }

    .client-logo-box {
        width: 90px !important;
        height: 90px !important;
        margin: 0 auto 15px auto !important;
    }

    .testimonial-author {
        width: 100% !important;
        margin-top: 10px !important;
        padding-bottom: 20px !important; /* Safeguards area to push footers down naturally */
    }

    .testimonial-author h3 {
        font-size: 1.1rem !important;
    }

    .testimonial-author p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        padding: 0 5px;
    }

    /* Downscale arrow dimension sizing to avoid masking copy area */
    .carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}