/*
 * Article blocks for News: BambuUP block styles and end-of-article buttons.
 * Loaded on article pages and inside the editor (add_editor_style prefixes it there),
 * so writers see what readers get.
 */

/* Lead paragraph (page styles size every <p>, so match their specificity on the article page). */
.is-style-bbu-lead,
.bambu-page .community-prose p.is-style-bbu-lead {
    color: #0f172a;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.6;
}

/* Key takeaways / Fact box / Highlight */
.wp-block-group.is-style-bbu-key-takeaways,
.wp-block-group.is-style-bbu-fact-box,
.wp-block-group.is-style-bbu-highlight {
    margin: 32px 0;
    padding: 24px 28px;
    border-radius: 16px;
}

.wp-block-group.is-style-bbu-key-takeaways {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #43b263;
}

.wp-block-group.is-style-bbu-fact-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px #0000000d;
}

.wp-block-group.is-style-bbu-highlight {
    color: #ffffff;
    background: linear-gradient(120deg, #08162d 0%, #1e2a5a 60%, #4c2f78 100%);
}

.wp-block-group.is-style-bbu-highlight a {
    color: #c7f0d6;
}

.wp-block-group.is-style-bbu-key-takeaways > :first-child,
.wp-block-group.is-style-bbu-fact-box > :first-child,
.wp-block-group.is-style-bbu-highlight > :first-child {
    margin-top: 0;
}

.wp-block-group.is-style-bbu-key-takeaways > :last-child,
.wp-block-group.is-style-bbu-fact-box > :last-child,
.wp-block-group.is-style-bbu-highlight > :last-child {
    margin-bottom: 0;
}

.wp-block-group.is-style-bbu-key-takeaways h3,
.wp-block-group.is-style-bbu-fact-box h3 {
    margin: 0 0 12px;
    color: #1f7a46;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wp-block-group.is-style-bbu-fact-box ul,
.wp-block-group.is-style-bbu-fact-box ul.wp-block-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wp-block-group.is-style-bbu-fact-box li {
    margin: 0;
    padding: 0;
}

.wp-block-group.is-style-bbu-fact-box li strong {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

/* Key numbers */
.wp-block-columns.is-style-bbu-stats {
    gap: 16px;
    margin: 32px 0;
}

.wp-block-columns.is-style-bbu-stats > .wp-block-column {
    padding: 20px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.wp-block-columns.is-style-bbu-stats .bbu-stat-value {
    margin: 0;
    color: #1f7a46;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
}

.wp-block-columns.is-style-bbu-stats .bbu-stat-label {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
}

/* Expert quote */
.wp-block-quote.is-style-bbu-expert {
    position: relative;
    margin: 36px 0;
    padding: 28px 28px 24px 32px;
    color: #0f172a;
    background: #f8fafc;
    border: 0;
    border-left: 4px solid #7147a7;
    border-radius: 0 16px 16px 0;
}

.wp-block-quote.is-style-bbu-expert p {
    margin: 0;
    font-size: 20px;
    font-style: italic;
    line-height: 1.55;
}

.wp-block-quote.is-style-bbu-expert cite {
    display: block;
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
}

/* Core blocks inside articles */
.wp-block-image figcaption,
.wp-element-caption {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.wp-block-separator {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

.bbu-source {
    color: #64748b;
    font-size: 14px;
    font-style: italic;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.wp-block-table th,
.wp-block-table td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.wp-block-table th {
    background: #f1f5f9;
}

.wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}

.wp-block-button__link,
.bbu-article-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(90deg, #43b263 0%, #3ba295 25%, #3b7ab5 50%, #7147a7 75%, #814272 100%);
    border: 0;
    border-radius: 9999px;
}

.wp-block-button.is-style-bbu-outline .wp-block-button__link,
.bbu-article-cta-button.is-outline {
    color: #08162d;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.community-prose .wp-block-button__link,
.community-prose .bbu-article-cta-button {
    color: #ffffff;
    text-decoration: none;
}

.community-prose .wp-block-button.is-style-bbu-outline .wp-block-button__link,
.community-prose .bbu-article-cta-button.is-outline {
    color: #08162d;
}

/* End-of-article buttons and social row */
.bbu-article-cta {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e2e8f0;
}

.bbu-article-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bbu-article-follow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 24px 0 0;
    color: #64748b;
    font-size: 14px;
}

.bbu-article-follow span {
    font-weight: 600;
}

.community-prose .bbu-article-follow a {
    color: #1f7a46;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 640px) {
    .is-style-bbu-lead,
    .bambu-page .community-prose p.is-style-bbu-lead,
    .wp-block-quote.is-style-bbu-expert p {
        font-size: 18px;
    }

    .bbu-article-cta-button {
        width: 100%;
        justify-content: center;
    }
}
