/* ===== Blog Feature Styles (VisualPatti theme) ===== */

/* Page background: soft, fixed gradient that stays clean on long/scrolling pages
   (overrides the repeating diagonal body gradient from custom.css). */
body {
    background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 100%) fixed;
    min-height: 100vh;
}

/* ===== Public site header (Visual Capitalist style) ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-topbar {
    background: #1f2430;
    color: #e5e7eb;
}
.site-topbar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.site-logo-mark {
    font-size: 1.6rem;
    color: #3b82f6;
    line-height: 1;
}
.site-logo-text {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 2px;
    color: #fff;
    font-size: 1.15rem;
}
.site-logo-text strong { font-weight: 800; }

.site-topnav {
    display: flex;
    align-items: center;
    gap: 22px;
}
.site-topnav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    transition: color 0.15s;
}
.site-topnav-link:hover { color: #fff; }
.site-topnav-strong { font-weight: 600; color: #e5e7eb; }
.site-subscribe {
    border: 1px solid #4b5563;
    padding: 7px 16px;
    border-radius: 4px;
    font-weight: 600;
}
.site-subscribe:hover { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.site-hamburger {
    background: none;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    padding: 4px;
    width: auto;
    display: flex;
}

.site-catbar {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.site-catbar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.site-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}
.site-cat {
    color: #374151;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: capitalize;
    transition: color 0.15s;
}
.site-cat:hover { color: #2563eb; }
.site-search-btn {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
    padding: 4px;
    width: auto;
    display: flex;
}
.site-search-btn:hover { color: #2563eb; }
.site-search-box {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px 12px;
}
.site-search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
}
.site-search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

@media (max-width: 768px) {
    .site-topnav { gap: 14px; }
    .site-topnav-strong, .site-subscribe, .site-topnav-dashboard { display: none; }
    .site-catbar { display: none; }
    .site-catbar.open { display: block; }
    .site-catbar.open .site-catbar-inner {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 20px;
    }
    .site-catbar.open .site-search-btn { position: static; margin-top: 8px; }
}

/* ===== Admin layout (WordPress-style sidebar) ===== */
:root { --admin-sidebar-w: 240px; }

.admin-body { background: #f1f5f9; }

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--admin-sidebar-w);
    background: #1a1a2e;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 200;
    padding: 20px 0;
}
.admin-logo {
    display: block;
    padding: 8px 22px 22px;
    text-decoration: none;
}
.admin-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: none;
}
.admin-nav { display: flex; flex-direction: column; }
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.admin-nav-link:hover { background: #24243e; color: #fff; }
.admin-nav-link.active {
    background: #24243e;
    color: #fff;
    border-left-color: #3b82f6;
}
.admin-nav-icon { width: 18px; text-align: center; opacity: 0.9; }

.admin-sidebar-bottom { padding: 0 0 4px; }
.admin-user {
    padding: 12px 22px;
    border-top: 1px solid #2d2d44;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-user-email { color: #fff; font-size: 0.85rem; font-weight: 600; word-break: break-all; }
.admin-user-roles { color: #94a3b8; font-size: 0.75rem; text-transform: capitalize; }
.admin-logout { color: #fca5a5; }
.admin-logout:hover { background: #3b1d1d; color: #fecaca; }

.admin-main {
    margin-left: var(--admin-sidebar-w);
    min-height: 100vh;
    padding: 20px 0;
}
/* Pull admin content up since there's no top navbar offset here. */
.admin-main .blog-admin { margin-top: 24px; }

.admin-mobilebar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #1a1a2e;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    z-index: 210;
}
.admin-mobile-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    width: auto;
}
.admin-mobile-logo { text-decoration: none; }
.admin-mobile-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: none;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        top: 56px;
        padding-top: 12px;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; padding-top: 68px; }
    .admin-mobilebar { display: flex; }
}

/* Shared */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 1.05rem;
}
.badge-id {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}
.status-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-draft { background: #fef3c7; color: #92400e; }
.status-published { background: #d1fae5; color: #065f46; }

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===== Admin / Manage page ===== */
.blog-admin {
    max-width: 1000px;
    margin: 100px auto 60px;
    padding: 0 20px;
}
.blog-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.blog-admin-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}
.blog-admin-actions {
    display: flex;
    gap: 10px;
}
.btn-bulk-delete {
    padding: 10px 18px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-bulk-delete:hover:not(:disabled) { background: #fecaca; }
.btn-bulk-delete:disabled { opacity: 0.5; cursor: not-allowed; }

/* Editor */
.post-editor {
    display: none;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.post-editor.active { display: block; }
.post-editor h3 {
    margin-bottom: 18px;
    font-size: 1.25rem;
    color: #1a1a2e;
}
.post-editor .form-group { margin-bottom: 16px; }
.slug-field {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.slug-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.9rem;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}
.slug-field input {
    border: none;
    border-radius: 0;
    flex: 1;
}
.slug-field input:focus {
    outline: none;
    box-shadow: none;
}
.slug-field:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.slug-hint {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
}
/* Drag & drop featured image */
.dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 22px 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: #93c5fd; background: #f1f6ff; }
.dropzone.dragover {
    border-color: #3b82f6;
    background: #e0edff;
}
.dropzone.uploading { opacity: 0.6; pointer-events: none; }
.dropzone-inner { pointer-events: none; }
.dropzone-icon {
    font-size: 1.8rem;
    color: #3b82f6;
    display: block;
    margin-bottom: 4px;
}
.dropzone-text { color: #475569; font-size: 0.95rem; margin: 0; }
.dropzone-browse { color: #2563eb; font-weight: 600; text-decoration: underline; }
.dropzone-hint { color: #94a3b8; font-size: 0.8rem; margin: 4px 0 0; }
.dropzone input[type="file"] {
    display: block;
    margin: 12px auto 0;
    width: auto;
    font-size: 0.85rem;
    cursor: pointer;
}

/* CSV table preview in the editor */
.table-preview-wrap { display: none; margin-top: 12px; }
.table-preview-wrap.active { display: block; }
.table-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}
.table-preview { overflow-x: auto; }

/* Rendered data table (editor preview + published post) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    background: #fff;
}
.data-table th, .data-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}
.data-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}
.data-table tr:nth-child(even) td { background: #f8fafc; }
.post-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 6px;
}

.image-preview-wrap {
    display: none;
    margin-top: 12px;
}
.image-preview-wrap.active { display: block; }
.image-preview-wrap img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    display: block;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}
.btn-remove-image {
    padding: 6px 12px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-remove-image:hover { background: #e2e8f0; }
.editor-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.btn-submit {
    padding: 10px 22px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-submit:hover { background: #059669; }
.btn-cancel {
    padding: 10px 22px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-cancel:hover { background: #e2e8f0; }

/* Table */
.blog-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.blog-table th, .blog-table td {
    padding: 14px 18px;
    text-align: left;
}
.blog-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.blog-table tr:not(:last-child) td { border-bottom: 1px solid #f1f5f9; }
.blog-table tr:hover td { background: #f8fafc; }
.blog-table td { color: #334155; font-size: 0.95rem; }
.col-check { width: 40px; text-align: center; }
.col-check input { width: auto; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.btn-view, .btn-edit, .btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-view { background: #e0e7ff; color: #3730a3; }
.btn-view:hover { background: #c7d2fe; }
.btn-edit { background: #dbeafe; color: #1e40af; }
.btn-edit:hover { background: #bfdbfe; }
.btn-delete { background: #fee2e2; color: #dc2626; }
.btn-delete:hover { background: #fecaca; }

/* ===== Home magazine layout (Latest / Featured / Popular) ===== */
.btn-manage {
    display: inline-block;
    padding: 8px 18px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
}

.home-layout {
    max-width: 1160px;
    margin: 30px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 34px;
    align-items: start;
}
.home-col { min-width: 0; }

/* Section headings ("Latest" / "Popular") with the angled green-style tab */
.col-heading {
    position: relative;
    border-top: 2px solid #e5e7eb;
    margin-bottom: 18px;
    height: 22px;
}
.col-heading span {
    position: absolute;
    top: -1px;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 5px 14px 5px 10px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.col-heading-popular span { right: 0; left: auto; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }

/* Shared kicker (category + time) */
.kicker {
    display: block;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 5px;
}
/* Footer "powered" block: stack lines, right-aligned. */
.footer-powered {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.kicker-time { color: #9ca3af; font-weight: 500; }
.kicker-cat { color: #6b7280; text-decoration: none; }
.kicker-cat:hover { color: #2563eb; }

/* Category page */
.category-page {
    max-width: 780px;
    margin: 40px auto 60px;
    padding: 0 20px;
}
.category-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 28px;
}
.cat-item {
    display: flex;
    gap: 20px;
    padding: 22px 0;
    border-bottom: 1px solid #eef0f3;
    text-decoration: none;
    color: inherit;
    align-items: center;
}
.cat-thumb {
    flex: 0 0 200px;
    width: 200px;
    aspect-ratio: 16 / 10;
    border-radius: 2px;
    overflow: hidden;
    background: #f1f5f9;
}
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.cat-item-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.25;
    margin-top: 2px;
}
.cat-item:hover .cat-item-title { color: #2563eb; }

/* Category tag on the single post page */
.post-cat-tag {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 12px 4px 10px;
    margin-bottom: 12px;
    text-decoration: none;
    clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.post-cat-tag:hover { background: #1d4ed8; }

@media (max-width: 600px) {
    .cat-thumb { flex-basis: 120px; width: 120px; }
    .cat-item-title { font-size: 1.1rem; }
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

/* Side items (Latest / Popular) */
.side-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eef0f3;
    text-decoration: none;
    color: inherit;
}
.side-item:first-child { padding-top: 0; }
.side-thumb {
    flex: 0 0 68px;
    width: 68px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: #f1f5f9;
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.side-meta { min-width: 0; }
.side-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}
.side-item:hover .side-title { color: #2563eb; }

/* Featured (center) */
.feat-card { display: block; text-decoration: none; }
.feat-image {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #f1f5f9;
    border-radius: 2px;
}
/* Crop to a consistent banner, anchored to the top so the title/header of
   tall infographics stays visible. */
.feat-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.feat-cat {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 12px 4px 10px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.feat-body { padding: 16px 0 20px; border-bottom: 1px solid #eef0f3; margin-bottom: 20px; }
.feat-body a { text-decoration: none; }
.feat-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
    margin-top: 2px;
}
.feat-body a:hover .feat-title { color: #2563eb; }

.feat-secondary { display: flex; flex-direction: column; gap: 16px; }
.feat-sec-item {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    align-items: center;
}
.feat-sec-thumb {
    flex: 0 0 150px;
    width: 150px;
    aspect-ratio: 16 / 10;
    border-radius: 2px;
    overflow: hidden;
    background: #f1f5f9;
}
.feat-sec-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.feat-sec-title {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.25;
}
.feat-sec-item:hover .feat-sec-title { color: #2563eb; }

@media (max-width: 980px) {
    .home-layout { grid-template-columns: 1fr; gap: 40px; }
    .home-featured { order: -1; }
}

/* ===== Single post ===== */
/* Two-column single-post layout: content left, reserved sidebar (ads) right. */
.post-layout {
    max-width: 1140px;
    margin: 40px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
}
.post-main { min-width: 0; }

.post-aside {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.aside-signup {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}
.aside-signup h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}
.aside-signup input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.aside-signup input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.aside-signup-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.aside-signup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Inline "Subscribed" confirmation (replaces the form on success) */
.subscribe-done {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #065f46;
    background: #d1fae5;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.95rem;
}
.subscribe-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Reserved ad space (empty placeholder for now). */
.ad-slot {
    min-height: 600px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .post-layout { grid-template-columns: 1fr; gap: 0; }
    .post-aside { display: none; }
}

.post-article {
    padding: 0;
}
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}
.breadcrumbs a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #94a3b8; }
.breadcrumb-current {
    color: #64748b;
    font-weight: 500;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-notfound {
    text-align: center;
    padding: 60px 20px;
}
.post-notfound h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 12px;
}
.post-notfound p {
    color: #64748b;
    margin-bottom: 24px;
}

.post-header { margin-bottom: 24px; }
.draft-tag {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    margin-bottom: 12px;
}
.post-date {
    color: #64748b;
    font-size: 0.95rem;
}
.post-hero {
    margin: 24px 0 32px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.post-hero img { width: 100%; display: block; }
.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #334155;
}
.post-content p { margin-bottom: 20px; }
.post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 32px 0 14px;
    line-height: 1.3;
}
.post-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 26px 0 12px;
    line-height: 1.3;
}
.post-content ul,
.post-content ol {
    margin: 0 0 20px 24px;
}
.post-content li { margin-bottom: 8px; }
.post-content a { color: #2563eb; text-decoration: underline; }
.post-content blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    padding: 12px 20px;
    margin: 0 0 20px;
    color: #475569;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 12px 0;
    display: block;
}

/* ===== Single-post footer (newsletter + topics + prev/next) ===== */
.post-footer {
    margin: 40px 0 0;
    padding: 0;
}
.newsletter-box {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 36px;
}
.newsletter-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}
.newsletter-sub {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 520px;
}
.newsletter-form { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.newsletter-form input {
    width: 100%;
    max-width: 520px;
    padding: 13px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}
.newsletter-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.newsletter-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.newsletter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.related-topics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding-bottom: 20px;
    margin-bottom: 8px;
}
.related-label {
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.topic-tag {
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
}
.topic-tag:hover { color: #3b82f6; }

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}
.nav-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}
.nav-card.nav-next { justify-content: flex-end; text-align: right; }
.nav-empty { visibility: hidden; }
.nav-arrow {
    font-size: 2rem;
    color: #9ca3af;
    line-height: 1;
    transition: color 0.15s;
}
.nav-card:hover .nav-arrow { color: #3b82f6; }
.nav-meta { display: flex; flex-direction: column; gap: 4px; }
.nav-kicker {
    color: #2563eb;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.nav-title {
    color: #1a1a2e;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
}
.nav-card:hover .nav-title { color: #3b82f6; }

@media (max-width: 640px) {
    .post-nav { grid-template-columns: 1fr; gap: 16px; }
    .nav-card.nav-next { justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
    .nav-empty { display: none; }
    .newsletter-box { padding: 24px; }
}

/* ===== Rich Text Editor ===== */
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f8fafc;
}
.rte-toolbar button {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    width: auto;
    transition: background 0.15s, border-color 0.15s;
}
.rte-toolbar button:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
.rte-sep {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
    margin: 0 4px;
}
.rte-editor {
    min-height: 220px;
    max-height: 480px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    background: #fff;
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
}
.rte-editor:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.rte-editor:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
}
.rte-editor h2, .rte-editor h3 { color: #1a1a2e; margin: 12px 0 8px; }
.rte-editor ul, .rte-editor ol { margin: 0 0 12px 22px; }
.rte-editor blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    padding: 8px 16px;
    margin: 0 0 12px;
    color: #475569;
    font-style: italic;
}
.rte-editor img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.rte-editor a { color: #2563eb; text-decoration: underline; }

/* ===== UI Modal ===== */
.ui-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ui-modal-overlay.active { display: flex; }
.ui-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: uiModalIn 0.2s ease-out;
}
@keyframes uiModalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.ui-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.ui-modal-message {
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 24px;
}
.ui-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 24px;
    margin-top: -12px;
}
.ui-modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.ui-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.ui-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.ui-modal-btn-cancel { background: #f1f5f9; color: #475569; }
.ui-modal-btn-cancel:hover { background: #e2e8f0; }
.ui-modal-btn-ok { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.ui-modal-btn-ok:hover { box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }

.ui-modal-custom { margin-bottom: 24px; }

/* ===== Auth / Login ===== */
.auth-section {
    max-width: 420px;
    margin: 120px auto 60px;
    padding: 0 20px;
}
.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.auth-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.auth-sub {
    color: #64748b;
    margin-bottom: 24px;
}
.auth-btn { width: 100%; margin-top: 8px; }
.auth-hint { margin-top: 16px; font-size: 0.9rem; color: #64748b; text-align: center; }
.auth-hint a { color: #3b82f6; font-weight: 600; text-decoration: none; }
.auth-hint a:hover { text-decoration: underline; }

/* Referral link box */
.referral-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.referral-info strong { color: #1a1a2e; font-size: 1.05rem; }
.referral-info p { color: #64748b; font-size: 0.9rem; margin: 4px 0 14px; }
.referral-row { display: flex; gap: 10px; }
.referral-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #334155;
}
.referral-row .btn-add { white-space: nowrap; }

/* Role badges + checkboxes */
.status-badge.role-superadmin { background: #ede9fe; color: #6d28d9; }
.status-badge.role-admin { background: #dbeafe; color: #1e40af; }
.status-badge.role-editor { background: #d1fae5; color: #065f46; }
.status-badge.role-guest { background: #f1f5f9; color: #475569; }
.roles-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.roles-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #334155;
    margin: 0;
}
.roles-checkboxes input { width: auto; }
.muted { color: #94a3b8; }

/* ===== Toast ===== */
.ui-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 1100;
}
.ui-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    .post-title { font-size: 1.9rem; }
    .blog-table th:nth-child(5), .blog-table td:nth-child(5) { display: none; }
    .row-actions { flex-wrap: wrap; }
}
