/**
 * Creajeux Formation Panels Module
 * Volets accordeon survolables
 */

/* Container */
.cj-formation-panels {
    display: flex;
    gap: 6px;
    height: var(--cj-fp-height, 540px);
}

/* Individual card */
.cj-formation-card {
    position: relative;
    flex-basis: 0;
    flex-grow: 1;
    min-width: 0;
    cursor: pointer;
    overflow: hidden;
    transition: flex-grow 0.55s cubic-bezier(0.7, 0, 0.2, 1);
    background: #f5f2ec;
    color: #15130f;
}

/* Active state - expanded */
.cj-formation-card.is-active {
    flex-grow: var(--cj-fp-expand-ratio, 4.2);
}

/* Compact number (visible when collapsed) */
.cj-formation-compact-number {
    position: absolute;
    top: 32px;
    left: 28px;
    z-index: 2;
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(32px, 3.4vw, 54px);
    font-weight: 900;
    line-height: 0.85;
    color: #eb5d0f;
    transition: opacity 0.22s ease;
}

/* Compact title wrapper */
.cj-formation-compact-title-wrap {
    position: absolute;
    bottom: 26px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 2;
}

/* Compact title (vertical text when collapsed) */
.cj-formation-compact-title {
    font-family: "Saira Condensed", sans-serif;
    font-weight: 800;
    font-size: 26px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #15130f;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Hide compact elements when active */
.cj-formation-card.is-active .cj-formation-title-compact,
.cj-formation-card.is-active .cj-formation-compact-number {
    opacity: 0;
    pointer-events: none;
}

/* Expanded panel (hidden by default) */
.cj-formation-panel {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Show panel when active */
.cj-formation-card.is-active .cj-formation-panel {
    opacity: 1;
    pointer-events: auto;
}

/* Background image */
.cj-formation-image {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: right center;
    opacity: 0.7;
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 1) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 1) 100%
    );
}

/* Content container */
.cj-formation-content {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(680px, calc(100vw - 72px));
    max-width: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 36px;
    z-index: 2;
}

/* Kicker (small label above title) */
.cj-formation-kicker {
    font-family: "Space Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #eb5d0f;
    margin-bottom: 10px;
}

/* Main title */
.cj-formation-title {
    margin: 0 0 6px;
    font-family: "Saira Condensed", sans-serif;
    font-weight: 900;
    font-size: clamp(34px, 3.6vw, 58px);
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: #15130f;
}

/* Subtitle */
.cj-formation-subtitle {
    font-family: "Saira", sans-serif;
    font-size: 18px;
    color: #544e45;
    margin-bottom: 20px;
}

/* Description */
.cj-formation-description {
    margin: 0 0 22px;
    max-width: 440px;
    font-size: 15px;
    line-height: 1.55;
    color: #5c564c;
}

/* Tags container */
.cj-formation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

/* Individual tag */
.cj-formation-tag {
    font-family: "Space Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #15130f;
    border: 1px solid rgba(0, 0, 0, 0.22);
    padding: 7px 12px;
}

/* CTA button */
.cj-formation-link-button {
    display: inline-flex;
    align-self: flex-start;
    align-items: stretch;
    height: 46px;
    cursor: pointer;
    font-family: "Saira Condensed", sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}

.cj-formation-link-label {
    background: #15130f;
    color: #f5f2ec;
    padding: 0 20px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.cj-formation-link-icon {
    background: #eb5d0f;
    color: #0b0a09;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Accent bar on left side */
.cj-formation-accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #eb5d0f;
    z-index: 3;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1080px) {
    .cj-formation-panels {
        height: 500px;
    }

    .cj-formation-content {
        width: min(560px, calc(100vw - 64px));
        padding: 30px;
    }
}

@media (max-width: 720px) {
    .cj-formation-panels {
        flex-direction: column;
        height: auto;
        min-height: 980px;
        gap: 5px;
    }

    .cj-formation-card {
        flex-basis: 0;
        flex-grow: 1;
        min-height: 80px;
    }

    .cj-formation-card.is-active {
        flex-grow: var(--cj-fp-expand-ratio, 4.2);
        min-height: 400px;
    }

    .cj-formation-compact-number {
        top: 20px;
        left: 22px;
        font-size: 34px;
    }

    .cj-formation-compact-title-wrap {
        top: 22px;
        bottom: auto;
        left: 78px;
        right: 18px;
        justify-content: flex-start;
    }

    .cj-formation-compact-title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 22px;
        line-height: 1;
    }

    .cj-formation-content {
        width: 100%;
        padding: 24px 22px;
    }

    .cj-formation-image {
        opacity: 0.42;
    }

    .cj-formation-title {
        font-size: clamp(34px, 12vw, 50px);
    }

    .cj-formation-description {
        max-width: min(430px, 100%);
        font-size: 14px;
    }

    .cj-formation-tags {
        gap: 6px;
        margin-bottom: 16px;
    }

    .cj-formation-tag {
        font-size: 9px;
        padding: 6px 9px;
    }

    .cj-formation-link-button {
        height: 42px;
        font-size: 12px;
    }
}
