/* Global layout */

body.page-bg {
    background-color: #1a1d20;
    color: #f2f2f2;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

/* Top bar / header */

.topbar {
    background-color: #111316;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #2a2f35;
}

.site-name {
    font-weight: 600;
    font-size: 1rem;
}

.site-link {
    color: #fff;
    text-decoration: none;
}

.site-link:hover {
    text-decoration: underline;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 0.8rem;
    color: #cfcfcf;
}

/* Content grids */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px,100%), 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.layout-center {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Cards */

.card {
    background-color: #24292f;
    border: 1px solid #2f353d;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.card-narrow {
    max-width: 360px;
    margin: 60px auto;
}

.card-wide {
    max-width: 100%;
}

.title {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* Posts */

.post-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-image {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #2f353d;
    background-color: #000;
}

.post-image-large {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #2f353d;
    background-color: #000;
    margin-bottom: 16px;
}

.post-title {
    margin: 0;
    color: #fff;
    font-weight: 600;
    font-size: 1.3rem;
}

.post-title-link {
    color: #fff;
    text-decoration: none;
}

.post-title-link:hover {
    text-decoration: underline;
}

.post-meta {
    color: #9ba1ac;
    margin-bottom: 8px;
}

.post-snippet,
.post-body {
    color: #d8dee9;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Recent post list in admin */

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

.post-list-item {
    background-color: #1f242a;
    border: 1px solid #2f353d;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.post-list-item .muted {
    margin-top: 4px;
}

/* Forms */

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: #e1e4e8;
    font-weight: 500;
    gap: 6px;
}

.input,
.textarea {
    background-color: #1a1d20;
    border: 1px solid #3b414c;
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
}

.input:focus,
.textarea:focus {
    outline: 2px solid #4b9cff;
    border-color: #4b9cff;
    box-shadow: 0 0 10px rgba(75,156,255,0.4);
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.hint {
    font-size: 0.75rem;
    color: #8a8f99;
}

/* Buttons / links */

.btn-primary {
    background: linear-gradient(to right, #4b9cff, #5f61ff);
    border: none;
    border-radius: 10px;
    color: #fff;
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 15px 30px rgba(75,156,255,0.4);
}

.btn-primary:hover {
    filter: brightness(1.07);
}

.btn-secondary {
    background-color: #2f353d;
    border: 1px solid #434c5a;
    color: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: #3a414d;
}

.btn-link {
    color: #4b9cff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.small {
    font-size: 0.8rem;
}

.full-width {
    width: 100%;
}

/* Alerts */

.alert {
    background-color: #602a2a;
    border: 1px solid #a33a3a;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Utility */

.muted {
    color: #8a8f99;
}

.footer {
    text-align: center;
    padding: 30px 20px 60px;
    color: #6d6f75;
    border-top: 1px solid #2a2f35;
    margin-top: 40px;
}
