/* The articles page (website/articles.php). */
:root, html[data-theme="dark"] {
    --bg: #0c1222; --surface: #111a31; --surface-soft: #1a2447;
    --border: rgba(148,163,184,0.14);
    --text: #e5e7eb; --muted: #94a3b8;
    --accent: #7c3aed; --accent-2: #a78bfa;
    --topbar-bg: rgba(12,18,34,0.85);
    --btn-bg: rgba(148,163,184,0.1);
    --btn-bg-hover: rgba(148,163,184,0.2);
    --card: rgba(255,255,255,0.03);
    --card-hover-border: rgba(124,58,237,0.45);
    --card-shadow-hover: 0 20px 40px -16px rgba(0,0,0,0.5);
}
html[data-theme="light"] {
    --bg: #f7f9fc; --surface: #ffffff; --surface-soft: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a; --muted: #64748b;
    --accent: #7c3aed; --accent-2: #6d28d9;
    --topbar-bg: rgba(255,255,255,0.88);
    --btn-bg: #f1f5f9;
    --btn-bg-hover: #e2e8f0;
    --card: #ffffff;
    --card-hover-border: rgba(124,58,237,0.45);
    --card-shadow-hover: 0 16px 40px -18px rgba(15,23,42,0.22);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: var(--font), Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.7;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar__inner {
    max-width: 1200px; margin: 0 auto;
    display:flex; align-items:center; justify-content:space-between;
    padding: 14px 24px; gap: 16px;
}
.topbar__logo { display:flex; align-items:center; gap: 10px; font-weight: 800; color: var(--text); }
.topbar__logo img { height: 32px; width: auto; }
.topbar__back {
    display:inline-flex; align-items:center; gap: 6px;
    padding: 0 16px; min-height: 44px; border-radius: 10px;
    background: var(--btn-bg); color: var(--text);
    font-size: 13px; font-weight: 600;
    transition: background 0.2s;
}
.topbar__back:hover { background: var(--btn-bg-hover); text-decoration: none; }

.hero {
    max-width: 1200px; margin: 40px auto 8px; padding: 0 24px;
    text-align: center;
}
.hero h1 {
    font-size: clamp(26px, 3.6vw, 42px);
    font-weight: 900; line-height: 1.35; margin-bottom: 12px;
}
.hero p { color: var(--muted); font-size: 15.5px; max-width: 720px; margin: 0 auto; }
.hero__stats {
    margin-top: 16px; font-size: 13px; color: var(--muted);
    display:inline-flex; gap:10px; padding: 6px 14px; border-radius: 999px;
    background: var(--btn-bg); border: 1px solid var(--border);
}

.cats {
    max-width: 1200px; margin: 28px auto 8px; padding: 0 24px;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.cats a {
    padding: 0 18px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px;
    background: var(--btn-bg); color: var(--text);
    font-size: 13px; font-weight: 700; text-decoration: none;
    border: 1px solid var(--border);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cats a.is-active, .cats a:hover {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff; border-color: transparent; text-decoration: none;
}

.grid {
    max-width: 1200px; margin: 28px auto 0;
    padding: 0 24px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.card {
    display: flex; flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none; color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
html[data-theme="light"] .card { box-shadow: 0 4px 18px -10px rgba(15,23,42,0.08); }
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--card-hover-border);
    text-decoration: none;
}
.cover {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden;
    background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(59,130,246,0.18));
}
.cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.card:hover .cover img { transform: scale(1.05); }
.cover--empty {
    display: flex; align-items:center; justify-content:center;
    font-size: 48px; color: var(--muted);
}
.cat-badge {
    position: absolute; top: 12px; inset-inline-start: 12px;
    background: rgba(124,58,237,0.92); color: #fff;
    padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
}
.body { padding: 18px 20px 22px; display:flex; flex-direction:column; gap: 10px; flex:1; }
.title { margin:0; font-size: 17px; font-weight: 800; line-height: 1.5; color: var(--text);
    display:-webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow:hidden; }
.excerpt { margin:0; font-size: 13px; line-height:1.7; color: var(--muted);
    display:-webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow:hidden; }
.meta { display:flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.read { margin-top:auto; padding-top: 8px; font-size: 13px; font-weight: 700; color: var(--accent-2); }

.empty {
    max-width: 540px; margin: 60px auto 40px; padding: 0 24px; text-align:center;
    color: var(--muted);
}
.empty__icon { font-size: 64px; margin-bottom: 12px; opacity: 0.6; }

.pager {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin: 16px auto 60px; padding: 0 24px;
    flex-wrap: wrap;
}
.pager a, .pager span {
    min-width: 44px; height: 44px;
    display:inline-flex; align-items:center; justify-content:center;
    padding: 0 12px; border-radius: 10px;
    background: var(--btn-bg); color: var(--text);
    font-size: 13px; font-weight: 700;
    text-decoration: none; border: 1px solid var(--border);
    transition: background 0.2s;
}
.pager a:hover { background: var(--btn-bg-hover); text-decoration:none; }
.pager .is-active {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff; border-color: transparent;
}
.pager .is-disabled { opacity: 0.4; pointer-events: none; }

.theme-toggle {
    display:inline-flex; align-items:center;
    background: var(--btn-bg); border-radius: 999px; padding: 3px;
    margin-inline-end: 8px;
}
.theme-toggle a {
    width: 44px; height: 44px; border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    color: var(--muted); font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.theme-toggle a.is-active { background: var(--accent); color: #fff; }

.list-head { max-width: 1200px; margin: 28px auto 0; padding: 0 24px; font-size: 22px; font-weight: 800; }
.list-head + .grid { margin-top: 16px; }
.about { max-width: 900px; margin: 0 auto 60px; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); }
.about h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.about p { color: var(--muted); font-size: 14.5px; margin-bottom: 10px; }
.about ul { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; font-size: 14px; font-weight: 700; }
@media (max-width: 940px) { .about { margin-inline: 16px; } }
@media (max-width: 640px) {
    .list-head { padding: 0 16px; }
    .grid { grid-template-columns: 1fr; gap: 16px; padding: 0 16px 32px; }
    .hero { margin-top: 28px; padding: 0 16px; }
    .cats { padding: 0 16px; }
}
