/* =============================================================
   Block: Logo Bar
   Prefix: blk-logo-bar
   ============================================================= */

.blk-logo-bar {
    padding-block: clamp(2.5rem, 5vw, 4rem);
    background: var(--sd-color-gray-900);
}

.blk-logo-bar__inner {
    max-width: var(--sd-container-max);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sd-space-8);
}

/* ── Optional label ── */
.blk-logo-bar__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    text-align: center;
}

/* ── Logo list ── */
.blk-logo-bar__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 4vw, 4rem);
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.blk-logo-bar__item {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Link wrapper ── */
.blk-logo-bar__link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: var(--sd-radius-base);
    transition: opacity var(--sd-transition-base);
}

.blk-logo-bar__link:focus-visible {
    outline: 2px solid var(--sd-color-focus);
    outline-offset: 4px;
}

/* ── Logo image ── */
.blk-logo-bar__logo {
    display: block;
    max-width: 140px;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;

    /* Desaturate by default */
    filter: brightness(0) invert(1) opacity(0.4);
    transition:
        filter var(--sd-transition-base),
        transform var(--sd-transition-base);
}

.blk-logo-bar__item:hover .blk-logo-bar__logo,
.blk-logo-bar__link:focus-visible .blk-logo-bar__logo {
    /* Restore full colour on hover */
    filter: brightness(0) invert(1) opacity(0.85);
    transform: scale(1.05);
}

/* ── Light background variant ──────────────────────────────
   Apply .blk-logo-bar--light on the section element
   for a white/off-white background version.
   ─────────────────────────────────────────────────────── */
.blk-logo-bar--light {
    background: var(--sd-color-gray-50);
}

.blk-logo-bar--light .blk-logo-bar__label {
    color: var(--sd-color-gray-400);
}

.blk-logo-bar--light .blk-logo-bar__logo {
    /* On light background: desaturate to grey instead of white */
    filter: grayscale(1) opacity(0.45);
}

.blk-logo-bar--light .blk-logo-bar__item:hover .blk-logo-bar__logo,
.blk-logo-bar--light .blk-logo-bar__link:focus-visible .blk-logo-bar__logo {
    filter: grayscale(0) opacity(1);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .blk-logo-bar__list {
        gap: clamp(1.5rem, 6vw, 2.5rem);
    }

    .blk-logo-bar__logo {
        max-width: 100px;
        max-height: 36px;
    }
}

@media (max-width: 480px) {
    .blk-logo-bar__list {
        /* Force 2-3 column wrap on very small screens */
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--sd-space-6) var(--sd-space-4);
        justify-items: center;
    }

    .blk-logo-bar__logo {
        max-width: 80px;
        max-height: 30px;
    }
}
