/* ===== Consistent section spacing ===== */

/* Desktop (lg) */
@media (min-width: 1024px) {
    #expertise-unique-section {
        padding-top: 64px !important;
        padding-bottom: 64px !important;
    }
    #gadimat-timeline-unique {
        padding-top: 64px !important;
        padding-bottom: 80px !important;
    }
}

/* Small desktop / large tablet (1024-1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    /* Hero stat cards */
    #gadimat-hero-unique .hero-ag-glass span {
        font-size: 2rem !important; /* 32px */
        line-height: 2.25rem !important;
    }
    #gadimat-hero-unique .hero-ag-glass {
        height: auto !important;
        min-height: 180px;
        padding: 1.25rem !important;
    }
    #gadimat-hero-unique .hero-ag-glass p {
        font-size: 0.8rem !important;
    }

    /* Section titles smaller */
    #expertise-unique-section h2 {
        font-size: 2rem !important; /* 32px */
        line-height: 2.25rem !important;
    }

    /* Timeline: reduce sizing */
    #gadimat-timeline-unique .tl-item {
        gap: 0 !important;
    }
    #gadimat-timeline-unique .tl-img-group,
    #gadimat-timeline-unique .tl-text-group {
        min-height: 350px !important;
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
    /* Photo cards smaller */
    #gadimat-timeline-unique .tl-photo-card:first-child,
    #gadimat-timeline-unique .tl-img-group > .tl-photo-card:first-of-type {
        width: 300px !important;
        height: 200px !important;
    }
    #gadimat-timeline-unique .tl-photo-card {
        width: 280px !important;
        height: 180px !important;
    }
    /* Year text smaller */
    #gadimat-timeline-unique .tl-year-anim {
        font-size: 2.5rem !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Section spacing */
    #expertise-unique-section {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }
    #gadimat-timeline-unique {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    /* Hero stat cards: smaller title font */
    #gadimat-hero-unique .hero-ag-glass span {
        font-size: 2.25rem !important; /* text-4xl = 36px */
        line-height: 2.5rem !important;
    }
    #gadimat-hero-unique .hero-ag-glass {
        height: auto !important;
        min-height: 180px;
        padding: 1.25rem !important;
    }
    #gadimat-hero-unique .hero-ag-glass p {
        font-size: 0.8rem !important;
    }

    /* Section titles: scale down from 5xl to 4xl */
    #expertise-unique-section h2 {
        font-size: 2.25rem !important; /* 36px */
        line-height: 2.5rem !important;
    }

    /* Expertise image: limit height on tablet */
    #expertise-unique-section .expertise-anim-right {
        max-height: 400px !important;
    }

}

/* Mobile */
@media (max-width: 767px) {
    #expertise-unique-section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    #gadimat-timeline-unique {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

/* Fix expertise image to match text content height */
#expertise-unique-section .grid {
    align-items: stretch;
}

#expertise-unique-section .expertise-anim-right {
    min-height: 0 !important;
    height: auto;
    overflow: hidden;
}

#expertise-unique-section .expertise-anim-right > div {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

#expertise-unique-section .expertise-anim-right img {
    height: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* Fix hero wrapper clipping the stat cards */
#gadimat-hero-unique {
    min-height: 100vh;
}
/* The parent wrapper must not clip hero content */
#gadimat-hero-unique ~ * {
    position: relative;
    z-index: 1;
}
.h-screen:has(#gadimat-hero-unique) {
    height: auto !important;
    min-height: 100vh;
}

/* Hero stat card titles: reduce from 5xl to 4xl globally */
#gadimat-hero-unique .hero-ag-glass span {
    font-size: 2.25rem !important; /* 36px = text-4xl */
    line-height: 2.5rem !important;
}

/* Unique Styles for this Hero Section only */
.hero-ag-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Unique styles for the corner marker */
.expertise-crosshair {
    position: absolute;
    color: #9ca3af;
    /* gray-400 */
    font-size: 24px;
    font-weight: 300;
    z-index: 10;
}

.expertise-line-v {
    position: absolute;
    background-color: #e5e7eb;
    /* gray-200 */
    width: 1px;
}

.expertise-line-h {
    position: absolute;
    background-color: #e5e7eb;
    /* gray-200 */
    height: 1px;
}

/* Unique styling for the background blob shape without variables */
.mp-blob-shape {
    border-radius: 40% 60% 50% 50% / 50% 50% 50% 50%;
    transform: rotate(-5deg);
}

/* Faint line pattern overlay */
.mp-lines-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 C 30 40, 70 60, 100 50' stroke='%23ec4899' stroke-width='0.5' stroke-opacity='0.1'/%3E%3C/svg%3E");
}

/* ===== VMV Scroll-Pin Accordion ===== */

/* Outer section: height = 100vh * (slides + 1) so ScrollTrigger has room */
#vmv-unique-section {
    position: relative;
}

.vmv-pin-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
}

.vmv-inner {
    width: 100%;
}

.vmv-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    min-height: 70vh;
}

/* Left accordion */
.vmv-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vmv-slide {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.5rem 0;
    cursor: pointer;
}

.vmv-slide:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.vmv-slide-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.vmv-number {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.3);
    min-width: 2.5rem;
    font-family: 'Raleway', sans-serif;
    transition: color 0.4s ease;
}

.vmv-slide.is-active .vmv-number {
    color: rgba(0, 0, 0, 0.5);
}

.vmv-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-family: 'Raleway', sans-serif;
    color: #2A5291;
    transition: color 0.4s ease, opacity 0.4s ease;
}

/* Upcoming slides: faded title */
.vmv-slide:not(.is-active):not(.is-past) .vmv-title {
    color: rgba(42, 82, 145, 0.15);
}

/* Past slides: solid */
.vmv-slide.is-past .vmv-title {
    color: #2A5291;
}

/* Active slide */
.vmv-slide.is-active .vmv-title {
    color: #2A5291;
}

/* Slide body — hidden by default, revealed for active */
.vmv-slide-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease 0.1s;
    padding-left: 0;
}

.vmv-slide.is-active .vmv-slide-body {
    max-height: 300px;
    opacity: 1;
}

.vmv-slide.is-active:hover .vmv-slide-body,
.vmv-slide.is-active:focus-within .vmv-slide-body {
    max-height: 900px;
}

.vmv-dot-separator {
    display: none;
}

.vmv-subtitle {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2A5291;
    font-family: 'Raleway', sans-serif;
    margin-bottom: 0.5rem;
}

.vmv-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.45);
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
    max-width: 500px;
}

/* Right images */
.vmv-images {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 70vh;
    max-height: 600px;
}

.vmv-img-wrap {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.vmv-img-wrap.is-active {
    opacity: 1;
    transform: translateY(0);
}

.vmv-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile: simple stacked layout, no pin, no animation */
@media (max-width: 1023px) {
    .vmv-layout {
        grid-template-columns: 1fr;
        gap: 0;
        min-height: auto;
    }

    .vmv-pin-wrapper {
        height: auto;
        padding: 2.5rem 0;
    }

    .vmv-images {
        display: none;
    }

    .vmv-slide-body {
        padding-left: 0;
    }

    .vmv-slide .vmv-slide-body {
        max-height: none;
        opacity: 1;
    }

    .vmv-slide .vmv-title {
        color: #2A5291 !important;
        font-size: 1.5rem;
    }

    .vmv-slide .vmv-number {
        color: rgba(0, 0, 0, 0.4);
    }
}

/* ===== Mot du président/directeur — Scroll-Pin Accordion ===== */

#mot-pin-section {
    position: relative;
}

.mot-pin-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
}

.mot-inner {
    width: 100%;
}

.mot-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    min-height: 70vh;
}

/* Left accordion */
.mot-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mot-slide {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.5rem 0;
    cursor: default;
}

.mot-slide:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mot-slide-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.mot-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-family: 'Raleway', sans-serif;
    color: #2A5291;
    transition: color 0.4s ease, opacity 0.4s ease;
}

.mot-slide:not(.is-active):not(.is-past) .mot-title {
    color: rgba(42, 82, 145, 0.15);
}

.mot-slide.is-past .mot-title {
    color: #2A5291;
}

.mot-slide.is-active .mot-title {
    color: #2A5291;
}

/* Slide body — hidden by default, revealed for active */
.mot-slide-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease 0.1s;
}

.mot-slide.is-active .mot-slide-body {
    max-height: 500px;
    opacity: 1;
}

.mot-subtitle {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2A5291;
    font-family: 'Raleway', sans-serif;
    margin: 0.75rem 0 0.5rem;
}

.mot-paragraphs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mot-paragraphs p {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.45);
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
    max-width: 520px;
}

/* Right images */
.mot-images {
    position: relative;
    height: 70vh;
    max-height: 600px;
}

.mot-img-wrap {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mot-img-wrap.is-active {
    opacity: 1;
    transform: translateY(0);
}

.mot-person {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4/5;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mot-person-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
}

.mot-name-card {
    position: absolute;
    top: 30%;
    left: -2rem;
    z-index: 20;
    background: white;
    padding: 1rem 1.5rem;
    padding-right: 3rem;
    border-radius: 2rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Mobile/Tablet: static stacked, no animation */
@media (max-width: 1023px) {
    .mot-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
    }

    .mot-pin-wrapper {
        height: auto;
        padding: 2.5rem 0;
    }

    .mot-slide .mot-slide-body {
        max-height: none;
        opacity: 1;
    }

    .mot-slide .mot-title {
        color: #2A5291 !important;
        font-size: 1.5rem;
    }

    .mot-images {
        display: none;
    }
}

/* The faint background grid markers */
.tl-grid-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 0;
}

.tl-grid-marker::before,
.tl-grid-marker::after {
    content: "";
    position: absolute;
    background-color: #cbd5e1;
}

/* Horizontal line of marker */
.tl-grid-marker::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
}

/* Vertical line of marker */
.tl-grid-marker::after {
    left: 50%;
    top: 0;
    height: 100%;
    width: 1px;
}

/* Photo Card Styling to match the white border look */
.tl-photo-card {
    background-color: #d9d9d9;
    /* gray-200 placeholder */
    border: 6px solid white;
    border-radius: 1rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}
/* ===== History Timeline — CSS Scroll Snap (desktop only) ===== */
@media (min-width: 1024px) {
    html {
        scroll-snap-type: y mandatory;
    }

    .tl-item {
        height: 100vh;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }
}

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {

    /* ── Per-item entrance animations (CSS, triggered by IntersectionObserver) ── */

    /* Initial hidden states */
    .tl-item .tl-year-anim {
        opacity: 0;
        transform: scale(0.5);
        transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .tl-item .tl-icon-anim {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity 0.4s ease 0.18s, transform 0.4s ease 0.18s;
    }
    .tl-item .tl-img-group {
        opacity: 0;
        transform: translateX(-45px);
        transition: opacity 0.75s ease 0.22s, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.22s;
    }
    .tl-item .tl-text-group {
        opacity: 0;
        transform: translateY(28px);
        transition: opacity 0.7s ease 0.35s, transform 0.7s ease 0.35s;
    }

    /* Visible state — added by IntersectionObserver */
    .tl-item--visible .tl-year-anim,
    .tl-item--visible .tl-icon-anim,
    .tl-item--visible .tl-img-group,
    .tl-item--visible .tl-text-group {
        opacity: 1;
        transform: none;
    }
}
