:root {
    color-scheme: dark;
    --page-bg: #080b12;
    --surface: #111827;
    --surface-raised: #172033;
    --border: #293548;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --blue: #3b82f6;
    --blue-light: #93c5fd;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            ellipse at top,
            rgba(30, 64, 175, .12),
            transparent 55%
        ),
        var(--page-bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--blue-light);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px max(24px, calc((100% - 1100px) / 2));
    background: rgba(8, 11, 18, .96);
    border-bottom: 1px solid var(--border);
}

.logo {
    color: #f9fafb;
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -.5px;
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

.site-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: .94rem;
    transition: color .2s ease;
}

.site-nav a:hover {
    color: #fff;
}

.view-post-page {
    width: min(850px, calc(100% - 32px));
    margin: 38px auto 60px;
}

.post-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    color: #fff;
}

.post-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, .3);
}

.post-cover-wrap {
    width: 100%;
    max-height: 520px;
    overflow: hidden;
    background: #0b1220;
}

.post-cover {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #0b1220;
}

.post-body {
    padding: 30px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
}

.post-category,
.post-status {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 700;
}

.post-category {
    color: #93c5fd;
    background: #172554;
    border: 1px solid #1e40af;
}

.post-status-draft {
    color: #fde68a;
    background: #422006;
    border: 1px solid #92400e;
}

.post-title {
    margin: 0 0 24px;
    color: #f9fafb;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.author-avatar-link {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.author-avatar {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #374151;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.author-name {
    color: #93c5fd;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.author-name:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.author-caption {
    color: var(--muted);
    font-size: .84rem;
}

.post-region {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    margin-bottom: 22px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0b1220;
    color: #cbd5e1;
}

.post-region strong {
    color: #f9fafb;
}

.post-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.post-content-section h2 {
    margin: 0 0 16px;
    color: #f3f4f6;
    font-size: 1.15rem;
}

.post-content {
    color: #d1d5db;
    font-size: 1.04rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
    white-space: normal;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .88rem;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: #2563eb;
    border-color: #3b82f6;
}

.button-primary:hover {
    background: #1d4ed8;
}

.button-secondary {
    color: #e5e7eb;
    background: #263449;
    border-color: #3b4b61;
}

.button-secondary:hover {
    background: #34445b;
}

.post-error {
    padding: 35px 25px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .25);
}

.error-icon {
    font-size: 3rem;
}

.post-error h1 {
    color: #f9fafb;
}

.post-error p {
    margin-bottom: 24px;
    color: #cbd5e1;
    line-height: 1.7;
}

.site-footer {
    padding: 25px 16px;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid var(--border);
    font-size: .88rem;
}

a:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 4px;
}

@media (max-width: 650px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .site-nav {
        gap: 12px 16px;
    }

    .view-post-page {
        width: calc(100% - 20px);
        margin: 22px auto 40px;
    }

    .post-body {
        padding: 20px;
    }

    .post-cover-wrap,
    .post-cover {
        max-height: 340px;
    }

    .post-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.post-video {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 24px auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border: 1px solid #263247;
    border-radius: 12px;
}

.post-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
