/* =========================================================================
   Blog — global design system
   Modern, accessible, mobile-first.
   ========================================================================= */

:root {
    /* Theme primaries — overridden inline by SiteSettings via base.html */
    --primary: #6366f1;
    --accent: #8b5cf6;
    --nav-accent: #38ada9;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #0f172a;

    /* Auto-derived variants — always tracked from the primaries above */
    --primary-hover: color-mix(in srgb, var(--primary) 82%, black);
    --primary-soft:  color-mix(in srgb, var(--primary) 12%, white);
    --primary-ring:  color-mix(in srgb, var(--primary) 22%, transparent);
    --primary-glow:  color-mix(in srgb, var(--primary) 40%, transparent);
    --accent-hover:  color-mix(in srgb, var(--accent) 82%, black);
    --nav-accent-hover: color-mix(in srgb, var(--nav-accent) 82%, black);

    --bg-mesh: radial-gradient(at 0% 0%, color-mix(in srgb, var(--primary) 10%, transparent) 0, transparent 50%),
                radial-gradient(at 100% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0, transparent 50%);
    --surface-2: color-mix(in srgb, var(--surface) 92%, var(--text));
    --border:    color-mix(in srgb, var(--text) 12%, var(--surface));

    --text-muted: color-mix(in srgb, var(--text) 55%, var(--surface));
    --text-light: color-mix(in srgb, var(--text) 8%, white);

    --success: #10b981;
    --success-soft: color-mix(in srgb, #10b981 16%, white);
    --warning: #f59e0b;
    --warning-soft: color-mix(in srgb, #f59e0b 16%, white);
    --danger: #ef4444;
    --danger-hover: color-mix(in srgb, #ef4444 82%, black);
    --danger-soft: color-mix(in srgb, #ef4444 14%, white);
    --info: #0ea5e9;
    --info-soft: color-mix(in srgb, #0ea5e9 14%, white);

    --sidebar-width: 260px;
    --navbar-height: 70px;

    /* Radius — scaled by --radius-mult so the radius preset can re-tune the whole scale */
    --radius-mult: 1;
    --radius-sm: calc(8px  * var(--radius-mult));
    --radius:    calc(12px * var(--radius-mult));
    --radius-lg: calc(16px * var(--radius-mult));
    --radius-xl: calc(24px * var(--radius-mult));

    --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
    --shadow-sm: 0 4px 12px rgba(15,23,42,.06);
    --shadow: 0 10px 30px -10px rgba(15,23,42,.15);
    --shadow-lg: 0 25px 50px -12px rgba(15,23,42,.25);

    --font-heading: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body:    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

/* Border-radius presets — applied via [data-radius="…"] on <html> from base.html */
:root[data-radius="sharp"]    { --radius-mult: 0; }
:root[data-radius="soft"]     { --radius-mult: 1; }
:root[data-radius="rounded"]  { --radius-mult: 1.6; }
:root[data-radius="pillowy"]  { --radius-mult: 2.4; }

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-mesh);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
}
h1 { font-size: clamp(1.75rem, 2.5vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2vw, 1.875rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; cursor: pointer; }

/* ----- Container ----- */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .9rem;
    border: 1.5px solid transparent;
    background: var(--surface-2);
    color: var(--text);
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-ghost     { background: transparent; }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn-sm { padding: 7px 14px; font-size: .825rem; }
.btn-block { width: 100%; }

/* Icon-only square actions */
.btn-icon {
    width: 38px; height: 38px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}
.btn-edit   { background: var(--primary-soft); color: var(--primary); }
.btn-edit:hover { background: var(--primary); color: #fff; }
.btn-del    { background: var(--danger-soft); color: var(--danger); }
.btn-del:hover { background: var(--danger); color: #fff; }
.btn-archive { background: var(--warning-soft); color: var(--warning); }
.btn-archive:hover { background: var(--warning); color: #fff; }
.btn-status { background: var(--success-soft); color: var(--success); }
.btn-status:hover { background: var(--success); color: #fff; }
.btn-key    { background: var(--info-soft); color: var(--info); }
.btn-key:hover { background: var(--info); color: #fff; }

/* ----- Cards ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card-body { padding: 24px; }
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ----- Badges ----- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-published { background: var(--success-soft); color: #065f46; }
.badge-draft     { background: var(--warning-soft); color: #92400e; }
.badge-archived  { background: var(--danger-soft);  color: #991b1b; }
.badge-info      { background: var(--info-soft);    color: #075985; }
.badge-primary   { background: var(--primary-soft); color: var(--primary-hover); }

/* ----- Forms ----- */
.form-control,
.form-select,
input[type=text], input[type=email], input[type=password],
input[type=url], input[type=tel], input[type=number],
input[type=search], textarea, select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .92rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus,
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}
label, .form-label {
    font-weight: 600;
    font-size: .82rem;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}
.form-text { font-size: .8rem; color: var(--text-muted); }
.form-fields p { margin-bottom: 18px; }

/* Checkbox */
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ----- Alerts ----- */
.alerts { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    background: var(--primary-soft);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    box-shadow: var(--shadow-xs);
}
.alert-success { background: var(--success-soft); border-color: var(--success); color: #065f46; }
.alert-error,
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger);  color: #991b1b; }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: #92400e; }
.alert-info    { background: var(--info-soft);    border-color: var(--info);    color: #075985; }
.alert .close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    opacity: .6;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ----- Tables ----- */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 14px 18px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.table thead th {
    background: var(--surface-2);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }

/* ----- Pagination ----- */
.pagination {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination a, .pagination .current, .pagination .disabled {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { opacity: .4; }

/* =========================================================================
   PUBLIC SITE — header, hero, blog grid, footer
   ========================================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-nav {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
}
.brand img { height: 36px; width: auto; }
.brand span { color: var(--primary); }

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}
.nav-links a {
    color: var(--text);
    font-weight: 600;
    font-size: .92rem;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -22px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    padding: 6px 8px 6px 14px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    transition: var(--transition);
}
.nav-search:focus-within { border-color: var(--primary); background: #fff; }
.nav-search input {
    border: none;
    background: transparent;
    padding: 4px 0;
    font-size: .88rem;
    width: 180px;
}
.nav-search input:focus { box-shadow: none; }
.nav-search button {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
}

.menu-toggle {
    display: none;
    width: 42px; height: 42px;
    border: none;
    background: var(--surface-2);
    border-radius: 12px;
    color: var(--text);
    font-size: 1.1rem;
}

.hero {
    position: relative;
    padding: 140px 0 80px;
    text-align: center;
    color: #fff;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--primary) 92%, transparent),
            color-mix(in srgb, var(--accent)  92%, transparent)),
        url("/static/blogapp/css/images/banner.jpg") center/cover no-repeat;
}
.hero--image { background-color: var(--surface-2); }
.hero .tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 18px;
}
.hero h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    max-width: 800px;
    margin: 0 auto 18px;
    color: #fff;
}
.hero p { max-width: 600px; margin: 0 auto; opacity: .9; font-size: 1.05rem; }
.hero-cta {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 24px;
    padding: 12px 24px;
    background: #fff;
    color: var(--primary) !important;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.2); }

/* Floating back-to-top button */
.back-to-top {
    position: fixed;
    right: 22px; bottom: 22px;
    width: 46px; height: 46px;
    border: none; border-radius: 50%;
    background: var(--primary); color: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background .25s ease;
    z-index: 9000;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-hover); }
@media (max-width: 600px) { .back-to-top { right: 14px; bottom: 14px; } }

/* Blog grid */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    padding: 32px 0;
}
@media (max-width: 992px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.section-head h2 { margin: 0; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tab {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Category dropdown — replaces the per-category chip row beside the
   "Latest Articles" heading on the blog list page. Native <select> styled
   to match the rest of the UI; submits on change for a no-JS-fallback. */
.cat-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.cat-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 9px 38px 9px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 180px;
    transition: var(--transition);
}
.cat-select:hover  { border-color: var(--primary); color: var(--primary); }
.cat-select:focus  { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cat-select-caret  {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: .72rem;
    color: var(--text-muted);
}
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
@media (max-width: 992px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
}
.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.blog-card .thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
}
.blog-card .thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.blog-card:hover .thumb img { transform: scale(1.05); }
.blog-card .cat-pill {
    position: absolute;
    top: 14px; left: 14px;
    background: rgba(255,255,255,.95);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.blog-card .body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.blog-card h3 {
    font-size: 1.18rem;
    line-height: 1.35;
    margin: 0;
}
.blog-card h3 a { color: var(--text); }
.blog-card h3 a:hover { color: var(--primary); }
.blog-card .excerpt {
    /* Same serif used in the article body for visual continuity from card
       to detail page; slightly smaller, with a relaxed line-height that
       reads well in a 14-word teaser. */
    font-family: "Lora", "Source Serif 4", Georgia, "Times New Roman", serif;
    color: #475569;
    font-size: .96rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
    margin: 0;
    flex: 1;
}
.blog-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    color: var(--text-muted);
    font-size: .82rem;
}
.read-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: auto;
    padding: 10px 14px;
    background: var(--primary);
    color: #fff !important;
    font-weight: 600;
    font-size: .88rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15,23,42,.1);
    transition: transform .2s ease, box-shadow .2s ease, gap .2s ease;
}
.read-more:hover {
    gap: 10px;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15,23,42,.18);
}

/* =========================================================================
   Sidebar widgets — colourful, on-brand
   ========================================================================= */
.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
/* Gradient bar across the top of every widget — clear visual punch. */
.widget::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.widget:hover {
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
    transform: translateY(-2px);
}
.widget h3 {
    margin: 0 0 18px;
    font-size: 1.05rem;
    padding-bottom: 12px;
    border-bottom: 1px dashed color-mix(in srgb, var(--primary) 25%, transparent);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
/* Wrap the icon in a soft rounded badge so the heading reads as a "label". */
.widget h3 > i:first-child {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 18%, white),
        color-mix(in srgb, var(--accent) 18%, white));
    color: var(--primary) !important;
    font-size: .92rem;
}

/* Always-visible themed scrollbar so users see the section IS scrollable. */
.widget-scroll {
    max-height: 320px;
    overflow-y: scroll;        /* scroll, not auto — gutter stays visible */
    overflow-x: hidden;
    padding-right: 10px;
    margin-right: -10px;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 50%, transparent) color-mix(in srgb, var(--primary) 8%, transparent);
}
.widget-scroll::-webkit-scrollbar { width: 8px; }
.widget-scroll::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    border-radius: 999px;
}
.widget-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--primary) 60%, transparent),
        color-mix(in srgb, var(--accent) 60%, transparent));
    border-radius: 999px;
    border: 1.5px solid var(--surface);
}
.widget-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

/* ---------- Categories list ---------- */
.cat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.cat-list li { margin: 0; }
/* Cap the categories scroller at ~3 items so the 4th peeks below the fold —
   makes it obvious there's more to scroll. */
.cat-list.widget-scroll { max-height: 158px; }
.cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    color: var(--text);
    font-weight: 500;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    border: 1px solid transparent;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
/* Coloured leading rail — cycles colour-mixed accent shades for visual variety. */
.cat-list a::before {
    content: "";
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 30%, transparent);
    transition: width .25s ease, background .25s ease;
}
.cat-list a:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 22%, transparent);
    transform: translateX(2px);
}
.cat-list a:hover::before {
    width: 5px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}
.cat-list a.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px var(--primary-glow);
}
.cat-list a.active::before {
    background: rgba(255,255,255,.65);
    width: 5px;
}
.cat-list a.active span,
.cat-list a.active span > i { color: inherit; }
.cat-list a span { display: inline-flex; align-items: center; gap: 10px; }
.cat-list a span > i {
    color: color-mix(in srgb, var(--primary) 75%, var(--text));
    font-size: .85rem;
    transition: color .25s ease;
}
.cat-list a .badge {
    font-size: .7rem;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    background: color-mix(in srgb, var(--primary) 14%, white);
    color: var(--primary);
    border: none;
}
.cat-list a:hover .badge { background: var(--primary); color: #fff; }
.cat-list a.active .badge { background: rgba(255,255,255,.25); color: #fff; }

/* ---------- Recent posts ---------- */
.recent-list { display: flex; flex-direction: column; gap: 12px; }
.recent-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
}
.recent-item:hover {
    background: color-mix(in srgb, var(--primary) 7%, transparent);
    border-color: color-mix(in srgb, var(--primary) 20%, transparent);
    transform: translateX(2px);
}
.recent-item img {
    width: 80px; height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    transition: transform .35s ease, box-shadow .35s ease;
    box-shadow: 0 2px 8px rgba(15,23,42,.08);
}
.recent-item:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--primary-glow);
}
.recent-item h4 {
    margin: 0 0 6px;
    font-size: .92rem;
    line-height: 1.35;
    font-weight: 600;
}
.recent-item h4 a {
    color: var(--text);
    transition: var(--transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.recent-item h4 a:hover { color: var(--primary); }
.recent-item .date {
    font-size: .76rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    border-radius: 999px;
}
.recent-item .date i { color: var(--primary); }

/* =========================================================================
   Share buttons — flat brand colours, compact, simple hover lift
   ========================================================================= */
.social-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.social-grid a,
.social-grid button {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff !important;
    font-size: 1rem;
    transition: transform .2s ease, box-shadow .2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15,23,42,.1);
    flex-shrink: 0;
}
.social-grid a:hover,
.social-grid button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15,23,42,.18);
}

/* Solid brand colours — no gradients except Instagram (its real brand
   identity is a gradient). */
.s-fb { background: #1877f2; }
.s-tw { background: #1da1f2; }
.s-ig { background: linear-gradient(45deg,#f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.s-yt { background: #ff0000; }
.s-li { background: #0a66c2; }
.s-wa { background: #25d366; }
.s-em { background: #64748b; }
.s-cp { background: var(--primary); }
.social-grid button { font: inherit; padding: 0; }

/* =========================================================================
   Footer — SCSL-style dark panel with three-column block layout
   ========================================================================= */
.footer {
    position: relative;
    background:
        radial-gradient(1200px 400px at 110% 0%,
            color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%),
        radial-gradient(900px 360px at -10% 100%,
            color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
        #0b1224;
    color: #cbd5e1;
    padding: 64px 0 28px;
    margin-top: 60px;
    overflow: hidden;
}
.footer::before,
.footer::after {
    content: "";
    position: absolute;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: .35;
    /* Soft grey/teal tint over the white-line circuit art so it blends with
       the dark navy panel instead of stark white. */
    filter: brightness(.85) contrast(.95);
}
.footer::before {
    /* Top-right corner — circuit traces radiating in from the upper edge. */
    top: 0; right: 0;
    width: 360px; height: 360px;
    background-image: url("images/site-footer-shape-1.webp");
    background-position: top right;
}
.footer::after {
    /* Bottom-left corner — opposite-corner accent for visual balance. */
    bottom: 0; left: 0;
    width: 360px; height: 360px;
    background-image: url("images/site-footer-shape-2.webp");
    background-position: bottom left;
}
@media (max-width: 900px) {
    .footer::before, .footer::after { width: 220px; height: 220px; opacity: .22; }
}
.footer .container { position: relative; z-index: 1; }

.footer-about {
    color: #94a3b8;
    font-size: .92rem;
    line-height: 1.7;
    max-width: 720px;
    margin: 0 0 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.footer a { color: #cbd5e1; text-decoration: none; transition: color .2s ease; }
.footer a:hover { color: #fff; }

.footer-col { display: flex; flex-direction: column; }
.footer-block { margin-bottom: 22px; }
.footer-block:last-child { margin-bottom: 0; }

.footer-block-head {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: .01em;
}
.footer-block-head i {
    color: #fff;
    font-size: 1rem;
}
.footer-block-head--plain {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .82rem;
    color: #fff;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    display: block;
}

.footer-block-body {
    margin: 0;
    color: #cbd5e1;
    font-size: .9rem;
    line-height: 1.55;
    padding-left: 28px;
}

.footer-links { list-style: none; padding: 0; margin: 0 0 28px; }
.footer-links li { margin-bottom: 10px; font-size: .92rem; }

.footer-follow-head {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
}
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social a {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, .35);
    background: rgba(255, 255, 255, .03);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.footer-social a:hover {
    color: #fff;
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, .18);
    padding-top: 22px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: .85rem;
    color: #94a3b8;
}
.footer-bottom p { margin: 0; }
.footer-up {
    width: 38px; height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .25);
    background: rgba(255, 255, 255, .04);
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.footer-up:hover {
    color: #fff;
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    transform: translateY(-2px);
}

/* Single blog */
.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.article-cover {
    aspect-ratio: 16 / 7;
    background: var(--surface-2);
    overflow: hidden;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { padding: 36px; }
.article-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: .88rem;
    margin-bottom: 14px;
}
.article-meta i { color: var(--primary); margin-right: 4px; }
.article h1 { margin-bottom: 18px; }
.article-content {
    /* Lora is a serif designed for screen reading — measurably better
       legibility on long-form posts than the site's sans-serif default. */
    font-family: "Lora", "Source Serif 4", Georgia, "Times New Roman", serif;
    font-size: 1.125rem;       /* 18px — slightly larger than UI body for comfort */
    line-height: 1.85;
    color: #1f2937;
    letter-spacing: 0.005em;
    word-spacing: 0.01em;
    /* Cap measure (line length) at ~75ch so eyes don't have to track too far. */
    max-width: 72ch;
    margin-left: auto;
    margin-right: auto;
}
.article-content > * + * { margin-top: 1.1em; }
.article-content p { margin: 0 0 1.1em; }
.article-content p:last-child { margin-bottom: 0; }
/* Drop cap on the first paragraph — subtle editorial feel. */
.article-content > p:first-of-type::first-letter {
    float: left;
    font-size: 3.4em;
    line-height: 0.92;
    padding: 4px 10px 0 0;
    font-weight: 700;
    color: var(--primary);
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}
.article-content h2,
.article-content h3,
.article-content h4 {
    /* Sans for headings creates contrast against the serif body. */
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-top: 1.8em;
    margin-bottom: 0.55em;
}
.article-content h2 { font-size: 1.6rem; font-weight: 700; }
.article-content h3 { font-size: 1.3rem; font-weight: 700; }
.article-content h4 { font-size: 1.1rem; font-weight: 600; }
.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
.article-content a:hover { color: var(--accent, #8b5cf6); }
.article-content strong { color: #0f172a; font-weight: 700; }
.article-content em { font-style: italic; }
.article-content ul,
.article-content ol { padding-left: 1.6em; margin: 0 0 1.1em; }
.article-content li { margin-bottom: 0.35em; }
.article-content li::marker { color: var(--primary); }
.article-content img {
    border-radius: var(--radius);
    margin: 22px auto;
    display: block;
    max-width: 100%;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: linear-gradient(180deg, var(--primary-soft), transparent);
    padding: 18px 22px;
    margin: 22px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    font-size: 1.08em;
    color: #334155;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content code {
    font-family: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
    background: #f1f5f9;
    color: #0f172a;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.9em;
}
.article-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 18px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 18px 0;
    font-size: 0.92rem;
    line-height: 1.6;
}
.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}
.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px auto;
    width: 60%;
}

.share-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.share-row span { font-weight: 600; color: var(--text-muted); }

/* Comments */
.comments-section { margin-top: 36px; }
.comment {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.comment .avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.comment .who { font-weight: 700; }
.comment .when { color: var(--text-muted); font-size: .82rem; margin-left: 8px; }
.comment p { margin: 6px 0 0; }

/* =========================================================================
   DASHBOARD — sidebar / topbar / stat cards
   ========================================================================= */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}
.app-sidebar {
    background: #0f172a;
    color: var(--text-light);
    padding: 28px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.app-sidebar .brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    padding: 0 8px 26px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 18px;
    letter-spacing: -.02em;
}
.app-sidebar .brand-row span { color: var(--primary); }

.side-section-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #64748b;
    margin: 18px 8px 10px;
}
.side-nav { list-style: none; padding: 0; margin: 0; }
.side-nav li + li { margin-top: 2px; }
.side-nav a, .side-nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: .9rem;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}
.side-nav a i, .side-nav button i { width: 20px; text-align: center; opacity: .85; }
.side-nav a:hover, .side-nav button:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}
.side-nav a.active {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 18%, transparent),
        color-mix(in srgb, var(--accent)  18%, transparent));
    color: #fff;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.side-logout {
    margin-top: 24px;
    color: #fca5a5 !important;
    border: 1px solid rgba(252,165,165,.22) !important;
    background: rgba(239,68,68,.06) !important;
}
.side-logout:hover { background: rgba(239,68,68,.18) !important; color: #fff !important; }

.app-main { display: flex; flex-direction: column; min-width: 0; }

.app-footer-text {
    margin-top: auto;
    padding: 14px 24px;
    text-align: center;
    font-size: .78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.app-topbar {
    height: var(--navbar-height);
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.app-topbar .left { display: flex; align-items: center; gap: 14px; }
.app-topbar h1 { font-size: 1.25rem; margin: 0; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--surface-2);
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: .88rem;
}
.user-chip .avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
}
.role-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--primary-soft);
    color: var(--primary);
    letter-spacing: .04em;
}

.page-content { padding: 32px 28px; flex: 1; }
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
}
.page-head .title h1 { margin-bottom: 4px; }
.page-head .subtitle { color: var(--text-muted); margin: 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.stat-icon.indigo  { background: linear-gradient(135deg,#eef2ff,#c7d2fe); color: var(--primary); }
.stat-icon.green   { background: linear-gradient(135deg,#d1fae5,#6ee7b7); color: #065f46; }
.stat-icon.amber   { background: linear-gradient(135deg,#fef3c7,#fcd34d); color: #92400e; }
.stat-icon.pink    { background: linear-gradient(135deg,#fce7f3,#f9a8d4); color: #9d174d; }
.stat .num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat .label { font-size: .82rem; color: var(--text-muted); margin: 4px 0 0; font-weight: 600; }

.action-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Auth card */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 42px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 640px; }
.auth-card h1 { text-align: center; margin-bottom: 6px; }
.auth-card .lead { text-align: center; color: var(--text-muted); margin-bottom: 26px; }
.auth-back { display: block; text-align: center; margin-top: 22px; color: var(--text-muted); font-size: .88rem; }

/* Mobile */
.mobile-drawer-bg {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.4);
    z-index: 90;
}
@media (max-width: 992px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar {
        position: fixed;
        top: 0; left: 0;
        width: var(--sidebar-width);
        z-index: 100;
        transform: translateX(-100%);
        transition: var(--transition);
    }
    .app-sidebar.open { transform: translateX(0); box-shadow: 30px 0 60px rgba(0,0,0,.3); }
    .mobile-drawer-bg.open { display: block; }
    .nav-links { display: none; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-search input { width: 110px; }
}

/* Smaller content padding */
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .auth-card { padding: 28px; }
    .article-body { padding: 22px; }
    .page-content { padding: 22px 16px; }
    .app-topbar { padding: 0 16px; }
}

/* =========================================================================
   FILTER BAR + SEARCH (industry-standard list pages)
   ========================================================================= */

.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: center;
}
.filter-bar form { margin: 0; display: contents; }

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: .9rem;
}
.search-box input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    font-size: .9rem;
    transition: var(--transition);
}
.search-box input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
    outline: none;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.filter-controls select {
    width: auto;
    min-width: 140px;
    padding: 9px 14px;
    font-size: .85rem;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}
.filter-controls select:focus { outline: none; border-color: var(--primary); }

.filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: .88rem;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .78rem;
}
.filter-chip a {
    color: var(--primary);
    line-height: 1;
    margin-left: 2px;
    opacity: .7;
}
.filter-chip a:hover { opacity: 1; }

@media (max-width: 768px) {
    .filter-bar {
        grid-template-columns: 1fr;
    }
    .filter-bar form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .filter-controls { width: 100%; }
    .filter-controls select { flex: 1; min-width: 0; }
}

/* Tabs (used in trash page) */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}
.tab {
    padding: 11px 18px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .9rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    text-decoration: none;
    transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count {
    margin-left: 6px;
    background: var(--surface-2);
    color: var(--text);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}
.tab.active .count { background: var(--primary-soft); color: var(--primary); }

/* =========================================================================
   DASHBOARD WIDGETS (industry-standard)
   ========================================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-top: 22px;
}
@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 22px;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.panel-head h3 {
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-head h3 i { color: var(--primary); }
.panel-link {
    font-size: .82rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.panel-link:hover { gap: 7px; }

/* Status breakdown bar chart */
.breakdown-bar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
    margin-bottom: 18px;
}
.breakdown-seg {
    height: 100%;
    transition: width .4s ease;
}
.breakdown-seg.published { background: var(--success); }
.breakdown-seg.draft     { background: var(--warning); }
.breakdown-seg.archived  { background: var(--danger); }
.breakdown-legend { display: grid; gap: 10px; }
.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: .88rem;
}
.breakdown-row .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.breakdown-row .dot.published { background: var(--success); }
.breakdown-row .dot.draft     { background: var(--warning); }
.breakdown-row .dot.archived  { background: var(--danger); }

/* Recent items list (for dashboard) */
.feed { display: flex; flex-direction: column; }
.feed-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-item .icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .title { font-weight: 600; font-size: .9rem; margin: 0; line-height: 1.3; }
.feed-item .title a { color: var(--text); }
.feed-item .title a:hover { color: var(--primary); }
.feed-item .meta { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }

/* Quick actions panel */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    text-align: center;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: var(--transition);
    font-size: .82rem;
    font-weight: 600;
}
.qa-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-2px);
}
.qa-btn i { font-size: 1.2rem; }

/* Top-categories list */
.cat-rank { display: flex; flex-direction: column; gap: 12px; }
.cat-rank .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .88rem;
}
.cat-rank .name { font-weight: 600; }
.cat-rank .bar {
    flex: 1;
    height: 6px;
    margin: 0 12px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.cat-rank .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Utility helpers */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex { display: flex; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 24px; }
.hidden { display: none; }

/* =========================================================================
   SCSL NAVBAR — Meta Hover Tech style
   Fixed header that's transparent on load and turns white on scroll.
   All classes prefixed with .scsl- to avoid clashing with site-header.
   ========================================================================= */
.scsl-header,
.scsl-header *,
.scsl-header *::before,
.scsl-header *::after { margin: 0; padding: 0; box-sizing: border-box; }
.scsl-header ul { list-style: none; }
.scsl-header a { text-decoration: none; color: inherit; }

.scsl-header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 9999;
    background-color: transparent;
    transition: background-color .4s ease-in-out, box-shadow .4s ease-in-out, padding .4s ease-in-out;
    padding: 15px 0;
}
.scsl-header.scsl-fixed-nav {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    padding: 5px 0;
}

.scsl-nav-container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.scsl-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    position: relative;
    gap: 20px;
}

/* Logo */
.scsl-navbar-brand { display: flex; align-items: center; position: relative; }
.scsl-logo {
    height: 50px; width: auto;
    transition: height .5s ease, opacity .5s ease;
}
.scsl-logo-light { display: block; opacity: 1; }
.scsl-logo-dark {
    display: none; opacity: 0;
    position: absolute; top: 50%; left: 0;
    transform: translateY(-50%);
    height: 50px;
}
.scsl-header.scsl-fixed-nav .scsl-logo-light { display: none; opacity: 0; }
.scsl-header.scsl-fixed-nav .scsl-logo-dark {
    display: block; opacity: 1;
    position: relative; top: auto; transform: none;
}
.scsl-header.scsl-fixed-nav .scsl-logo { height: 46px; }

/* Desktop menu */
.scsl-navbar-nav { display: flex; align-items: center; gap: 5px; }
.scsl-nav-item { position: relative; }

.scsl-nav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 28px 15px;
    font-family: "Montserrat", "Plus Jakarta Sans", sans-serif;
    font-size: 12px; font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #ffffff !important;
    transition: all .4s ease;
    position: relative;
    cursor: pointer;
}
.scsl-nav-link svg, .scsl-nav-link i { color: #ffffff; transition: color .3s ease; }
.scsl-nav-link:hover, .scsl-nav-link:hover svg, .scsl-nav-link:hover i { color: var(--nav-accent, #38ada9) !important; }

.scsl-header.scsl-fixed-nav .scsl-nav-link {
    color: var(--text) !important;
    padding: 22px 15px;
}
.scsl-header.scsl-fixed-nav .scsl-nav-link svg,
.scsl-header.scsl-fixed-nav .scsl-nav-link i { color: var(--text); }
.scsl-header.scsl-fixed-nav .scsl-nav-link:hover,
.scsl-header.scsl-fixed-nav .scsl-nav-link:hover svg,
.scsl-header.scsl-fixed-nav .scsl-nav-link:hover i { color: var(--nav-accent, #38ada9) !important; }

.scsl-chevron { font-size: 10px; transition: transform .3s ease; }
.scsl-nav-item:hover .scsl-nav-link .scsl-chevron { transform: rotate(180deg); color: var(--nav-accent, #38ada9) !important; }

/* Hover arrow indicator */
.scsl-arrow-up {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--nav-accent, #38ada9);
    opacity: 0;
    transition: all .3s ease;
}
.scsl-nav-link:hover .scsl-arrow-up { opacity: 1; }

/* Right side actions: search + button */
.scsl-nav-actions { display: flex; align-items: center; gap: 12px; }
.scsl-nav-search {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    padding: 4px 6px 4px 14px;
    transition: all .3s ease;
}
.scsl-nav-search input {
    background: transparent; border: none; outline: none;
    color: #fff;
    font-size: .85rem; width: 150px;
}
.scsl-nav-search input::placeholder { color: rgba(255,255,255,.75); }
.scsl-nav-search button {
    width: 30px; height: 30px;
    border: none; border-radius: 50%;
    background: var(--nav-accent, #38ada9); color: #fff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.scsl-header.scsl-fixed-nav .scsl-nav-search {
    background: var(--surface-2);
    border-color: var(--border);
}
.scsl-header.scsl-fixed-nav .scsl-nav-search input { color: var(--text); }
.scsl-header.scsl-fixed-nav .scsl-nav-search input::placeholder { color: var(--text-muted); }

.scsl-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px;
    background: var(--nav-accent, #38ada9);
    color: #fff !important;
    border-radius: 999px;
    font-family: "Montserrat", sans-serif;
    font-size: 12px; font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: all .3s ease;
    border: 1px solid var(--nav-accent, #38ada9);
    cursor: pointer;
}
.scsl-cta:hover { background: #2c8784; border-color: #2c8784; transform: translateY(-1px); }
.scsl-cta-outline { background: transparent; border-color: rgba(255,255,255,.5); color: #fff !important; }
.scsl-cta-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.scsl-header.scsl-fixed-nav .scsl-cta-outline { border-color: var(--border); color: var(--text) !important; }
.scsl-header.scsl-fixed-nav .scsl-cta-outline:hover { background: var(--surface-2); }

/* Dropdown */
.scsl-dropdown-menu {
    position: absolute;
    top: 100%; left: 0;
    min-width: 240px;
    background: #fff;
    border-top: 5px solid var(--nav-accent, #38ada9);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: all .3s ease;
    z-index: 1000;
}
.scsl-nav-item.scsl-dropdown:hover .scsl-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.scsl-dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    font-family: "Montserrat", sans-serif;
    font-size: 13px; font-weight: 500;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border);
    transition: all .3s ease;
}
.scsl-dropdown-menu li:last-child a { border-bottom: none; border-radius: 0 0 10px 10px; }
.scsl-dropdown-menu li a:hover { background: var(--nav-accent, #38ada9); color: #fff !important; }

/* Hamburger */
.scsl-navbar-toggle {
    display: none;
    background: transparent; border: none;
    cursor: pointer; padding: 10px;
    z-index: 10002;
}
.scsl-navbar-toggle svg { width: 28px; height: 28px; fill: #fff; transition: fill .3s ease; }
.scsl-header.scsl-fixed-nav .scsl-navbar-toggle svg { fill: var(--nav-accent, #38ada9); }

/* Spacer so page content isn't hidden behind the fixed header */
/* Spacer matches the *scrolled* navbar height (5px padding + 46px logo + 5px
   = 56px) so non-hero pages have content sit immediately below the bar. */
.scsl-header-spacer { height: 60px; }
.scsl-header-spacer.scsl-on-hero { height: 0; }

/* Mobile */
@media (max-width: 992px) {
    .scsl-navbar {
        justify-content: center;
        flex-wrap: wrap;
    }
    .scsl-navbar-toggle {
        display: block;
        position: absolute;
        left: 15px; top: 50%;
        transform: translateY(-50%);
    }
    .scsl-navbar-brand { margin: 0 auto; }
    .scsl-logo, .scsl-header.scsl-fixed-nav .scsl-logo { height: 46px; }

    .scsl-navbar-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        padding: 0;
        box-shadow: 0 10px 30px rgba(0,0,0,.15);
        z-index: 9999;
        max-height: 80vh;
        overflow-y: auto;
    }
    .scsl-navbar-nav.scsl-menu-active { display: flex; }
    .scsl-nav-item { width: 100%; border-bottom: 1px solid var(--border); }
    .scsl-nav-item:last-child { border-bottom: none; }

    .scsl-nav-link {
        color: var(--text) !important;
        padding: 16px 26px;
        justify-content: space-between;
        font-size: 13px;
    }
    .scsl-nav-link svg, .scsl-nav-link i { color: var(--text) !important; }
    .scsl-arrow-up { display: none; }

    .scsl-dropdown-menu {
        position: static;
        opacity: 1; visibility: visible; transform: none;
        min-width: 100%;
        border-top: none; border-radius: 0;
        box-shadow: none;
        max-height: 0; overflow: hidden;
        padding: 0;
        background: var(--surface-2);
        transition: max-height .4s ease;
    }
    .scsl-dropdown-menu.scsl-dropdown-active { max-height: 600px; }
    .scsl-dropdown-menu li a { padding: 13px 26px 13px 42px; color: var(--text-muted) !important; }
    .scsl-dropdown-menu li a:hover { background: var(--nav-accent, #38ada9); color: #fff !important; }
    .scsl-nav-item.scsl-dropdown:hover .scsl-dropdown-menu {
        opacity: 1; visibility: visible; transform: none; max-height: 0;
    }
    .scsl-nav-item.scsl-dropdown .scsl-dropdown-menu.scsl-dropdown-active { max-height: 600px; }

    .scsl-nav-actions {
        width: 100%;
        padding: 16px 26px;
        gap: 10px;
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
    }
    .scsl-nav-search { flex: 1; background: #fff; border-color: #e2e8f0; }
    .scsl-nav-search input { color: #0f172a; width: 100%; }
    .scsl-nav-search input::placeholder { color: #64748b; }

    .scsl-header { background: transparent; }
    .scsl-header.scsl-fixed-nav { background: #fff; }

    .scsl-header-spacer { height: 60px; }
}

/* When the page has its own hero, allow the navbar to overlap it */
.scsl-on-hero .hero { padding-top: 130px; }
