/* aieo/brand-archive-hero — full-bleed hero with logo overlay. */

/* The theme's palette (11.3.3), on the block's own root, each with a fallback for a theme without it. The "pink" is
   the theme's second accent; text on it takes the page's background, 4.5:1 in both schemes. Text over the hero
   image stays white on the scrim. */
.aieo-brand-hero {
    --aieo-bh-pink: var(--wp--preset--color--accent-2, #c1272d);
    --aieo-bh-text: var(--wp--preset--color--fg, currentColor);
    --aieo-bh-bg: var(--wp--preset--color--bg, #fff);
    --aieo-bh-scrim: rgba(0, 0, 0, 0.45);
    position: relative;
    min-height: 320px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wp--preset--color--subtle, #f4f4f5) 0%, var(--aieo-bh-bg) 100%);
    color: var(--aieo-bh-text);
    margin: 0 0 24px;
    display: flex;
    align-items: flex-end;
    padding: 32px;
}
/* A dark ground under the photo (#111111, a colour of both palettes), as the archive hero's (11.3.3). */
.aieo-brand-hero.has-hero-image { color: #fff; background: #111111; }
.aieo-brand-hero.has-hero-image .aieo-brand-hero__title { color: #fff; }
.aieo-brand-hero.has-hero-image .aieo-brand-hero__count,
.aieo-brand-hero.has-hero-image .aieo-brand-hero__headline { color: rgba(255, 255, 255, 0.9); }

.aieo-brand-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.aieo-brand-hero__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.aieo-brand-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--aieo-bh-scrim) 100%);
}

.aieo-brand-hero__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.aieo-brand-hero__logo {
    width: 96px;
    height: 96px;
    background: #fff; /* light in both schemes: logos are drawn for a light ground (R9) */
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.aieo-brand-hero__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aieo-brand-hero__title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.aieo-brand-hero__headline {
    margin: 0;
    font-size: 1.1rem;
    max-width: 640px;
    line-height: 1.4;
}
.aieo-brand-hero__headline strong { font-weight: 700; color: var(--aieo-bh-pink); }
.aieo-brand-hero__headline em     { font-style: italic; }
.aieo-brand-hero.has-hero-image .aieo-brand-hero__headline strong { color: #fff; }

.aieo-brand-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.aieo-brand-hero__count { font-weight: 500; }

.aieo-brand-hero__rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.aieo-brand-hero__rating-stars {
    color: var(--aieo-bh-pink);
    letter-spacing: 1px;
    font-size: 14px;
}
.aieo-brand-hero__rating-meta { font-weight: 600; }
.aieo-brand-hero__rating-count {
    font-weight: 400;
    margin-left: 4px;
    opacity: 0.85;
}

.aieo-brand-hero__actions {
    margin-top: 4px;
    display: flex;
    gap: 8px;
}
/* ── Follow brand button (dedicated, no shared classes with the
       legacy AIEO_Wishlist heart). Uses local view.js for click. ──── */
.aieo-brand-follow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--aieo-bh-bg);
    color: var(--aieo-bh-text);
    border: 1.5px solid var(--aieo-bh-pink);
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: background-color 150ms ease, color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.aieo-brand-follow:hover {
    background: var(--aieo-bh-pink);
    color: var(--aieo-bh-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}
.aieo-brand-follow.is-in-list {
    background: var(--aieo-bh-pink);
    color: var(--aieo-bh-bg);
}
.aieo-brand-follow.is-loading { opacity: .65; cursor: wait; transform: none; }

.aieo-brand-follow__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    /* Reset line-height so the inline-flex span doesn't reserve baseline
     * descender space, which would push the SVG ~1–2px above the
     * uppercase text's visual centerline. */
    line-height: 0;
    color: var(--aieo-bh-pink);
    transition: color 150ms ease;
}
.aieo-brand-follow__icon svg {
    width: 100%;
    height: 100%;
    display: block;
    /* The heart path's bounding box (y≈5→21) sits ~0.5 SVG-units below
     * the viewBox geometric center (12), so its visual mass-center
     * lands below the icon span's flex-centered axis. Counter the
     * imbalance with a sub-pixel translate so the heart visually
     * aligns with the uppercase text's optical centerline. */
    transform: translateY(-0.5px);
}
/* Match label optical centering to the icon: uppercase letters have
 * empty descender space, which throws off `align-items: center` against
 * a glyph-shaped icon. Reset line-height + bump the label down half a
 * pixel so its optical center matches the icon's. */
.aieo-brand-follow__label {
    line-height: 1;
    transform: translateY(0.5px);
}

/* Default state: outline shown, fill hidden. */
.aieo-brand-follow .aieo-brand-follow__icon-fill { opacity: 0; transition: opacity 150ms ease; }

/* Hover state: the button paints the accent, the icon takes the text's colour on it. */
.aieo-brand-follow:hover .aieo-brand-follow__icon { color: var(--aieo-bh-bg); }

/* In-list state: filled heart, in the text's colour on the accent. */
.aieo-brand-follow.is-in-list .aieo-brand-follow__icon { color: var(--aieo-bh-bg); }
.aieo-brand-follow.is-in-list .aieo-brand-follow__icon-fill { opacity: 1; }
.aieo-brand-follow.is-in-list .aieo-brand-follow__icon-outline { stroke: var(--aieo-bh-bg); }

.aieo-brand-follow__label { white-space: nowrap; }

@media (max-width: 768px) {
    .aieo-brand-hero { padding: 24px 16px; min-height: 240px; }
    .aieo-brand-hero__logo { width: 72px; height: 72px; }
}

/* ── Brand archive sidebar + main column layout (used by the
       aieo/brand-archive-page pattern). Lives here so the rules ship
       with the brand-archive-hero block (which is always present on
       the page). ────────────────────────────────────────────────────── */

.aieo-brand-archive-cols {
    align-items: flex-start;
}
.aieo-brand-archive-sidebar {
    position: sticky;
    top: 80px;
    align-self: flex-start;
}
.aieo-brand-archive-main {
    min-width: 0;
}

/* Mobile-only condensed FiboFilters bar (placed above the columns in
   the pattern). Hidden on desktop where the vertical sidebar takes over. */
.aieo-brand-archive-mobile-bar {
    display: none;
}

@media (max-width: 1024px) {
    /* Sidebar drops to full-width and stops being sticky; child blocks
       (vertical filters + From-the-Blog) restack below the products.
       A stacked column must be ONE flex line. WordPress forces
       `flex-wrap:wrap !important` on columns below 782px, and a wrapping line
       is as wide as its widest item's minimum. One product image whose file
       is missing counts 3000px there (WordPress's sizes="auto" placeholder),
       so the product grid went 3000px wide on a phone. */
    .wp-block-columns.aieo-brand-archive-cols { flex-wrap: nowrap !important; flex-direction: column; }
    .aieo-brand-archive-sidebar {
        position: static;
        flex-basis: 100% !important;
        max-width: none !important;
        order: 2;       /* push sidebar below the products on mobile */
    }
    .aieo-brand-archive-main {
        flex-basis: 100% !important;
        order: 1;
    }
    /* Hide the desktop sidebar's fibofilters block; use the mobile one. */
    .aieo-brand-archive-sidebar > .wp-block-fibofilters-filters,
    .aieo-brand-archive-sidebar [class*="fibofilters-vertical-filters-container"] {
        display: none;
    }
    /* Show the mobile bar instead. */
    .aieo-brand-archive-mobile-bar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 30;
        background: var(--wp--preset--color--bg, #fff);
        margin: 0 -16px 12px;
        padding: 8px 16px;
        border-bottom: 1px solid var(--wp--preset--color--line, #dcdcdc);
    }
}
