/* Long-form article extras.
 *
 * Loaded AFTER blog.css, which already owns .article, .article__back,
 * .article__meta and .article h1/h2/p/ul/li. This file only adds what blog.css
 * lacks: h3, tables, blockquote, code, images, and the CTA/related blocks used
 * by the SEO landing pages under /<slug>/.
 */

/* ---- Prose elements blog.css doesn't cover ---- */

.article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

/* Scoped to prose containers on purpose. A blanket `.article a` out-specifies
   .btn--primary (0,1,1 vs 0,1,0) and blog.css's .article__back (0,2,1 vs 0,1,0),
   so it repainted the CTA button's white label blue and underlined the back link.
   Targeting the prose elements avoids the specificity fight entirely. */
.article p a,
.article li a,
.article td a,
.article th a,
.article blockquote a {
    color: var(--color-blue);
    text-decoration: underline;
    text-decoration-color: rgba(62, 179, 252, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition-fast);
}

.article p a:hover,
.article li a:hover,
.article td a:hover,
.article th a:hover,
.article blockquote a:hover {
    text-decoration-color: var(--color-blue);
}

/* .article-related uses <li><a>, so it would inherit the prose treatment. */
.article .article-related a {
    text-decoration: none;
}

.article blockquote {
    margin: var(--space-xl) 0;
    padding: var(--space-md) var(--space-lg);
    border-left: 3px solid var(--color-purple);
    background: var(--bg-elevated);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

.article blockquote p:last-child {
    margin-bottom: 0;
}

.article code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.15em 0.4em;
}

.article pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-x: auto;
    margin-bottom: var(--space-lg);
}

.article pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    display: block;
    margin: var(--space-xl) 0;
}

.article figcaption {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: calc(var(--space-md) * -1 + var(--space-xs));
    margin-bottom: var(--space-xl);
}

/* ---- Lead paragraph + updated stamp ---- */

.article__lead {
    font-size: 1.2rem !important;
    color: var(--text-secondary);
    line-height: 1.7 !important;
    margin-bottom: var(--space-xl) !important;
}

.article__updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: var(--space-2xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* ---- Comparison table ----
 * Horizontal scroll on the wrapper rather than stacked rows, so the table stays
 * a real table for crawlers and copy/paste.
 */

.table-scroll {
    overflow-x: auto;
    margin: var(--space-xl) 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.cmp-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 1rem;
}

.cmp-table th,
.cmp-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}

.cmp-table thead th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cmp-table tbody tr + tr th,
.cmp-table tbody tr + tr td {
    border-top: 1px solid var(--border-subtle);
}

.cmp-table tbody td {
    color: var(--text-secondary);
}

/* The Beetler column — brand gradient rule along the top, subtly lifted */
.cmp-table thead th.cmp-table__col--ours {
    position: relative;
    color: var(--text-primary);
}

.cmp-table thead th.cmp-table__col--ours::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
}

.cmp-table .cmp-table__col--ours {
    background: rgba(174, 82, 242, 0.06);
    color: var(--text-primary);
}

/* ---- CTA block ---- */

.article-cta {
    margin: var(--space-3xl) 0 var(--space-2xl);
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    text-align: center;
}

.article-cta h2 {
    margin-top: 0 !important;
    margin-bottom: var(--space-md) !important;
}

.article-cta p {
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto var(--space-xl) !important;
}

/* ---- Related links ---- */

.article-related {
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

.article-related h2 {
    font-size: 1.1rem !important;
    margin-top: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.article-related ul {
    list-style: none;
    padding-left: 0 !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.article-related li {
    margin-bottom: 0;
}

.article-related a {
    display: block;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition-base), background var(--transition-base);
}

.article-related a:hover {
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .article__lead {
        font-size: 1.1rem !important;
    }

    .article-cta {
        padding: var(--space-xl) var(--space-lg);
    }

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

    .cmp-table th,
    .cmp-table td {
        padding: var(--space-md);
    }
}
