/* nurgalive.com/blog/static/css/blog.css */
/* Modernized, responsive design inspired by clean SaaS/blog aesthetics */

/* ---------- Theme tokens ---------- */
:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-2: #f1f4fa;
    --text: #0f172a;
    --heading: #0b1324;
    --muted: #64748b;
    --primary: #111827;
    --primary-contrast: #ffffff;
    --accent: #f97316;
    --border: #e2e8f0;
    --ring: rgba(15, 23, 42, 0.15);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --container: 1120px;
}

:root.dark {
    --bg: #020617;
    --surface: #0f172a;
    --surface-2: #111827;
    --text: #e2e8f0;
    --heading: #f8fafc;
    --muted: #94a3b8;
    --primary: #f97316;
    --primary-contrast: #0f172a;
    --border: #334155;
    --ring: rgba(148, 163, 184, 0.22);
    --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.55);
    --shadow-md: 0 14px 36px rgba(2, 6, 23, 0.65);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        "Apple Color Emoji",
        "Segoe UI Emoji";
    color: var(--text);
    background:
        radial-gradient(
            1200px 400px at 20% -10%,
            rgba(249, 115, 22, 0.12),
            transparent 55%
        ),
        radial-gradient(
            900px 380px at 85% -20%,
            rgba(99, 102, 241, 0.1),
            transparent 60%
        ),
        var(--bg);
    line-height: 1.65;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.45em;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--heading);
    font-family:
        "Playfair Display", Georgia, Cambria, "Times New Roman", Times, serif;
}

p {
    margin-top: 0;
}

/* ---------- Layout ---------- */
.content.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.content.container .row {
    display: block;
    margin: 0;
}

.content.container .row > [class*="col-"] {
    width: 100%;
    float: none;
    padding: 0;
}

/* ---------- Top header / navbar ---------- */
.page-header {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0;
    padding: 0.8rem 1rem;
    border: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.93),
        rgba(255, 255, 255, 0.9)
    );
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.page-header h1 a,
.page-header h1 a:visited,
.page-header h1 a:active {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(1.15rem, 2.8vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--heading);
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 12px;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.page-header h1 a:hover {
    background: #eef2ff;
    transform: translateY(-1px);
}

.top-menu,
.top-menu:hover,
.top-menu:visited {
    float: right;
    margin: 0.22rem 0 0.22rem 0.5rem;
    color: #0f172a;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.top-menu:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.top-menu .glyphicon {
    font-size: 14px;
}

/* Makes username badge cleaner */
span.top-menu {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

/* ---------- Author bio ---------- */
.author-bio {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem !important;
    box-shadow: var(--shadow-sm);
}


/* ---------- Post cards ---------- */
.post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.post:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cfd8e3;
}

.post.post-detail-card {
    border: 0;
    box-shadow: none;
    transform: none;
}

.post.post-detail-card:hover {
    border: 0;
    box-shadow: none;
    transform: none;
}

.post h2,
.post h1 {
    font-size: clamp(1.25rem, 2.8vw, 1.9rem);
    margin-bottom: 0.35rem;
}

.post .post-title {
    font-size: clamp(2.2rem, 4vw, 2.9rem);
    font-weight: 820;
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: 0.65rem;
}

.post > .post-title + .post-rich-content {
    padding-top: 1rem;
}

.post h2 a,
.post h1 a {
    color: var(--heading);
}

.post h2 a:hover,
.post h1 a:hover {
    color: #1d4ed8;
}

.date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 999px;
    padding: 0.22rem 0.62rem;
}

.date::before {
    content: "●";
    color: var(--accent);
    font-size: 0.65rem;
}

.post p {
    color: #1f2937;
}

.post-rich-content {
    color: #1f2937;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-rich-content > *:first-child {
    margin-top: 0;
}

.post-rich-content > *:last-child {
    margin-bottom: 0;
}

.post-rich-content h1,
.post-rich-content h2,
.post-rich-content h3,
.post-rich-content h4,
.post-rich-content h5,
.post-rich-content h6 {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}

.post-rich-content h1 {
    font-size: clamp(2rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.post-rich-content h2 {
    font-size: clamp(1.65rem, 2.4vw, 1.95rem);
    font-weight: 760;
    line-height: 1.16;
    letter-spacing: -0.025em;
}

.post-rich-content h3 {
    font-size: clamp(1.4rem, 1.9vw, 1.6rem);
    font-weight: 720;
    line-height: 1.22;
    letter-spacing: -0.015em;
}

.post-rich-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.26;
    letter-spacing: -0.01em;
}

.post-rich-content h5 {
    font-size: 1.08rem;
    font-weight: 680;
    line-height: 1.32;
    letter-spacing: 0;
}

.post-rich-content h6 {
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.36;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.post-rich-content p,
.post-rich-content ul,
.post-rich-content ol,
.post-rich-content blockquote,
.post-rich-content pre {
    margin-bottom: 0.8rem;
}

.post-rich-content p,
.post-rich-content li,
.post-rich-content blockquote {
    white-space: pre-wrap;
}

.post-rich-content ul,
.post-rich-content ol {
    padding-left: 1.25rem;
}

.post-rich-content ul {
    list-style: disc;
    list-style-position: outside;
}

.post-rich-content ol {
    list-style: decimal;
    list-style-position: outside;
}

.post-rich-content ul ul {
    list-style: circle;
}

.post-rich-content ol ol {
    list-style: lower-alpha;
}

.post-rich-content li {
    display: list-item;
}

.post-rich-content ul,
.post-rich-content ol,
.post-rich-content li {
    list-style: revert;
}

.post-rich-content blockquote {
    margin-left: 0;
    padding: 0.65rem 0.8rem;
    border-left: 4px solid #cbd5e1;
    border-radius: 0 10px 10px 0;
    background: #f8fafc;
    color: #334155;
}

.post-rich-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    border-radius: 6px;
    padding: 0.08rem 0.35rem;
    background: #eff6ff;
    color: #1d4ed8;
}

.post-rich-content pre {
    overflow-x: auto;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.85rem;
}

.post-rich-content pre code {
    display: block;
    border-radius: 0;
    background: transparent;
    color: inherit;
    padding: 0;
}

.post-rich-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.post-rich-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.1rem auto;
    border-radius: 0.75rem;
}

.post-rich-content img:not([data-size]) {
    width: min(640px, 100%);
}

.post-rich-content img[data-size="small"] {
    width: min(240px, 100%);
}

.post-rich-content img[data-size="medium"] {
    width: min(420px, 100%);
}

.post-rich-content img[data-size="large"] {
    width: min(640px, 100%);
}

.post-rich-content img[data-size="full"] {
    width: 100%;
}

.post-excerpt {
    margin-bottom: 0.9rem;
}

.post-meta {
    padding-top: 0.5rem;
    border-top: 1px dashed #d6e0ec;
}

.post-top-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    margin-bottom: 0.55rem;
}

.post-top-meta .date {
    margin-bottom: 0;
}

.post-reading-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.post-reading-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.post-reading-meta svg {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 auto;
}

.post-reading-meta-inline {
    margin-bottom: 0;
}

.post-top-meta-detail {
    margin-bottom: 0;
}

:root.dark .post-reading-meta span {
    border-color: #334155;
    background: #0b1220;
}

.post-comments-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #1e3a8a;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.post-comments-count {
    display: inline-flex;
    min-width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e0ecff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.post a[href*="post_detail"] {
    display: inline-flex;
    margin-top: 0.35rem;
    font-weight: 600;
    color: #1d4ed8;
}

/* ---------- Forms ---------- */
.post-form textarea,
.post-form input,
.post-form select {
    width: 100%;
    border: 1px solid #d7deea;
    border-radius: var(--radius-sm);
    background: #fff;
    color: #0f172a;
    padding: 0.7rem 0.78rem;
    font-size: 0.97rem;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.post-form textarea:focus,
.post-form input:focus,
.post-form select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.25);
}

.post-form textarea {
    min-height: 180px;
    resize: vertical;
}

.post-form {
    display: grid;
    gap: 1rem;
    max-width: 52rem;
}

.post-editor-form {
    max-width: 100%;
}

.post-editor-form > * {
    min-width: 0;
}

.post-editor-app {
    border: 1px solid #d7deea;
    border-radius: var(--radius-md);
    background: #ffffff;
    overflow: visible;
    min-width: 0;
}

.post-editor-app.active {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.25);
}

.post-editor-app .simple-editor-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: visible;
    min-width: 0;
}

.post-editor-app .simple-editor-content {
    max-width: none;
    width: 100%;
    display: block;
    height: auto;
    min-height: 0;
    min-width: 0;
}

.post-editor-app .simple-editor-content .tiptap.ProseMirror.simple-editor {
    display: block;
    flex: none;
    min-height: 320px;
    min-width: 0;
    padding: 1rem 1.1rem 1rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-editor-app .tiptap-toolbar {
    border-bottom: 1px solid #d7deea;
    background: #ffffff;
}

.post-editor-app .tiptap-toolbar[data-variant="fixed"] {
    position: sticky;
    top: 0;
    z-index: 20;
}

.post-editor-app .tiptap-button {
    border-radius: 10px;
}

.post-editor-app .tiptap-toolbar [data-active-state="on"] {
    border-color: #f97316;
    background: #fff7ed;
    color: #9a3412;
}

.editor-title-wrap {
    display: grid;
    gap: 0.45rem;
}

.editor-title-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #334155;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.editor-unpublished-banner {
    display: block;
    border: 1px solid #f59e0b;
    border-radius: var(--radius-sm);
    background: #fffbeb;
    color: #92400e;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.65rem 0.8rem;
    margin: 0.3rem 0 1rem;
}

.post-editor-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.editor-status {
    font-size: 0.86rem;
    font-weight: 600;
    color: #64748b;
}

.editor-status[data-state="saving"] {
    color: #0369a1;
}

.editor-status[data-state="saved"] {
    color: #166534;
}

.editor-status[data-state="error"] {
    color: #b91c1c;
}

.post-form > p {
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.post-form label {
    display: block;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
}

.post-form .helptext {
    color: #64748b;
    font-size: 0.82rem;
}

.post-form ul.errorlist {
    list-style: none;
    margin: 0;
    padding: 0;
    color: #b91c1c;
    font-size: 0.86rem;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 0.25rem;
}

.save,
.btn-default,
.btn.btn-default,
a.btn.btn-default,
.post-form button[type="submit"],
.post-form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 1px solid #0f172a;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    padding: 0.58rem 1rem;
    min-height: 38px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.save:hover,
.btn-default:hover,
.btn.btn-default:hover,
a.btn.btn-default:hover,
.post-form button[type="submit"]:hover,
.post-form input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn.btn-default,
a.btn.btn-default {
    text-decoration: none;
    white-space: nowrap;
}

.post-action-btn {
    min-height: 38px;
    padding: 0.58rem 1rem;
    font-size: 0.92rem;
    line-height: 1;
}

.add-comment-btn {
    min-width: 9.2rem;
    justify-content: center;
}

.save {
    float: none;
}

/* ---------- Comments ---------- */
.comment {
    margin: 0.85rem 0 0 0;
    padding: 0.95rem 1rem;
    border: 1px solid #dce7f5;
    border-left: 4px solid #c7d2fe;
    border-radius: var(--radius-md);
    background: #f6f9ff;
}

.comments-stack {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.8rem;
    margin-bottom: 0.55rem;
}

.comment-author {
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.2;
}

.comment-timestamp {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.comment-timestamp::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #94a3b8;
}

.comment-body {
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.6;
}

.comment-body p {
    margin: 0;
}

/* ---------- Theme switcher ---------- */
.theme-switcher {
    display: inline-flex;
    width: 100%;
    align-items: center;
    gap: 0.2rem;
    border: 1px solid #d8e0eb;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.2rem;
    box-shadow: var(--shadow-sm);
}

.theme-switcher-desktop {
    display: none;
}

.theme-switcher-mobile {
    width: 100%;
}

.theme-option {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.36rem 0.65rem;
    min-height: 31px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #475569;
    background: transparent;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.theme-option:hover {
    color: #0f172a;
    transform: translateY(-1px);
}

.theme-option[data-active="true"] {
    background: linear-gradient(120deg, #fb923c, #f97316);
    color: #fff;
}

.theme-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.24);
}

:root.dark .theme-switcher {
    border-color: #475569;
    background: rgba(15, 23, 42, 0.88);
}

:root.dark .theme-option {
    color: #cbd5e1;
}

:root.dark .theme-option:hover {
    color: #f8fafc;
}

:root.dark .theme-option[data-active="true"] {
    color: #0f172a;
}

/* ---------- Dark-mode component overrides ---------- */
:root.dark .page-header {
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.94),
        rgba(15, 23, 42, 0.9)
    );
}

:root.dark .page-header h1 a:hover {
    background: #1e293b;
}

:root.dark .top-menu,
:root.dark .top-menu:hover,
:root.dark .top-menu:visited {
    color: #e2e8f0;
    background: #0f172a;
    border-color: #334155;
}

:root.dark .top-menu:hover {
    border-color: #475569;
}

:root.dark span.top-menu {
    background: #3f230f;
    border-color: #7c2d12;
    color: #fdba74;
}

:root.dark .author-bio {
    background: linear-gradient(180deg, #0f172a, #111827);
    border-color: #334155;
}


:root.dark .post:hover {
    border-color: #475569;
}

:root.dark .post h2 a:hover,
:root.dark .post h1 a:hover,
:root.dark .post a[href*="post_detail"] {
    color: #93c5fd;
}

:root.dark .date {
    background: #0b1220;
    border-color: #334155;
}

:root.dark .post p {
    color: #cbd5e1;
}

:root.dark .post-rich-content {
    color: #cbd5e1;
}

:root.dark .post-rich-content blockquote {
    border-left-color: #475569;
    background: #0b1220;
    color: #cbd5e1;
}

:root.dark .post-rich-content code {
    background: #1e293b;
    color: #bfdbfe;
}

:root.dark .post-rich-content pre {
    border-color: #334155;
    background: #020617;
}

:root.dark .post-rich-content a {
    color: #93c5fd;
}

:root.dark .post-meta {
    border-top-color: #334155;
}

:root.dark .post-comments-link {
    color: #bfdbfe;
}

:root.dark .post-comments-count {
    background: #1e3a8a;
    color: #dbeafe;
}

:root.dark .post-form textarea,
:root.dark .post-form input,
:root.dark .post-form select,
:root.dark td input {
    border-color: #334155;
    background: #0b1220;
    color: #e2e8f0;
}

:root.dark .post-form label,
:root.dark td:first-child {
    color: #cbd5e1;
}

:root.dark .post-form .helptext,
:root.dark .comments-empty {
    color: #94a3b8;
}

:root.dark .editor-title-label {
    color: #cbd5e1;
}

:root.dark .editor-status {
    color: #94a3b8;
}

:root.dark .editor-status[data-state="saving"] {
    color: #7dd3fc;
}

:root.dark .editor-status[data-state="saved"] {
    color: #86efac;
}

:root.dark .editor-status[data-state="error"] {
    color: #fca5a5;
}

:root.dark .editor-unpublished-banner {
    border-color: #d97706;
    background: #422006;
    color: #fcd34d;
}

:root.dark .save,
:root.dark .btn-default,
:root.dark .btn.btn-default,
:root.dark a.btn.btn-default,
:root.dark .post-form button[type="submit"],
:root.dark .post-form input[type="submit"] {
    border-color: #f97316;
    background: #f97316;
    color: #0f172a;
}

:root.dark .comment {
    border-color: #334155;
    border-left-color: #475569;
    background: #0b1220;
}

:root.dark .comment-author {
    color: #f8fafc;
}

:root.dark .comment-body {
    color: #e2e8f0;
}

:root.dark .comment-timestamp {
    color: #94a3b8;
}

:root.dark .comment-timestamp::before {
    background: #64748b;
}

.comment-actions {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.comments-empty {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-weight: 500;
}

body.modal-open {
    overflow: hidden;
}

.delete-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.85);
}

.image-lightbox-content {
    position: relative;
    z-index: 1;
    margin: 0;
    width: min(96vw, 1200px);
    max-height: calc(100vh - 2rem);
    display: grid;
    gap: 0.75rem;
    justify-items: center;
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    width: auto;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.45);
}

.image-lightbox-caption {
    color: #e2e8f0;
    font-size: 0.95rem;
    text-align: center;
    max-width: 80ch;
    min-height: 1.4rem;
}

.post-rich-content img {
    cursor: zoom-in;
}

.image-lightbox-close {
    border-color: #e2e8f0;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
}

.image-lightbox-close:hover {
    background: #1e293b;
}

.delete-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.58);
}

.delete-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 34rem);
    border: 1px solid #dbe4ee;
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-md);
    padding: 1.1rem;
}

.delete-modal-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
}

.delete-modal-description {
    margin: 0;
    color: #334155;
    font-size: 0.95rem;
}

.delete-switch-row {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.delete-switch {
    position: relative;
    width: 50px;
    height: 30px;
    flex: 0 0 auto;
}

.delete-switch input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.delete-switch-track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    transition: background-color 0.2s ease;
}

.delete-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease;
}

.delete-switch input:checked + .delete-switch-track {
    background: #f97316;
    border-color: #f97316;
}

.delete-switch input:checked + .delete-switch-track::after {
    transform: translateX(20px);
}

.delete-switch input:focus-visible + .delete-switch-track {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.24);
}

.delete-switch-label {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
}

.delete-modal-actions {
    margin-top: 1.05rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
}

.delete-modal-actions form {
    margin: 0;
}

#confirm-delete-post-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

:root.dark .delete-modal-card {
    border-color: #334155;
    background: #0f172a;
}

:root.dark .delete-modal-description {
    color: #cbd5e1;
}

:root.dark .delete-switch-track {
    background: #1e293b;
    border-color: #475569;
}

:root.dark .delete-switch-track::after {
    background: #f8fafc;
}

:root.dark .delete-switch-label {
    color: #f8fafc;
}

/* ---------- Login page ---------- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.7rem;
    margin-bottom: 0.75rem;
}

td {
    vertical-align: middle;
}

td:first-child {
    width: 120px;
    color: #334155;
    font-weight: 600;
    padding-right: 0.55rem;
}

td input {
    width: 100%;
    border: 1px solid #d7deea;
    border-radius: var(--radius-sm);
    padding: 0.64rem 0.72rem;
}

td input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.2);
}

/* ---------- Utility-like helpers ---------- */
.u-hidden {
    display: none !important;
}

.u-pill {
    border-radius: 999px !important;
}

.u-shadow {
    box-shadow: var(--shadow-md) !important;
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    .page-header {
        padding: 0.9rem 1.35rem;
    }

    .content.container {
        padding: 1.5rem 1.35rem 4rem;
    }

    .post {
        padding: 1.25rem 1.2rem;
    }

    .theme-switcher-mobile {
        display: none;
    }
}

@media (min-width: 1024px) {
    .theme-switcher-desktop {
        display: inline-flex;
        width: auto;
    }
}

@media (max-width: 767px) {
    .page-header {
        padding: 0.65rem 0.7rem;
    }

    .top-menu,
    .top-menu:hover,
    .top-menu:visited {
        margin-left: 0.35rem;
        padding: 0.5rem 0.58rem;
        min-width: 34px;
        text-align: center;
    }

    span.top-menu {
        display: none;
    }

    .content.container {
        padding: 0.9rem 0.75rem 2.2rem;
    }

    .author-bio {
        display: block !important;
        text-align: left;
    }

    .author-bio img {
        margin-right: 0 !important;
        margin-bottom: 0.7rem;
    }

    td:first-child {
        width: 95px;
        font-size: 0.92rem;
    }

    .post-action-btn {
        min-height: 32px;
        padding: 0.45rem 0.8rem;
        font-size: 0.84rem;
    }

    .add-comment-btn {
        min-width: 8.4rem;
    }

    .comment {
        padding: 0.85rem 0.8rem;
    }

    .comment-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .comment-author {
        font-size: 0.98rem;
    }

    .comment-timestamp {
        font-size: 0.74rem;
        letter-spacing: 0.035em;
    }

    .comment-body {
        font-size: 0.95rem;
    }

    .post-top-meta {
        gap: 0.35rem;
    }

    .post-reading-meta {
        font-size: 0.78rem;
    }
}

/* ---------- Motion accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
