/* Shared styles for long-form article pages */

article p {
    margin-top: 1rem;
    line-height: 1.7;
}

article h2 {
    margin-top: 2.5rem;
}

article h3 {
    margin-top: 2rem;
}

article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* Article metadata line */
.article-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Override site's list-style: none for article prose */
article ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-top: 0.75rem;
}

article ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin-top: 0.75rem;
}

article li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
    -webkit-overflow-scrolling: touch;
}

article table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

article thead th {
    background: var(--fg);
    color: var(--bg);
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

article tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

article tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--fg) 4%, var(--bg));
}

article .text-right {
    text-align: right;
}

article .row-highlight {
    background: color-mix(in srgb, var(--fg) 8%, var(--bg));
}

article tfoot td {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border-top: 2px solid var(--border);
}

article caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    padding-bottom: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Figures and images */
article figure {
    margin: 1.5rem 0;
}

article figure img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

article figcaption {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Footnotes */
article .footnote {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

@media (max-width: 480px) {
    article table {
        font-size: 0.8rem;
    }

    article thead th,
    article tbody td,
    article tfoot td {
        padding: 0.4rem 0.5rem;
    }
}
