/*
 * AFPIA Post CAP — styles landing (plugin)
 * Version: 1.0.1
 */

/*
 * Isolation Divi : le Customizer injecte h1–h6{color}, a{color}, html{font-size:calc()}.
 * Ces règles doivent gagner même si un style Divi reste en tête.
 */
html {
    font-size: 16px !important;
}

body.afpia-lp-canvas {
    color: #10241A !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
}

body.afpia-lp-canvas h1,
body.afpia-lp-canvas h2,
body.afpia-lp-canvas h3,
body.afpia-lp-canvas h4,
body.afpia-lp-canvas h5,
body.afpia-lp-canvas h6 {
    color: inherit !important;
    font-weight: inherit !important;
}

body.afpia-lp-canvas a {
    color: inherit !important;
}

/* Couleurs utilitaires : battre Divi (a{color}, héritage text-cream sur les CTA). */
body.afpia-lp-canvas .text-ink {
    color: #10241A !important;
}

body.afpia-lp-canvas .text-lime {
    color: #B9E97D !important;
}

body.afpia-lp-canvas .text-cream {
    color: #F6F1E6 !important;
}

body.afpia-lp-canvas .bg-lime {
    background-color: #B9E97D !important;
}

body.afpia-lp-canvas .bg-ink {
    background-color: #10241A !important;
}

body.afpia-lp-canvas .bg-forest {
    background-color: #173226 !important;
}

body.afpia-lp-canvas .bg-cream {
    background-color: #F6F1E6 !important;
}

/* CTA : fond + texte explicites (Divi écrase sinon les classes Tailwind). */
body.afpia-lp-canvas a.bg-lime,
body.afpia-lp-canvas a.bg-lime.text-ink {
    background-color: #B9E97D !important;
    color: #10241A !important;
}

body.afpia-lp-canvas a.bg-lime.hover\:bg-ink:hover {
    background-color: #10241A !important;
    color: #B9E97D !important;
}

body.afpia-lp-canvas a.bg-lime.hover\:bg-cream:hover {
    background-color: #F6F1E6 !important;
    color: #10241A !important;
}

body.afpia-lp-canvas a.bg-ink,
body.afpia-lp-canvas a.bg-ink.text-lime,
body.afpia-lp-canvas a#mobile-cta {
    background-color: #10241A !important;
    color: #B9E97D !important;
}

body.afpia-lp-canvas a.bg-ink.hover\:bg-forest:hover {
    background-color: #173226 !important;
    color: #B9E97D !important;
}

body.afpia-lp-canvas .font-display,
body.afpia-lp-canvas h1.display-title,
body.afpia-lp-canvas h2.display-title,
body.afpia-lp-canvas h3.display-title,
body.afpia-lp-canvas .display-title {
    font-weight: 900 !important;
}

/* Aspekta © Ivo Dolenc, SIL OFL 1.1 */
@font-face {
    font-family: "Aspekta";
    src: url("assets/fonts/Aspekta-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aspekta";
    src: url("assets/fonts/Aspekta-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Big Shoulders Display Black © Patric King, SIL OFL 1.1 */
@font-face {
    font-family: "Big Shoulders Display";
    src: url("assets/fonts/BigShouldersDisplay-Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: "Aspekta", system-ui, sans-serif;
    background: #F6F1E6;
    color: #10241A;
    overflow-x: clip;
    max-width: 100%;
}

/* Padding bas uniquement quand le CTA mobile est visible */
@media (max-width: 639px) {
    body.has-mobile-cta {
        padding-bottom: 6rem;
    }
}

::selection {
    background: #B9E97D;
    color: #10241A;
}

.font-display {
    font-family: "Big Shoulders Display", Impact, sans-serif;
    font-weight: 900;
}

/* Titres display : même rendu que la LP Entreprises
   (interlignage aéré pour les accents À, É, Ô…).
   !important pour gagner face au CDN Tailwind. */
h1.display-title,
h2.display-title,
h3.display-title,
.display-title {
    line-height: 1.2 !important;
    letter-spacing: -0.005em;
    padding-top: 0.22em;
    hyphens: none;
    -webkit-hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
}

h2.display-title {
    line-height: 1.22 !important;
}

.hero-copy h1.display-title,
.hero-copy .display-title {
    line-height: 1.18 !important;
    padding-top: 0.1em;
    letter-spacing: -0.01em;
}

/* Mobile : image un peu plus basse pour laisser respirer le bloc texte dans le viewport. */
@media (max-width: 639px) {
    .hero-media img {
        aspect-ratio: 2.4 / 1;
        max-height: min(24svh, 9.25rem);
    }
}

p.section-lead {
    line-height: 1.05;
}

h1, h2, h3,
.font-display,
.section-lead {
    text-wrap: pretty;
}

.site-header {
    background: #F6F1E6;
}

.shell {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.box-panel {
    border-radius: 1.75rem;
    overflow: hidden;
}

/* Sticky / bleed panels: allow decorative overflow (stars). */
.box-panel--allow-sticky,
.box-panel--bleed {
    overflow: visible;
}

@media (min-width: 1024px) {
    .box-panel {
        border-radius: 2.4rem;
    }
}

section[id] {
    scroll-margin-top: 5.5rem;
}

body.admin-bar header.site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar header.site-header {
        top: 46px;
    }
}

/* Hero — composition asymétrique, image dominante */
.hero-panel {
    display: flex;
    flex-direction: column;
}

.hero-media {
    position: relative;
    order: -1;
}

.hero-media img {
    width: 100%;
    aspect-ratio: 2.2 / 1;
    max-height: min(28svh, 10.5rem);
    object-fit: cover;
    /* Ancre haute : garde la tête visible malgré le crop */
    object-position: center 8%;
    display: block;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .hero-media img {
        aspect-ratio: 16 / 9;
        max-height: min(34svh, 14rem);
        object-position: center 16%;
    }
}

@media (min-width: 1024px) {
    .hero-panel {
        display: grid;
        grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
        min-height: 38rem;
    }

    .hero-copy {
        display: flex;
        flex-direction: column;
        justify-content: center;
        order: 0;
    }

    .hero-media {
        order: 0;
        min-height: 100%;
    }

    .hero-media img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center 28%;
        border-radius: 0;
    }

    .hero-media::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: min(40%, 12rem);
        z-index: 1;
        background: linear-gradient(90deg, #173226 0%, rgba(23, 50, 38, 0) 100%);
        pointer-events: none;
    }
}

/* Étoile hero : jonction texte / image (~42%), desktop only */
.hero-scroll-star {
    display: none;
}

@media (min-width: 1024px) {
    .hero-frame {
        isolation: isolate;
    }

    .hero-scroll-star {
        display: block;
        position: absolute;
        left: 42%;
        top: 100%;
        z-index: 30;
        width: clamp(170px, 15vw, 230px);
        pointer-events: none;
        transform: translate(-50%, -50%);
    }

    .hero-scroll-star img {
        display: block;
        width: 100%;
        height: auto;
        transform: rotate(var(--hero-star-rot, 0deg));
        will-change: transform;
    }
}

/* Progresser — panneau chaleureux */
.progress-panel {
    background: #D7F5A0;
}

.progress-panel .decor--chair {
    opacity: 0.14;
    width: min(38%, 280px);
}

/* Parcours — timeline */
.parcours-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.parcours-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    align-items: start;
    padding-bottom: 1.35rem;
}

.parcours-timeline li:last-child {
    padding-bottom: 0;
}

.parcours-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 1.05rem;
    top: 2.35rem;
    bottom: 0.15rem;
    width: 2px;
    background: rgba(16, 36, 26, 0.22);
}

.parcours-step-num {
    width: 2.1rem;
    font-family: "Big Shoulders Display", Impact, sans-serif;
    font-weight: 900;
    font-size: 1.85rem;
    line-height: 1;
}

.parcours-step-label {
    font-size: 1.125rem;
    line-height: 1.2;
    font-weight: 700;
}

.parcours-step-hint {
    margin-top: 0.2rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: rgba(16, 36, 26, 0.62);
}

/* Campus — carte avec photo + numéro/titre alignés */
.campus-card {
    overflow: hidden;
}

.campus-card-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.campus-card-head .campus-num {
    flex-shrink: 0;
    font-family: "Big Shoulders Display", Impact, sans-serif;
    font-weight: 900;
    font-size: 1.85rem;
    line-height: 1;
}

.campus-card-head h3 {
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-star img,
    .decor--star img {
        transform: none !important;
    }
}

/* Reveal sans ombre au hover */
.js .reveal {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition:
        opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.js .reveal.is-inview {
    opacity: 1;
    transform: none;
    will-change: auto;
}

.card-media {
    overflow: hidden;
}

.card-media img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-inview:hover .card-media img {
    transform: scale(1.04);
}

/* Décorations animées */
.decor {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.decor img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.decor--wood {
    inset: -4% 0 auto auto;
    width: min(48%, 400px);
    aspect-ratio: 1;
    opacity: 0.28;
    mix-blend-mode: screen;
    animation: decor-drift 18s ease-in-out infinite alternate;
}

.decor--wood img {
    object-fit: cover;
    filter: brightness(1.15);
}

.decor--star {
    width: clamp(120px, 16vw, 200px);
    aspect-ratio: 1;
    opacity: 0.95;
    z-index: 6;
}

.decor--star img {
    transform: rotate(var(--decor-star-rot, 0deg));
    will-change: transform;
}

/* Centre de l’étoile ≈ coin du panneau → ~1/4 chevauche (comme la maquette). */
.decor--star-br {
    right: 0;
    bottom: 0;
    translate: 48% 48%;
}

.decor--star-tr {
    top: 0;
    right: 0;
    translate: 48% -48%;
}

.decor--chair {
    width: min(42%, 320px);
    aspect-ratio: 1;
    opacity: 0.12;
    animation: decor-float 10s ease-in-out infinite alternate;
}

.decor--chair-br {
    right: 0;
    bottom: 0;
}

.decor--chair-bl {
    left: 0;
    bottom: -2%;
}

@keyframes decor-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes decor-float {
    from { transform: translate3d(0, 0, 0) rotate(-2deg); }
    to { transform: translate3d(0, -10px, 0) rotate(2deg); }
}

@keyframes decor-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-8px, 10px, 0) scale(1.04); }
}

.check {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border-radius: 0.9rem;
    background: #fff;
    border: 1px solid rgba(16, 36, 26, 0.08);
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.check:hover {
    border-color: rgba(16, 36, 26, 0.22);
    background: #faf8f2;
}

.check:has(input:checked) {
    border-color: #10241A;
    background: #B9E97D;
}

.check input {
    margin-top: 0.2rem;
    accent-color: #10241A;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.field {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(16, 36, 26, 0.12);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    font: inherit;
    color: #10241A;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field:focus {
    border-color: #10241A;
    box-shadow: 0 0 0 3px #B9E97D;
}

.field::placeholder {
    color: rgba(16, 36, 26, 0.38);
}

.site-footer a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer a:hover {
    opacity: 0.75;
}

/* Pages légales */
.legal-content {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(16, 36, 26, 0.92);
}

.legal-content > * + * {
    margin-top: 1rem;
}

.legal-content h2 {
    font-family: "Big Shoulders Display", Impact, sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    line-height: 1;
    text-transform: uppercase;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    color: #10241A;
}

.legal-content .legal-lead {
    margin-top: 0;
}

.legal-content ul {
    list-style: disc;
    padding-left: 1.25rem;
}

.legal-content ul ul {
    margin-top: 0.5rem;
    list-style: circle;
}

.legal-content a {
    color: #10241A;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-content a:hover {
    color: #173226;
}

.legal-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid rgba(16, 36, 26, 0.12);
    border-radius: 1rem;
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 520px;
}

.legal-content th,
.legal-content td {
    text-align: left;
    vertical-align: top;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(16, 36, 26, 0.1);
}

.legal-content thead th {
    background: #173226;
    color: #F6F1E6;
    font-weight: 700;
    border-bottom: none;
}

.legal-content tbody tr:last-child td {
    border-bottom: none;
}

.legal-content td p + p {
    margin-top: 0.65rem;
}

@media (max-width: 767px) {
    .decor--wood,
    .decor--chair {
        width: 55%;
        opacity: 0.1;
    }

    .decor--star {
        width: clamp(96px, 28vw, 140px);
        opacity: 0.95;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .reveal,
    .card-media img,
    .check {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .decor--wood,
    .decor--star,
    .decor--chair {
        animation: none !important;
    }
}
