/* =========================================================
   Compétences — split éditorial (rail + scène)
   ========================================================= */

.kc-comp {
    --kc-comp-focus: rgba(198, 168, 93, 0.45);
    --bs-focus-ring-color: rgba(198, 168, 93, 0.45);
    --bs-nav-link-color: var(--kc-text-muted);
    --bs-nav-link-hover-color: var(--kc-ink);
    --bs-nav-pills-link-active-color: var(--kc-ink);
    --bs-nav-pills-link-active-bg: transparent;
    padding: clamp(4.5rem, 8vw, 7rem) 0;
    background:
        linear-gradient(180deg, #F7F5F0 0%, #FAFAF7 40%, #FAFAF7 100%);
    font-family: var(--kc-font);
    color: var(--kc-text);
}

.kc-comp__container {
    width: 100%;
    max-width: var(--kc-container);
    margin-inline: auto;
    padding-inline: 24px;
}

.kc-comp__header {
    text-align: center;
    margin: 0 0 clamp(2.25rem, 4vw, 3.25rem);
}

.kc-comp__title {
    margin: 0;
    color: var(--kc-ink);
    font-size: clamp(1.85rem, 3vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.kc-comp__title::after {
    content: "";
    display: block;
    width: 52px;
    height: 3px;
    margin: 1rem auto 0;
    border-radius: 3px;
    background: var(--kc-gold);
}

/* ---------- Layout split ---------- */
.kc-comp__layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 2.75rem);
    align-items: start;
}

/* ---------- Rail (nav) ---------- */
.kc-comp__nav {
    position: sticky;
    top: 6.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0;
    padding: 0.35rem;
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius-md);
    background: #fff;
    list-style: none;
    box-shadow: var(--kc-shadow-sm);
}

.kc-comp__nav > [role="presentation"] {
    margin: 0;
    width: 100%;
}

.kc-comp__tab {
    appearance: none;
    display: grid;
    grid-template-columns: 2rem 1fr;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    margin: 0;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-radius: 8px;
    background: transparent !important;
    color: var(--kc-text-muted) !important;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition:
        color 0.22s var(--kc-ease),
        background-color 0.22s var(--kc-ease);
}

.kc-comp__tab:hover {
    color: var(--kc-ink) !important;
    background: rgba(198, 168, 93, 0.08) !important;
}

.kc-comp__tab.active,
.kc-comp__tab.is-active,
.kc-comp__tab.active:hover,
.kc-comp__tab.is-active:hover {
    color: var(--kc-ink) !important;
    background: var(--kc-gold-soft) !important;
    box-shadow: none !important;
}

.kc-comp__tab:focus,
.kc-comp__tab:focus-visible,
.kc-comp .nav-link:focus,
.kc-comp .nav-link:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.kc-comp__tab:focus-visible {
    box-shadow: inset 0 0 0 2px var(--kc-comp-focus) !important;
}

.kc-comp__tab-index {
    color: var(--kc-gold-700);
    font-size: 0.72rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.kc-comp__tab.active .kc-comp__tab-index,
.kc-comp__tab.is-active .kc-comp__tab-index {
    opacity: 1;
}

.kc-comp__tab-icon {
    display: none;
}

.kc-comp__tab-label {
    font-weight: inherit;
}

/* ---------- Stage ---------- */
.kc-comp__stage {
    position: relative;
    min-height: 22rem;
    margin: 0;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius-md);
    background: #fff;
    box-shadow: var(--kc-shadow-sm);
    overflow: hidden;
}

.kc-comp__stage::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--kc-gold) 0%, rgba(198, 168, 93, 0.25) 100%);
    pointer-events: none;
}

.kc-comp__pane {
    position: relative;
}

.kc-comp__pane-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 0 0 1.5rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid rgba(15, 27, 45, 0.07);
}

.kc-comp__pane-num {
    flex-shrink: 0;
    color: var(--kc-gold);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.kc-comp__pane-title {
    margin: 0.35rem 0 0;
    color: var(--kc-ink);
    font-size: clamp(1.3rem, 2.2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.kc-comp__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kc-comp__list--single {
    grid-template-columns: 1fr;
    max-width: 40rem;
}

.kc-comp__list li {
    position: relative;
    padding: 0.8rem 0 0.8rem 1.2rem;
    border-bottom: 1px solid rgba(15, 27, 45, 0.06);
    color: #3D4A5C;
    font-size: 0.98rem;
    line-height: 1.65;
}

.kc-comp__list li:last-child {
    border-bottom: 0;
}

/* En grille 2 cols, retirer la bordure du dernier de chaque colonne est difficile ;
   on garde une séparation légère partout sauf vrai dernier enfant du flux */
.kc-comp__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.2rem;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--kc-gold);
}

/* Phases MOE */
.kc-comp__phases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.kc-comp__phase {
    padding: 1.15rem 1.1rem 1.2rem;
    border-radius: 10px;
    background: #FAFAF7;
    border: 1px solid rgba(15, 27, 45, 0.05);
}

.kc-comp__phase-title {
    margin: 0 0 0.75rem;
    color: var(--kc-gold-700);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.kc-comp__phase .kc-comp__list {
    grid-template-columns: 1fr;
    gap: 0;
}

.kc-comp__phase .kc-comp__list li {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.92rem;
}

/* AMO */
.kc-comp__prose {
    margin: 0;
    max-width: 42rem;
    color: #3D4A5C;
    font-size: 1.08rem;
    line-height: 1.85;
}

/* Un panneau à la fois */
#services .kc-comp__stage > .tab-pane {
    display: none;
}

#services .kc-comp__stage > .tab-pane.active {
    display: block;
    animation: kc-comp-in 0.32s var(--kc-ease);
}

@keyframes kc-comp-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.kc-comp .kc-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--kc-ease), transform 0.7s var(--kc-ease);
}

.kc-comp .kc-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.kc-comp .kc-reveal--1 { transition-delay: 0.06s; }
.kc-comp .kc-reveal--2 { transition-delay: 0.14s; }

/* ---------- Tablet ---------- */
@media (max-width: 991.98px) {
    .kc-comp__layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .kc-comp__nav {
        position: relative;
        top: auto;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.25rem;
        padding: 0.4rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .kc-comp__nav::-webkit-scrollbar {
        display: none;
    }

    .kc-comp__nav > [role="presentation"] {
        width: auto;
        flex: 0 0 auto;
    }

    .kc-comp__tab {
        grid-template-columns: auto;
        gap: 0;
        white-space: nowrap;
        padding: 0.7rem 1rem;
    }

    .kc-comp__tab-index {
        display: none;
    }

    .kc-comp__tab.active,
    .kc-comp__tab.is-active {
        background: var(--kc-ink) !important;
        color: #fff !important;
    }

    .kc-comp__phases {
        grid-template-columns: 1fr;
    }

    .kc-comp__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .kc-comp__container {
        padding-inline: 20px;
    }

    .kc-comp__stage {
        padding: 1.35rem 1.15rem 1.5rem;
    }

    .kc-comp__pane-head {
        gap: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kc-comp__tab,
    .kc-comp .kc-reveal,
    #services .kc-comp__stage > .tab-pane.active {
        transition: none;
        animation: none;
    }

    .kc-comp .kc-reveal {
        opacity: 1;
        transform: none;
    }
}
