/**
 * OOI Platform V1 — Moment Card
 *
 * Variantes :
 * - grid
 * - compact
 * - featured
 * - editorial
 */


/* =========================================================
   01. BASE
========================================================= */

.ooi-moment-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;

    border: 1px solid var(--ooi-border);
    border-radius: var(--ooi-radius-lg);

    background: var(--ooi-surface);
    box-shadow: var(--ooi-shadow-md);

    color: var(--ooi-text);

    transition:
        transform var(--ooi-transition),
        box-shadow var(--ooi-transition),
        border-color var(--ooi-transition);
}

.ooi-moment-card:hover {
    border-color: rgba(114, 112, 172, .28);
    box-shadow: var(--ooi-shadow-lg);
    transform: translateY(-4px);
}


/* =========================================================
   02. AFFICHE CLASSIQUE
========================================================= */

.ooi-moment-card__poster {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;

    aspect-ratio: 1 / 1;

    background: #071426;
    color: inherit;
    text-decoration: none;
}

.ooi-moment-card__poster-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;

    background: #071426;

    object-fit: contain !important;
    object-position: center;

    transition:
        transform var(--ooi-transition-slow),
        filter var(--ooi-transition);
}

.ooi-moment-card__poster-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ooi-space-sm);

    background:
        radial-gradient(
            circle at 70% 20%,
            rgba(128, 197, 207, .24),
            transparent 42%
        ),
        linear-gradient(
            145deg,
            #071426,
            #243248
        );

    color: rgba(255, 255, 255, .82);
}

.ooi-moment-card__poster-placeholder span {
    font-size: 28px;
    font-weight: 850;
    letter-spacing: .08em;
}

.ooi-moment-card__poster-placeholder small {
    font-size: var(--ooi-font-xs);
    font-weight: 700;
}

.ooi-moment-card__poster-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding: var(--ooi-space-lg);

    background:
        linear-gradient(
            180deg,
            transparent 45%,
            rgba(7, 20, 38, .72) 100%
        );

    opacity: 0;

    transition:
        opacity var(--ooi-transition);
}

.ooi-moment-card__discover {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;

    padding: 9px 18px;

    border-radius: var(--ooi-radius-xl);

    background:
        linear-gradient(
            135deg,
            var(--ooi-accent),
            var(--ooi-memory)
        );

    color: #071426;

    font-size: var(--ooi-font-sm);
    font-weight: 850;

    transform: translateY(8px);

    transition:
        transform var(--ooi-transition);
}

.ooi-moment-card__poster:hover
.ooi-moment-card__poster-image,
.ooi-moment-card__poster:focus-visible
.ooi-moment-card__poster-image {
    filter: brightness(.78);
    transform: scale(1.025);
}

.ooi-moment-card__poster:hover
.ooi-moment-card__poster-overlay,
.ooi-moment-card__poster:focus-visible
.ooi-moment-card__poster-overlay {
    opacity: 1;
}

.ooi-moment-card__poster:hover
.ooi-moment-card__discover,
.ooi-moment-card__poster:focus-visible
.ooi-moment-card__discover {
    transform: translateY(0);
}


/* =========================================================
   03. CONTENU CLASSIQUE
========================================================= */

.ooi-moment-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;

    padding: var(--ooi-space-lg);
}

.ooi-moment-card__branch,
.ooi-moment-card__status {
    display: inline-flex;
    min-height: 25px;
    align-items: center;

    padding: 5px 10px;

    border-radius: var(--ooi-radius-xl);

    font-size: 10px;
    font-weight: 850;
    letter-spacing: .055em;
    line-height: 1.2;
    text-transform: uppercase;
}

.ooi-moment-card__branch {
    margin-bottom: var(--ooi-space-sm);

    background: rgba(114, 112, 172, .13);
    color: var(--ooi-primary);
}

.ooi-moment-card__status {
    margin-bottom: var(--ooi-space-sm);

    background: rgba(128, 197, 207, .16);
    color: #176873;
}

.ooi-moment-card__status--past,
.ooi-moment-card__status--termine,
.ooi-moment-card__status--completed {
    background: rgba(217, 158, 130, .18);
    color: #87503a;
}

.ooi-moment-card__status--upcoming,
.ooi-moment-card__status--a_venir {
    background: rgba(170, 207, 128, .21);
    color: #4e7028;
}

.ooi-moment-card__title {
    margin: 2px 0 0;

    color: var(--ooi-text);

    font-size: clamp(22px, 2.3vw, 30px);
    font-weight: 800;
    line-height: 1.1;

    overflow-wrap: anywhere;
}

.ooi-moment-card__title a {
    color: inherit;
    text-decoration: none;

    transition:
        color var(--ooi-transition-fast);
}

.ooi-moment-card__title a:hover,
.ooi-moment-card__title a:focus-visible {
    color: var(--ooi-primary);
}

.ooi-moment-card__date,
.ooi-moment-card__location {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-top: var(--ooi-space-sm);

    color: var(--ooi-text-light);

    font-size: var(--ooi-font-sm);
    font-weight: 650;
    line-height: 1.4;
}

.ooi-moment-card__intention {
    display: -webkit-box;

    margin: var(--ooi-space-md) 0 0;
    overflow: hidden;

    color: var(--ooi-text-light);

    font-size: var(--ooi-font-sm);
    line-height: 1.55;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ooi-moment-card__footer {
    display: flex;
    width: 100%;

    margin-top: auto;
    padding-top: var(--ooi-space-lg);
}

.ooi-moment-card__link {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;

    padding: 9px 16px;

    border: 1px solid rgba(114, 112, 172, .26);
    border-radius: var(--ooi-radius-xl);

    background: rgba(114, 112, 172, .06);
    color: var(--ooi-primary);

    font-size: var(--ooi-font-sm);
    font-weight: 800;
    text-decoration: none;

    transition:
        transform var(--ooi-transition-fast),
        background-color var(--ooi-transition-fast);
}

.ooi-moment-card__link:hover,
.ooi-moment-card__link:focus-visible {
    background: rgba(114, 112, 172, .12);
    transform: translateY(-1px);
}


/* =========================================================
   04. VARIANTE GRID
========================================================= */

.ooi-moment-card--grid {
    width: 100%;
    max-width: 390px;
}


/* =========================================================
   05. VARIANTE COMPACT
========================================================= */

.ooi-moment-card--compact {
    display: grid;
    width: 100%;
    max-width: 620px;

    grid-template-columns:
        116px
        minmax(0, 1fr);

    align-items: stretch;
}

.ooi-moment-card--compact
.ooi-moment-card__poster {
    width: 116px;
    height: 116px;
    min-height: 116px;
    align-self: center;

    aspect-ratio: 1 / 1;
    border-radius: 0;
}

.ooi-moment-card--compact
.ooi-moment-card__poster-image {
    width: 100% !important;
    height: 100% !important;

    object-fit: contain !important;
}

.ooi-moment-card--compact
.ooi-moment-card__content {
    min-width: 0;
    justify-content: center;

    padding: var(--ooi-space-md);
}

.ooi-moment-card--compact
.ooi-moment-card__title {
    font-size: 21px;
}

.ooi-moment-card--compact
.ooi-moment-card__intention,
.ooi-moment-card--compact
.ooi-moment-card__footer {
    display: none;
}

.ooi-moment-card--compact
.ooi-moment-card__branch,
.ooi-moment-card--compact
.ooi-moment-card__status {
    margin-bottom: 5px;
}

.ooi-moment-card--compact
.ooi-moment-card__date,
.ooi-moment-card--compact
.ooi-moment-card__location {
    margin-top: 5px;

    font-size: 12px;
}


/* =========================================================
   06. VARIANTE FEATURED
========================================================= */

.ooi-moment-card--featured {
    display: grid;
    width: 100%;
    max-width: 980px;

    grid-template-columns:
        minmax(280px, .9fr)
        minmax(0, 1.1fr);
}

.ooi-moment-card--featured
.ooi-moment-card__content {
    justify-content: center;

    padding:
        clamp(
            var(--ooi-space-lg),
            4vw,
            var(--ooi-space-xl)
        );
}

.ooi-moment-card--featured
.ooi-moment-card__title {
    font-size: clamp(30px, 4vw, 48px);
}


/* =========================================================
   07. VARIANTE EDITORIAL
========================================================= */

.ooi-moment-card--editorial {
    --ooi-moment-editorial-accent: #80c5cf;
    --ooi-moment-editorial-text: #ffffff;
    --ooi-moment-editorial-dark: #071426;

    position: relative;

    display: flex;
    width: 100%;
    max-width: 390px;
    flex-direction: column;

    overflow: visible;

    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    color: var(--ooi-text);
}

.ooi-moment-card--editorial:hover {
    border-color: transparent;
    box-shadow: none;
    transform: translateY(-4px);
}


/* =========================================================
   07.1. ZONE AFFICHE ÉDITORIALE
========================================================= */

.ooi-moment-card__editorial-poster {
    position: relative;

    display: block;
    width: 100%;

    overflow: visible;

    color: inherit;
    text-decoration: none;
}

.ooi-moment-card__editorial-media {
    position: relative;
    isolation: isolate;

    display: block;
    width: 100%;

    overflow: hidden;

    aspect-ratio: 1 / 1;

    border: 1px solid rgba(255, 255, 255, .08);
    border-radius:
        var(--ooi-radius-lg)
        var(--ooi-radius-lg)
        0
        0;

    background: var(--ooi-moment-editorial-dark);
}

.ooi-moment-card--editorial
.ooi-moment-card__poster-image {
    position: relative;
    z-index: 0;

    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;

    object-fit: cover !important;
    object-position: center;

    transform: scale(1.001);

    transition:
        transform var(--ooi-transition-slow),
        filter var(--ooi-transition);
}

.ooi-moment-card--editorial:hover
.ooi-moment-card__poster-image,
.ooi-moment-card__editorial-poster:focus-visible
.ooi-moment-card__poster-image {
    filter: brightness(.93);
    transform: scale(1.025);
}


/* =========================================================
   07.2. DÉGRADÉ DE LISIBILITÉ
========================================================= */

.ooi-moment-card__editorial-shade {
    position: absolute;
    z-index: 1;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            135deg,
            rgba(3, 10, 22, .73) 0%,
            rgba(3, 10, 22, .32) 27%,
            transparent 52%
        ),
        linear-gradient(
            225deg,
            rgba(3, 10, 22, .30) 0%,
            transparent 30%
        ),
        linear-gradient(
            0deg,
            rgba(3, 10, 22, .18) 0%,
            transparent 26%
        );
}


/* =========================================================
   07.3. DATE EN RELIEF
========================================================= */

.ooi-moment-card__editorial-date {
    position: absolute;
    z-index: 4;
    top: -15px;
    left: -11px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    pointer-events: none;

    color: var(--ooi-moment-editorial-text);

    line-height: .82;

    filter:
        drop-shadow(
            0 5px 4px rgba(0, 0, 0, .22)
        )
        drop-shadow(
            0 12px 16px rgba(0, 0, 0, .20)
        );

    transform: rotate(-3.5deg);
    transform-origin: left bottom;
}

.ooi-moment-card__editorial-month {
    display: block;

    font-size:
        clamp(
            42px,
            4.8vw,
            62px
        );

    font-weight: 900;
    letter-spacing: -.075em;
    line-height: .82;
    text-transform: uppercase;
    white-space: nowrap;

    -webkit-text-stroke:
        1px rgba(255, 255, 255, .08);
}

.ooi-moment-card__editorial-year {
    display: block;

    margin-top: 9px;
    margin-left: 14px;

    color:
        var(--ooi-moment-editorial-accent);

    font-size:
        clamp(
            20px,
            2vw,
            27px
        );

    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1;

    transform: rotate(1.5deg);
}


/* =========================================================
   07.4. LABEL DE BRANCHE
========================================================= */

.ooi-moment-card__editorial-branch {
    position: absolute;
    z-index: 4;
    top: 17px;
    right: 16px;

    display: inline-flex;
    min-height: 27px;
    max-width: calc(100% - 155px);

    align-items: center;
    justify-content: center;

    padding: 6px 11px;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--ooi-radius-xl);

    background:
        var(--ooi-moment-editorial-accent);

    color: var(--ooi-moment-editorial-dark);

    font-size: 9px;
    font-weight: 900;
    letter-spacing: .075em;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;

    transform: rotate(1.2deg);
}


/* =========================================================
   07.5. CTA PLEINE LARGEUR
========================================================= */

.ooi-moment-card__editorial-footer {
    position: relative;

    display: flex;
    width: 100%;
    min-height: 60px;

    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 14px 20px;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, .06);
    border-top:
        2px solid
        var(--ooi-moment-editorial-accent);

    border-radius:
        0
        0
        var(--ooi-radius-lg)
        var(--ooi-radius-lg);

    background:
        linear-gradient(
            135deg,
            #071426 0%,
            #101d31 100%
        );

    color: #fff;

    font-size: var(--ooi-font-md);
    font-weight: 850;
    letter-spacing: -.015em;
    text-decoration: none;

    transition:
        background-color var(--ooi-transition-fast),
        color var(--ooi-transition-fast);
}

.ooi-moment-card__editorial-footer::before {
    position: absolute;
    inset: 0;

    content: "";

    pointer-events: none;

    background:
        linear-gradient(
            115deg,
            transparent 0%,
            rgba(255, 255, 255, .05) 50%,
            transparent 100%
        );

    opacity: 0;
    transform: translateX(-35%);

    transition:
        opacity var(--ooi-transition),
        transform var(--ooi-transition);
}

.ooi-moment-card__editorial-footer:hover::before,
.ooi-moment-card__editorial-footer:focus-visible::before {
    opacity: 1;
    transform: translateX(35%);
}

.ooi-moment-card__editorial-footer > span {
    position: relative;
    z-index: 1;
}

.ooi-moment-card__editorial-arrow {
    display: inline-block;

    color:
        var(--ooi-moment-editorial-accent);

    font-size: 21px;
    line-height: 1;

    transition:
        transform var(--ooi-transition-fast);
}

.ooi-moment-card__editorial-footer:hover,
.ooi-moment-card__editorial-footer:focus-visible {
    color: #fff;
}

.ooi-moment-card__editorial-footer:hover
.ooi-moment-card__editorial-arrow,
.ooi-moment-card__editorial-footer:focus-visible
.ooi-moment-card__editorial-arrow {
    transform: translateX(6px);
}


/* =========================================================
   08. ACCENTS PAR BRANCHE
========================================================= */

.ooi-moment-card--branch-community,
.ooi-moment-card--branch-communaute {
    --ooi-moment-editorial-accent: #8d89e8;
}

.ooi-moment-card--branch-formation {
    --ooi-moment-editorial-accent: #d99e82;
}

.ooi-moment-card--branch-sport,
.ooi-moment-card--branch-core-team {
    --ooi-moment-editorial-accent: #ffab4e;
}

.ooi-moment-card--branch-table-ronde,
.ooi-moment-card--branch-table-ronde-ooi {
    --ooi-moment-editorial-accent: #aacf80;
}

.ooi-moment-card--branch-evenement,
.ooi-moment-card--branch-culture {
    --ooi-moment-editorial-accent: #80c5cf;
}

.ooi-moment-card--branch-solidarite {
    --ooi-moment-editorial-accent: #d99e82;
}


/* =========================================================
   09. ACCESSIBILITÉ
========================================================= */

.ooi-moment-card a:focus-visible {
    outline:
        3px solid
        rgba(128, 197, 207, .58);

    outline-offset: 3px;
}

.ooi-moment-card__editorial-poster:focus-visible {
    border-radius: var(--ooi-radius-lg);
}


/* =========================================================
   10. RESPONSIVE — TABLETTE ET MOBILE
========================================================= */

@media screen and (max-width: 720px) {

    .ooi-moment-card--featured {
        grid-template-columns: 1fr;
    }

    .ooi-moment-card--compact {
        grid-template-columns:
            96px
            minmax(0, 1fr);
    }

    .ooi-moment-card--compact
    .ooi-moment-card__poster {
        width: 96px;
        height: 96px;
        min-height: 96px;
    }

    .ooi-moment-card--compact
    .ooi-moment-card__title {
        font-size: 18px;
    }

    .ooi-moment-card--compact
    .ooi-moment-card__location {
        display: none;
    }

    .ooi-moment-card--editorial {
        flex:
            0
            0
            min(84vw, 340px);

        max-width:
            min(84vw, 340px);
    }

    .ooi-moment-card__editorial-date {
        top: -10px;
        left: -6px;

        transform: rotate(-3deg);
    }

    .ooi-moment-card__editorial-month {
        font-size:
            clamp(
                39px,
                12vw,
                51px
            );
    }

    .ooi-moment-card__editorial-year {
        margin-top: 7px;
        margin-left: 11px;

        font-size:
            clamp(
                18px,
                5.5vw,
                23px
            );
    }

    .ooi-moment-card__editorial-branch {
        top: 14px;
        right: 13px;

        min-height: 24px;
        max-width: 44%;

        padding: 5px 9px;

        font-size: 8px;
    }

    .ooi-moment-card__editorial-footer {
        min-height: 55px;

        padding: 12px 16px;

        font-size: 14px;
    }
}


/* =========================================================
   11. RESPONSIVE — PETIT MOBILE
========================================================= */

@media screen and (max-width: 440px) {

    .ooi-moment-card--compact {
        grid-template-columns:
            82px
            minmax(0, 1fr);

        border-radius: var(--ooi-radius-md);
    }

    .ooi-moment-card--compact
    .ooi-moment-card__poster {
        width: 82px;
        height: 82px;
        min-height: 82px;
    }

    .ooi-moment-card--compact
    .ooi-moment-card__content {
        padding: 11px 12px;
    }

    .ooi-moment-card--compact
    .ooi-moment-card__branch,
    .ooi-moment-card--compact
    .ooi-moment-card__status {
        font-size: 8px;
    }

    .ooi-moment-card--compact
    .ooi-moment-card__date {
        font-size: 10px;
    }

    .ooi-moment-card--editorial {
        flex-basis: 86vw;
        max-width: 86vw;
    }

    .ooi-moment-card__editorial-date {
        top: -8px;
        left: -4px;
    }

    .ooi-moment-card__editorial-month {
        font-size:
            clamp(
                37px,
                12.5vw,
                47px
            );
    }

    .ooi-moment-card__editorial-year {
        margin-top: 6px;
        margin-left: 10px;

        font-size: 18px;
    }

    .ooi-moment-card__editorial-branch {
        top: 12px;
        right: 11px;

        max-width: 42%;

        padding: 5px 8px;
    }

    .ooi-moment-card__editorial-footer {
        min-height: 52px;

        padding: 11px 14px;
    }
}


/* =========================================================
   12. ANIMATIONS RÉDUITES
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .ooi-moment-card,
    .ooi-moment-card__poster-image,
    .ooi-moment-card__poster-overlay,
    .ooi-moment-card__discover,
    .ooi-moment-card__link,
    .ooi-moment-card__editorial-footer,
    .ooi-moment-card__editorial-footer::before,
    .ooi-moment-card__editorial-arrow {
        transition: none;
    }

    .ooi-moment-card:hover,
    .ooi-moment-card__poster:hover
    .ooi-moment-card__poster-image,
    .ooi-moment-card__link:hover,
    .ooi-moment-card--editorial:hover,
    .ooi-moment-card--editorial:hover
    .ooi-moment-card__poster-image,
    .ooi-moment-card__editorial-footer:hover
    .ooi-moment-card__editorial-arrow {
        transform: none;
    }

    .ooi-moment-card__editorial-footer:hover::before,
    .ooi-moment-card__editorial-footer:focus-visible::before {
        opacity: 0;
        transform: none;
    }
}