/* bravo-heroes-gallery — Elementor Widget
   Camadas (baixo → cima):
     1. Item background  (cor/gradiente Elementor — editável)
     2. .bsh-img  z-index:1  (foto à frente do gradiente)
     3. .bsh-panel z-index:2  (texto à frente de tudo)

   Desktop ≥1024px : todos visíveis, hover expande
   Tablet 768–1023px : 3 por página, hover expande, pontos de nav
   Mobile <768px    : 1 por página, pontos de nav
*/

/* ── Root ──────────────────────────────────────────────────── */
.bsh-root {
    font-family: inherit;
    width: 100%;
}

/* ── Track ─────────────────────────────────────────────────── */
.bsh-track {
    display: flex;
    gap: 10px;
    height: 400px;
    align-items: stretch;
}

/* ── Item — estado base (colapsado) ────────────────────────── */
.bsh-item {
    flex-grow: 0.5;
    flex-shrink: 1;
    flex-basis: 0;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-color: #1a1a2e;
    position: relative;
    filter: grayscale(100%);
    -webkit-user-select: none;
    user-select: none;
    transition: flex-grow 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                filter 0.4s ease;
}

.bsh-item--hidden {
    display: none !important;
}

/* ── Hover CSS puro (funciona sem JS) ──────────────────────── */
@media (hover: hover) {
    /* Expande o item hovado */
    .bsh-item:hover {
        flex-grow: 3 !important;
        filter: grayscale(0%) !important;
        cursor: default;
    }

    /* Colapsa o item ativo quando outro está a ser hovado */
    .bsh-track:hover .bsh-item.is-active:not(:hover) {
        flex-grow: 0.5;
        filter: grayscale(100%);
    }

    /* Esconde o texto no item ativo quando ele colapsa por hover */
    .bsh-track:hover .bsh-item.is-active:not(:hover) .bsh-panel {
        opacity: 0 !important;
        transition-delay: 0s;
    }
}

/* ── Estado ativo (JS — persiste após hover) ───────────────── */
.bsh-item.is-active {
    flex-grow: 3;
    cursor: default;
    filter: grayscale(0%);
}

/* ── Imagem — layer 1 (à frente do background do item) ─────── */
.bsh-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
    z-index: 1 !important;
    pointer-events: none;
    transition: filter 0.4s ease;
}

/* ── Panel — layer 2 (texto à frente da imagem) ────────────── */
/*
  Transparente por defeito — usa o panel_bg do Elementor
  para o gradiente de legibilidade sobre a foto.
  opacity:0 quando colapsado, opacity:1 quando ativo ou hovado.
*/
.bsh-panel {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    box-sizing: border-box;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bsh-item.is-active .bsh-panel,
.bsh-item:hover .bsh-panel {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.2s;
}

/* ── Name ──────────────────────────────────────────────────── */
.bsh-name {
    display: block;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 8px;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

/* ── Quote ─────────────────────────────────────────────────── */
.bsh-quote {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-style: italic;
    line-height: 1.55;
    max-width: 280px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* ── Dots ──────────────────────────────────────────────────── */
.bsh-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    min-height: 16px;
}

.bsh-dot {
    all: unset;
    display: inline-block;
    box-sizing: border-box;
    width: 8px !important;
    height: 8px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: #D1D5DB !important;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.bsh-dot.is-active {
    background: #201d49 !important;
}

/* ── Tablet (768px–1023px) ─────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1279px) {
    .bsh-track {
        height: 360px;
    }
}

/* ── Mobile (<768px) ───────────────────────────────────────── */
@media (max-width: 767px) {
    .bsh-track {
        height: 460px;
    }

    .bsh-item {
        flex-grow: 1 !important;
        flex-basis: 100% !important;
        border-radius: 12px;
        cursor: default;
        filter: grayscale(0%) !important;
    }

    .bsh-panel {
        opacity: 1 !important;
        pointer-events: auto;
        transition: none;
        transition-delay: 0s;
    }

    .bsh-name {
        white-space: normal;
        font-size: 18px;
    }

    .bsh-quote {
        max-width: none;
        font-size: 15px;
    }
}
