:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --ink: #16181d;
    --muted: #626a76;
    --line: #dde2ea;
    --brand: #0b6bcb;
    --brand-dark: #064b92;
    --accent: #d33f49;
    --shadow: 0 18px 45px rgba(20, 28, 40, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header, .admin-header {
    min-height: 68px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header { position: sticky; }
.header-spacer { width: 320px; flex: 0 1 320px; }
.brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
    font-weight: 700;
    color: var(--muted);
    margin-left: auto;
}
.site-nav a:hover { color: var(--brand); }
.menu-toggle {
    display: none !important;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    gap: 4px;
}
.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 999px;
}
.menu-toggle strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.menu-toggle:hover { background: #f4f6f9; }

.hero {
    min-height: 430px;
    display: grid;
    align-items: end;
    padding: 72px 5vw 48px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(5, 8, 14, .88), rgba(5, 8, 14, .35)),
        url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1600&q=80") center/cover;
}
.hero > div { max-width: 760px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 5.4rem); line-height: .96; margin: 8px 0 18px; }
.hero p { max-width: 640px; font-size: 1.1rem; }
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; font-size: .78rem; letter-spacing: 0; }
.search-form { display: flex; gap: 10px; max-width: 560px; margin-top: 26px; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
}
button, .button, .watch-button {
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button:hover, .button:hover, .watch-button:hover { background: var(--brand-dark); }
.muted { background: #e9edf3; color: var(--ink); }

.section { padding: 44px 5vw; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section h2, .section h1 { margin: 0; }
.featured-grid, .post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
}
.post-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.post-card-media {
    aspect-ratio: 16 / 10;
    background: #20242c;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 3rem;
    font-weight: 900;
}
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 18px; }
.post-card h2 { font-size: 1.12rem; line-height: 1.25; margin: 8px 0; }
.post-card p, .page-title p, .static-page p { color: var(--muted); }
.sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    position: sticky;
    top: 92px;
}
.category-pill {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--brand);
    font-weight: 700;
}
.ad-slot {
    min-height: 110px;
    margin: 24px 5vw;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 8px;
    background: #f4f6f9;
    color: var(--muted);
    display: grid;
    gap: 8px;
    text-align: center;
    padding: 16px;
}
.ad-slot > span { font-size: .78rem; text-transform: uppercase; font-weight: 700; }
.ad-inline { grid-column: 1 / -1; margin: 4px 0; }
.sidebar .ad-slot { margin: 0 0 18px; }

.article { max-width: 920px; margin: 0 auto; padding: 42px 5vw; }
.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: .92rem; margin-bottom: 20px; }
.article-header h1 { font-size: clamp(2.1rem, 5vw, 4.5rem); line-height: 1; margin: 8px 0 18px; }
.article-header p { color: var(--muted); font-size: 1.12rem; }
.article-cover { width: 100%; max-height: 520px; object-fit: cover; border-radius: 8px; margin: 28px 0; }
.article-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px;
    font-size: 1.08rem;
}
.watch-button { margin-top: 24px; background: var(--accent); }
.related-posts { margin-top: 34px; }
.related-posts h2 { margin: 0 0 16px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.related-grid a {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.related-grid span {
    display: block;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.related-grid strong { line-height: 1.25; }
.site-footer {
    margin-top: 40px;
    padding: 36px 5vw;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    background: #10141b;
    color: #fff;
}
.site-footer p { color: #c8d0dc; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

.admin-body { background: #eef2f7; }
.admin-main { padding: 34px 5vw; }
.login-card, .admin-panel {
    max-width: 1120px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.login-card { max-width: 430px; margin-top: 8vh; }
.login-card form, .admin-form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 700; }
.admin-title { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.admin-title p { color: var(--muted); margin: 4px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.checkbox { display: flex; align-items: center; gap: 10px; }
.checkbox input { width: auto; }
.form-actions, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .88rem; text-transform: uppercase; }
.actions form { display: inline; }
.actions button { background: #d64045; padding: 8px 10px; }
.alert { background: #ffe8e9; color: #9b1c21; border-radius: 8px; padding: 12px; }
.empty { color: var(--muted); background: var(--surface); padding: 18px; border-radius: 8px; }
.static-page { max-width: 840px; }
.cookie-notice {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    max-width: 760px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; color: var(--muted); }
.cookie-notice div { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.cookie-notice a { color: var(--brand); font-weight: 700; }
.cookie-notice button { padding: 10px 14px; }

@media (max-width: 780px) {
    .site-header {
        min-height: 62px;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        position: sticky;
    }
    .admin-header, .site-footer, .admin-title { align-items: flex-start; flex-direction: column; }
    .header-spacer { display: none; }
    .brand {
        font-size: 1.55rem;
        max-width: calc(100% - 120px);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .menu-toggle {
        display: inline-flex !important;
        position: absolute;
        right: 5vw;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .site-nav {
        display: none;
        position: absolute;
        left: 5vw;
        right: 5vw;
        top: calc(100% + 8px);
        z-index: 20;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow);
        padding: 10px;
        gap: 0;
    }
    .site-nav.is-open { display: grid; }
    .site-nav a {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }
    .site-nav a:last-child { border-bottom: 0; }
    .hero { min-height: 360px; padding-top: 46px; }
    .search-form, .content-grid, .form-grid { grid-template-columns: 1fr; display: grid; }
    .content-grid { gap: 18px; }
    .sidebar { position: static; }
    .article-body { padding: 20px; }
    .cookie-notice { align-items: flex-start; flex-direction: column; }
}
