/* ==========================================================================
   Brands Block — navy section + grid of brand cards that glow and swap to a
   colour logo on hover.
   ========================================================================== */

.section.brands {
    padding-top: 64px;
    padding-bottom: 64px;
    background: var(--color-card-navy);
}

/* ---- Header ------------------------------------------------------------- */
.brands-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}
.brands-intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
}
.brands-eyebrow {
    align-self: flex-start;
    font-family: var(--font-heading);
    font-size: var(--text-label-xs);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-foreground);
    background: #EEF2F8;
    padding: 7px 14px 6px;
    clip-path: polygon(1.8% 0, 100% 0, 98.2% 100%, 0% 100%);
}
.brands-heading { margin: 0; color: var(--color-background); }
.brands-subcopy { margin: 0; color: var(--color-background); }

/* Layout only — colours/padding/hover come from the global .btn .btn-accent */
.brands-btn { flex-shrink: 0; }

/* ---- Grid --------------------------------------------------------------- */
.brands-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.brands-item { display: flex; }

/* ---- Card --------------------------------------------------------------- */
.brands-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    background: var(--color-card-navy);
    border: 1px solid rgba(245, 245, 245, 0.2);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.brands-card:hover,
.brands-card:focus-visible {
    background: var(--color-secondary);
    border-color: var(--color-border);
    box-shadow: 0 0 50px rgba(65, 143, 222, 0.6);
    transform: translateY(-2px);
}
.brands-card:focus-visible { outline: none; }

/* Logo box */
.brands-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80px;
    border-radius: 3px;
    border: 1.3px solid rgba(245, 245, 245, 0.2);
    background: var(--color-card-navy);
    overflow: hidden;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.brands-card:hover .brands-logo,
.brands-card:focus-visible .brands-logo {
    background: var(--color-secondary);
    border-color: var(--color-border);
}
.brands-logo-default {
    max-width: 76%;
    max-height: 58%;
    object-fit: contain;
    /* Black-and-white (light) on the dark card; full colour on hover */
    filter: grayscale(1) invert(1) brightness(2);
    transition: filter 0.25s ease;
}
.brands-card:hover .brands-logo-default,
.brands-card:focus-visible .brands-logo-default {
    filter: none;
}
.brands-logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
    color: var(--color-background);
    transition: color 0.25s ease;
}
.brands-card:hover .brands-logo-text,
.brands-card:focus-visible .brands-logo-text { color: var(--color-foreground); }

/* Card content */
.brands-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.brands-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.brands-card-name {
    font-family: var(--font-heading);
    font-size: var(--text-label-lg);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-background);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.25s ease;
}
.brands-card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-foreground);
    font-size: 12px;
}
.brands-card-desc {
    font-family: var(--font-body);
    font-size: var(--text-paragraph-sm);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--color-brand-gray);
    transition: color 0.25s ease;
}
.brands-card:hover .brands-card-name,
.brands-card:focus-visible .brands-card-name { color: var(--color-foreground); }
.brands-card:hover .brands-card-desc,
.brands-card:focus-visible .brands-card-desc { color: var(--color-secondary-foreground); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .brands-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 991px) {
    .brands-header { flex-direction: column; align-items: flex-start; gap: 20px; }
    .brands-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile (<768px): the grid is replaced by a Slick swipe slider (see script.js).
   One card per view with a peek of the next; the track bleeds to the screen's
   right edge. Card styling is unchanged. */
@media (max-width: 767px) {
    .section.brands { overflow: hidden; }

    /* extend the track to the right viewport edge so the peek reaches it */
    .brands-grid { margin-right: calc(50% - 50vw); }
    .brands-grid.slick-slider { display: block; }
    .brands-grid .slick-track { display: flex; }
    .brands-grid .slick-slide { height: auto; }

    .brands-item {
        width: min(80vw, 320px);
        padding-right: 16px;
        box-sizing: border-box;
    }
    .brands-card { height: 100%; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .brands-card,
    .brands-logo,
    .brands-logo-default,
    .brands-logo-hover,
    .brands-card-name,
    .brands-card-desc { transition: none; }
    .brands-card:hover { transform: none; }
}
