/* home.css — sections de l'accueil : bandeau, cartes des prêts, profils, étapes, avis, devis */

/* ---------- Page « Qui sommes-nous ? » ---------- */
.about-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 90% 15%, rgba(34, 38, 94, 0.1), transparent 35%),
        var(--c-bg-soft);
}

.about-hero-inner {
    padding-block: clamp(4rem, 9vw, 8rem);
}

.about-hero h1,
.about-hero-lead {
    max-width: 780px;
}

.about-hero h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.3rem, 6vw, 4.6rem);
    font-weight: 700;
    line-height: 1.08;
}

.about-hero-lead {
    margin-bottom: 1.8rem;
    color: var(--c-primary);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.about-eyebrow {
    margin-bottom: 0.65rem;
    color: var(--c-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.about-eyebrow--center {
    text-align: center;
}

.about-mission-grid,
.about-audience-inner {
    display: grid;
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
}

.about-mission-mark {
    display: grid;
    min-height: 280px;
    place-items: center;
    border-radius: var(--radius-card);
    background: linear-gradient(145deg, var(--c-primary), #444b9a);
    color: #fff;
    box-shadow: var(--shadow);
}

.about-mission-mark span {
    max-width: 8ch;
    padding: 1.5rem;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.about-copy h2,
.about-audience h2 {
    font-size: var(--fs-h2);
}

.about-copy p:last-child {
    margin-bottom: 0;
}

.about-steps {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.about-step {
    padding: 1.5rem;
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow);
}

.about-step-number {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 1.1rem;
    place-items: center;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
}

.about-step h3 {
    margin-bottom: 0.55rem;
    font-size: 1.1rem;
}

.about-step p {
    margin: 0;
}

.about-disclaimer {
    padding-left: 1rem;
    border-left: 3px solid var(--c-accent);
    font-size: 0.92rem;
}

@media (min-width: 760px) {
    .about-mission-grid,
    .about-audience-inner {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .about-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- 1. Bandeau ---------- */
.hero {
    background: var(--c-bg-soft);
    overflow: hidden;
}

.hero-inner {
    display: grid;
    gap: 1.5rem;
    align-items: center;
    padding-block: 2rem 0;
}

.hero-text {
    align-self: center;
    padding-bottom: 1rem;
    text-align: center;
}

.hero h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    text-transform: uppercase;
}

.hero-sub {
    max-width: 34rem;
    margin: 0 auto 1.5rem;
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.hero-photo {
    width: min(100%, 540px);
    aspect-ratio: 1;
    object-fit: contain;
    margin-inline: auto;
    margin-top: -1.5rem;
    animation: hero-float 6s ease-in-out infinite;
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (min-width: 900px) {
    .hero-inner {
        grid-template-columns: 1.1fr 0.9fr;
        padding-top: 3.5rem;
    }

    .hero-text {
        text-align: left;
    }

    .hero-sub {
        margin-inline: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .hero-photo {
        width: min(100%, 620px);
        margin-top: -3rem;
    }
}

.loans {
    scroll-margin-top: var(--header-h);
}

/* Cartes des prêts :
   - le prêt « le plus demandé » est au sommet, centré sur l'axe du bloc des autres cartes ;
   - les autres prêts sont alignés sur une même ligne en dessous. */
.loans {
    --loan-gap: 1.5rem;
}

.loan-featured {
    display: flex;
    justify-content: center;
    margin-bottom: var(--loan-gap);
}

.loan-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--loan-gap);
}

/* mobile : une carte par ligne */
.loan-featured .loan-card,
.loan-grid .loan-card {
    flex: 0 1 100%;
    min-width: 0;
}

/* tablette : deux cartes par ligne (la dernière reste centrée) */
@media (min-width: 600px) {
    .loan-featured .loan-card {
        flex: 0 0 calc((100% - var(--loan-gap)) / 2);
    }

    .loan-grid .loan-card {
        flex: 0 1 calc((100% - var(--loan-gap)) / 2);
    }
}

/* ordinateur : la carte « le plus demandé » est plus grande, centrée et passe DEVANT la rangée
   des trois autres prêts (alignés sur une même ligne). Elle déborde sur le haut de la carte du
   milieu et sur le bord intérieur des cartes voisines.
   --loan-overlap : de combien la carte vedette descend sur la rangée du dessous.
   --loan-block   : largeur maximale du bloc de cartes.
   --loan-zoom    : taille de la carte vedette par rapport aux autres. */
@media (min-width: 900px) {
    .loans {
        --loan-overlap: 5rem;
        --loan-block: 1100px;
        --loan-zoom: 1.3;
    }

    .loan-featured,
    .loan-grid {
        max-width: var(--loan-block);
        margin-inline: auto;
    }

    .loan-featured {
        position: relative;
        z-index: 2;
        margin-bottom: calc(-1 * var(--loan-overlap));
    }

    .loan-featured .loan-card {
        flex: 0 0 calc((100% - 2 * var(--loan-gap)) / 3 * var(--loan-zoom));
        box-shadow: 0 24px 60px rgba(34, 38, 94, 0.28);
    }

    .loan-grid {
        position: relative;
        z-index: 1;
    }

    .loan-grid .loan-card {
        flex: 0 1 calc((100% - 2 * var(--loan-gap)) / 3);
    }
}

.loan-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.loan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 34px rgba(34, 38, 94, 0.18);
}

.loan-card-media {
    position: relative;
    aspect-ratio: 4 / 4.2;
    background: var(--loan-bg, var(--c-card));
}

.loan-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.loan-card:hover .loan-card-media img,
.loan-card:focus-within .loan-card-media img {
    transform: scale(1.06);
}

.loan-badge {
    position: absolute;
    top: 0;
    left: 1.5rem;
    z-index: 1;
    width: 5rem;
    padding: 1.1rem 0.5rem 2.6rem;
    background: var(--c-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.loan-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 1.25rem 1.25rem 1.5rem;
    text-align: center;
}

.loan-card h3 {
    margin: 0;
    font-size: var(--fs-h3);
}

.loan-card p {
    margin: 0;
    font-size: 0.9rem;
}

/* carte « le plus demandé » : bas bleu marine, texte blanc */
.loan-card.is-featured .loan-card-body {
    background: var(--c-primary);
    color: #fff;
}

.loan-card.is-featured h3 {
    color: #fff;
}

.loan-card.is-featured .btn {
    background: #fff;
    border-color: #fff;
    color: var(--c-primary);
}

.loan-card.is-featured .btn:hover {
    background: var(--c-bg-soft);
    border-color: var(--c-bg-soft);
}

.loan-card .btn {
    transition: transform 0.25s ease, background 0.2s, color 0.2s, border-color 0.2s;
}

.loan-card:hover .btn,
.loan-card:focus-within .btn {
    transform: translateY(-2px);
}

@media (max-width: 520px) {
    .hero-inner {
        gap: 0.75rem;
        padding-top: 1.25rem;
    }

    .hero-photo {
        width: min(100%, 430px);
        margin-top: -1rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .loans {
        --loan-gap: 1rem;
    }

    .loan-card-media {
        aspect-ratio: 16 / 13;
    }
}

/* ---------- 3. Qui peut demander ---------- */
.profile-list {
    display: grid;
    justify-items: center;
    gap: 1.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}

.profile-photo {
    width: clamp(96px, 22vw, 150px);
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--c-primary);
    border-radius: 50%;
    background: var(--c-card);
}

html.js .profile-list > li[data-reveal] {
    opacity: 0;
    transform: translateX(-90px);
    transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

html.js .profile-list > li.is-visible {
    opacity: 1;
    transform: translateX(0);
}

html.js .profile-list > li.is-visible .profile-photo {
    animation: profile-arrive 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes profile-arrive {
    0% {
        opacity: 0;
        transform: scale(0.72) rotate(-12deg);
    }
    70% {
        transform: scale(1.04) rotate(3deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.profile-list span {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--c-primary);
}

/* ---------- 4. Comment ça marche ---------- */
.steps {
    display: grid;
    gap: 2rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
    text-align: center;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--c-step);
    color: #fff;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 300;
}

html.js .steps > li.is-visible .step-num {
    animation: step-turn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes step-turn {
    0% {
        opacity: 0;
        transform: perspective(260px) rotateY(-180deg) scale(0.7);
    }
    65% {
        transform: perspective(260px) rotateY(20deg) scale(1.06);
    }
    100% {
        opacity: 1;
        transform: perspective(260px) rotateY(0) scale(1);
    }
}

.steps p {
    margin: 0;
    font-weight: 500;
    color: var(--c-primary);
}

/* ---------- 5. Avis clients ---------- */
.testimonials {
    --slant: clamp(24px, 5vw, 70px);
    background: var(--c-primary);
    color: #fff;
    clip-path: polygon(0 var(--slant), 100% 0, 100% 100%, 0 100%);
    padding-block: calc(var(--slant) + 2.5rem) 3rem;
}

.testimonials-inner {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.testimonials h2 {
    color: #fff;
    font-size: var(--fs-h2);
}

.testimonials-demo-label {
    display: inline-block;
    margin: 0.5rem 0 0;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.testimonial-list {
    display: flex;
    gap: 1.5rem;
    margin-inline: 2.5rem;
    padding: 0.25rem 0.5rem 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.testimonial-list.is-marquee {
    scroll-behavior: auto;
    scrollbar-width: none;
}

.testimonial-list.is-marquee::-webkit-scrollbar {
    display: none;
}

.testimonial-list:focus-visible {
    outline-color: #fff;
}

.testimonial {
    flex: 0 0 min(100%, 220px);
    margin: 0;
    text-align: center;
    scroll-snap-align: center;
}

.testimonial-carousel {
    position: relative;
    min-width: 0;
}

.testimonial-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transform: translateY(-50%);
}

.testimonial-nav:hover {
    background: #fff;
    color: var(--c-primary);
}

.testimonial-nav-prev {
    left: 0;
}

.testimonial-nav-next {
    right: 0;
}

.stars {
    margin: 0 0 0.5rem;
    color: var(--c-star);
    font-size: 1.3rem;
    letter-spacing: 0.15em;
}

.testimonial blockquote {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.testimonial figcaption {
    margin-top: 0.5rem;
    font-weight: 700;
}

@media (min-width: 1000px) {
    .testimonials-inner {
        grid-template-columns: 1fr 2fr;
    }

    .testimonial-list {
        padding-inline: 0.75rem;
    }

    .testimonial-carousel::before,
    .testimonial-carousel::after {
        position: absolute;
        top: 0.25rem;
        bottom: 0.25rem;
        z-index: 1;
        width: 2.25rem;
        content: "";
        pointer-events: none;
    }

    .testimonial-carousel::before {
        left: 0;
        border: 0.45rem solid #fff;
        border-right: 0;
        border-radius: 50% 0 0 50%;
    }

    .testimonial-carousel::after {
        right: 0;
        border: 0.45rem solid #fff;
        border-left: 0;
        border-radius: 0 50% 50% 0;
    }

    .testimonial-nav {
        display: none;
    }
}

@media (max-width: 999px) {
    .testimonial-nav {
        display: inline-flex;
    }
}

@media (max-width: 560px) {
    .testimonial-list {
        margin-inline: 2rem;
    }

    .testimonial-nav {
        width: 2.2rem;
        height: 2.2rem;
    }
}

/* Accolades qui suivent automatiquement la hauteur du contenu */
@media (min-width: 1000px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        position: absolute;
        top: 0;
        bottom: 0;
    }
}

/* ---------- 6. Appel au devis ---------- */
.quote-cta .section-lead {
    margin-bottom: 1.8rem;
}

/* À AJOUTER À LA FIN de home.css (là où sont déjà les styles .about-*) :
   images de la page « conventions ». N'écrase aucune règle existante. */

/* ---------- 1. Bandeau du haut : photo réactive et animée ---------- */
.about-hero--photo {
    position: relative;
    overflow: hidden;
}

.about-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    overflow: hidden;
}

.about-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 78% 5%;   /* on garde la tête entière : on rogne surtout le bas */
    transform-origin: 75% 40%;
    /* 1) entrée en fondu + léger zoom arrière, 2) lente dérive continue */
    animation:
        conv-hero-in 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both,
        conv-hero-drift 20s ease-in-out 1.2s infinite alternate;
}

.about-hero--photo .about-hero-inner {
    position: relative;
    z-index: 1;
}

/* Le rouge de « eyebrow » est peu lisible sur le fond bleu de la photo : on passe au marine */
.about-hero--photo .about-eyebrow {
    color: var(--c-primary);
}

/* Le texte arrive par petites touches, l'un après l'autre */
.about-hero--photo .about-hero-inner > * {
    animation: conv-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.about-hero--photo .about-hero-inner > :nth-child(1) { animation-delay: 0.10s; }
.about-hero--photo .about-hero-inner > :nth-child(2) { animation-delay: 0.22s; }
.about-hero--photo .about-hero-inner > :nth-child(3) { animation-delay: 0.34s; }
.about-hero--photo .about-hero-inner > :nth-child(4) { animation-delay: 0.46s; }
.about-hero--photo .about-hero-inner > :nth-child(5) { animation-delay: 0.58s; }

@keyframes conv-hero-in {
    from { opacity: 0; transform: scale(1.12) translateX(3%); }
    to   { opacity: 1; transform: none; }
}

@keyframes conv-hero-drift {
    from { transform: scale(1); }
    to   { transform: scale(1.07) translateX(-1.5%); }
}

@keyframes conv-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* Ordinateur : photo en fond, le texte reste dans la moitié gauche (fond vide) */
@media (min-width: 760px) {
    .about-hero--photo {
        display: flex;
        align-items: center;
        min-height: clamp(380px, 46vw, 560px);
    }

    .about-hero--photo .about-hero-inner {
        width: 100%;
    }

    .about-hero--photo .about-hero-inner > * {
        max-width: min(38rem, 44vw);   /* le texte ne passe pas sur le visage */
    }

    /* titre un peu plus petit entre 760 et 1100 px : « conventionnés » ne dépasse pas sa colonne */
    .about-hero--photo h1 {
        font-size: clamp(1.9rem, 4.2vw, 4.2rem);
    }
}

/* Mobile : la photo (cadrage 4:3 recentré) d'abord, le texte en dessous */
@media (max-width: 759px) {
    .about-hero--photo {
        display: flex;
        flex-direction: column;
    }

    .about-hero-media {
        position: relative;
        inset: auto;
        order: -1;                          /* avant le texte */
        height: clamp(240px, 64vw, 360px);
    }

    .about-hero-media img {
        object-position: center 20%;
    }

    /* le texte est maintenant sous la photo : moins d'espace au-dessus */
    .about-hero--photo .about-hero-inner {
        padding-top: 1.75rem;
    }
}

/* ---------- 2. Bloc d'introduction : photo carrée + pastille de texte ---------- */
.about-mission-media {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-mission-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.about-mission-badge {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--c-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- 3. Les trois profils : portrait rond + numéro en pastille ---------- */
.about-approach .about-step {
    text-align: center;
}

.about-step-media {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1rem;
}

.about-step-photo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.about-step-media .about-step-number {
    position: absolute;
    top: -0.25rem;
    left: -0.25rem;
    margin: 0;
    box-shadow: 0 0 0 3px #fff;
}

/* ---------- 4. Section « Vérifier les conditions » : photo sous le titre ---------- */
.about-audience-photo {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-top: 1.5rem;
    border-radius: var(--radius-card);
    object-fit: cover;
    box-shadow: var(--shadow);
}