/**
 * Cenexa Content Pipeline — Article Front-End Styles
 *
 * Scoped to posts created by the plugin.
 * Only loaded via wp_enqueue on single posts with _cenexa_imported meta.
 *
 * @package Cenexa_Content_Pipeline
 */

/* ═══════════════════════════════════════
   CSS Variables (Brand Colors)
   ═══════════════════════════════════════ */
.cenexa-article {
    --cenexa-primary:    #0B2545;
    --cenexa-accent-bg:  #F3F7FD;
    --cenexa-border:     #0B2545;
    --cenexa-text:       #000000;
    --cenexa-bg:         #FFFFFF;
    --cenexa-text-muted: #6b7280;
    --cenexa-link:       #0B2545;
    --cenexa-callout-bg: #F3F7FD;
    --cenexa-callout-border: #0B2545;
}

/* ═══════════════════════════════════════
   Post Title (theme override)
   ═══════════════════════════════════════ */
.cenexa-article-post .entry-title,
.cenexa-article-post h1.entry-title,
.cenexa-article-post .post-title,
.cenexa-article-post h1.post-title {
    font-size: 32px !important;
    line-height: 1.25 !important;
    margin-bottom: 16px !important;
    color: #0B2545 !important;
}

/* ═══════════════════════════════════════
   Article Base
   ═══════════════════════════════════════ */
.cenexa-article {
    color: var(--cenexa-text);
    background: var(--cenexa-bg);
    line-height: 1.75;
    font-size: 17px;
    max-width: 760px;
    margin: 0 auto;
}

.cenexa-article h2 {
    color: var(--cenexa-primary);
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cenexa-border);
}

.cenexa-article h3 {
    color: var(--cenexa-primary);
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.cenexa-article p {
    margin: 0 0 16px 0 !important;
    margin-block-end: 16px !important;
    padding: 0 !important;
}

.cenexa-article a {
    color: var(--cenexa-link);
    text-decoration: underline;
}

.cenexa-article a:hover {
    opacity: 0.8;
}

/* ═══════════════════════════════════════
   Lists
   ═══════════════════════════════════════ */
.cenexa-article ul,
.cenexa-article ol {
    margin: 0 0 16px 0 !important;
    margin-block-end: 16px !important;
    padding: 0 0 0 2em !important;
    padding-inline-start: 2em !important;
    list-style-position: outside !important;
}

.cenexa-article ul {
    list-style-type: disc !important;
}

.cenexa-article ol {
    list-style-type: decimal !important;
}

.cenexa-article li {
    margin-bottom: 6px !important;
    display: list-item !important;
    padding-left: 0.25em !important;
}

.cenexa-article strong {
    font-weight: 700;
}

.cenexa-article em {
    font-style: italic;
    color: var(--cenexa-text-muted);
}

/* ═══════════════════════════════════════
   Blockquotes
   ═══════════════════════════════════════ */
.cenexa-article blockquote {
    border-left: 4px solid var(--cenexa-border);
    background: var(--cenexa-accent-bg);
    margin: 24px 0;
    padding: 16px 20px;
    font-style: italic;
}

.cenexa-article blockquote p {
    margin-bottom: 8px !important;
}

.cenexa-article blockquote cite {
    display: block;
    font-size: 14px;
    color: var(--cenexa-text-muted);
    font-style: normal;
    margin-top: 8px;
}

/* ═══════════════════════════════════════
   AI Summary Callout [ai_summary]
   ═══════════════════════════════════════ */
.cenexa-callout {
    border: 1px solid var(--cenexa-callout-border);
    border-radius: 6px;
    margin: 24px 0;
    overflow: hidden;
}

.cenexa-callout--summary {
    background: var(--cenexa-callout-bg);
    border-left: 4px solid var(--cenexa-border);
}

.cenexa-callout__label {
    background: var(--cenexa-primary);
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cenexa-callout__content {
    padding: 16px 20px;
}

.cenexa-callout__content p:last-child {
    margin-bottom: 0 !important;
}

/* ═══════════════════════════════════════
   Key Finding Callout
   ═══════════════════════════════════════ */
.cenexa-callout--finding {
    background: var(--cenexa-accent-bg);
    border-color: var(--cenexa-border);
}

.cenexa-callout--warning {
    background: #fef9f0;
    border-color: #e8a020;
}

/* ═══════════════════════════════════════
   Banner Ads (injected shortcodes)
   — Styling handled by the shortcode plugin.
     Override theme clears so text wraps beside banners.
   ═══════════════════════════════════════ */
.cenexa-article .banner-ad-right ~ h2,
.cenexa-article .banner-ad-right ~ h3,
.cenexa-article .banner-ad-right ~ p {
    clear: none !important;
}

/* ═══════════════════════════════════════
   Article Images
   ═══════════════════════════════════════ */
.cenexa-article .article-image,
.cenexa-article figure.article-image {
    margin: 24px 0 !important;
    text-align: left !important;
    display: block !important;
    max-width: 100% !important;
    width: auto !important;
}

.cenexa-article .article-image img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: block !important;
}

.cenexa-article .article-image figcaption {
    font-size: 13px;
    color: var(--cenexa-text-muted);
    margin-top: 8px;
    font-style: italic;
    max-width: 100% !important;
    word-wrap: break-word;
}

/* ═══════════════════════════════════════
   Tables
   ═══════════════════════════════════════ */
.cenexa-article table,
.cenexa-article .cenexa-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.cenexa-article table th,
.cenexa-article .cenexa-table th {
    background: var(--cenexa-primary);
    color: #fff;
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
}

.cenexa-article table td,
.cenexa-article .cenexa-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.cenexa-article table tbody tr:nth-child(even),
.cenexa-article .cenexa-table tbody tr:nth-child(even) {
    background: var(--cenexa-accent-bg);
}

/* ═══════════════════════════════════════
   References / Disclaimer
   ═══════════════════════════════════════ */
.cenexa-article h2:last-of-type + p em,
.cenexa-article > p:last-child em {
    display: block;
    padding: 12px 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    color: var(--cenexa-text-muted);
    text-align: center;
}
