/**
 * AGC Editorial — rendered article typography (preview + published posts + block editor)
 *
 * Scope roots:
 * - .agc-article (synced HTML wrapper)
 * - body.agc-editorial-post .entry-content (theme fallback when wrapper stripped)
 * - .editor-styles-wrapper .block-editor-block-list__layout (block editor content)
 */
.agc-article,
body.agc-editorial-post .entry-content,
body.agc-editorial-post .wp-block-post-content,
.editor-styles-wrapper .block-editor-block-list__layout {
    --agc-article-text: #1e293b;
    --agc-article-muted: #64748b;
    --agc-article-border: #e2e8f0;
    --agc-article-accent: #6366f1;
    font-size: 15px;
    line-height: 1.75;
    color: var(--agc-article-text);
    max-width: 72ch;
}

.agc-article > *:first-child,
body.agc-editorial-post .entry-content > *:first-child,
body.agc-editorial-post .wp-block-post-content > *:first-child,
.editor-styles-wrapper .block-editor-block-list__layout > *:first-child {
    margin-top: 0;
}

.agc-article > *:last-child,
body.agc-editorial-post .entry-content > *:last-child,
body.agc-editorial-post .wp-block-post-content > *:last-child,
.editor-styles-wrapper .block-editor-block-list__layout > *:last-child {
    margin-bottom: 0;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) h2 {
    margin: 2em 0 0.75em;
    font-size: 1.45rem;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) h3 {
    margin: 1.5em 0 0.6em;
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 600;
    color: #1e293b;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) h4,
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) h5,
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) h6 {
    margin: 1.25em 0 0.5em;
    font-weight: 600;
    color: #334155;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) p {
    margin: 0 0 1em;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) ul,
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) ol {
    margin: 0 0 1.25em 1.25em;
    padding: 0;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) li {
    margin-bottom: 0.35em;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) li > ul,
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) li > ol {
    margin-top: 0.35em;
    margin-bottom: 0;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) blockquote {
    margin: 1.25em 0;
    padding: 0.85em 1.1em;
    border-left: 4px solid var(--agc-article-accent);
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #334155;
    font-style: italic;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) a {
    color: var(--agc-article-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) a:hover {
    color: #4f46e5;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) strong {
    font-weight: 600;
    color: #0f172a;
}

/* Tables */
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table-wrap {
    margin: 1.25em 0;
    overflow-x: auto;
    border: 1px solid var(--agc-article-border);
    border-radius: 8px;
    background: #fff;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table th,
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--agc-article-border);
    vertical-align: top;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table tr:last-child td {
    border-bottom: none;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

/* Callouts */
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout {
    margin: 1.25em 0;
    padding: 14px 16px 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--agc-article-border);
    border-left-width: 4px;
    background: #fff;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__title {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__body {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--info .agc-callout__label {
    color: #1d4ed8;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--tip {
    border-left-color: #10b981;
    background: #ecfdf5;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--tip .agc-callout__label {
    color: #047857;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--warning .agc-callout__label {
    color: #b45309;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--quote {
    border-left-color: #8b5cf6;
    background: #f5f3ff;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout--quote .agc-callout__label {
    color: #6d28d9;
}

/* Story modal preview chrome (admin only) */
.agc-ed-sm-article-preview .agc-article {
    max-width: none;
}

/* Nested blocks inside callouts */
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__body > *:first-child {
    margin-top: 0;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__body > *:last-child {
    margin-bottom: 0;
}

:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__body h2,
:is(.agc-article, body.agc-editorial-post .entry-content, body.agc-editorial-post .wp-block-post-content, .editor-styles-wrapper .block-editor-block-list__layout) .agc-callout__body h3 {
    margin-top: 1em;
    font-size: 1.05rem;
}

