/* Blog — mobile-first responsive */
:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --text: #e7ecf3;
    --muted: #8b9cb3;
    --accent: #5b9fd4;
    --accent-hover: #7eb3e0;
    --border: #2d3a4d;
    --radius: 10px;
    --font: "Segoe UI", system-ui, sans-serif;
    --max: 720px;
    --header-h: 3.5rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--bg);
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

.site-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 20, 25, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
}

.logo {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo:hover,
.logo:focus {
    color: var(--accent);
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    color: inherit;
}

.nav-toggle-bar {
    display: block;
    height: 2px;
    width: 1.1rem;
    margin: 0 auto;
    background: currentColor;
    border-radius: 1px;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
}

.site-nav a:hover,
.site-nav a:focus {
    color: var(--accent);
}

.site-nav a.is-active {
    color: var(--accent);
}

@media (max-width: 639px) {
    .site-nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }

    .site-nav.is-open {
        max-height: 12rem;
    }

    .site-nav ul {
        padding: 0.75rem 1rem 1rem;
    }
}

@media (min-width: 640px) {
    .nav-toggle {
        display: none;
    }

    .site-nav ul {
        display: flex;
        gap: 1.5rem;
    }

    .site-nav a {
        padding: 0.25rem 0;
    }
}

.page-wrap {
    flex: 1 0 auto;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 1.5rem;
}

main {
    display: block;
}

.page-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.03em;
}

.page-intro {
    color: var(--muted);
    margin: 0 0 2rem;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    display: block;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.post-card:hover,
.post-card:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.post-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.post-card .meta {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

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

.pagination {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    color: var(--muted);
    text-decoration: none;
}

.pagination a:hover {
    color: var(--accent);
}

.article-meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.article-body {
    max-width: var(--max);
}

.article-body h2,
.article-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    margin: 0 0 1rem;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.article-body a {
    color: var(--accent);
}

.article-body code {
    background: var(--surface);
    padding: 0.15em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body pre {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--border);
}

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 1.25rem 1rem;
    background: var(--surface);
}

.footer-inner {
    max-width: 56rem;
    margin: 0 auto;
}

.footer-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 0.75rem;
}

.footer-link-list {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.footer-link-list a {
    color: var(--accent);
    text-decoration: none;
}

.footer-link-list a:hover {
    text-decoration: underline;
}

.footer-copy {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Admin & forms */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-danger {
    border-color: #c45c5c;
    color: #f0a0a0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 32rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.form-group textarea {
    min-height: 8rem;
    resize: vertical;
}

.form-row-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.alert-error {
    border-color: #c45c5c;
    color: #f0a0a0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    color: var(--muted);
    font-weight: 600;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
