/* ── Articles page styles ────────────────────────────────────────────
   Extends ../style.css which provides CSS variables, fonts, and base reset.
   ──────────────────────────────────────────────────────────────────── */

/* ── Container ─────────────────────────────────────────────────────── */
.articles-container {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.articles-container .logo-container {
    margin-bottom: 2rem;
}

.articles-container .logo-container a {
    display: inline-block;
}

/* ── List view ─────────────────────────────────────────────────────── */
#articles-list h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    font-family: 'Azonix', system-ui, sans-serif;
    letter-spacing: 1px;
}

.article-card {
    display: block;
    padding: 1.25rem;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent, var(--border));
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.article-card:nth-child(1) { --accent: #e06c75; }
.article-card:nth-child(2) { --accent: #61afef; }
.article-card:nth-child(3) { --accent: #c678dd; }
.article-card:nth-child(4) { --accent: #56b6c2; }
.article-card:nth-child(5) { --accent: #c9a34e; }
.article-card:nth-child(6) { --accent: #7aab58; }
.article-card:nth-child(7) { --accent: #b87d3a; }
.article-card:nth-child(8) { --accent: #be5046; }

.article-card:hover {
    transform: translateY(-2px);
    border-color: var(--fg);
}

.article-card time {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.2rem;
}

.article-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.article-card p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ── Article view ──────────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--fg);
}

#article-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

#article-header time {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* ── Markdown content styling ──────────────────────────────────────── */
#article-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

#article-content h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

#article-content p {
    margin: 0 0 1.2rem;
}

#article-content a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

#article-content a:hover {
    text-decoration-color: var(--fg);
}

#article-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

#article-content blockquote {
    border-left: 3px solid var(--border);
    margin: 1.5rem 0;
    padding: 0.5rem 1rem;
    color: var(--muted);
}

#article-content code {
    background: rgba(128, 128, 128, 0.15);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

#article-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.5;
}

#article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.88em;
}

#article-content ul,
#article-content ol {
    padding-left: 1.5rem;
    margin: 0 0 1.2rem;
}

#article-content li {
    margin-bottom: 0.4rem;
}

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

#article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

#article-content th,
#article-content td {
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

#article-content th {
    background: var(--bg);
    font-weight: 600;
}

/* ── Status messages ───────────────────────────────────────────────── */
.status-msg {
    padding: 3rem 0;
    text-align: center;
    color: var(--muted);
}

.status-msg.error {
    color: #c44;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.articles-container footer {
    margin-top: 60px;
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 699px) {
    .articles-container {
        padding: 0 1rem;
    }

    #articles-list h1 {
        font-size: 1.6rem;
    }
}
