/* ===== LAYOUTS/BLOG-BUILDER-BLOG-ARTICLE.CSS ===== */
/* Blog Builder overrides specifically for blog article pages */

/* Blog article typography overrides */
.page-blog-article .article-entry-body > .bb-text {
    max-width: none;
    margin: 24px 0 0;
}

.page-blog-article .article-entry-body > .bb-text p {
    max-width: 60ch;
    font-family: var(--blog-copy-font);
    font-size: var(--blog-copy-size);
    line-height: var(--blog-copy-leading);
    letter-spacing: 0;
    color: var(--text-primary);
    text-wrap: pretty;
}

.page-blog-article .article-entry-body > .bb-text p + p {
    margin-top: 14px;
}

.page-blog-article .article-entry-body > .bb-text :is(ul, ol) {
    max-width: 60ch;
    margin: 0 0 18px;
    padding-left: 1.35em;
}

.page-blog-article .article-entry-body > .bb-text li + li {
    margin-top: 8px;
}

/* Row overrides for blog articles */
.page-blog-article .bb-row {
    gap: 18px !important;
    margin: 30px 0;
    align-items: start !important;
}

.page-blog-article .bb-row-cell {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
}

.page-blog-article .bb-row-cell .bb-text {
    max-width: none;
    margin: 0;
    min-height: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

.page-blog-article .bb-row-cell .bb-text p {
    color: inherit;
}

.page-blog-article .bb-row-cell .bb-text p strong:first-child {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-blog-article .bb-row-cell .bb-text p:first-child + p {
    margin-top: 0;
}

.page-blog-article .bb-row-cell .bb-text p {
    max-width: 36ch;
    margin-left: 0;
    margin-right: 0;
    font-family: var(--blog-copy-font);
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.62;
    letter-spacing: 0;
    text-wrap: pretty;
}

.page-blog-article .bb-row-cell .bb-text p:first-child {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.page-blog-article .bb-row-cell .bb-image {
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.page-blog-article .bb-row-cell .bb-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin: 0;
}

/* Hero overrides */
.page-blog-article .bb-hero.bb-hero-h-viewport {
    min-height: 52vh;
    border-top: none;
    border-bottom: none;
}

.page-blog-article .bb-hero .bb-hero-inner {
    max-width: min(760px, 100%);
    padding: 28px 24px;
}

.page-blog-article .bb-hero h2 {
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.page-blog-article .bb-hero .bb-hero-subtitle {
    max-width: 52ch;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Block margins */
.page-blog-article .bb-callout,
.page-blog-article .bb-pullquote,
.page-blog-article .bb-before-after,
.page-blog-article .bb-image,
.page-blog-article .bb-gallery-scroll,
.page-blog-article .bb-gallery-grid,
.page-blog-article .bb-contact-sheet {
    margin-left: 0;
    margin-right: 0;
}

.page-blog-article .article-entry-body > :is(.bb-row, .bb-image, .bb-before-after, .bb-gallery-scroll, .bb-gallery-grid, .bb-contact-sheet, .bb-pullquote, .bb-hero, table) {
    clear: both;
}

/* Callout overrides */
.page-blog-article .bb-callout {
    padding: 14px 16px;
    border-left: 2px solid var(--bb-callout-border, var(--border));
    border-top: 1px solid color-mix(in srgb, var(--bb-callout-border, var(--border)) 40%, transparent);
    border-right: none;
    border-bottom: none;
    background: var(--bb-callout-bg, rgba(255, 255, 255, 0.03));
    box-shadow: none;
}

.page-blog-article .bb-callout h3 {
    margin-bottom: 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-blog-article .bb-callout .bb-callout-body p {
    max-width: 60ch;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0;
    text-wrap: pretty;
}

/* Side callouts (left/right) */
.page-blog-article .article-entry-body > .bb-callout.bb-callout-left,
.page-blog-article .article-entry-body > .bb-callout.bb-callout-right {
    position: relative;
    width: min(240px, 100%);
    padding: 0 0 0 44px;
    border: none;
    background: transparent;
    box-shadow: none;
}

.page-blog-article .article-entry-body > .bb-callout.bb-callout-left::before,
.page-blog-article .article-entry-body > .bb-callout.bb-callout-right::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 30px;
    border-top: 1px solid color-mix(in srgb, var(--text-muted) 55%, transparent);
}

.page-blog-article .article-entry-body > .bb-callout.bb-callout-left h3,
.page-blog-article .article-entry-body > .bb-callout.bb-callout-right h3 {
    margin: 0 0 6px;
    color: color-mix(in srgb, var(--text-primary) 88%, transparent);
    font-size: 12px;
    font-style: italic;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}

.page-blog-article .article-entry-body > .bb-callout.bb-callout-left .bb-callout-body p,
.page-blog-article .article-entry-body > .bb-callout.bb-callout-right .bb-callout-body p {
    max-width: none;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    font-style: italic;
}

/* Desktop side callout positioning */
@media (min-width: 1240px) {
    .page-blog-article .article-entry-body > .bb-callout.bb-callout-left {
        float: left;
        clear: left;
        margin: 8px 24px 16px -260px;
    }

    .page-blog-article .article-entry-body > .bb-callout.bb-callout-right {
        float: right;
        clear: right;
        margin: 8px -260px 16px 24px;
    }
}

/* Pullquote overrides */
.page-blog-article .bb-pullquote {
    padding: 8px 0 0 18px;
    border-left: 2px solid color-mix(in srgb, var(--accent) 28%, var(--border));
}

.page-blog-article .bb-pullquote p {
    max-width: 34ch;
    font-family: var(--blog-copy-font);
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.28;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.page-blog-article .bb-pullquote cite {
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

/* Before/after overrides */
.page-blog-article .bb-before-after {
    padding-top: 8px;
    border-top: 1px solid var(--blog-rule, var(--border));
}

.page-blog-article .bb-before-after figcaption,
.page-blog-article .bb-image figcaption {
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    font-style: normal;
}

/* First/last child margin adjustments */
.page-blog-article .article-entry-body > .bb-callout:first-child,
.page-blog-article .article-entry-body > p:first-child,
.page-blog-article .article-entry-body > .bb-image:first-child,
.page-blog-article .article-entry-body > .bb-row:first-child,
.page-blog-article .article-entry-body > table:first-child,
.page-blog-article .article-entry-body > ul:first-child,
.page-blog-article .article-entry-body > ol:first-child {
    margin-top: 0;
}

.page-blog-article .article-entry-body > h2:first-child,
.page-blog-article .article-entry-body > h3:first-child {
    margin-top: 0;
    padding-top: 0;
}

.page-blog-article .article-entry-body > .bb-callout:first-child {
    margin-top: 0;
}

.page-blog-article .article-entry-body > .bb-callout:last-child {
    margin-bottom: 0;
}

/* Row overrides for non-blog article pages */
.page-article:not(.page-blog-article) .bb-row {
    gap: 12px;
    column-gap: 16px;
    margin: 20px 0;
    align-items: start;
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell {
    padding: 0;
    border: 1px solid var(--border);
    overflow: hidden;
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell > h3:first-child {
    display: block;
    margin: 0;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    font-size: 10px;
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell table {
    margin: 0;
    border: none;
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell th,
.page-article:not(.page-blog-article) .bb-row > .bb-row-cell td {
    border-left: none;
    border-right: none;
    border-color: color-mix(in srgb, var(--border) 60%, transparent);
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell tr:last-child td {
    border-bottom: none;
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell th:first-child,
.page-article:not(.page-blog-article) .bb-row > .bb-row-cell td:first-child {
    padding-left: 10px;
}

.page-article:not(.page-blog-article) .bb-row > .bb-row-cell th:last-child,
.page-article:not(.page-blog-article) .bb-row > .bb-row-cell td:last-child {
    padding-right: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .page-blog-article {
        max-width: calc(100vw - 24px) !important;
        --blog-copy-size: 17px;
    }

    .page-blog-article .bb-row {
        gap: 14px !important;
        margin: 24px 0;
    }

    .page-blog-article .bb-row-cell .bb-text {
        padding: 0;
    }

    .page-blog-article .bb-row-cell .bb-text p {
        max-width: none;
        font-size: 17px;
        line-height: 1.62;
    }

    .page-blog-article .bb-row-cell .bb-image img {
        aspect-ratio: auto;
    }

    .page-blog-article .bb-hero.bb-hero-h-viewport {
        min-height: 40vh;
    }

    .page-blog-article .bb-hero .bb-hero-inner {
        padding: 20px 18px;
    }

    .page-blog-article .bb-pullquote p {
        max-width: none;
        font-size: 22px;
    }

    .page-article:not(.page-blog-article) .bb-row > .bb-row-cell + .bb-row-cell {
        margin-top: 4px;
    }
}

@media (max-width: 980px) and (min-width: 601px) {
    .page-blog-article .bb-row {
        grid-template-columns: var(--bb-row-cols-tablet, inherit);
        gap: var(--bb-row-gap-tablet, inherit);
    }
}
