/* ==========================================================================
 * Cuisinaffaires - Page Réalisation (Single)
 * ========================================================================== */

.ca-single {
    --ca-orange: #e8742c;
    --ca-orange-dark: #d2641f;
    --ca-dark: #0f172a;
    --ca-soft: #f6f7f8;
    --ca-border: #e5e7eb;
    --ca-text: #374151;
    --ca-radius: 14px;

    color: var(--ca-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

.ca-single * { box-sizing: border-box; }

/* ===== HERO ===== */
.ca-single-hero {
    position: relative;
    min-height: 70vh;
    background-size: cover;
    background-position: center;
    background-color: #1f2937;
    color: #fff;
    display: flex;
    align-items: flex-end;
    padding: 90px 20px 60px;  /* top augmenté pour laisser place au bouton retour absolu */
}
.ca-single-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.2) 0%, rgba(15,23,42,.85) 100%);
}
.ca-single-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.ca-back-btn {
    position: absolute !important;
    top: 30px;
    left: 50%;
    transform: translateX(-600px);  /* aligné sur le bord gauche du conteneur 1200px */
    z-index: 2;
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.15);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    backdrop-filter: blur(8px);
    margin-bottom: 0;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.ca-back-btn:hover {
    background: var(--ca-orange);
    color: #fff !important;
}
@media (max-width: 1240px) {
    .ca-back-btn {
        left: 20px;
        transform: none;
    }
}
.ca-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.ca-hero-tag {
    background: var(--ca-orange);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}
.ca-hero-title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.ca-hero-city {
    font-size: 17px;
    font-weight: 500;
    margin: 0;
    opacity: .92;
}

/* ===== INFO GRID ===== */
.ca-single-info {
    max-width: 1200px;
    margin: -50px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}
.ca-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    background: #fff;
    padding: 30px;
    border-radius: var(--ca-radius);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
}
.ca-info-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: 10px;
    transition: background .2s;
}
.ca-info-card:hover { background: var(--ca-soft); }
.ca-info-icon {
    font-size: 24px;
    margin-bottom: 4px;
}
.ca-info-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.ca-info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ca-dark);
}

/* ===== SECTION HEAD ===== */
.ca-section-head {
    text-align: center;
    margin-bottom: 36px;
}
.ca-section-head h2 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    color: var(--ca-dark);
    margin: 0 0 8px;
}
.ca-section-head p {
    color: #6b7280;
    margin: 0;
    font-size: 15px;
}

/* ===== VIDEO ===== */
.ca-single-video {
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 20px;
}
.ca-video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--ca-radius);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .15);
    background: #000;
}
.ca-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== AVANT / APRES (slider de comparaison) ===== */
.ca-single-ba {
    max-width: 1100px;
    margin: 0 auto 70px;
    padding: 0 20px;
}
.ca-ba-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Slider container */
.ca-ba-slider {
    --ca-ba-pos: 50%;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--ca-radius);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
    cursor: ew-resize;
    user-select: none;
    margin: 0;
    background: #1f2937;
    touch-action: none;
}
.ca-ba-slider * {
    -webkit-user-drag: none;
    user-select: none;
}

/* Les deux images en pleine taille, superposées */
.ca-ba-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
/* L'image AVANT est clippée par la position de la poignée */
.ca-ba-img-before {
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--ca-ba-pos)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--ca-ba-pos)) 0 0);
}

/* Labels "Avant" et "Après" */
.ca-ba-label {
    position: absolute;
    top: 18px;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.ca-ba-label-before {
    left: 18px;
    background: rgba(15, 23, 42, .85);
    color: #fff;
}
.ca-ba-label-after {
    right: 18px;
    background: rgba(232, 116, 44, .95);
    color: #fff;
}

/* Poignée verticale centrale */
.ca-ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--ca-ba-pos);
    width: 56px;
    transform: translateX(-50%);
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: ew-resize;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Ligne verticale derrière la poignée */
.ca-ba-handle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: #fff;
    box-shadow: 0 0 12px rgba(0,0,0,.4);
}
.ca-ba-handle-knob {
    position: relative;
    width: 56px;
    height: 56px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    color: var(--ca-orange);
    font-weight: 900;
    font-size: 26px;
    box-shadow: 0 8px 22px rgba(0,0,0,.4), 0 0 0 4px rgba(255,255,255,.3);
    transition: transform .2s ease, box-shadow .2s ease;
    line-height: 1;
}
.ca-ba-slider:hover .ca-ba-handle-knob {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 0 6px rgba(255,255,255,.35);
}
.ca-ba-slider.dragging {
    cursor: grabbing;
}
.ca-ba-slider.dragging .ca-ba-handle-knob {
    transform: scale(1.15);
    background: var(--ca-orange);
    color: #fff;
}
.ca-ba-arrow {
    display: inline-block;
    line-height: 1;
}

.ca-ba-note {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 20px;
    font-style: italic;
}

/* Sections de galerie séparées */
.ca-gallery-section { margin-bottom: 40px; }
.ca-gallery-subtitle {
    font-size: 13px;
    margin: 0 0 16px;
    text-align: left;
}
.ca-pill-before, .ca-pill-after {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.ca-pill-before { background: #fef3c7; color: #92400e; }
.ca-pill-after  { background: #d1fae5; color: #065f46; }

/* ===== TESTIMONIAL ===== */
.ca-single-testimonial {
    max-width: 800px;
    margin: 0 auto 60px !important;
    padding: 60px 40px 50px;
    background: linear-gradient(135deg, var(--ca-soft) 0%, #fff 100%);
    border-radius: var(--ca-radius);
    position: relative;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .06);
    text-align: center;
}
.ca-single-testimonial .ca-testimonial-text {
    text-align: center;
    font-size: 17px;
    line-height: 1.7;
    color: #374151;
    font-style: italic;
}
.ca-quote-mark {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 90px;
    font-weight: 700;
    color: var(--ca-orange);
    opacity: .25;
    line-height: 1;
}
.ca-testimonial-text {
    font-size: 17px;
    font-style: italic;
    color: #4b5563;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}
.ca-testimonial-text p { margin: 0 0 12px; }
.ca-testimonial-text p:last-child { margin-bottom: 0; }
.ca-testimonial-author {
    margin-top: 18px;
    font-weight: 600;
    color: var(--ca-orange);
    font-size: 14px;
    font-style: normal;
}

/* ===== GALERIE ===== */
.ca-single-gallery {
    max-width: 1280px;
    margin: 0 auto 60px;
    padding: 0 20px;
}
.ca-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.ca-gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    cursor: zoom-in;
    background: #1f2937;
}
.ca-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.ca-gallery-item:hover img { transform: scale(1.06); }
.ca-gallery-item::after {
    content: '🔍';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .4);
    color: #fff;
    font-size: 28px;
    opacity: 0;
    transition: opacity .25s;
}
.ca-gallery-item:hover::after { opacity: 1; }

/* Layout en mosaïque (premier élément + grand) */
.ca-gallery-grid .ca-gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

/* ===== CTA FINALE ===== */
.ca-single-cta {
    background: linear-gradient(135deg, var(--ca-dark) 0%, #1e293b 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    margin-top: 40px;
}
.ca-cta-inner {
    max-width: 700px;
    margin: 0 auto;
}
.ca-cta-inner h2 {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 800;
    margin: 0 0 14px;
    color: #fff;
}
.ca-cta-inner p {
    font-size: 17px;
    color: rgba(255,255,255,.85);
    margin: 0 0 28px;
}
.ca-cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.ca-btn-primary, .ca-btn-secondary {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform .2s, background .2s, color .2s;
    font-size: 15px;
}
.ca-btn-primary {
    background: var(--ca-orange);
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(232,116,44,.3);
}
.ca-btn-primary:hover {
    background: var(--ca-orange-dark);
    transform: translateY(-2px);
}
.ca-btn-secondary {
    background: rgba(255,255,255,.1);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.2);
}
.ca-btn-secondary:hover {
    background: rgba(255,255,255,.18);
    transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ca-single-hero { min-height: 50vh; padding: 40px 20px 40px; }
    .ca-info-grid { padding: 20px; gap: 12px; }
    .ca-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .ca-gallery-grid .ca-gallery-item:first-child { grid-column: span 2; grid-row: auto; }
    .ca-single-testimonial { padding: 40px 24px; }
}
@media (max-width: 500px) {
    .ca-gallery-grid { grid-template-columns: 1fr; gap: 10px; }
    .ca-gallery-grid .ca-gallery-item:first-child { grid-column: auto; }
    .ca-single-cta { padding: 50px 20px; }
    .ca-btn-primary, .ca-btn-secondary { width: 100%; }
}
