/*
 * Blog — Post detail + Index (PBI #45225)
 * Self-contained styles scoped under .bp-article (post) and .bx-index (index).
 * Mirrors empty-cart-recos.css — inlines its own design tokens rather than
 * depending on a site-wide load of docs/design-system.css (not yet integrated).
 *
 * Visual reference: docs/design-system.css + docs/design-system/buydirect-order-history-redesign.html
 */

/* ── Shared tokens ────────────────────────────────────────────────────── */
.bp-article,
.bx-index {
    --bp-red:         #C4112F;
    --bp-red-hover:   #a50e27;
    --bp-red-light:   #FDF2F4;
    --bp-dark:        #262626;
    --bp-gray:        #666;
    --bp-gray-muted:  #888;
    --bp-gray-border: #e5e5e5;
    --bp-gray-bg:     #f8f8f8;
    --bp-gray-bg-2:   #f3f3f3;
    --bp-radius:      8px;
    --bp-radius-lg:   12px;
    --bp-shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --bp-shadow-md:   0 4px 16px rgba(0,0,0,0.10);

    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 5rem;
    color: var(--bp-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
}

/* ── Post: Hero ───────────────────────────────────────────────────────── */
.bp-article { max-width: 960px; }

.bp-hero {
    position: relative;
    border-radius: var(--bp-radius-lg);
    overflow: hidden;
    margin: 1.5rem 0 2.5rem;
    background: var(--bp-gray-bg-2);
}
.bp-hero-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.bp-hero-body {
    padding: 28px 32px 32px;
    background: #fff;
    border: 1px solid var(--bp-gray-border);
    border-top: none;
    border-bottom-left-radius: var(--bp-radius-lg);
    border-bottom-right-radius: var(--bp-radius-lg);
}
.bp-category {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    color: #fff;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
    background: var(--bp-red);
}
.bp-title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bp-dark);
    margin: 0 0 16px;
    letter-spacing: -0.3px;
}
.bp-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--bp-gray);
}
.bp-meta-sep { color: var(--bp-gray-border); }
.bp-meta-author { display: flex; align-items: center; gap: 10px; }
.bp-meta-author img {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--bp-gray-border);
}
.bp-meta-author .name { font-weight: 600; color: var(--bp-dark); font-size: 13px; }
.bp-meta-author .role { font-size: 12px; color: var(--bp-gray-muted); }

/* ── Post: Article body ───────────────────────────────────────────────── */
.bp-body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}
.bp-body p { margin: 0 0 1.25rem; }
.bp-body a { color: var(--bp-red); text-decoration: underline; text-underline-offset: 2px; }
.bp-body a:hover { color: var(--bp-red-hover); }
.bp-body h1,
.bp-body h2,
.bp-body h3,
.bp-body h4 {
    color: var(--bp-dark);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.bp-body h1 { font-size: 28px; margin: 2.25rem 0 1rem; }
.bp-body h2 { font-size: 24px; margin: 2rem 0 .9rem; }
.bp-body h3 { font-size: 20px; margin: 1.75rem 0 .75rem; }
.bp-body h4 { font-size: 17px; margin: 1.5rem 0 .6rem; }
.bp-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bp-radius);
    margin: 1.5rem 0;
    display: block;
}
.bp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bp-gray-border);
}
.bp-tag {
    font-size: 12px;
    color: var(--bp-gray);
    background: var(--bp-gray-bg);
    padding: 4px 10px;
    border-radius: 100px;
}

/* ── Post: Category CTA banner ────────────────────────────────────────── */
.bp-cta {
    margin: 3rem 0 2rem;
    padding: 28px 32px;
    background: linear-gradient(135deg, var(--bp-red) 0%, var(--bp-red-hover) 100%);
    border-radius: var(--bp-radius-lg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.bp-cta-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
}
.bp-cta-text p {
    font-size: 14px;
    margin: 0;
    opacity: 0.92;
}
.bp-cta-btn {
    padding: 12px 26px;
    background: #fff;
    color: var(--bp-red);
    border-radius: var(--bp-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s ease;
}
.bp-cta-btn:hover { background: var(--bp-red-light); transform: translateY(-1px); box-shadow: var(--bp-shadow-md); }

/* ── Post: Trending product grid ──────────────────────────────────────── */
.bp-trending { margin: 3rem 0 1rem; }
.bp-trending-header { margin-bottom: 20px; }
.bp-trending-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--bp-dark);
}
.bp-trending-subtitle {
    font-size: 13px;
    color: var(--bp-gray);
    margin: 0;
}
.bp-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.bp-card {
    border: 1px solid var(--bp-gray-border);
    border-radius: var(--bp-radius-lg);
    background: #fff;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--bp-dark);
    overflow: hidden;
    transition: all .15s ease;
}
.bp-card:hover { box-shadow: var(--bp-shadow-md); transform: translateY(-2px); text-decoration: none; }
.bp-card-img {
    aspect-ratio: 1;
    background: var(--bp-gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
}
.bp-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-card-oos {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    color: var(--bp-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bp-card-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.bp-card-brand {
    font-size: 10px;
    color: var(--bp-gray-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bp-card-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--bp-dark);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bp-card-prices { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.bp-card-price { font-size: 16px; font-weight: 700; color: var(--bp-red); }
.bp-card-msrp { font-size: 12px; color: var(--bp-gray-muted); text-decoration: line-through; }
.bp-card-btn {
    margin-top: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--bp-red);
    background: #fff;
    color: var(--bp-red);
    border-radius: var(--bp-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.bp-card-btn:hover:not(:disabled) { background: var(--bp-red-light); }
.bp-card-btn:disabled { border-color: var(--bp-gray-border); color: var(--bp-gray-muted); cursor: not-allowed; }

/* ── Post: Klaviyo email capture ──────────────────────────────────────── */
.bp-newsletter {
    margin: 3rem 0 1rem;
    padding: 28px 32px;
    background: var(--bp-gray-bg);
    border-radius: var(--bp-radius-lg);
    text-align: center;
}
.bp-newsletter h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--bp-dark);
}
.bp-newsletter p {
    font-size: 14px;
    color: var(--bp-gray);
    margin: 0 0 16px;
}
/* The div.klaviyo-form-* element is hydrated by the Klaviyo onsite JS loaded in _Layout. */

/* ── Index: List page ─────────────────────────────────────────────────── */
.bx-index-header { margin: 1.5rem 0 2rem; }
.bx-index-header h1 {
    font-size: 30px;
    font-weight: 700;
    margin: 0;
    color: var(--bp-dark);
    letter-spacing: -0.3px;
}
.bx-featured { margin-bottom: 2.5rem; }
.bx-featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    border: 1px solid var(--bp-gray-border);
    border-radius: var(--bp-radius-lg);
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: var(--bp-dark);
    transition: all .15s ease;
}
.bx-featured-card:hover { box-shadow: var(--bp-shadow-md); text-decoration: none; }
.bx-featured-img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 340px;
}
.bx-featured-body { padding: 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.bx-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.bx-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    color: #fff;
    letter-spacing: 0.3px;
}
.bx-badge-tag { background: #0c2340; }
.bx-featured-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--bp-dark);
    line-height: 1.25;
}
.bx-date { font-size: 12px; color: var(--bp-gray-muted); }
.bx-excerpt { font-size: 14px; color: var(--bp-gray); line-height: 1.55; }
.bx-author { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; }
.bx-author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--bp-gray-border); }
.bx-author .name { font-size: 13px; font-weight: 600; }
.bx-author .role { font-size: 12px; color: var(--bp-gray-muted); }

.bx-section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--bp-dark);
}
.bx-section-title small { font-size: 14px; font-weight: 400; color: var(--bp-gray-muted); margin-left: 8px; }
.bx-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.bx-card {
    border: 1px solid var(--bp-gray-border);
    border-radius: var(--bp-radius-lg);
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: var(--bp-dark);
    display: flex;
    flex-direction: column;
    transition: all .15s ease;
}
.bx-card:hover { box-shadow: var(--bp-shadow-md); transform: translateY(-2px); text-decoration: none; }
.bx-card-img {
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bp-gray-bg);
}
.bx-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bx-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--bp-dark);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bx-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--bp-gray-muted);
    margin-top: auto;
    padding-top: 8px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .bp-product-grid { grid-template-columns: repeat(3, 1fr); }
    .bx-grid { grid-template-columns: repeat(3, 1fr); }
    .bp-title { font-size: 28px; }
}
@media (max-width: 768px) {
    .bp-article,
    .bx-index { padding: 0 16px 3rem; }
    .bp-product-grid { grid-template-columns: repeat(2, 1fr); }
    .bx-grid { grid-template-columns: repeat(2, 1fr); }
    .bp-hero-body { padding: 20px 22px 24px; }
    .bp-title { font-size: 24px; }
    .bp-cta { padding: 22px; }
    .bp-cta-text h3 { font-size: 18px; }
    .bx-featured-card { grid-template-columns: 1fr; }
    .bx-featured-img { min-height: 220px; }
    .bx-featured-body { padding: 22px; }
    .bx-featured-title { font-size: 20px; }
    .bx-index-header h1 { font-size: 24px; }
    .bp-body { font-size: 15px; }
}
@media (max-width: 480px) {
    .bp-product-grid { grid-template-columns: 1fr; }
    .bx-grid { grid-template-columns: 1fr; }
}
