/* ===== LAYOUTS/BLOG-BUILDER.CSS ===== */
/* Blog Builder layout system (.bb-* blocks) - Part 1: Layout blocks */

/* Full-bleed breakout - negates body padding to go edge-to-edge */
.bb-full-bleed {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-bottom: 40px;
    overflow-x: hidden;
}

.bb-full-bleed img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    margin: 0;
}

.bb-full-bleed.bb-h-viewport {
    height: 100vh;
}

.bb-full-bleed.bb-h-viewport img {
    height: 100%;
    object-fit: cover;
}

.bb-full-bleed.bb-h-half {
    height: 50vh;
}

.bb-full-bleed.bb-h-half img {
    height: 100%;
    object-fit: cover;
}

.bb-full-bleed.bb-parallax img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
}

.bb-full-bleed.bb-obj-top img {
    object-position: top;
}

.bb-full-bleed.bb-obj-bottom img {
    object-position: bottom;
}

.bb-full-bleed .bb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.6));
}

.bb-full-bleed .bb-caption {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 0;
}

.bb-cap-bottom-left {
    text-align: left;
    justify-content: flex-start !important;
}

.bb-cap-bottom-right {
    text-align: right;
    justify-content: flex-end !important;
}

.bb-overlay.bb-cap-bottom-left {
    justify-content: flex-start;
}

.bb-overlay.bb-cap-bottom-right {
    justify-content: flex-end;
}

/* Split (diptych) */
.bb-split {
    display: grid;
    gap: 16px;
    margin: 24px 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 0 24px;
}

.bb-split.bb-ratio-50-50 {
    grid-template-columns: 1fr 1fr;
}

.bb-split.bb-ratio-60-40 {
    grid-template-columns: 3fr 2fr;
}

.bb-split.bb-ratio-40-60 {
    grid-template-columns: 2fr 3fr;
}

.bb-split.bb-ratio-70-30 {
    grid-template-columns: 7fr 3fr;
}

.bb-split.bb-ratio-30-70 {
    grid-template-columns: 3fr 7fr;
}

.bb-split img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    margin: 0;
}

.bb-split .bb-text {
    display: flex;
    align-items: center;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.bb-split.bb-valign-top {
    align-items: start;
}

.bb-split.bb-valign-top .bb-text {
    align-items: flex-start;
}

.bb-split.bb-valign-bottom {
    align-items: end;
}

.bb-split.bb-valign-bottom .bb-text {
    align-items: flex-end;
}

/* Text over image */
.bb-text-over-image {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
}

.bb-text-over-image img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    margin: 0;
}

.bb-text-over-image .bb-overlay-text {
    position: absolute;
    padding: 24px 32px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    z-index: 1;
}

.bb-text-over-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--bb-darken, 0.4));
    pointer-events: none;
}

.bb-pos-center .bb-overlay-text {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bb-pos-top-left .bb-overlay-text {
    top: 24px;
    left: 24px;
}

.bb-pos-bottom-left .bb-overlay-text {
    bottom: 24px;
    left: 24px;
}

.bb-pos-bottom-right .bb-overlay-text {
    bottom: 24px;
    right: 24px;
    text-align: right;
}

.bb-text-over-image.bb-fs-sm .bb-overlay-text {
    font-size: 14px;
}

.bb-text-over-image.bb-fs-lg .bb-overlay-text {
    font-size: 28px;
}

/* Masonry */
.bb-masonry {
    column-gap: var(--bb-gap, 8px);
    margin: 24px 0;
}

.bb-masonry.bb-cols-2 {
    column-count: 2;
}

.bb-masonry.bb-cols-3 {
    column-count: 3;
}

.bb-masonry.bb-cols-4 {
    column-count: 4;
}

.bb-masonry img {
    width: 100%;
    display: block;
    margin-bottom: var(--bb-gap, 8px);
    break-inside: avoid;
    border: none;
    border-radius: var(--bb-radius, 0);
}

.bb-masonry.bb-hover-zoom img {
    transition: transform 0.3s ease;
}

.bb-masonry.bb-hover-zoom img:hover {
    transform: scale(1.05);
    z-index: 1;
}

/* Pullquote */
.bb-pullquote {
    max-width: 640px;
    margin: 36px var(--bb-text-mr) 36px var(--bb-text-ml);
    padding: 0 0 0 18px;
    border: none;
    font-style: italic;
}

.bb-pullquote p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.03em;
}

.bb-pullquote cite {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 12px;
}

.bb-pq-centered {
    text-align: center;
    padding-left: 0;
}

.bb-pq-left-bar {
    border-left: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
    padding-left: 18px;
}

.bb-pq-large p {
    font-size: 20px;
    line-height: 1.5;
    font-weight: 600;
}

.bb-pq-fs-sm p {
    font-size: 13px;
}

.bb-pq-fs-lg p {
    font-size: 20px;
}

.bb-pq-accent-muted {
    border-color: var(--text-muted);
}

.bb-pq-accent-muted.bb-pq-left-bar {
    border-left-color: var(--text-muted);
}

.bb-pq-accent-none {
    border-color: transparent;
}

.bb-pq-accent-none.bb-pq-left-bar {
    border-left-color: transparent;
}

/* Spacer */
.bb-spacer {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 640px;
    margin-left: var(--bb-text-ml);
    margin-right: var(--bb-text-mr);
}

.bb-spacer-dotted::before {
    content: "";
    width: 40px;
    border-bottom: 1px solid var(--text-muted);
    opacity: 0.4;
}

.bb-spacer-line::before {
    content: "";
    width: 48px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}

.bb-spacer-asterisks::before {
    content: "·  ·  ·";
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.2em;
    opacity: 0.4;
}

/* Gallery scroll (horizontal) */
.bb-gallery-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--bb-gallery-gap, 12px);
    padding: 4px 0;
    margin: 24px 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: 24px;
    padding-right: 24px;
}

.bb-gallery-scroll img,
.bb-gallery-scroll figure {
    flex-shrink: 0;
    scroll-snap-align: start;
    height: var(--bb-gallery-h, 300px);
    border: none;
    margin: 0;
}

.bb-gallery-scroll img {
    width: auto;
    object-fit: cover;
}

.bb-gallery-scroll figure img {
    height: 260px;
    width: auto;
    object-fit: cover;
}

.bb-gallery-scroll figcaption {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Gallery grid */
.bb-gallery-grid {
    display: grid;
    gap: var(--bb-gallery-gap, 8px);
    margin: 24px 0;
}

.bb-gallery-grid.bb-cols-2 {
    grid-template-columns: 1fr 1fr;
}

.bb-gallery-grid.bb-cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.bb-gallery-grid.bb-cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.bb-gallery-grid img {
    width: 100%;
    height: var(--bb-gallery-h, 200px);
    object-fit: cover;
    display: block;
    border: none;
    margin: 0;
}

.bb-gallery-grid figure {
    margin: 0;
}

.bb-gallery-grid figure img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.bb-gallery-grid figcaption {
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-muted);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Contact sheet - dense uniform grid */
.bb-contact-sheet {
    display: grid;
    gap: 1px;
    margin: 24px 0;
    background: var(--border);
    border: 1px solid var(--border);
}

.bb-contact-sheet.bb-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bb-contact-sheet.bb-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.bb-contact-sheet.bb-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.bb-contact-sheet img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border: none;
    margin: 0;
    background: var(--bg-primary);
    transition: opacity 0.15s ease;
    cursor: pointer;
}

.bb-contact-sheet img:hover {
    opacity: 0.8;
}

.article-photo-link {
    color: inherit;
    text-decoration: none;
}

.bb-contact-sheet > .article-photo-link,
.bb-gallery-grid > .article-photo-link {
    display: block;
    min-width: 0;
}

.bb-gallery-scroll > .article-photo-link {
    flex-shrink: 0;
    scroll-snap-align: start;
    height: var(--bb-gallery-h, 300px);
}

.bb-gallery-scroll > .article-photo-link img {
    height: 100%;
    width: auto;
    object-fit: cover;
}

/* Embed */
.bb-embed {
    margin: 24px 0;
}

.bb-embed-content {
    max-width: 680px;
}

.bb-embed-narrow {
    max-width: 480px;
}

.bb-embed-center {
    margin-left: auto;
    margin-right: auto;
}
