/* =============================================================
   Brand Accordion — Frontend CSS
   Variables injectées via shortcode : --ba-radius, --ba-accent, --ba-logo-h-base
============================================================= */

.ba-accordion-wrap {
    --ba-radius:      10px;
    --ba-accent:      #000;
    --ba-logo-h-base: 60px;
    /* Hauteur logo responsive : fixe sur desktop, réduit proportionnellement sur mobile */
    --ba-logo-h: clamp(
        calc(var(--ba-logo-h-base) * 0.65),
        calc(var(--ba-logo-h-base) * 0.65 + (var(--ba-logo-h-base) - var(--ba-logo-h-base) * 0.65) * ((100vw - 360px) / (1200px - 360px))),
        var(--ba-logo-h-base)
    );
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
}

/* Item wrapper */
.ba-item {
    border: 1px solid #e5e7eb;
    border-radius: var(--ba-radius);
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow .2s;
}
.ba-item.ba-open {
    border-color: var(--ba-accent);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Header (bouton logo) — pas de changement de fond au survol */
.ba-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: none;
    cursor: pointer;
    text-align: left;
}

/* Logo — hauteur fixe pilotée par --ba-logo-h (responsive via clamp) */
.ba-logo {
    height: var(--ba-logo-h);
    max-width: 220px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.ba-logo-fallback {
    height: var(--ba-logo-h);
    display: flex;
    align-items: center;
    font-size: clamp(13px, 2vw, 18px);
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: .02em;
    flex-shrink: 0;
}

/* Chevron */
.ba-chevron {
    width: 22px;
    height: 22px;
    color: #9ca3af;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform .25s cubic-bezier(.4,0,.2,1), color .15s;
}
.ba-item.ba-open .ba-chevron {
    transform: rotate(180deg);
    color: var(--ba-accent);
}

/* Corps */
.ba-body {
    border-top: 1px solid #e5e7eb;
}
.ba-item.ba-open .ba-body {
    border-color: var(--ba-accent);
}
.ba-body-inner {
    padding: 20px;
}

/* Grille d'images */
.ba-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.ba-images img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: calc(var(--ba-radius) - 2px);
    display: block;
}

/* Texte */
.ba-text {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 16px;
}
.ba-text p:last-child { margin-bottom: 0; }

/* Bouton */
.ba-btn-wrap { margin-top: 4px; }
.ba-btn {
    display: inline-block;
    text-decoration: none !important;
    transition: background .15s, color .15s, transform .1s;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    .ba-body-inner { padding: 14px; }
    .ba-header     { padding: 12px 14px; }
    .ba-images     { grid-template-columns: 1fr 1fr; }
}

/* Contenu HTML riche (Quill) */
.ba-text img {
    max-width: 100%;
    height: auto;
    border-radius: calc(var(--ba-radius) - 2px);
    display: block;
    margin: 8px 0;
}
.ba-text a           { color: var(--ba-accent); text-decoration: underline; }
.ba-text a:hover     { opacity: .8; }
.ba-text ul,
.ba-text ol          { padding-left: 1.4em; margin-bottom: 12px; }
.ba-text li          { margin-bottom: 4px; }
.ba-text strong      { font-weight: 700; }
.ba-text em          { font-style: italic; }
.ba-text p           { margin-bottom: 8px; }
.ba-text p:last-child{ margin-bottom: 0; }
