:root {
    --text: #111827;
    --muted: #6b7280;
    --link: #1f2937;
    --accent: #4f46e5;
    --bg: #ffffff;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

/* ---------- Mobile-first reading ---------- */
html {
    font-size: 20px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Cambria, "Cambria Math", Georgia, serif;
    line-height: 1.9;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Public ---------- */
.public-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 22px 56px;
}

/* Homepage site title */
.site-title {
    font-size: 2.4rem;
    margin: 0;
    letter-spacing: 0.3px;
}

.site-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Article page title (centered) */
.post-title {
    font-size: 2.4rem;
    margin: 0;
    text-align: center;
    letter-spacing: 0.3px;
}

/* Divider */
.divider {
    margin: 22px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

/* Post list */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    padding: 18px 4px;
    border-bottom: 1px solid var(--border);
}

.post-list li a {
    font-size: 1.15rem;
    line-height: 1.4;
}

/* Article body text — justified */
.post-content {
    font-size: 1.15rem;
    text-align: justify;
    text-justify: inter-word;
}

.post-content h1 {
    font-size: 2.1rem;
}

.post-content h2 {
    font-size: 1.6rem;
}

.post-content h3 {
    font-size: 1.3rem;
}

.post-content p {
    margin: 0.9em 0;
}

.post-content ul {
    padding-left: 1.4em;
}

/* Back link */
.back-link {
    margin-top: 32px;
    display: inline-block;
    color: var(--muted);
}

/* ---------- Admin (unchanged, compact) ---------- */
@media (min-width: 900px) {
    html {
        font-size: 16px;
    }

    .admin-container {
        max-width: 1000px;
        margin: 40px auto;
        padding: 24px;
    }

    input,
    textarea {
        width: 100%;
        font-family: inherit;
        font-size: 1rem;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 4px;
    }

    textarea {
        min-height: 320px;
    }

    button {
        padding: 8px 14px;
        border: 1px solid var(--border);
        background: #fff;
        cursor: pointer;
    }

    button:hover {
        background: #f3f4f6;
    }
}

/* Reduce base font size on small mobile screens */
@media (max-width: 480px) {
    html {
        font-size: 17px;
    }
}

/* Slightly reduce article heading size on small mobile screens */
@media (max-width: 480px) {
    .post-title {
        font-size: 1.5rem;
    }
}

/* Center-align homepage title and subtitle */
.site-title,
.site-subtitle {
    text-align: center;
}

/* ---------- Admin: Professional post list ---------- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.admin-actions a {
    margin-left: 12px;
}

.btn-primary {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: #111827;
    color: #ffffff;
    text-decoration: none;
}

.btn-primary:hover {
    background: #1f2937;
}

.btn-secondary {
    padding: 8px 14px;
    border: 1px solid var(--border);
    text-decoration: none;
}

.admin-list {
    border-top: 1px solid var(--border);
}

.admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 6px;
    border-bottom: 1px solid var(--border);
}

.admin-title {
    font-size: 1rem;
}

.admin-controls a {
    margin-right: 12px;
}

.admin-controls button {
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    padding: 0;
}

.admin-controls button:hover {
    text-decoration: underline;
}

.deleted {
    background: #fafafa;
}

.deleted-text {
    color: var(--muted);
    text-decoration: line-through;
}

.status {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Improve comment box on small mobile screens */
@media (max-width: 480px) {
    .comment-form textarea {
        width: 100%;
        min-height: 140px;
        /* more comfortable on iPhone */
        font-size: 1rem;
    }
}