/* =============================================
   HERITAGE BRANDS BLOCK
   Standalone, byte-for-byte copy of the home page section-6 hscroll.
   The home version lives (unscoped) in assets/css/app.css; this block
   reuses the SAME `.hscroll-*` class names and the SAME values, scoped
   under `.heritage-brands` so it is self-contained (the editor only loads
   design-system.css + editor.css, not app.css) and never collides with
   the home's global rules. Reference = the home; keep them in sync.
   ============================================= */

.heritage-brands {
    position: relative;
    width: 100%;
    color: var(--color-white, #fff);
    overflow: hidden;
}

/* Cards behave like links on the home (section-6 .hscroll-card). */
.heritage-brands .hscroll-card {
    cursor: pointer;
}

/* The track grows beyond the section; GSAP translates it on scroll, and
   `.heritage-brands { overflow:hidden }` clips it (mirrors .section-6). */
.heritage-brands .hscroll-track {
    display: flex;
    align-items: center;
    gap: 6vw;
    height: 100vh;
    width: max-content;
    padding: 60px 30vw 0 14vw;
    will-change: transform;
}

.heritage-brands .hscroll-cards {
    display: contents;
}

/* ── Intro panel (left side) ─────────────────────── */
.heritage-brands .hscroll-intro {
    flex-shrink: 0;
    width: 45vw;
    min-width: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 6vw;
}

.heritage-brands .hscroll-title {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-black);
    font-size: var(--font-size-h2);
    line-height: var(--line-height-heading);
    color: var(--color-white);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateX(-60px);
}

/* Words wrapped in *asterisks* in the admin become this gold accent
   (`<span class="gold">`, same as the home). */
.heritage-brands .hscroll-title .gold,
.heritage-brands .hscroll-title em {
    color: var(--gold);
    font-style: normal;
}

.heritage-brands .hscroll-text {
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-body);
    line-height: var(--line-height-copy);
    color: var(--color-white);
    margin-bottom: 1.5rem;
    max-width: 500px;
    opacity: 0;
    transform: translateX(-40px);
}

.heritage-brands .hscroll-text p {
    margin: 0;
}

.heritage-brands .hscroll-text p + p {
    margin-top: 1em;
}

.heritage-brands .hscroll-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-30px);
}

.heritage-brands .hscroll-cols p {
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-body);
    line-height: var(--line-height-copy);
    color: var(--color-white);
    margin: 0;
}

.heritage-brands .hscroll-cols p + p {
    margin-top: 1em;
}

.heritage-brands .hscroll-cta {
    opacity: 0;
    transform: translateX(-30px);
}

.heritage-brands .hscroll-cta a {
    display: inline-block;
    padding: var(--button-padding);
    font-size: var(--font-size-button);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-button);
    border-radius: var(--button-radius);
    background: var(--gold);
    color: var(--dark-blue);
    border: 1px solid var(--gold);
    text-decoration: none;
    transition: var(--transition-standard);
}

.heritage-brands .hscroll-cta a:hover {
    background: transparent;
    color: var(--gold);
}

/* ── Brand cards: full-bleed image, blue tint, no border-radius --- */
.heritage-brands .hscroll-card {
    flex-shrink: 0;
    width: 335px;
    height: 430px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-white);
    will-change: transform;
    transition: var(--transition-transform-medium);
    border-radius: var(--card-radius);
    border: none!important;
}

.heritage-brands .hscroll-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    border: 1px solid rgba(var(--color-gold-rgb), 0.25);
}

/* Full-bleed background image — jumbotron-style filter */
.heritage-brands .hscroll-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: var(--transition-filter);
}

/* Blue overlay via pseudo-element */
.heritage-brands .hscroll-card-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--color-dark-blue-rgb), 0.7);
    transition: var(--transition-background-soft);
}

.heritage-brands .hscroll-card:hover .hscroll-card-img {
    filter: grayscale(30%) contrast(1.05);
}

.heritage-brands .hscroll-card:hover .hscroll-card-img::after {
    background: rgba(var(--color-dark-blue-rgb), 0.15);
}

/* White overlay variant — selected via the block's "Cards Filter Color" field. */
.heritage-brands--filter-white .hscroll-card-img::after {
    background: rgba(var(--color-white-rgb), 0.6);
}

.heritage-brands--filter-white .hscroll-card:hover .hscroll-card-img::after {
    background: rgba(var(--color-white-rgb), 0.15);
}

/* On the white overlay, card text turns dark blue for contrast. */
.heritage-brands--filter-white .hscroll-card-name,
.heritage-brands--filter-white .hscroll-card-desc {
    color: var(--color-dark-blue) !important;
}

/* Card content overlaid on the image */
.heritage-brands .hscroll-card-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 2rem 1.8rem;
}

/* Logo: centered horizontally and vertically at top of card */
.heritage-brands .hscroll-card-logo {
    width: auto;
    max-width: 80%;
    object-fit: contain;
    align-self: center;
    flex: 1;
    display: block;
    margin: auto 0;
    transition: var(--transition-opacity);
}

.heritage-brands .hscroll-card:hover .hscroll-card-logo {
    opacity: 1;
}

/* Text group at bottom */
.heritage-brands .hscroll-card-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.heritage-brands .hscroll-card-name {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md-2);
    color: var(--color-white);
    margin: 0;
}

/* *word* in the card title becomes gold (matches the intro title). */
.heritage-brands .hscroll-card-name .gold,
.heritage-brands .hscroll-card-name em {
    color: var(--gold);
    font-style: normal;
}

.heritage-brands .hscroll-card-desc {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-copy-snug);
    color: rgba(var(--color-white-rgb), 0.92);
    margin: 0;
}

/* CTA button below the card text — uses the card link's text. The whole card
   is the <a>, so this is a styled <span> (no nested anchor); clicking it still
   follows the card link. */
.heritage-brands .hscroll-card-cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: var(--space-xs);
    padding: 0.6rem 1.1rem;
    font-family: var(--font-family-base);
    font-size: var(--font-size-button);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-button);
    line-height: var(--line-height-flat);
    border-radius: var(--button-radius);
    background: var(--gold);
    color: var(--dark-blue);
    border: 1px solid var(--gold);
    transition: var(--transition-standard);
}

/* Hover state triggers on the button only, not the whole card. */
.heritage-brands .hscroll-card-cta:hover {
    background: transparent;
    color: var(--gold);
}

/* --- Fixed 'See all' button bottom-right --- */
.heritage-brands .hscroll-see-all {
    position: absolute;
    bottom: 30px;
    right: 3rem;
    z-index: 20;
    display: inline-block;
    padding: var(--button-padding-sm);
    font-size: var(--font-size-button);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-button);
    border-radius: var(--button-radius);
    text-decoration: none;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    transition: var(--transition-standard);
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
}

.heritage-brands .hscroll-see-all:hover {
    background: var(--gold);
    color: var(--dark-blue);
}

/* --- Staggered vertical positions (destructured look) --- */
.heritage-brands .hscroll-card-1 { transform: translateY(-30px); }
.heritage-brands .hscroll-card-2 { transform: translateY(40px); }
.heritage-brands .hscroll-card-3 { transform: translateY(-15px); }
.heritage-brands .hscroll-card-4 { transform: translateY(55px); }
.heritage-brands .hscroll-card-5 { transform: translateY(-40px); }
.heritage-brands .hscroll-card-6 { transform: translateY(25px); }
.heritage-brands .hscroll-card-7 { transform: translateY(-20px); }

/* ==========================================
   RESPONSIVE — Mobile carousel
   (mirrors the home's `.section-6 .hscroll-*` mobile rules)
   ========================================== */
@media (max-width: 1023px) {
    .heritage-brands {
        padding: 0;
        overflow: visible;
    }

    .heritage-brands .hscroll-intro {
        width: 100% !important;
        min-width: 0;
        padding: var(--section-padding-mobile) 0 !important;
    }

    .heritage-brands .hscroll-track {
        display: flex;
        flex-wrap: wrap;
        padding: 0 !important;
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        height: auto;
        gap: var(--space-xl);
        overflow: visible;
        transform: none !important;
    }

    .heritage-brands .hscroll-cards {
        display: flex;
        width: 100%;
        max-width: 100vw;
        gap: 1.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 1.5rem var(--space-sm);
        scroll-padding-inline: 1.5rem;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        box-sizing: border-box;
    }

    .heritage-brands .hscroll-cards::-webkit-scrollbar {
        display: none;
    }

    .heritage-brands .hscroll-card {
        flex: 0 0 min(72vw, 300px);
        transform: none !important;
        width: auto;
        height: 360px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .heritage-brands .hscroll-title,
    .heritage-brands .hscroll-text,
    .heritage-brands .hscroll-cols,
    .heritage-brands .hscroll-cta {
        opacity: 1;
        transform: none !important;
    }

    .heritage-brands .hscroll-title {
        font-size: var(--font-size-xl-2);
        margin-bottom: 1rem;
    }

    .heritage-brands .hscroll-cols {
        grid-template-columns: 1fr;
    }

    .heritage-brands .hscroll-see-all {
        position: static;
        display: block;
        width: calc(100% - 3rem);
        text-align: center;
        margin: 1.5rem auto 4rem;
        pointer-events: auto;
    }
}

@media (max-width: 600px) {
    .heritage-brands .hscroll-card {
        flex-basis: min(72vw, 300px);
        width: auto;
    }
}

@media (max-width: 450px) {
    .heritage-brands .hscroll-cols {
        display: flex;
        flex-direction: column;
    }
}

/* ==========================================
   Editor preview tweaks
   No pin/JS in the editor, so force the reveal-from-hidden elements
   visible and let the track lay out without the pinned 100vh behavior.
   ========================================== */
.wp-block[data-type="acf/heritage-brands"] .hscroll-track {
    height: auto;
    flex-wrap: wrap;
    padding: 2rem;
}

.wp-block[data-type="acf/heritage-brands"] .hscroll-title,
.wp-block[data-type="acf/heritage-brands"] .hscroll-text,
.wp-block[data-type="acf/heritage-brands"] .hscroll-cols,
.wp-block[data-type="acf/heritage-brands"] .hscroll-cta,
.wp-block[data-type="acf/heritage-brands"] .hscroll-card,
.wp-block[data-type="acf/heritage-brands"] .hscroll-see-all {
    opacity: 1 !important;
    transform: none !important;
}

.wp-block[data-type="acf/heritage-brands"] .hscroll-see-all {
    position: static;
    margin-top: 1.5rem;
}
