/**
 * Frontend CSS du bloc "BTP - Services accordeon".
 * Chargee uniquement quand le bloc est present.
 */

.btp-services-block {
    --btp-services-accent: var(--btp-accent-dark, #1c1917);
    --btp-services-radius: 16px;
    --btp-services-card-bg: linear-gradient(135deg, #f8fafc 0%, #f5f5f4 100%);
    --btp-services-text: #1c1917;
    --btp-services-text-muted: #57534e;
    --btp-services-text-light: #78716c;
    --btp-services-border: #e7e5e4;
    --btp-services-border-soft: #f5f5f4;
    --btp-services-shadow-md: 0 4px 16px -4px rgba(15, 23, 42, 0.1);
    --btp-services-shadow-lg: 0 12px 40px -12px rgba(15, 23, 42, 0.18);
    background: #fff;
    border: 1px solid var(--btp-services-border);
    border-radius: var(--btp-services-radius);
    margin: 2em 0;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.btp-services-block:hover { border-color: color-mix(in srgb, var(--btp-services-accent) 35%, var(--btp-services-border)); }
.btp-services-block.is-open { box-shadow: var(--btp-services-shadow-md); }

/* ============================================================
   Header (bouton toggle accordeon)
   ============================================================ */
.btp-services-block__header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s;
    margin: 0;
    box-shadow: none;
}
.btp-services-block__header:hover {
    background: color-mix(in srgb, var(--btp-services-accent) 8%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .btp-services-block__header:hover { background: rgba(14, 131, 121, 0.08); }
}

.btp-services-block__icon {
    flex: 0 0 auto;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--btp-services-accent), color-mix(in srgb, var(--btp-services-accent) 80%, #000));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .btp-services-block__icon { background: linear-gradient(135deg, #1c1917, #0A6660); }
}

.btp-services-block__title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btp-services-block__title {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--btp-services-text);
    line-height: 1.3;
    margin: 0;
}

.btp-services-block__subtitle {
    font-size: 12px;
    color: var(--btp-services-text-light);
    line-height: 1.35;
    margin: 0;
}

.btp-services-block__chevron {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--btp-services-accent) 12%, transparent);
    color: var(--btp-services-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .btp-services-block__chevron { background: rgba(14, 131, 121, 0.12); }
}
.btp-services-block.is-open .btp-services-block__chevron {
    transform: rotate(180deg);
}

/* ============================================================
   Body (contenu deplie)
   ============================================================ */
.btp-services-block__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.btp-services-block.is-open .btp-services-block__body { max-height: 3000px; }

.btp-services-block__body-inner {
    padding: 4px 20px 24px;
    border-top: 1px solid var(--btp-services-border-soft);
    padding-top: 20px;
}

/* ============================================================
   Track (contient les cards). 2 modes : stacked ou carousel
   ============================================================ */
.btp-services-track-wrap { position: relative; }
.btp-services-track-viewport { overflow: hidden; }

.btp-services-track {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.btp-services-track[data-layout="carousel"] {
    flex-direction: row;
    gap: 0;
}
.btp-services-track[data-layout="carousel"] .btp-services-card {
    min-width: 100%;
    flex: 0 0 100%;
}

/* ============================================================
   Card service (photo + contenu, cote a cote)
   ============================================================ */
.btp-services-card {
    background: var(--btp-services-card-bg);
    border: 1px solid var(--btp-services-border-soft);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr 200px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btp-services-block--media-left .btp-services-card {
    grid-template-columns: 200px 1fr;
}
.btp-services-block--media-left .btp-services-card__media { order: -1; }

.btp-services-card:hover {
    border-color: color-mix(in srgb, var(--btp-services-accent) 25%, transparent);
    box-shadow: var(--btp-services-shadow-md);
    transform: translateY(-2px);
}

.btp-services-card__content {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.btp-services .btp-services-card__title,
.btp-services-card__title.btp-services-card__title {
    font-family: var(--btp-font-display, Georgia, serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--btp-services-text);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.btp-services-card__desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--btp-services-text-muted);
}
.btp-services-card__desc p { margin: 0 0 0.4em; }
.btp-services-card__desc p:last-child { margin-bottom: 0; }

.btp-services-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--btp-services-accent);
    color: #fff !important;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 4px;
    font-family: inherit;
}
.btp-services-card__cta:hover {
    background: var(--btp-services-text);
    transform: translateY(-1px);
}
.btp-services-card__cta--disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}
.btp-services-card__cta svg { width: 12px; height: 12px; }

.btp-services-card__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 180px;
}
.btp-services-card__media::before {
    content: "";
    position: absolute;
    top: -30%; right: -30%;
    width: 140%; height: 140%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.btp-services-card__media-icon {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,0.85);
}

/* ============================================================
   Fleches carousel (position absolue sur les cotes)
   ============================================================ */
.btp-services-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--btp-services-border);
    background: #fff;
    color: var(--btp-services-text-muted);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: var(--btp-services-shadow-md);
    z-index: 5;
    padding: 0;
    font-family: inherit;
}
.btp-services-arrow--prev { left: -22px; }
.btp-services-arrow--next { right: -22px; }
.btp-services-track-wrap.is-carousel .btp-services-arrow { display: inline-flex; }
.btp-services-arrow:hover {
    border-color: var(--btp-services-accent);
    color: var(--btp-services-accent);
    transform: translateY(-50%) scale(1.08);
    box-shadow: var(--btp-services-shadow-lg);
}
.btp-services-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: translateY(-50%);
}
.btp-services-arrow:disabled:hover {
    border-color: var(--btp-services-border);
    color: var(--btp-services-text-muted);
    transform: translateY(-50%);
    box-shadow: var(--btp-services-shadow-md);
}

/* ============================================================
   Dots (indicateurs de position)
   ============================================================ */
.btp-services-dots {
    display: none;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}
.btp-services-track-wrap.is-carousel .btp-services-dots { display: flex; }
.btp-services-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--btp-services-border);
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
}
.btp-services-dot.is-active {
    background: var(--btp-services-accent);
    width: 22px;
    border-radius: 4px;
}

/* ============================================================
   Responsive : sur mobile, la photo passe en haut
   ============================================================ */
@media (max-width: 700px) {
    .btp-services-card,
    .btp-services-block--media-left .btp-services-card {
        grid-template-columns: 1fr;
    }
    .btp-services-card__media { aspect-ratio: 16 / 10; min-height: 0; order: -1; }
    .btp-services-card__content { padding: 18px 20px; }
    .btp-services-block--media-left .btp-services-card__media { order: -1; }
}

@media (max-width: 640px) {
    .btp-services-arrow--prev { left: 8px; }
    .btp-services-arrow--next { right: 8px; }
    .btp-services-arrow { background: rgba(255,255,255,0.95); backdrop-filter: blur(4px); }
    .btp-services-block__header { padding: 14px 16px; gap: 10px; }
    .btp-services-block__icon { width: 38px; height: 38px; }
    .btp-services-block__body-inner { padding: 4px 14px 18px; padding-top: 16px; }
}
