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

/* Custom font: drop a .ttf into assets/fonts/, then uncomment and edit:
@font-face {
    font-family: "My Font";
    src: url("fonts/MyFont-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "My Font";
    src: url("fonts/MyFont-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
*/

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: #000;
    color: #fff;
    /* After enabling @font-face above, put your family name first: */
    /* font-family: "My Font", system-ui, ... */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: #fff;
    text-decoration: underline;
}

a:hover {
    color: #ccc;
}

.container {
    width: min(760px, 92vw);
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.site-header,
.site-footer {
    border-bottom: 1px solid #333;
}

.site-footer {
    border-top: 1px solid #333;
    border-bottom: none;
    color: #888;
    font-size: 0.9rem;
}

.site-header .container,
.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.site-title {
    font-weight: bold;
    font-size: 1.25rem;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-nav a {
    text-decoration: none;
}

.site-nav a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin-top: 0;
}

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

.post-item {
    border-bottom: 1px solid #222;
    padding: 1.25rem 0;
}

.post-item h2 {
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
}

.post-item h2 a {
    text-decoration: none;
}

.post-item h2 a:hover {
    text-decoration: underline;
}

li.post-item:last-child {
    border-bottom: none;
    padding: 1.25rem 0 0 0;
}

.post-meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-excerpt {
    color: #ccc;
}

.post-body {
    font-size: 1.05rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
    border: 1px solid #333;
}

.post-body pre {
    background: #111;
    border: 1px solid #333;
    padding: 1rem;
    overflow-x: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre;
}

.post-body code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    background: #111;
    padding: 0.1em 0.35em;
    border: 1px solid #222;
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    white-space: inherit;
}

.post-body blockquote {
    border-left: 3px solid #444;
    margin: 1rem 0;
    padding-left: 1rem;
    color: #bbb;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #222;
}

.pagination-info {
    color: #888;
    font-size: 0.9rem;
}

button,
.btn,
input[type="submit"],
input[type="button"] {
    background: #fff;
    color: #000;
    border: 1px solid #fff;
    padding: 0.5rem 1rem;
    font: inherit;
    cursor: pointer;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #ddd;
}

.btn-secondary {
    background: #000;
    color: #fff;
}

.btn-secondary:hover {
    background: #222;
}

.btn-danger {
    background: #000;
    color: #fff;
    border-color: #f66;
}

.btn-danger:hover {
    background: #300;
}

label {
    display: block;
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    background: #000;
    color: #fff;
    border: 1px solid #444;
    padding: 0.6rem 0.75rem;
    font: inherit;
    margin-bottom: 1rem;
}

textarea {
    min-height: 320px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
}

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

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.flash {
    padding: 0.75rem 1rem;
    border: 1px solid #444;
    margin-bottom: 1rem;
}

.flash-error {
    border-color: #a44;
    color: #faa;
}

.flash-success {
    border-color: #4a4;
    color: #afa;
}

.login-box {
    max-width: 360px;
    margin: 2rem auto;
    padding: 1.5rem;
    border: 1px solid #333;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #222;
    vertical-align: top;
}

.admin-table th {
    color: #888;
    font-weight: normal;
    font-size: 0.9rem;
}

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

.help-text {
    color: #888;
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.upload-panel {
    border: 1px solid #333;
    padding: 1rem;
    margin-bottom: 1rem;
}

.upload-panel input[type="file"] {
    margin-bottom: 0.75rem;
}

.upload-result {
    color: #afa;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.preview-toggle {
    margin: 1rem 0;
}

.preview-box {
    border: 1px solid #333;
    padding: 1rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid #444;
    color: #888;
}

.badge-draft {
    border-color: #a66;
    color: #faa;
}

