/* ═══════════════════════════════════════════════════════════
   BuildX -- Article Template Styles
   The article body content has its own embedded <style> block
   from the WordPress extraction. These styles handle:
   - Featured image hero
   - Meta bar (categories, date, reading time)
   - Related articles grid
   - Bottom CTA
   ═══════════════════════════════════════════════════════════ */

/* ── Featured Image Hero ──────────────────────────────────── */
.article-hero {
    background-color: var(--color-gray-100, #F5F5F5);
}

.article-hero__image-wrapper {
    max-width: 1260px;
    margin: 0 auto;
}

.article-hero__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
}

/* ── Meta Bar ─────────────────────────────────────────────── */
.article-meta {
    border-bottom: 1px solid var(--color-border, #E5E5E5);
    padding: 1rem 0;
}

.article-meta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.article-meta__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-meta__details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-gray-500, #6B6B6B);
    font-size: 0.875rem;
}

.article-meta__separator {
    color: var(--color-border, #E5E5E5);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge--sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
}

/* Topic badges */
.badge--basics    { background: #EBF5FF; color: #1E5CA6; }
.badge--budget    { background: #E8F8E8; color: #1A7A2E; }
.badge--build     { background: #FFF3E0; color: #B35900; }
.badge--design    { background: #F3E5F5; color: #7B2D8E; }
.badge--rules     { background: #FDE8E8; color: #B91C1C; }

/* Content type badges */
.badge--podcast  { background: #E8F0FE; color: #1A56DB; }
.badge--video    { background: #FDE8E8; color: #B91C1C; }
.badge--article  { background: #E8F8E8; color: #1A7A2E; }

/* Audience badges */
.badge--family    { background: #EBF5FF; color: #1E5CA6; }
.badge--pros      { background: #FFF3E0; color: #B35900; }
.badge--rental    { background: #E8F8E8; color: #1A7A2E; }
.badge--retirement { background: #F3E5F5; color: #7B2D8E; }
.badge--workspace { background: #FDE8E8; color: #B91C1C; }

/* Fallback for unknown categories */
.badge:not([class*="badge--basics"]):not([class*="badge--budget"]):not([class*="badge--build"]):not([class*="badge--design"]):not([class*="badge--rules"]):not([class*="badge--family"]):not([class*="badge--pros"]):not([class*="badge--rental"]):not([class*="badge--retirement"]):not([class*="badge--workspace"]) {
    background: var(--color-gray-100, #F5F5F5);
    color: var(--color-gray-700, #333);
}

/* ── Article Body ──────────────────────────────────────────── */
/* Content HTML is self-contained with its own <style> block.
   No external styling applied -- Josh delivers drop-in HTML+CSS. */

/* ── Related Articles ─────────────────────────────────────── */
.related-articles {
    padding: 3rem 0;
    background-color: var(--color-gray-100, #F5F5F5);
    border-top: 1px solid var(--color-border, #E5E5E5);
}

.related-articles__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black, #111);
    margin-bottom: 1.5rem;
}

.related-articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ── Content Card (shared with Learning Center) ───────────── */
.content-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.content-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.content-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-gray-100, #F5F5F5);
}

.content-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.content-card:hover .content-card__image img {
    transform: scale(1.03);
}

.content-card__body {
    padding: 1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-card__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.content-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-black, #111);
    margin: 0 0 0.5rem;
}

.content-card__excerpt {
    font-size: 0.875rem;
    color: var(--color-gray-500, #6B6B6B);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

/* ── Bottom CTA ───────────────────────────────────────────── */
.article-cta {
    padding: 3rem 0;
}

.article-cta__box {
    background: var(--bx-black, #000000);
    color: #fff;
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.article-cta__box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #fff;
}

.article-cta__box p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.article-cta__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .related-articles__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .article-hero__image {
        max-height: 280px;
    }

    .article-meta__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .related-articles__grid {
        grid-template-columns: 1fr;
    }

    .related-articles {
        padding: 2rem 0;
    }

    .article-cta__box {
        padding: 2rem 1.25rem;
    }

    .article-cta__actions {
        flex-direction: column;
        align-items: center;
    }
}

/* -- Video Player Embed ---------------------------------------- */
.video-player {
    max-width: 960px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.video-player__wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.video-player__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Meet the Builder ────────────────────────────────────── */
.fp-builder {
    padding: 48px 0;
    border-bottom: 1px solid #E5E5E5;
}

.fp-builder__inner {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-top: 24px;
}

.fp-builder__photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 5px solid #000;
}

.fp-builder__content h4 {
    font-size: 1.25rem;
    margin: 0 0 12px;
}

.fp-builder__content p {
    line-height: 1.7;
    color: #333;
}

/* ── Inline video embeds (from Divi shortcode conversion) ── */
.video-embed {
    margin: 24px 0;
}

.video-embed iframe {
    border: 0;
    border-radius: 8px;
    max-width: 100%;
}

@media (max-width: 600px) {
    .fp-builder__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
