/* ==========================================================================
   SJ Reviews — Coup de cœur (style Airbnb)

   Layout-only defaults. Colors, typography, spacing, border-radius, and
   shadows are driven by Elementor's {{WRAPPER}} selectors via SharedControls.
   This CSS only defines the structural flexbox layout + sensible fallbacks
   for standalone shortcode usage (without Elementor).
   ========================================================================== */

/* ── Container ──────────────────────────────────────────────────────────── */
.sj-cdc {
    display: flex;
    align-items: center;
    /* Fallback defaults (overridden by Elementor when used as widget) */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 24px;
    color: #222;
    max-width: 100%;
    box-sizing: border-box;
    text-decoration: none;
}

/* ── Badge (col 1) ──────────────────────────────────────────────────────── */
.sj-cdc__badge {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.sj-cdc__badge-inner {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sj-cdc__leaf {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sj-cdc__leaf svg {
    display: block;
    height: 32px;
    width: auto;
    /* currentColor permet le contrôle de couleur via Elementor (leaf_color) */
    color: #222;
}

.sj-cdc__leaf img {
    display: block;
    height: 32px;
    width: auto;
    object-fit: contain;
}

.sj-cdc__badge-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    max-width: 90px;
    white-space: normal;
}

/* ── Description (col 2) ────────────────────────────────────────────────── */
.sj-cdc__desc {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    padding: 0 20px;
    border-left: 1px solid #e0e0e0;
    /* min-width évite l'écrasement sur écrans intermédiaires (Mac laptop) */
    min-width: 100px;
}

/* ── Stats (col 3) ──────────────────────────────────────────────────────── */
.sj-cdc__stats {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 1px solid #e0e0e0;
    padding-left: 20px;
}

.sj-cdc__rating-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sj-cdc__avg {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.sj-cdc__stars {
    display: flex;
    align-items: center;
}

.sj-cdc__stars-wrap {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.sj-cdc__stars-wrap svg {
    display: block;
}

/* Separator */
.sj-cdc__sep {
    width: 1px;
    height: 40px;
    background-color: #e0e0e0;
    flex-shrink: 0;
}

/* Count */
.sj-cdc__count-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sj-cdc__count {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.sj-cdc__count-label {
    font-size: 11px;
    font-weight: 500;
    color: #717171;
    margin-top: 2px;
}

/* ==========================================================================
   Layout variants — structural positioning only, no colors
   ========================================================================== */

/* ── Layout: stacked ────────────────────────────────────────────────────────
   Badge pleine largeur en haut → description + stats sur la même ligne dessous
   ┌─────────────────────────────────┐
   │         badge (100%)            │
   ├────────────────┬────────────────┤
   │  desc (flex)   │  note + count  │
   └────────────────┴────────────────┘
*/
.sj-cdc--stacked {
    flex-wrap: wrap;
    row-gap: 12px;
}

.sj-cdc--stacked .sj-cdc__badge {
    flex: 0 0 100%;
    justify-content: center;
}

.sj-cdc--stacked .sj-cdc__desc {
    flex: 1 1 auto;
    min-width: 0;
    border-left: none;
    padding-left: 0;
    padding-right: 20px;
}

.sj-cdc--stacked .sj-cdc__stats {
    flex: 0 0 auto;
}

/* ── Layout: vertical ───────────────────────────────────────────────────────
   Tout empilé verticalement, centré
   ┌──────────────────┐
   │      badge       │
   ├──────────────────┤
   │      desc        │
   ├──────────────────┤
   │  note | count    │
   └──────────────────┘
*/
.sj-cdc--vertical {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sj-cdc--vertical .sj-cdc__badge {
    width: 100%;
    justify-content: center;
}

.sj-cdc--vertical .sj-cdc__desc {
    width: 100%;
    border-left: none;
    padding: 0;
    text-align: center;
    min-width: 0;
}

.sj-cdc--vertical .sj-cdc__stats {
    border-left: none;
    padding-left: 0;
    justify-content: center;
}

/* ── Layout: split ──────────────────────────────────────────────────────────
   Colonne gauche : badge + description empilés
   Colonne droite : note + commentaires centrés
   ┌───────────────────┬──────────────┐
   │  badge            │              │
   │  desc (flex)      │  note+count  │
   └───────────────────┴──────────────┘
*/
.sj-cdc--split {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "badge stats"
        "desc  stats";
    align-items: stretch;
    column-gap: 20px;
    row-gap: 8px;
}

.sj-cdc--split .sj-cdc__badge {
    grid-area: badge;
    align-self: end;
}

.sj-cdc--split .sj-cdc__desc {
    grid-area: desc;
    border-left: none;
    padding-left: 0;
    min-width: 0;
    align-self: start;
}

.sj-cdc--split .sj-cdc__stats {
    grid-area: stats;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #e0e0e0;
    padding-left: 20px;
    gap: 8px;
}

.sj-cdc--split .sj-cdc__sep {
    width: 100%;
    height: 1px;
}

/* ==========================================================================
   Responsive — structural only (Elementor responsive controls handle the rest)
   ========================================================================== */

@media (max-width: 768px) {
    .sj-cdc {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .sj-cdc__desc {
        flex: 1 1 0;
        border-left: none;
        padding: 0;
        min-width: 120px;
    }

    .sj-cdc__stats {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e0e0e0;
        padding-top: 12px;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sj-cdc {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 14px;
    }

    .sj-cdc__desc {
        border-left: none;
        padding: 0;
        border-top: 1px solid #e0e0e0;
        padding-top: 10px;
    }

    .sj-cdc__stats {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e0e0e0;
        padding-top: 10px;
    }

    /* Stacked → déjà optimisé mobile, stats passe pleine largeur */
    .sj-cdc--stacked .sj-cdc__desc {
        flex: 0 0 100%;
        padding-right: 0;
    }

    .sj-cdc--stacked .sj-cdc__stats {
        border-left: none;
        padding-left: 0;
        width: 100%;
        justify-content: center;
    }

    /* Split → collapse en colonne */
    .sj-cdc--split {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sj-cdc--split .sj-cdc__desc {
        border-left: none;
        padding-left: 0;
    }

    .sj-cdc--split .sj-cdc__stats {
        border-left: none;
        padding-left: 0;
        flex-direction: row;
    }

    .sj-cdc--split .sj-cdc__sep {
        width: 1px;
        height: 40px;
    }
}
