/* aieo/brand-related — BRAND-SPECIFIC rules only.
 *
 * Article-card + vertical-layout rules (the bits this block shares with
 * `aieo/taxonomy-related-articles`) live in
 *   wp-content/plugins/ai-eshop-optimizer/assets/css/aieo-article-cards.css
 * and load via the shared `aieo-article-cards` style handle (registered
 * in AIEO_Blocks_Loader, referenced from this block's block.json
 * `viewStyle` array). When the brand archive renders, BOTH stylesheets
 * load — this one for the brand-only chips + other-brands strip, and
 * the shared one for article cards.
 *
 * On the category / need / tag archives only the shared file loads —
 * those archives have no chips or other-brands strip.
 */

/* ── Category chips — rectangular pink-outlined buttons matching the
       category/subcategory selector elsewhere on the site. ─────────── */

.aieo-brand-related__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: flex-start;
}
.aieo-brand-related__chip a {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 6px;
    border: 1.5px solid #F46767;
    background: #fff;
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color 150ms ease, color 150ms ease, transform 120ms ease;
}
.aieo-brand-related__chip a:hover {
    background: #F46767;
    color: #fff;
    transform: translateY(-1px);
}
/* Promoted/active chip variant — caller adds .is-active to the <li>. */
.aieo-brand-related__chip.is-active a {
    background: #F46767;
    color: #fff;
}

/* ── Other brands strip ───────────────────────────────────────── */

.aieo-brand-related__brand-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.aieo-brand-related__brand-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #1f2937;
    text-decoration: none;
    background: #fff;
    transition: border-color 120ms ease, transform 120ms ease;
}
.aieo-brand-related__brand-card a:hover {
    border-color: #F46767;
    transform: translateY(-1px);
}
.aieo-brand-related__brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f9fafb;
    border-radius: 4px;
    overflow: hidden;
}
.aieo-brand-related__brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.aieo-brand-related__brand-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
}

/* ── Vertical layout brand-strip overrides ───────────────────────── */

.aieo-brand-related--vertical .aieo-brand-related__brand-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aieo-brand-related--vertical .aieo-brand-related__brand-card a {
    flex-direction: row;
    align-items: center;
    padding: 8px;
}
.aieo-brand-related--vertical .aieo-brand-related__brand-logo {
    flex: 0 0 56px;
    width: 56px;
    aspect-ratio: 1 / 1;
}

/* ── Mobile: chips + brand-strip full-width when sidebar collapses. ── */

@media (max-width: 1024px) {
    .aieo-brand-related__chips,
    .aieo-brand-related__brand-strip {
        width: 100%;
    }
    .aieo-brand-related--vertical .aieo-brand-related__brand-card a {
        width: 100%;
    }
    .aieo-brand-related__chips { gap: 10px; }
    .aieo-brand-related__chip { flex: 1 1 calc(50% - 10px); }
    .aieo-brand-related__chip a {
        display: block;
        text-align: center;
        padding: 12px 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .aieo-brand-related__chip { flex: 1 1 100%; }
}
