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

/* Image blocks */
.bb-image {
    margin: 24px 0;
}

.bb-image img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    margin: 0;
    border-radius: var(--bb-img-radius, 0);
}

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

.bb-img-center {
    margin-left: var(--bb-text-ml);
    margin-right: var(--bb-text-mr);
}

.bb-img-right {
    margin-left: auto;
    margin-right: 0;
}

.bb-img-sm img {
    max-width: 340px;
    width: auto;
}

.bb-img-md img {
    max-width: 520px;
    width: auto;
}

/* Markdown text blocks */
.bb-text {
    max-width: var(--bb-text-max, 640px);
    margin: var(--bb-block-gap, 16px) var(--bb-text-mr) 0 var(--bb-text-ml);
}

.bb-text:first-child {
    margin-top: 0;
}

.bb-text p {
    margin: 0 0 16px;
    line-height: var(--bb-line-height, 1.75);
}

.bb-text p:last-child {
    margin-bottom: 0;
}

.bb-text h3 {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Dropcap - dramatic first letter */
.bb-dropcap > p:first-child::first-letter {
    float: left;
    font-size: 4.2em;
    line-height: 0.72;
    padding-right: 10px;
    padding-top: 6px;
    font-weight: 700;
    color: var(--accent);
}

.bb-text-center {
    text-align: center;
}

.bb-text-right {
    text-align: right;
}

/* Section blocks */
.bb-section {
    margin: var(--bb-section-gap, 24px) 0;
}

.bb-section .bb-section-inner {
    width: 100%;
    max-width: var(--bb-section-max-width, 880px);
    margin: 0 auto;
}

.bb-section.bb-section-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: 24px;
    padding-right: 24px;
}

.bb-section.bb-section-v-center .bb-section-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bb-section.bb-section-v-bottom .bb-section-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Row blocks */
.bb-row {
    display: grid;
    margin: var(--bb-section-gap, 24px) 0;
}

.bb-row-cell {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bb-row-cell > *:first-child {
    margin-top: 0;
}

.bb-row-cell > *:last-child {
    margin-bottom: 0;
}

.bb-row-cell .bb-image {
    margin: 0;
    flex: 1;
}

.bb-row-cell .bb-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bb-row-cell h1,
.bb-row-cell h2,
.bb-row-cell h3,
.bb-row-cell h4 {
    margin-top: 0;
}

.bb-row-cell > p:last-child {
    margin-bottom: 0;
}

.bb-row-cell .bb-text {
    max-width: none;
    margin: 0;
}

.bb-row .bb-split,
.bb-row .bb-gallery-scroll {
    width: 100%;
    margin-left: 0;
    padding: 0;
}

/* Hero block */
.bb-hero {
    position: relative;
    margin: var(--bb-section-gap, 24px) 0;
    color: #fff;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.bb-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.12) 35%,
        rgba(0, 0, 0, var(--bb-hero-darken, 0.35)) 65%,
        rgba(0, 0, 0, calc(var(--bb-hero-darken, 0.35) + 0.22)) 100%
    );
}

.bb-hero .bb-hero-inner {
    position: relative;
    z-index: 1;
    max-width: min(920px, 94vw);
    margin: 0 auto;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: inherit;
}

.bb-hero.bb-hero-h-sm {
    min-height: 280px;
}

.bb-hero.bb-hero-h-md {
    min-height: 380px;
}

.bb-hero.bb-hero-h-lg {
    min-height: 520px;
}

.bb-hero.bb-hero-h-viewport {
    min-height: 80vh;
}

.bb-hero.bb-hero-a-center .bb-hero-inner {
    text-align: center;
}

.bb-hero.bb-hero-a-right .bb-hero-inner {
    text-align: right;
}

.bb-hero h2 {
    margin: 0 0 14px;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: #fff;
}

.bb-hero .bb-hero-subtitle {
    margin: 0 0 24px;
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    opacity: 0.65;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bb-hero .bb-hero-cta {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.65);
    padding: 8px 14px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bb-hero .bb-hero-poster {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    max-width: min(520px, 92%);
}

.bb-hero .bb-hero-poster p {
    margin: 0 0 4px;
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.bb-hero .bb-hero-poster p:last-child {
    margin-bottom: 0;
}

/* Callout block */
.bb-callout {
    margin: var(--bb-block-gap, 16px) 0;
    padding: 14px 16px;
    border: none;
    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);
    background: var(--bb-callout-bg, rgba(255, 255, 255, 0.03));
}

.bb-callout h3 {
    margin: 0 0 6px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--bb-accent, var(--accent));
}

.bb-callout .bb-callout-body p:last-child {
    margin-bottom: 0;
}

/* Callout variants */
.bb-callout-info {
    border-left-color: #4da3ff;
    border-top-color: rgba(77, 163, 255, 0.2);
}

.bb-callout-success {
    border-left-color: #36c77c;
    border-top-color: rgba(54, 199, 124, 0.2);
}

.bb-callout-warning {
    border-left-color: #d2a52f;
    border-top-color: rgba(210, 165, 47, 0.2);
}

.bb-callout-danger {
    border-left-color: #d75959;
    border-top-color: rgba(215, 89, 89, 0.2);
}

/* Timeline block */
.bb-timeline {
    position: relative;
    margin: var(--bb-section-gap, 24px) 0;
    display: grid;
    gap: 10px;
}

.bb-timeline-vertical::before {
    content: "";
    position: absolute;
    left: 102px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: color-mix(in srgb, var(--bb-accent, var(--accent)) 50%, transparent);
}

.bb-timeline-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 16px;
    align-items: start;
    padding: 6px 0;
}

.bb-timeline-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: color-mix(in srgb, var(--bb-accent, var(--accent)) 70%, var(--text-muted));
}

.bb-timeline-item h4 {
    margin: 0 0 4px;
    font-size: 14px;
    letter-spacing: 0.04em;
}

.bb-timeline-item p {
    margin: 0;
    color: var(--text-secondary);
}

.bb-timeline-compact .bb-timeline-item {
    grid-template-columns: 1fr;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}

/* Before/After block */
.bb-before-after {
    margin: var(--bb-section-gap, 24px) 0;
}

.bb-before-after-track {
    display: grid;
    grid-template-columns: var(--bb-before-split, 50%) 1fr;
    border: 1px solid var(--border);
}

.bb-before-after-track img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.bb-before-pane,
.bb-after-pane {
    position: relative;
}

.bb-before-pane span,
.bb-after-pane span {
    position: absolute;
    left: 8px;
    top: 8px;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 3px 8px;
    font-weight: 600;
}

.bb-before-after figcaption {
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Identity card */
.id-card {
    border: 1px solid var(--border);
    padding: 16px;
    margin: 16px 0 24px;
}

.id-card .bb-row {
    margin: 0;
}

.id-card .bb-row-cell > table:first-child {
    margin-top: 0;
}

.id-card .bb-row-cell > table thead {
    display: none;
}

.id-card .bb-row-cell > table td:first-child {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
    width: 1%;
}

.id-card .bb-image {
    margin: 0;
}

.id-card .bb-image img {
    border: 1px solid var(--border);
}

.id-card .spec-badges {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
