/**
 * Antigravity Core — Editorial & B2B Content Design System
 * Path: wp-content/themes/astra-child/assets/css/ag-article-editorial.css
 *
 * Replaces all legacy inline styles (style="") in post_content with scoped,
 * performant CSS adhering to GEMINI.md protocol v8.0.
 */

:root {
    --ag-brand-orange: #D76314;
    --ag-brand-orange-hover: #B8500F;
    --ag-bg-color: #F4F2EA;
    --ag-text-dark: #111827;
    --ag-text-muted: #6B7280;
    --ag-border-light: rgba(26, 26, 26, 0.12);
}

/* ── 1. Table of Contents (TOC) ─────────────────────────────────────────── */
.ag-toc-block {
    background: #ffffff;
    border: 1px solid var(--ag-border-light);
    border-left: 4px solid var(--ag-brand-orange);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 28px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.ag-toc-title {
    font-family: var(--ag-font-primary, 'Cormorant Garamond', serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--ag-text-dark);
    margin-bottom: 12px;
}

.ag-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ag-toc-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.ag-toc-list a {
    color: var(--ag-text-dark);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.ag-toc-list a:hover {
    color: var(--ag-brand-orange);
}

/* ── 2. Tailor's Expert Note / Pro Tip ───────────────────────────────────── */
.ag-tailor-tip {
    background: #FDFBF7;
    border: 1px solid rgba(215, 99, 20, 0.2);
    border-radius: 10px;
    padding: 20px 22px;
    margin: 32px 0;
    position: relative;
}

.ag-tailor-tip__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ag-brand-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ag-tailor-tip__title svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.ag-tailor-tip p {
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

/* ── 3. Article Conversion Block (Call To Action) ───────────────────────── */
.ag-article-cta {
    margin-top: 40px;
    padding: 32px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(215, 99, 20, 0.25);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(215, 99, 20, 0.06);
}

.ag-article-cta-title {
    margin-bottom: 12px;
    font-family: var(--ag-font-primary, 'Cormorant Garamond', serif);
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.25;
}

.ag-article-cta-desc {
    margin: 0 auto 24px auto;
    font-size: 16px;
    color: var(--ag-text-muted);
    max-width: 580px;
    line-height: 1.5;
}

.ag-article-cta .ag-btn-brand-v2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-height: 48px;
    padding: 0 32px;
    background: var(--ag-brand-orange);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-family: var(--ag-font-primary, 'Cormorant Garamond', serif);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: background 0.25s ease, transform 0.2s ease;
}

.ag-article-cta .ag-btn-brand-v2:hover {
    background: var(--ag-brand-orange-hover);
    transform: translateY(-1px);
}

/* ── 4. B2B Semantic Mesh Widget (Patterns -> Fabric -> Workshop) ─────────── */
.ag-semantic-mesh-widget {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 36px 0;
    background: #ffffff;
    border: 1px solid var(--ag-border-light);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.ag-mesh-col {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--ag-bg-color);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.ag-mesh-badge {
    align-self: flex-start;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--ag-brand-orange);
    color: #ffffff;
    margin-bottom: 10px;
}

.ag-mesh-col h4 {
    font-family: var(--ag-font-primary, 'Cormorant Garamond', serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--ag-text-dark);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.ag-mesh-col p {
    font-size: 13px;
    color: var(--ag-text-muted);
    line-height: 1.45;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.ag-mesh-col a {
    align-self: flex-start;
    font-size: 13px;
    font-weight: 600;
    color: var(--ag-brand-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ag-mesh-col a:hover {
    color: var(--ag-brand-orange-hover);
    text-decoration: underline;
}

/* ── 5. Responsive Mobile Grid ───────────────────────────────────────────── */
@media screen and (max-width: 767.98px) {
    .ag-semantic-mesh-widget {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .ag-article-cta {
        padding: 24px 16px;
    }
    
    .ag-article-cta-title {
        font-size: 22px;
    }
    
    .ag-article-cta .ag-btn-brand-v2 {
        width: 100%;
        min-height: 48px;
    }
}
