/**
 * FAQ Module - Styles
 */

/* ================================================
   CONTAINER
   ================================================ */

.cj-faq {
    position: relative;
    padding: 110px 6%;
    overflow: hidden;
}

.cj-faq__inner {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

/* ================================================
   THEME SOMBRE
   ================================================ */

.cj-faq--dark {
    background:
        linear-gradient(270deg, rgba(11, 10, 9, 0.96), rgba(11, 10, 9, 0.86)),
        #0b0a09;
    color: #f5f2ec;
}

.cj-faq--dark::before {
    content: var(--faq-watermark, "FAQ");
    position: absolute;
    right: 5%;
    top: 48px;
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(80px, 16vw, 230px);
    font-weight: 900;
    line-height: 0.78;
    color: rgba(245, 242, 236, 0.055);
    pointer-events: none;
    z-index: 0;
}

/* ================================================
   THEME CLAIR
   ================================================ */

.cj-faq--light {
    background: #f5f2ec;
    color: #15130f;
}

.cj-faq--light::before {
    content: var(--faq-watermark, "FAQ");
    position: absolute;
    right: 5%;
    top: 48px;
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(80px, 16vw, 230px);
    font-weight: 900;
    line-height: 0.78;
    color: rgba(21, 19, 15, 0.045);
    pointer-events: none;
    z-index: 0;
}

/* ================================================
   IMAGE PERSONNAGE
   ================================================ */

.cj-faq__character {
    position: absolute;
    bottom: 0;
    width: auto;
    height: var(--faq-character-size, 100%);
    max-height: 100%;
    z-index: 0;
    pointer-events: none;
    object-fit: contain;
    object-position: bottom;
}

/* Position droite */
.cj-faq__character--right {
    right: 0;
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 1) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 1) 100%
    );
}

/* Position gauche : flip horizontal + fade */
.cj-faq__character--left {
    left: 0;
    transform: scaleX(-1);
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 1) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 1) 100%
    );
}

/* Opacité selon thème */
.cj-faq--dark .cj-faq__character {
    opacity: 0.28;
}

.cj-faq--light .cj-faq__character {
    opacity: 0.2;
}

/* ================================================
   HEADER - Aligné à gauche
   ================================================ */

.cj-faq__header {
    margin-bottom: 42px;
}

.cj-faq__title {
    margin: 0;
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(38px, 5vw, 68px);
    font-weight: 900;
    line-height: 0.92;
    text-transform: uppercase;
}

/* Couleur du titre selon le thème */
.cj-faq--dark .cj-faq__title {
    color: #f5f2ec;
}

.cj-faq--light .cj-faq__title {
    color: #15130f;
}

/* Accent orange */
.cj-faq__title-accent {
    color: #eb5d0f;
}

/* ================================================
   LISTE FAQ - Alignée à droite
   ================================================ */

.cj-faq__list {
    position: relative;
    z-index: 1;
    margin-left: auto;
    max-width: 980px;
}

.cj-faq--dark .cj-faq__list {
    border-top: 1px solid rgba(245, 242, 236, 0.22);
}

.cj-faq--light .cj-faq__list {
    border-top: 1px solid rgba(21, 19, 15, 0.22);
}

/* ================================================
   ITEM FAQ (details/summary)
   ================================================ */

.cj-faq__item {
    padding: 0;
    overflow: hidden;
}

.cj-faq--dark .cj-faq__item {
    border-bottom: 1px solid rgba(245, 242, 236, 0.22);
}

.cj-faq--light .cj-faq__item {
    border-bottom: 1px solid rgba(21, 19, 15, 0.22);
}

/* ================================================
   QUESTION (summary)
   ================================================ */

.cj-faq__question {
    cursor: pointer;
    list-style: none;
    padding: 24px 0;
    padding-right: 40px;
    position: relative;
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(25px, 3vw, 38px);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
    transition:
        color 260ms cubic-bezier(.22,.72,.18,1),
        padding-left 260ms cubic-bezier(.22,.72,.18,1);
}

.cj-faq--dark .cj-faq__question {
    color: #f5f2ec;
}

.cj-faq--light .cj-faq__question {
    color: #15130f;
}

/* État ouvert */
.cj-faq__item[open] .cj-faq__question {
    color: #eb5d0f;
    padding-left: 12px;
}

/* Masquer le marker natif */
.cj-faq__question::-webkit-details-marker {
    display: none;
}

.cj-faq__question::marker {
    display: none;
    content: '';
}

/* Icône +/- */
.cj-faq__question::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #eb5d0f;
    font-size: 1.2em;
    transition:
        transform 260ms cubic-bezier(.22,.72,.18,1),
        color 260ms cubic-bezier(.22,.72,.18,1);
}

.cj-faq__item[open] .cj-faq__question::after {
    content: "\2013"; /* en dash */
    transform: translateY(-50%) rotate(180deg);
}

.cj-faq--dark .cj-faq__item[open] .cj-faq__question::after {
    color: #f5f2ec;
}

.cj-faq--light .cj-faq__item[open] .cj-faq__question::after {
    color: #15130f;
}

/* ================================================
   RÉPONSE
   ================================================ */

.cj-faq__answer {
    max-width: 760px;
    padding: 0 0 28px;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 260ms cubic-bezier(.22,.72,.18,1),
        transform 260ms cubic-bezier(.22,.72,.18,1);
}

.cj-faq--dark .cj-faq__answer {
    color: #d8d0c5;
}

.cj-faq--light .cj-faq__answer {
    color: #4d4840;
}

.cj-faq__answer p {
    margin: 0;
    font-size: 17px;
    line-height: 1.55;
}

/* Animation d'apparition */
.cj-faq__item[open] .cj-faq__answer {
    opacity: 1;
    transform: translateY(0);
}

/* Animation de fermeture */
.cj-faq__item.is-closing .cj-faq__answer {
    opacity: 0;
    transform: translateY(-8px);
}

/* ================================================
   BOUTON DANS RÉPONSE (style split-button)
   ================================================ */

.cj-faq__button {
    display: inline-flex;
    align-items: stretch;
    height: 52px;
    margin-top: 16px;
    font-family: "Saira Condensed", sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 200ms ease;
}

.cj-faq__button:hover {
    transform: translateY(-2px);
}

.cj-faq__button span:first-child {
    display: flex;
    align-items: center;
    padding: 0 26px;
    background: #eb5d0f;
    color: #0b0a09;
    white-space: nowrap;
}

.cj-faq__button span:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    background: #fff;
    color: #0b0a09;
    font-size: 20px;
}

/* ================================================
   TORN DIVIDERS (même structure que page-header)
   ================================================ */

.cj-faq__torn-back {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 90px;
    z-index: 4;
}

.cj-faq__torn-front {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 90px;
    background: #eb5d0f;
    z-index: 5;
}

/* Direction : descend vers la droite */
.cj-faq__torn-back--down-right {
    clip-path: polygon(0 100%, 100% 100%, 100% 38%, 0 86%);
}

.cj-faq__torn-front--down-right {
    clip-path: polygon(0 84%, 100% 36%, 100% 40%, 0 88%);
}

/* Direction : descend vers la gauche */
.cj-faq__torn-back--down-left {
    clip-path: polygon(0 100%, 100% 100%, 100% 86%, 0 38%);
}

.cj-faq__torn-front--down-left {
    clip-path: polygon(0 36%, 100% 84%, 100% 88%, 0 40%);
}

/* Couleurs torn - thème sombre (torn clair car section suivante est claire) */
.cj-faq--dark .cj-faq__torn-back {
    background: #f5f2ec;
}

/* Couleurs torn - thème clair (torn sombre car section suivante est sombre) */
.cj-faq--light .cj-faq__torn-back {
    background: #0b0a09;
}

/* Padding supplémentaire quand torn en bas */
.cj-faq--torn-bottom {
    padding-bottom: 140px;
}

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

@media (max-width: 1200px) {
    .cj-faq__character {
        height: calc(var(--faq-character-size, 100%) * 0.8);
    }

    .cj-faq--dark .cj-faq__character {
        opacity: 0.18;
    }

    .cj-faq--light .cj-faq__character {
        opacity: 0.12;
    }
}

@media (max-width: 768px) {
    .cj-faq {
        padding: 78px 18px;
    }

    .cj-faq::before {
        top: 28px;
        right: 18px;
        font-size: 78px !important;
    }

    .cj-faq__list {
        margin-left: 0;
        max-width: none;
    }

    .cj-faq__question {
        padding: 20px 0;
        padding-right: 36px;
        font-size: 25px;
    }

    .cj-faq__torn-back,
    .cj-faq__torn-front {
        height: 60px;
    }

    .cj-faq--torn-bottom {
        padding-bottom: 100px;
    }

    .cj-faq__character {
        height: calc(var(--faq-character-size, 100%) * 0.6);
    }

    .cj-faq--dark .cj-faq__character,
    .cj-faq--light .cj-faq__character {
        opacity: 0.1;
    }
}

@media (max-width: 480px) {
    .cj-faq {
        padding: 60px 16px;
    }

    .cj-faq__question {
        font-size: 22px;
    }

    .cj-faq__answer p {
        font-size: 15px;
    }

    .cj-faq__button {
        height: 48px;
        font-size: 14px;
    }

    .cj-faq__button span:first-child {
        padding: 0 18px;
    }

    .cj-faq__button span:last-child {
        width: 48px;
    }

    .cj-faq__torn-back,
    .cj-faq__torn-front {
        height: 45px;
    }

    .cj-faq__character {
        display: none;
    }
}

