/**
 * Expertises Page Styles - Thibierge Notaires
 * Specs from Figma: 1728px viewport
 */

/* =============================================
   PAGE LAYOUT
============================================= */

.expertises-page {
    padding: 0;
    margin: 0;
}

/* =============================================
   HERO SECTION
============================================= */

.expertises-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('../../images/hero-expertises.webp');
    background-size: cover;
    background-position: center;
    margin: 0;
    padding: 0;
}

/* Overlay sombre sur le hero — assure la lisibilité du titre et du texte */
.expertises-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
}

.expertises-hero__content {
    position: relative;
    z-index: 2;
    max-width: 1273px;
    margin: 0 auto;
    padding: 0 var(--gutter-desktop);
}

.expertises-hero__title {
    font-family: var(--font-magnetik);
    font-weight: 200;
    font-size: 81.37px;
    line-height: 90px;
    color: #fff;
    margin: 0 0 28px;
}

.expertises-hero__text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    line-height: 30px;
    color: #fff;
    max-width: 474px;
    margin: 0 auto;
}

.expertises-hero__scroll {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    cursor: pointer;
    animation: expertises-bounce 2s ease-in-out infinite;
}

.expertises-hero__scroll svg {
    display: block;
    width: 54px;
    height: 54px;
    transition: transform 0.3s ease;
}

.expertises-hero__scroll:hover svg {
    transform: translateY(5px);
}

@keyframes expertises-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* =============================================
   EXPERTISES CONTENT CONTAINER
============================================= */

.expertises-content {
    position: relative;
    background: transparent;
    overflow: visible;
}

/* =============================================
   TEAL SHAPE - decorative background
============================================= */

.expertises-shape {
    position: absolute;
    top: 781px;
    left: -40%;
    width: 150%;
    height: auto;
    max-width: none;
    z-index: 0;
    pointer-events: none;
}

/* =============================================
   VERTICAL LINES (TRAITS) - from Figma design
   Each trait is contained within its own section
============================================= */

/* Section 1: Actes courants - trait droit */
.expertises-section--1::after {
    content: '';
    position: absolute;
    left: 84%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e8eb;
    z-index: 5;
}

/* Section 2: Anticipation - trait gauche */
.expertises-section--2::before {
    content: '';
    position: absolute;
    left: 20%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e8eb;
    z-index: 5;
}

/* Section 3: Financement immobilier - trait gauche (aligné avec CTA, derrière la photo) ET droit */
.expertises-section--3::before {
    content: '';
    position: absolute;
    left: 20%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e8eb;
    z-index: 0; /* Derrière la photo */
}
.expertises-section--3::after {
    content: '';
    position: absolute;
    left: 84%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e8eb;
    z-index: 5;
}

/* Section 4: Immobilier institutionnel - PAS de trait */

/* Section 5: Promotion - trait droit */
.expertises-section--5::after {
    content: '';
    position: absolute;
    left: 84%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e8eb;
    z-index: 5;
}

/* =============================================
   EXPERTISE SECTIONS
============================================= */

.expertises-section {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 606px;
    border: 1px solid #eff2f6;
    border-left: 0;
    margin-top: -1px;
    width: 100%;
    overflow: visible;
    z-index: 2;
    background: transparent; /* Transparent pour laisser passer la shape */
}

/* Section 3 special - pas de fond pour laisser passer la shape */
.expertises-section--3 {
    background: transparent;
}
.expertises-section--3 .expertises-section__content {
    padding: 40px;
    position: relative;
}

/* Left layout: image on left, text on right */
.expertises-section--left {
    flex-direction: row;
}

/* Right layout: text on left, image on right */
.expertises-section--right {
    flex-direction: row-reverse;
}

/* Image container base */
.expertises-section__image {
    flex: 0 0 530px;
    width: 530px;
    height: 479px;
    overflow: hidden;
}

.expertises-section__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content container base */
.expertises-section__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 517px;
    padding: 0 40px;
}

/* =============================================
   SECTION-SPECIFIC POSITIONING (from Figma)
   Viewport reference: 1728px
============================================= */

/* Section 1: Actes courants (left) - Image x=0, Content x=854 */
.expertises-section--1 .expertises-section__image {
    margin-left: 0;
}
.expertises-section--1 .expertises-section__content {
    margin-left: 284px;
}

/* Section 2: Anticipation et transmission (right) - Image x=1050, Content x=453 */
.expertises-section--2 .expertises-section__image {
    margin-right: 148px;
}
.expertises-section--2 .expertises-section__content {
    margin-left: 413px;
    margin-right: auto;
}

/* Section 3: Financement immobilier (left) - Image LEFT side with shape behind */
.expertises-section--3 {
    position: relative;
    overflow: visible;
}
.expertises-section--3 .expertises-section__image {
    margin-left: 109px;
}
.expertises-section--3 .expertises-section__content {
    margin-left: 175px;
}

/* Section 4: Immobilier institutionnel (right) - Image x=1197, Content x=453 */
.expertises-section--4 .expertises-section__image {
    margin-right: 1px;
}
.expertises-section--4 .expertises-section__content {
    margin-left: 413px;
    margin-right: auto;
}

/* Section 5: Promotion, construction (left) - Image x=72, Content x=801 */
.expertises-section--5 .expertises-section__image {
    margin-left: 72px;
}
.expertises-section--5 .expertises-section__content {
    margin-left: 159px;
}

.expertises-section__surtitre {
    font-family: var(--font-geometos);
    font-weight: 400;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #72777b;
    margin: 0;
    min-height: 41px;
}

.expertises-section__titre {
    font-family: var(--font-bodoni);
    font-style: italic;
    font-weight: 400;
    font-size: 36px;
    line-height: 1.32;
    color: #222f30;
    margin: 0;
}

.expertises-section__texte {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    line-height: 30px;
    color: #72777b;
    margin: 0;
}

/* =============================================
   CTA SECTION
============================================= */

.expertises-cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    background: transparent; /* Transparent pour laisser passer la shape */
    overflow: visible;
    z-index: 1;
}

.expertises-cta__box {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 1040px;
    height: 302px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid #eff2f6;
}

.expertises-cta__title {
    font-family: var(--font-bodoni);
    font-style: italic;
    font-weight: 400;
    font-size: 36px;
    line-height: 1.32;
    color: #222f30;
    margin: 0;
    text-align: center;
}

.expertises-cta__link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.expertises-cta__link-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 1px;
}

.expertises-cta__link-text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    color: #1e1e1e;
    white-space: nowrap;
}

.expertises-cta__link-icon {
    width: 12px;
    height: 11px;
    color: #1e1e1e;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.expertises-cta__link:hover .expertises-cta__link-icon {
    transform: translateX(4px);
}

.expertises-cta__link-line {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: transparent;
    overflow: hidden;
}

.expertises-cta__link-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.expertises-cta__link:hover .expertises-cta__link-line::after {
    animation: lineWipeExpertises 0.5s ease;
}

@keyframes lineWipeExpertises {
    0% { transform: translateX(0); }
    50% { transform: translateX(100%); }
    50.01% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

/* =============================================
   TEAM SECTION
============================================= */

.expertises-team {
    position: relative;
    padding: 120px 0 0;
    background: #fff;
    overflow: hidden;
}

.expertises-team__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 40px 60px;
    max-width: 100%;
    margin: 0 0 60px;
    padding: 0 0 0 72px; /* Align with left sections */
}

.expertises-team__title {
    font-family: var(--font-magnetik);
    font-weight: 200;
    font-size: 81.37px;
    line-height: 90px;
    color: #222f30;
    margin: 0;
    flex: 0 0 auto;
}

.expertises-team__link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
    margin-bottom: 20px;
    flex: 0 0 auto;
}

.expertises-team__link-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 1px;
}

.expertises-team__link-text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    color: #1e1e1e;
    white-space: nowrap;
}

.expertises-team__link-icon {
    width: 12px;
    height: 11px;
    color: #1e1e1e;
    transition: transform 0.3s ease;
}

.expertises-team__link:hover .expertises-team__link-icon {
    transform: translateX(4px);
}

.expertises-team__link-line {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: transparent;
    overflow: hidden;
}

.expertises-team__link-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.expertises-team__link:hover .expertises-team__link-line::after {
    animation: lineWipeExpertises 0.5s ease;
}

/* =============================================
   TEAM CAROUSEL
============================================= */

.expertises-team__carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-bottom: 0;
}

.expertises-team__track {
    --item-width: 336px;
    --item-gap: 20px;
    --item-count: 6; /* surchargé inline depuis le template = nb d'items uniques (sans la duplication) */
    display: flex;
    gap: var(--item-gap);
    animation: scrollTeam var(--scroll-duration, 30s) linear infinite;
}

.expertises-team__item {
    flex: 0 0 auto;
    width: 336px;
    height: 492px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.expertises-team__item:hover {
    transform: scale(1.02);
}

.expertises-team__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.expertises-team__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Le track contient 2 copies de la liste (array_merge dans le template).
   On scrolle exactement de la largeur d'une copie : N items + N gaps
   (le gap après le Nᵉ item compte aussi puisqu'il y a un (N+1)ᵉ item derrière)
   → la 2ᵉ copie se retrouve pile à la position de départ, loop parfait. */
@keyframes scrollTeam {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-1 * var(--item-count) * (var(--item-width) + var(--item-gap))));
    }
}

/* Pause on hover */
.expertises-team__carousel:hover .expertises-team__track {
    animation-play-state: paused;
}

/* =============================================
   RESPONSIVE - LARGE DESKTOP
============================================= */

@media (max-width: 1700px) {
    .expertises-section__content {
        padding: 0 30px;
    }

    .expertises-section--left .expertises-section__content {
        margin-left: 60px;
    }

    .expertises-section--right .expertises-section__content {
        margin-right: 60px;
    }
}

@media (max-width: 1520px) {
    .expertises-hero__title {
        font-size: 64px;
        line-height: 72px;
    }

    .expertises-team__title {
        font-size: 64px;
        line-height: 72px;
    }

    .expertises-cta__box {
        width: 90%;
        max-width: 1040px;
    }
}

/* =============================================
   RESPONSIVE - TABLET
============================================= */

@media (max-width: 1279px) {
    .expertises-hero__title {
        font-size: 52px;
        line-height: 60px;
    }

    .expertises-hero__text {
        font-size: 16px;
        line-height: 26px;
    }

    .expertises-section {
        display: flex;
        flex-direction: column;
        min-height: auto;
        padding: 60px 0;
    }

    .expertises-section--left,
    .expertises-section--right {
        grid-template-columns: 1fr;
    }

    .expertises-section__image {
        width: 100%;
        max-width: 100%;
        height: 350px;
        order: 1;
        justify-self: stretch;
        margin: 0 !important;
    }

    .expertises-section__content {
        max-width: 100%;
        padding: 40px var(--gutter-tablet);
        margin: 0 !important;
        order: 2;
        justify-self: center;
    }

    .expertises-section__titre {
        font-size: 30px;
    }

    .expertises-cta__box {
        width: calc(100% - 80px);
        height: auto;
        padding: 60px 40px;
    }

    .expertises-cta__title {
        font-size: 30px;
    }

    .expertises-team__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
        padding: 0 var(--gutter-tablet);
    }

    .expertises-team__title {
        font-size: 48px;
        line-height: 56px;
    }

    .expertises-team__link {
        margin-bottom: 0;
    }

    .expertises-team__item {
        width: 280px;
        height: 400px;
    }

    /* Hide vertical traits on tablet */
    .expertises-section--1::after,
    .expertises-section--2::before,
    .expertises-section--3::before,
    .expertises-section--3::after,
    .expertises-section--5::after {
        display: none;
    }

    /* Adjust shape on tablet */
    .expertises-shape {
        top: 600px;
        left: -60%;
        width: 200%;
    }
}

/* =============================================
   RESPONSIVE - MOBILE
============================================= */

@media (max-width: 767px) {
    .expertises-hero {
        padding: 120px var(--gutter-mobile) 80px;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: flex-start;
        padding-top: 180px;
    }

    .expertises-hero__title {
        font-size: 36px;
        line-height: 44px;
        margin-bottom: 20px;
    }

    .expertises-hero__text {
        font-size: 15px;
        line-height: 24px;
    }

    .expertises-hero__scroll {
        bottom: 60px;
    }

    .expertises-hero__scroll svg {
        width: 40px;
        height: 40px;
    }

    /* Stack vertical "blocks" — chaque section = une carte avec bordure complète,
       gutters latéraux pour détacher du bord, et image confinée dans le bloc */
    .expertises-content {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 40px var(--gutter-mobile) 0;
    }

    .expertises-section {
        flex-direction: column !important;
        align-items: stretch !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #eff2f6 !important;
        background: #fff !important;
        overflow: hidden !important;
    }

    .expertises-section__image {
        flex: 0 0 auto !important;
        height: 280px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .expertises-section__image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .expertises-section__content {
        padding: 30px 24px;
        gap: 10px;
        max-width: none !important;
    }

    /* Section 3 (Financement) — pas de fond transparent en mobile, on traite comme les autres */
    .expertises-section--3 {
        background: #fff !important;
    }
    .expertises-section--3 .expertises-section__content {
        padding: 30px 24px !important;
    }

    .expertises-section__surtitre {
        font-size: 12px;
        letter-spacing: 1.2px;
        min-height: auto;
    }

    .expertises-section__titre {
        font-size: 26px;
    }

    .expertises-section__texte {
        font-size: 16px;
        line-height: 26px;
    }

    .expertises-cta {
        min-height: 0;
        padding: 0;
    }

    .expertises-cta__box {
        width: 100%;
        padding: 40px 20px;
        height: auto;
    }

    .expertises-cta__title {
        font-size: 24px;
    }

    .expertises-cta__link-text {
        font-size: 16px;
    }

    .expertises-team {
        padding: 40px 0 0;
    }

    .expertises-team__header {
        padding: 0 var(--gutter-mobile);
        margin-bottom: 40px;
    }

    .expertises-team__title {
        font-size: 32px;
        line-height: 40px;
    }

    .expertises-team__carousel {
        padding-bottom: 60px;
    }

    .expertises-team__item {
        width: 220px;
        height: 320px;
    }

    /* Shape repositionnée pour apparaître derrière la CTA "Vous avez un projet ?" */
    .expertises-shape {
        top: 1191px;
        left: -40%;
        width: 180%;
        opacity: 1;
    }
}
