/* ==========================================================================
   DedicatedMC — Ghost theme
   Bespoke, bleeding-edge, clean. Dark ground, glass surfaces, orange→pink
   accent used sparingly, generous whitespace, hairline borders.
   Brand tokens mirror dedicatedmc.io (globals.css).
   ========================================================================== */

:root {
    --brand-orange: #FB6340;
    --brand-pink: #FB3960;
    --brand-blue: #4B90CC;
    --brand-gradient: linear-gradient(90deg, #FB6340 0%, #FB3960 100%);

    --bg: #14151E;
    --bg-elevated: #1C1E2F;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.055);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #F4F5FA;
    --text-muted: rgba(244, 245, 250, 0.62);
    --text-faint: rgba(244, 245, 250, 0.40);

    --radius: 18px;
    --radius-sm: 12px;
    --radius-pill: 999px;

    --container: 1200px;
    --container-narrow: 720px;
    --container-wide: 1080px;

    --shadow-glow: 0 24px 60px -24px rgba(251, 57, 96, 0.35);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--gh-font-body, var(--font));
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-orange); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand-pink); }
h1, h2, h3, h4 { font-family: var(--gh-font-heading, var(--font)); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1.2em; }

:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }
.site-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; padding-bottom: 96px; }

.eyebrow {
    display: inline-block;
    font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--brand-orange);
    margin-bottom: 14px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(20, 21, 30, 0.72);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: background .3s var(--ease), border-color .3s var(--ease);
}
.site-header.scrolled { background: rgba(20, 21, 30, 0.9); border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo { height: 30px; width: auto; }
.brand-wordmark { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.brand-wordmark span { color: var(--brand-orange); }
.brand-tag {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
    color: var(--text-faint); border: 1px solid var(--border); border-radius: var(--radius-pill);
    padding: 3px 9px;
}

.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-link {
    position: relative; color: var(--text-muted); font-size: 15px; font-weight: 500;
}
.nav-link::after {
    content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
    background: var(--brand-gradient); border-radius: 2px; transition: width .25s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }

.header-cta { flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 15px; padding: 11px 20px; border-radius: var(--radius-pill);
    border: 1px solid transparent; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 24px -10px rgba(251,99,64,.6); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(251,57,96,.7); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 64px; text-align: center; overflow: hidden; }
.hero::before {
    content: ""; position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
    width: 760px; height: 520px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(251, 57, 96, 0.22), rgba(251, 99, 64, 0) 70%);
    filter: blur(10px);
}
.hero .container { position: relative; }
.hero-title {
    font-size: clamp(2.2rem, 5.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em;
    max-width: 16ch; margin: 0 auto .5em;
    background: linear-gradient(180deg, #fff 30%, rgba(244,245,250,.72));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--text-muted); font-size: 1.1rem; max-width: 52ch; margin: 0 auto; }

/* ---------- Post grid + cards ---------- */
.post-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 26px; margin: 40px 0 56px;
}
.post-card {
    position: relative; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); overflow: hidden;
    transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.post-card:hover { transform: translateY(-5px); border-color: rgba(251, 99, 64, .55); background: var(--surface-hover); box-shadow: var(--shadow-glow); }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: var(--text); }
.post-card-link:hover { color: var(--text); }
.post-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-elevated); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-media--placeholder {
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(120% 140% at 0% 0%, rgba(251,99,64,.14), transparent 55%), var(--bg-elevated);
}
.post-card-media--placeholder .brand-wordmark { font-size: 26px; opacity: .5; }
.post-card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-title { font-size: 1.22rem; margin: 0; }
.post-card-excerpt { color: var(--text-muted); font-size: .95rem; margin: 0; flex: 1; }
.post-card-meta, .post-meta {
    display: flex; align-items: center; gap: 10px; color: var(--text-faint);
    font-size: 13px; font-weight: 500; margin-top: 4px;
}
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ---------- Tag chips ---------- */
.tag-chip {
    display: inline-block; align-self: flex-start;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
    color: var(--brand-orange); background: rgba(251, 99, 64, .1);
    border: 1px solid rgba(251, 99, 64, .22); border-radius: var(--radius-pill);
    padding: 4px 11px; transition: background .2s var(--ease);
}
a.tag-chip:hover { background: rgba(251, 99, 64, .18); color: var(--brand-orange); }

/* ---------- Archive heads ---------- */
.archive-head { padding: 72px 0 8px; text-align: center; }
.archive-title { font-size: clamp(2rem, 4vw, 2.8rem); }
.archive-sub { color: var(--text-muted); max-width: 56ch; margin: 0 auto; }

/* ---------- Single post ---------- */
.post { padding-top: 64px; }
.post-header { text-align: center; margin-bottom: 34px; }
.post-header .tag-chip { align-self: center; margin-bottom: 18px; }
.post-title { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-bottom: 18px; }
.post-lede { color: var(--text-muted); font-size: 1.2rem; max-width: 60ch; margin: 0 auto 20px; }
.post-header .post-meta { justify-content: center; }
.post-author { color: var(--text); font-weight: 600; }

.post-feature-media { margin: 8px 0 44px; }
.post-feature-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.post-feature-media figcaption { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 12px; }

/* ---------- Prose (gh-content) ---------- */
.gh-content { font-size: 1.08rem; }
.gh-content > * { margin-bottom: 1.5em; }
.gh-content h2 { font-size: 1.7rem; margin-top: 1.8em; }
.gh-content h3 { font-size: 1.32rem; margin-top: 1.6em; }
.gh-content a { text-decoration: underline; text-decoration-color: rgba(251,99,64,.4); text-underline-offset: 3px; }
.gh-content img, .gh-content video { border-radius: var(--radius); border: 1px solid var(--border); }
.gh-content figcaption { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 10px; }
.gh-content blockquote {
    margin: 1.6em 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--brand-orange);
    color: var(--text); font-size: 1.2rem; font-style: italic;
}
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li { margin-bottom: .5em; }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.gh-content code {
    font-family: var(--font-mono); font-size: .9em; background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px;
}
.gh-content pre {
    background: #0F1017; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 20px 22px; overflow-x: auto; font-family: var(--font-mono); font-size: .9rem; line-height: 1.6;
}
.gh-content pre code { background: none; border: none; padding: 0; }

/* Tables */
.gh-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
    font-size: 0.9rem;
    line-height: 1.5;
}
.gh-content thead th {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    padding: 11px 14px;
    border-bottom: 2px solid rgba(251, 99, 64, 0.5);
    white-space: nowrap;
    vertical-align: bottom;
}
.gh-content tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    color: var(--text-muted);
}
.gh-content tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.gh-content tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.gh-content td code, .gh-content th code {
    white-space: nowrap;
    font-size: 0.85em;
    padding: 1px 6px;
}
/* Dense tables break out wider than the reading column on desktop */
@media (min-width: 1000px) {
    .gh-content table {
        width: 92vw;
        max-width: 1040px;
        margin-left: 50%;
        transform: translateX(-50%);
    }
}
/* Narrow screens: scroll rather than crush */
@media (max-width: 640px) {
    .gh-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.kg-bookmark-card, .kg-embed-card { margin: 1.6em 0; }
.kg-width-wide { margin-inline: -80px; }
.kg-width-full { margin-inline: calc(50% - 50vw); }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; }

/* ---------- Read more + CTA band ---------- */
.read-more { margin-top: 88px; padding-top: 56px; border-top: 1px solid var(--border); }
.read-more-title { font-size: 1.3rem; margin-bottom: 8px; }
.cta-band { margin-top: 40px; }
.cta-band .container {
    text-align: center; padding: 56px 24px;
    border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
    background: radial-gradient(120% 160% at 50% 0%, rgba(251,57,96,.14), transparent 60%), var(--surface);
}
.cta-band h3 { font-size: 1.8rem; margin-bottom: 6px; }
.cta-band p { color: var(--text-muted); margin-bottom: 22px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 40px; }
.page-btn {
    padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--radius-pill);
    color: var(--text); font-weight: 500; font-size: 14px; background: var(--surface);
    transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.page-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-1px); }
.page-btn--disabled { opacity: .35; pointer-events: none; }
.page-count { color: var(--text-faint); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Empty / error ---------- */
.empty-state, .error-page { text-align: center; padding: 100px 0; }
.error-page .btn { margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--border); background: #101119; padding: 56px 0 32px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.footer-brand { max-width: 380px; }
.footer-blurb { color: var(--text-muted); font-size: .92rem; margin: 14px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { color: var(--text-muted); font-size: 15px; font-weight: 500; }
.footer-links a:hover { color: var(--brand-orange); }
.footer-legal {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border);
    color: var(--text-faint); font-size: 13px;
}

/* ---------- Mobile nav ---------- */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s var(--ease); }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
    .header-cta { display: none; }
    .nav-toggle { display: flex; margin-left: auto; }
    .site-nav {
        position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; margin: 0;
        background: rgba(16, 17, 25, .97); backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border);
        max-height: 0; overflow: hidden; transition: max-height .3s var(--ease);
    }
    .nav-open .site-nav { max-height: 60vh; }
    .site-nav .nav-link { padding: 16px 24px; width: 100%; border-bottom: 1px solid var(--border); }
    .nav-link::after { display: none; }
    .kg-width-wide { margin-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
