/* ============================================
   Deepora - Modern Editorial Theme
   ============================================ */
:root {
    color-scheme: light;
    --page: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #eef3f8;
    --surface-glass: rgba(255,255,255,.9);
    --ink: #17202e;
    --muted: #667085;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #e11d48;
    --accent-2: #f59e0b;
    --line: #d9e2ec;
    --body-bg:
        linear-gradient(90deg, rgba(15,118,110,.07) 1px, transparent 1px),
        linear-gradient(0deg, rgba(225,29,72,.05) 1px, transparent 1px),
        linear-gradient(135deg, #f8fafc 0%, #eef6f3 48%, #fff7ed 100%);
    --header-bg: rgba(255,255,255,.86);
    --header-bg-scrolled: rgba(255,255,255,.95);
    --header-border: rgba(217,226,236,.75);
    --soft-border: rgba(217,226,236,.9);
    --post-content-bg: rgba(255,255,255,.78);
    --quote-bg: #fff7ed;
    --quote-ink: #431407;
    --code-bg: #e0f2fe;
    --code-ink: #075985;
    --count-bg: #dbeafe;
    --count-ink: #1d4ed8;
    --solid-bg: #17202e;
    --solid-ink: #ffffff;
    --cat-bg: linear-gradient(90deg, rgba(255,255,255,.94), rgba(236,253,245,.9) 50%, rgba(239,246,255,.94));
    --cat-label: #0f766e;
    --cat-link-bg: rgba(255,255,255,.72);
    --cat-link-border: rgba(15,118,110,.16);
    --cat-link-color: #17202e;
    --cat-link-hover: rgba(15,118,110,.1);
    --cat-active-bg: #0f766e;
    --cat-active-color: #ffffff;
    --radius: 8px;
    --shadow: 0 12px 30px rgba(15, 23, 42, .08);
    --shadow-lg: 0 22px 60px rgba(15, 23, 42, .16);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #07111f;
    --surface: #101b2d;
    --surface-2: #17243a;
    --surface-glass: rgba(16,27,45,.9);
    --ink: #edf4ff;
    --muted: #a8b5c8;
    --primary: #2dd4bf;
    --primary-dark: #5eead4;
    --accent: #fb7185;
    --accent-2: #fbbf24;
    --line: #2a3a52;
    --body-bg:
        linear-gradient(90deg, rgba(45,212,191,.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(251,113,133,.06) 1px, transparent 1px),
        radial-gradient(circle at top left, rgba(45,212,191,.14), transparent 32%),
        linear-gradient(135deg, #06101d 0%, #0d1829 50%, #1b1020 100%);
    --header-bg: rgba(7,17,31,.86);
    --header-bg-scrolled: rgba(7,17,31,.96);
    --header-border: rgba(42,58,82,.86);
    --soft-border: rgba(42,58,82,.9);
    --post-content-bg: rgba(16,27,45,.82);
    --quote-bg: #251625;
    --quote-ink: #ffe4e6;
    --code-bg: #132d42;
    --code-ink: #bae6fd;
    --count-bg: #12304b;
    --count-ink: #bfdbfe;
    --solid-bg: #edf4ff;
    --solid-ink: #07111f;
    --cat-bg: linear-gradient(90deg, rgba(7,17,31,.96), rgba(15,118,110,.24) 48%, rgba(37,99,235,.16));
    --cat-label: #5eead4;
    --cat-link-bg: rgba(237,244,255,.06);
    --cat-link-border: rgba(94,234,212,.18);
    --cat-link-color: #edf4ff;
    --cat-link-hover: rgba(94,234,212,.14);
    --cat-active-bg: #2dd4bf;
    --cat-active-color: #07111f;
    --shadow: 0 16px 38px rgba(0, 0, 0, .28);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .42);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--body-bg);
    background-size: 44px 44px, 44px 44px, auto;
    line-height: 1.72;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }

.container { width: min(1180px, calc(100% - 44px)); margin: 0 auto; }

/* ============ Motion ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes shine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes pulseLine { 0%,100% { transform: scaleX(.4); opacity: .55; } 50% { transform: scaleX(1); opacity: 1; } }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-2 { transition-delay: .08s; }
.reveal-delay-3 { transition-delay: .16s; }

/* ============ Header ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    backdrop-filter: blur(18px);
    transition: box-shadow .25s ease, background .25s ease;
}
.site-header.scrolled { background: var(--header-bg-scrolled); box-shadow: 0 14px 40px rgba(15,23,42,.1); }
.site-header.header-static { position: relative; }
.site-header.header-compact .header-inner { padding: 9px 0; }
.site-header.header-compact .brand-mark,
.site-header.header-compact .brand-logo,
.site-header.header-compact .nav-toggle { width: 36px; height: 36px; }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 1.26rem;
    font-weight: 900;
    letter-spacing: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 48%, var(--accent) 100%);
    box-shadow: 0 12px 22px rgba(15,118,110,.26);
    overflow: hidden;
}
.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: 0 12px 22px rgba(15,118,110,.22);
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
    transform: translateX(-120%);
}
.brand:hover .brand-mark::after { animation: shine .75s ease; }

.site-nav { display: flex; align-items: center; gap: 12px; order: 2; }
.site-nav > a {
    color: var(--ink);
    font-weight: 800;
    font-size: .92rem;
    padding: 9px 14px;
    border-radius: var(--radius);
}
.site-nav > a:hover {
    color: var(--solid-ink);
    background: var(--solid-bg);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 3;
}
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 9px 12px;
    font: inherit;
    font-size: .9rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--primary); }
.theme-toggle-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-block;
}
.theme-toggle-icon::before,
.theme-toggle-icon::after {
    content: "";
    position: absolute;
    transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease, background .25s ease;
}
.theme-toggle-icon::before {
    inset: 2px;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset -5px -3px 0 0 var(--ink);
}
.theme-toggle-icon::after {
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-2);
    opacity: 0;
    transform: scale(.65);
}
:root[data-theme="dark"] .theme-toggle-icon::before {
    inset: 6px;
    background: var(--accent-2);
    box-shadow:
        0 -8px 0 -3px var(--accent-2),
        0 8px 0 -3px var(--accent-2),
        8px 0 0 -3px var(--accent-2),
        -8px 0 0 -3px var(--accent-2),
        6px 6px 0 -4px var(--accent-2),
        -6px -6px 0 -4px var(--accent-2),
        6px -6px 0 -4px var(--accent-2),
        -6px 6px 0 -4px var(--accent-2);
}
:root[data-theme="dark"] .theme-toggle-icon::after {
    opacity: 1;
    transform: scale(1);
}
.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: 1.3rem;
    cursor: pointer;
}

.search-form {
    display: flex;
    align-items: center;
    min-width: 230px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,118,110,.12); }
.search-form input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    padding: 10px 12px;
    font: inherit;
}
.search-form button {
    border: 0;
    background: var(--solid-bg);
    color: var(--solid-ink);
    align-self: stretch;
    padding: 0 15px;
    font-weight: 900;
    cursor: pointer;
    transition: background .2s ease;
}
.search-form button:hover { background: var(--primary); }
.search-icon {
    min-width: 46px;
    width: 46px;
    transition: width .25s ease, border-color .2s ease, box-shadow .2s ease;
}
.search-icon:focus-within,
.search-icon.open {
    width: min(260px, 42vw);
}
.search-icon input {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
    transition: width .25s ease, opacity .2s ease, padding .2s ease;
}
.search-icon:focus-within input,
.search-icon.open input {
    width: 100%;
    padding: 10px 12px;
    opacity: 1;
    pointer-events: auto;
}
.search-icon button {
    width: 46px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    position: relative;
}
.search-icon button::before {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-color: var(--solid-ink);
    border-radius: 50%;
    left: 14px;
    top: 11px;
}
.search-icon button::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background: var(--solid-ink);
    transform: rotate(45deg);
    left: 26px;
    top: 27px;
    border-radius: 99px;
}

/* ============ Category Bar ============ */
.cat-bar {
    border-top: 1px solid var(--header-border);
    border-bottom: 1px solid var(--header-border);
    background: var(--cat-bg);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.cat-bar-inner {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 0;
    overflow-x: auto;
}
.cat-bar-label {
    flex: 0 0 auto;
    color: var(--cat-label);
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.cat-link {
    flex: 0 0 auto;
    color: var(--cat-link-color);
    font-size: .88rem;
    font-weight: 800;
    padding: 6px 12px;
    border: 1px solid var(--cat-link-border);
    border-radius: var(--radius);
    background: var(--cat-link-bg);
    backdrop-filter: blur(10px);
    transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.cat-link:hover {
    color: var(--cat-link-color);
    background: var(--cat-link-hover);
    border-color: var(--cat-label);
    transform: translateY(-2px);
}
.cat-link.active {
    color: var(--cat-active-color);
    background: var(--cat-active-bg);
    border-color: var(--cat-active-bg);
}

/* ============ Home Intro ============ */
.home-intro {
    position: relative;
    margin: 34px auto 24px;
    padding: 44px 0 34px;
    border-bottom: 1px solid var(--soft-border);
    opacity: 1;
}
.intro-kicker {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .14em;
}
.intro-kicker::before {
    content: "";
    width: 38px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    transform-origin: left;
    animation: pulseLine 2.8s ease-in-out infinite;
}
.home-intro h1 {
    max-width: 850px;
    margin: 12px 0 14px;
    font-size: clamp(2.4rem, 6vw, 5.25rem);
    line-height: .95;
    letter-spacing: 0;
}
.home-intro p {
    max-width: 690px;
    color: var(--muted);
    font-size: 1.08rem;
}

/* ============ Featured ============ */
.hero { margin-top: 26px; }
.featured-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
    grid-auto-rows: 230px;
    gap: 18px;
}
.featured-main { grid-row: span 2; }
.featured-card {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--solid-bg);
    box-shadow: var(--shadow);
    isolation: isolate;
    transition: transform .32s ease, box-shadow .32s ease;
}
.featured-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.featured-card a { display: block; height: 100%; color: #fff; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease, filter .7s ease; }
.featured-card:hover img { transform: scale(1.06); filter: saturate(1.08); }
.featured-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 9px;
    padding: 24px;
    color: #fff;
    background: linear-gradient(180deg, rgba(15,23,42,.02) 0%, rgba(15,23,42,.25) 42%, rgba(15,23,42,.92) 100%);
}
.featured-overlay h2 {
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    line-height: 1.22;
    letter-spacing: 0;
}
.featured-main .featured-overlay h2 { font-size: clamp(1.7rem, 4vw, 3rem); }
.featured-overlay .meta { color: rgba(255,255,255,.8); }

/* ============ Layout ============ */
.content-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 38px;
    margin: 46px auto 76px;
    align-items: start;
}
.content-with-sidebar.no-sidebar {
    grid-template-columns: 1fr;
}
.content-with-sidebar.no-sidebar .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
    padding-bottom: 10px;
    font-size: 1.72rem;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 74px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-2));
}
.archive-desc { max-width: 720px; color: var(--muted); margin: -8px 0 24px; }
.empty-note { color: var(--muted); padding: 24px 0; }

/* ============ Post Cards ============ */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.post-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--soft-border);
    border-radius: var(--radius);
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    transition: transform .32s ease, box-shadow .32s ease, border-color .32s ease;
}
.post-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #2563eb, var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .32s ease;
}
.post-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); border-color: rgba(15,118,110,.32); }
.post-card:hover::before { transform: scaleX(1); }
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .65s ease, filter .65s ease; }
.post-card:hover .card-thumb img { transform: scale(1.07); filter: saturate(1.08) contrast(1.02); }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px; }
.card-body h3 { font-size: 1.12rem; line-height: 1.35; font-weight: 900; letter-spacing: 0; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--primary-dark); }
.card-body p { flex: 1; color: var(--muted); font-size: .94rem; }
.meta { display: flex; gap: 10px 12px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }

.badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    color: #fff !important;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #be123c);
    padding: 4px 11px;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: .07em;
    text-transform: uppercase;
    transition: transform .2s ease, box-shadow .2s ease;
}
.badge:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(225,29,72,.26); }

/* ============ Sidebar ============ */
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 110px; }
.widget {
    border: 1px solid var(--soft-border);
    border-radius: var(--radius);
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    padding: 22px;
    transition: transform .28s ease, box-shadow .28s ease;
}
.widget:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.widget-title {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
}
.popular-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.popular-list a {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    color: var(--ink);
    border-radius: var(--radius);
    padding: 6px;
    transition: background .2s ease, transform .2s ease;
}
.popular-list a:hover { background: var(--surface-2); transform: translateX(4px); }
.popular-list img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.popular-list strong { display: block; font-size: .88rem; line-height: 1.3; }
.popular-list small { color: var(--muted); font-size: .76rem; }
.cat-list { list-style: none; }
.cat-list li + li { border-top: 1px dashed var(--line); }
.cat-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
    padding: 10px 4px;
    font-weight: 750;
}
.cat-list a:hover { color: var(--primary-dark); }
.cat-list span {
    min-width: 32px;
    text-align: center;
    border-radius: 999px;
    background: var(--count-bg);
    color: var(--count-ink);
    font-size: .72rem;
    font-weight: 900;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.tag-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: 5px 12px;
    font-size: .82rem;
    font-weight: 800;
    transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease;
}
.tag-pill:hover { color: #fff; background: var(--primary); border-color: var(--primary); transform: translateY(-2px); }

/* ============ Pagination ============ */
.pagination { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 34px; }
.page-link {
    min-width: 42px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 9px 14px;
    font-weight: 850;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.page-link:hover { transform: translateY(-2px); border-color: var(--primary); }
.page-link.active { background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-ink); }

/* ============ Single Post ============ */
.single-post { max-width: 850px; margin: 46px auto 76px; }
.post-header { text-align: center; margin-bottom: 30px; }
.post-header h1 {
    margin: 16px auto;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: 0;
    font-weight: 950;
}
.post-header .meta { justify-content: center; }
.post-header .meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-glass);
    padding: 4px 12px;
}
.post-hero-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); margin-bottom: 34px; }
.post-content {
    border-radius: var(--radius);
    background: var(--post-content-bg);
    border: 1px solid var(--soft-border);
    padding: clamp(20px, 4vw, 38px);
    font-size: 1.08rem;
}
.toc-box {
    border: 1px solid var(--soft-border);
    border-radius: var(--radius);
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin: 0 0 26px;
}
.toc-box strong { display: block; margin-bottom: 10px; font-weight: 900; }
.toc-box ol { margin-left: 1.2em; color: var(--muted); }
.toc-box a { color: var(--ink); font-weight: 750; }
.toc-box a:hover { color: var(--primary); }
.post-content p { margin-bottom: 1.25em; }
.post-content h2, .post-content h3 {
    margin: 1.7em 0 .6em;
    line-height: 1.22;
    font-weight: 900;
}
.post-content ul, .post-content ol { margin: 0 0 1.25em 1.4em; }
.post-content li { margin-bottom: .4em; }
.post-content li::marker { color: var(--accent); font-weight: 900; }
.post-content img { border-radius: var(--radius); margin: 1.2em auto; box-shadow: var(--shadow); }
.post-content img.img-small { width: 32%; }
.post-content img.img-medium { width: 55%; }
.post-content img.img-large { width: 78%; }
.post-content img.img-full { width: 100%; }
.post-content img.img-center { display: block; margin-left: auto; margin-right: auto; }
.post-content img.img-left { float: left; margin: .4em 1.2em .8em 0; }
.post-content img.img-right { float: right; margin: .4em 0 .8em 1.2em; }
.post-content .image-caption { color: var(--muted); text-align: center; font-size: .9rem; margin-top: -.6em; }
.post-content .content-table { width: 100%; border-collapse: collapse; margin: 1.2em 0; overflow: hidden; border-radius: var(--radius); }
.post-content .content-table th, .post-content .content-table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.post-content .content-table th { background: var(--surface-2); }
.post-content .content-button { display: inline-block; background: linear-gradient(135deg, var(--primary), #2563eb); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-weight: 900; }
.post-content .content-button:hover { color: #fff; transform: translateY(-2px); }
.post-content blockquote {
    margin: 1.4em 0;
    padding: 18px 20px;
    border-left: 5px solid var(--accent);
    border-radius: var(--radius);
    background: var(--quote-bg);
    color: var(--quote-ink);
    font-style: italic;
}
.post-content .callout-box {
    border-left-color: var(--primary);
    background: var(--surface-2);
    color: var(--ink);
    font-style: normal;
}
.post-content pre {
    margin: 1.3em 0;
    padding: 18px;
    overflow-x: auto;
    border-radius: var(--radius);
    background: #0f172a;
    color: #e2e8f0;
}
.post-content code { border-radius: 5px; background: var(--code-bg); color: var(--code-ink); padding: 2px 6px; font-size: .9em; }
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-tags { margin-top: 26px; }

.share-bar, .author-box, .comment-form {
    border: 1px solid var(--soft-border);
    border-radius: var(--radius);
    background: var(--surface-glass);
    box-shadow: var(--shadow);
}
.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 18px 20px;
}
.share-bar span { font-weight: 900; }
.share-bar a {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    padding: 6px 13px;
    font-weight: 800;
}
.copy-link-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    padding: 6px 13px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.share-bar a:hover, .copy-link-btn:hover { border-color: var(--primary); background: var(--primary); color: #fff; }

.author-box { display: flex; gap: 16px; align-items: center; padding: 22px; margin: 30px 0; }
.author-avatar, .comment-avatar {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    font-weight: 950;
    box-shadow: 0 12px 22px rgba(37,99,235,.22);
}
.author-box h4 { font-size: 1.05rem; font-weight: 900; }
.author-box p { color: var(--muted); font-size: .94rem; }
.related-posts { margin: 46px 0; }
.related-posts h3, .comments h3 { margin-bottom: 20px; font-size: 1.35rem; font-weight: 900; }

/* ============ Comments ============ */
.comments { margin-top: 48px; }
.comment { display: flex; gap: 14px; margin-bottom: 22px; }
.comment-avatar { width: 46px; height: 46px; font-size: 1rem; }
.comment-body {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.comment-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.comment-head small { color: var(--muted); }
.comment-body p { margin: 5px 0 8px; font-size: .95rem; }
.comment-reply { margin-top: 16px; margin-bottom: 0; }
.reply-btn {
    border: 0;
    background: none;
    color: var(--primary);
    cursor: pointer;
    font-size: .84rem;
    font-weight: 900;
}
.comment-form { margin-top: 30px; padding: 26px; border-top: 4px solid var(--primary); }
.comment-form h4 { margin-bottom: 16px; font-size: 1.18rem; font-weight: 900; }
.replying-note { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.replying-note button { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 900; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.comment-form input, .comment-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 12px 14px;
    font: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.comment-form input:focus, .comment-form textarea:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15,118,110,.12);
}
.comment-form textarea { resize: vertical; margin-bottom: 14px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 0; height: 0; opacity: 0; }

/* ============ Buttons and Alerts ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    padding: 12px 24px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(15,118,110,.22);
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 36px rgba(15,118,110,.3); }
.alert { border-radius: var(--radius); padding: 13px 16px; margin-bottom: 16px; font-size: .92rem; font-weight: 750; animation: slideDown .35s ease both; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.alert-error { background: #ffe4e6; color: #881337; border: 1px solid #fda4af; }

/* ============ 404 ============ */
.error-box { text-align: center; padding: 86px 20px; }
.error-box h1 { font-size: clamp(4.5rem, 13vw, 8rem); line-height: .9; color: var(--accent); font-weight: 950; }
.error-box p { color: var(--muted); margin: 12px 0 26px; font-size: 1.08rem; }

/* ============ Footer ============ */
.site-footer {
    color: #cbd5e1;
    background: linear-gradient(135deg, #0f172a, #111827 55%, #3f0f1f);
    border-top: 4px solid var(--primary);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 38px;
    padding: 50px 0;
}
.site-footer h3, .site-footer h4 { color: #fff; margin-bottom: 12px; font-weight: 900; }
.site-footer h3 { font-size: 1.35rem; }
.site-footer p { color: #aab7c7; font-size: .92rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { color: #aab7c7; font-size: .92rem; transition: color .2s ease, padding-left .2s ease; }
.footer-links a:hover { color: #fff; padding-left: 5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: .85rem; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* ============ Back To Top ============ */
.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: var(--solid-ink);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity .25s ease, transform .25s ease, background .25s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { background: var(--primary); transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
    .content-with-sidebar { grid-template-columns: 1fr; }
    .content-with-sidebar.no-sidebar .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar { position: static; }
    .featured-grid { grid-template-columns: 1fr; grid-auto-rows: 260px; }
    .featured-main { grid-row: span 1; }
    .post-grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 720px) {
    .container { width: min(100% - 28px, 1180px); }
    .header-inner { flex-wrap: wrap; gap: 10px; }
    .brand { flex: 1 1 auto; min-width: 0; }
    .brand span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-actions { margin-left: auto; }
    .nav-toggle { display: grid; place-items: center; }
    .site-nav {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 8px 0 2px;
    }
    .site-nav.open { display: flex; animation: slideDown .25s ease both; }
    .site-nav > a { text-align: center; background: var(--surface-2); }
    .theme-toggle {
        min-width: 42px;
        height: 42px;
        justify-content: center;
        padding: 0 10px;
    }
    .theme-toggle-text { display: none; }
    .search-form { min-width: 0; width: 100%; }
    .home-intro { margin-top: 20px; padding: 28px 0; }
    .featured-grid { grid-auto-rows: 235px; }
    .post-grid, .post-grid.grid-3 { grid-template-columns: 1fr; }
    .content-with-sidebar.no-sidebar .post-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .post-content { font-size: 1rem; }
    .comment { gap: 10px; }
    .comment-avatar { width: 38px; height: 38px; }
}
