/* Beauty Roundup Builder - Frontend post styles
 * Card design emulates The Zoe Report / Bustle layout:
 *  - White card background with soft drop shadow
 *  - Image at top
 *  - Short product title in serif
 *  - Amazon logo + "See price on Amazon" row
 *  - Thin divider
 *  - Black pill "See On Amazon" button (full width)
 */

.brb-disclosure {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
    margin: 0 0 1.5rem;
    text-align: center;
}

/* === MOBILE HERO ===
 * Bustle/Zoe Report style: split image of first two products at top,
 * followed by article title and angle. Hidden on desktop (theme renders
 * its own page header). Shows only on mobile widths.
 */
.brb-hero {
    display: none; /* hidden by default - shown only on mobile */
}

@media (max-width: 767px) {
    .brb-hero {
        display: block;
        margin: 0 -1rem 2rem; /* edge-to-edge on mobile */
        padding: 0 1rem 1.5rem;
        border-bottom: 1px solid #eee;
    }
    .brb-hero-images {
        display: flex;
        gap: 0;
        width: calc(100% + 2rem);
        margin: 0 -1rem 1.5rem;
        aspect-ratio: 2 / 1;
        overflow: hidden;
    }
    .brb-hero-img {
        flex: 1 1 50%;
        overflow: hidden;
        background: #f5f5f5;
        position: relative;
    }
    .brb-hero-img img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    /* If only one image is available, let it span full width */
    .brb-hero-images:has(.brb-hero-img:only-child) .brb-hero-img {
        flex: 1 1 100%;
    }
    .brb-hero-title {
        font-family: Georgia, "Times New Roman", serif;
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.2;
        color: #1a1a1a;
        margin: 0 0 0.75rem;
        padding: 0;
    }
    .brb-hero-angle {
        font-size: 1rem;
        line-height: 1.45;
        color: #555;
        margin: 0;
        font-style: normal;
    }
}

.brb-intro {
    margin-bottom: 2.5rem;
}

.brb-item-heading {
    margin: 3.5rem 0 1.25rem;
}

.brb-item-heading .brb-item-number {
    display: inline-block;
    margin-right: 0.4rem;
    color: #c73a4a;
    font-weight: 700;
}

/* The entire card is one <a> tag - clicking anywhere goes to Amazon */
a.brb-card,
.brb-card {
    display: block;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 1.5rem 1.25rem 1.25rem;
    margin: 0 auto 1.75rem;
    max-width: 460px;
    width: 100%;                /* Take up to max-width but never exceed container */
    overflow: hidden;           /* Final safety: clip anything that breaks out */
    text-align: center;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

a.brb-card:hover,
.brb-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    text-decoration: none !important;
    color: inherit !important;
}

a.brb-card:focus,
.brb-card:focus {
    outline: 2px solid #131921;
    outline-offset: 2px;
    text-decoration: none !important;
    color: inherit !important;
}

a.brb-card:visited,
.brb-card:visited {
    color: inherit !important;
}

/* Force inner spans to behave like block-level so they stack vertically.
 * Spans used inside <a> instead of divs to avoid wpautop issues. */
.brb-card-image,
.brb-card-name,
.brb-card-logo-row,
.brb-card-divider,
.brb-card-price,
.brb-card-btn {
    display: block;
    box-sizing: border-box;  /* Critical: padding counts INSIDE width, not added to it */
    max-width: 100%;          /* Belt-and-suspenders: never exceed parent */
}

/* Apply box-sizing globally inside the card for safety */
.brb-card,
.brb-card * {
    box-sizing: border-box;
}

.brb-card-image {
    width: 100%;
    margin: 0 auto 1rem;
    background: #fff;
}

.brb-card-image img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Short product title - serif, bold, like Bustle */
.brb-card-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0 auto 1rem;
    text-align: center;
    max-width: 360px;
}

/* The row containing Amazon logo on left and "See price on Amazon" text on right */
.brb-card-logo-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.875rem;
    padding: 0 0.25rem;
}

.brb-card-logo {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
}

.brb-card-logo img {
    max-height: 22px;
    max-width: 100px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.brb-card-price-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a1a1a;
    text-align: right;
    flex: 1 1 auto;
}

/* Fallback price display when no logo */
.brb-card-price {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.875rem;
    text-align: center;
}

/* Thin horizontal divider */
.brb-card-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 0.5rem 0 1rem;
    border: 0;
}

/* Full-width black pill button */
.brb-card-btn {
    /* Override the block rule above for buttons */
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    background: #131921;
    color: #fff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 0.9375rem;       /* slightly smaller so it fits comfortably */
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    text-transform: none;
    padding: 0.875rem 1rem;     /* tighter horizontal padding (was 1.5rem) */
    border-radius: 999px;
    border: none;
    line-height: 1.2;
    transition: background 0.15s ease;
    margin: 0;
    white-space: nowrap;        /* keep "See on Amazon →" on one line */
}

a.brb-card:hover .brb-card-btn,
.brb-card:hover .brb-card-btn {
    background: #2a3142;
}

.brb-arrow {
    display: inline-block;
    font-weight: 400;
    font-size: 1.05em;
    line-height: 1;
    transition: transform 0.15s ease;
}

a.brb-card:hover .brb-arrow,
.brb-card:hover .brb-arrow {
    transform: translateX(3px);
}

@media (min-width: 768px) {
    a.brb-card,
    .brb-card {
        padding: 1.75rem 1.5rem 1.5rem;
        max-width: 500px;
    }
    .brb-card-image img {
        max-height: 400px;
    }
    .brb-card-name {
        font-size: 1.125rem;
        max-width: 420px;
    }
    .brb-card-btn {
        font-size: 1rem;             /* desktop has more room for larger text */
        padding: 1rem 1.5rem;        /* desktop can afford more padding */
    }
}

/* Mobile / touch devices: replace hover lift with active tap feedback */
@media (hover: none) {
    a.brb-card:hover,
    .brb-card:hover {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
        transform: none;
    }
    a.brb-card:active,
    .brb-card:active {
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
        transform: translateY(-1px);
    }
}
