/* =============================================================
   InfoShalaa — Single Article Page (Standalone Module)
   Pure CSS. Light theme only.
   ============================================================= */

:root {
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --text: #0b1220;
    --text-soft: #475569;
    --text-muted: #64748b;
    --border: #e5eaf3;
    --border-strong: #d5deee;
    --card: #ffffff;
    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-soft: #eef4ff;
    --primary-soft-2: #dbeafe;
    --tag-bg: #eaf1ff;
    --tag-text: #1d4ed8;
    --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.08);
    --card-shadow-hover: 0 4px 8px rgba(15, 23, 42, 0.06), 0 24px 40px -18px rgba(37, 99, 235, 0.22);
    --radius: 18px;
    --radius-sm: 12px;
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
    --code-comment: #64748b;
    --code-keyword: #93c5fd;
    --code-string: #86efac;
    --code-fn: #fbbf24;
    --code-type: #f472b6;
    --code-num: #fdba74;
}

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

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
    font-size: 15.5px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

::selection {
    background: var(--primary);
    color: #fff;
}

h1,
h2,
h3,
h4 {
    font-family: "Sora", "Manrope", sans-serif;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ READING PROGRESS ============ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    z-index: 200;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* ============ NAVBAR (same as articles page) ============ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.navbar__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 76px;
}

.logo {
    font-family: "Sora", sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: var(--text);
    letter-spacing: -0.02em;
    flex-shrink: 0;

    display: flex;

    align-items: center;

    gap: 8px;
}

.logo > span {
    color: var(--text);
}

.logo > span span {
    color: var(--primary);
}
.logo > span span {

    color: var(--primary);

}

.logo-img {

    width: 60px;

    height: 60px;

    object-fit: contain;

}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 32px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.18s, background-color 0.18s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-link.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -2px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-dropdown {
    position: relative;
}

.nav-link--dropdown .chev {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-link--dropdown,
.nav-dropdown.is-open .nav-link--dropdown {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-dropdown:hover .nav-link--dropdown .chev,
.nav-dropdown.is-open .nav-link--dropdown .chev {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s, transform 0.2s, visibility 0.18s;
    z-index: 100;
}

.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.is-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-soft);
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover,
.dropdown-item.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 4px;
}

.dropdown-view-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    transition: background 0.15s;
}

.dropdown-view-all:hover {
    background: var(--primary-soft);
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.search-wrap {
    position: relative;
    max-width: 300px;
    flex: 0 1 300px;
}

.search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.search-input:focus {
    border-color: var(--primary);
    background: var(--card);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.account-dropdown {
    position: relative;
    flex-shrink: 0;
}

.account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px 0 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 13.5px;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.account-btn:hover,
.account-dropdown.is-open .account-btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.account-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-btn:hover .account-avatar,
.account-dropdown.is-open .account-avatar {
    background: rgba(255, 255, 255, 0.22);
}

.account-btn .chev {
    transition: transform 0.2s;
}

.account-dropdown.is-open .account-btn .chev {
    transform: rotate(180deg);
}

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s, transform 0.2s, visibility 0.18s;
    z-index: 100;
}

.account-dropdown.is-open .account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-menu__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--primary-soft);
    border-radius: 12px;
    margin-bottom: 6px;
}

.account-menu__avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.account-menu__name {
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    line-height: 1.2;
}

.account-menu__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.account-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-soft);
    font-weight: 500;
    font-size: 13.5px;
    transition: background 0.15s, color 0.15s;
}

.account-menu__item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.account-menu__divider {
    height: 1px;
    background: var(--border);
    margin: 6px 8px;
}

.mobile-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 8px 24px 20px;
    background: var(--card);
    border-top: 1px solid var(--border);
    gap: 2px;
}

.mobile-nav__link {
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-soft);
    transition: background 0.15s, color 0.15s;
}

.mobile-nav__link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.mobile-nav.is-open {
    display: flex;
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 0 20px;
    font-size: 13.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb__sep {
    color: var(--border-strong);
}

.breadcrumb__cat {
    color: var(--primary);
    font-weight: 600;
}

.breadcrumb__current {
    color: var(--text-muted);
}

/* ============ ARTICLE LAYOUT ============ */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 48px;
    align-items: start;
    padding-bottom: 60px;
}

/* ============ ARTICLE MAIN ============ */
.article-main .tag {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.article-title {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.article-subtitle {
    font-size: 16px;
    color: var(--text-soft);
    max-width: 680px;
    margin: 0 0 24px;
    line-height: 1.6;
}

.article-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-soft-2);
}

.author-line {
    font-size: 14px;
    color: var(--text-soft);
    font-weight: 500;
}

.author-line__by {
    color: var(--text-muted);
}

.author-line__name {
    color: var(--primary);
    font-weight: 700;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    flex-wrap: wrap;
}

.article-meta .dot {
    color: var(--border-strong);
}

.article-meta .views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.15s;
}

.icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.icon-btn.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary);
}

.icon-btn.is-active svg {
    fill: var(--primary);
    stroke: var(--primary);
}

.share-inline {
    position: relative;
}

.share-inline__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    gap: 4px;
    box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 20;
}

.share-inline.is-open .share-inline__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-inline__item {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    background: transparent;
    transition: background 0.15s, color 0.15s;
}

.share-inline__item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ============ HERO IMAGE ============ */
.article-hero {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.14);
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/7;
    object-fit: cover;
}

/* ============ INLINE TOC ============ */
.toc-inline {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 40px;
}

.toc-inline__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.toc-inline__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.toc-inline__title svg {
    color: var(--primary);
}

.toc-inline__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    background: var(--primary-soft);
    transition: background 0.15s;
}

.toc-inline__toggle:hover {
    background: var(--primary-soft-2);
}

.toc-inline__toggle svg {
    transition: transform 0.2s;
}

.toc-inline.is-collapsed .toc-inline__toggle svg {
    transform: rotate(180deg);
}

.toc-inline__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
    transition: opacity 0.2s, max-height 0.3s;
}

.toc-inline.is-collapsed .toc-inline__list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
}

.toc-inline__list li {
    counter-increment: toc;
}

.toc-inline__list a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, padding-left 0.2s;
}

.toc-inline__list a::before {
    content: counter(toc) ".";
    color: var(--text-muted);
    font-weight: 600;
    min-width: 22px;
}

.toc-inline__list a:hover {
    color: var(--primary);
    padding-left: 4px;
}

/* ============ ARTICLE BODY (RICH TEXT) ============ */
.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 16px;
    line-height: 1.25;
    scroll-margin-top: 100px;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 12px;
    scroll-margin-top: 100px;
}

.article-body h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 24px 0 10px;
    scroll-margin-top: 100px;
}

.article-body p {
    margin: 0 0 16px;
    color: var(--text-soft);
}

.article-body p strong {
    color: var(--text);
}

.article-body a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.25);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}

.article-body a:hover {
    text-decoration-color: var(--primary);
}

.article-body ul,
.article-body ol {
    margin: 0 0 18px;
    padding-left: 22px;
    color: var(--text-soft);
}

.article-body li {
    margin: 6px 0;
}

.article-body ul.check-list {
    padding-left: 0;
    list-style: none;
}

.article-body ul.check-list li {
    position: relative;
    padding-left: 32px;
    margin: 10px 0;
}

.article-body ul.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

/* Workflow steps */
.workflow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 24px 0 32px;
    flex-wrap: wrap;
}

.workflow__step {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}

.workflow__ico {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.3);
}

.workflow__step:last-child .workflow__ico {
    background: var(--primary);
    color: #fff;
}

.workflow__arrow {
    color: var(--text-muted);
    font-size: 20px;
    align-self: center;
    padding-top: 20px;
}

/* Callouts */
.callout {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 14px;
    margin: 20px 0;
    border-left: 4px solid;
}

.callout__ico {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.callout div {
    color: var(--text-soft);
    font-size: 14.5px;
}

.callout div strong {
    color: var(--text);
}

.callout--note {
    background: #eff6ff;
    border-color: #3b82f6;
}

.callout--note .callout__ico {
    background: #dbeafe;
    color: #1d4ed8;
}

.callout--tip {
    background: #f0fdf4;
    border-color: #10b981;
}

.callout--tip .callout__ico {
    background: #d1fae5;
    color: #047857;
}

.callout--warn {
    background: #fffbeb;
    border-color: #f59e0b;
}

.callout--warn .callout__ico {
    background: #fef3c7;
    color: #b45309;
}

/* Blockquote */
.article-body blockquote {

    margin: 24px 0;

    padding: 18px 24px;

    background: var(--primary-soft);

    border-left: 4px solid var(--primary);

    border-radius: 14px;

    font-family: "Sora", sans-serif;

    font-size: 17px;

    font-style: italic;

    color: var(--text);

}

.article-body blockquote p,
.article-body blockquote strong {

    color: var(--text);

}


.article-body blockquote cite {

    color: var(--text-muted);

}

.article-body blockquote cite {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: normal;
    font-weight: 600;
}

/* Table */
.table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.article-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14.5px;
}

.article-body table thead th {
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-family: "Sora", sans-serif;
    font-size: 13.5px;
}

.article-body table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
}

.article-body table tbody tr:last-child td {
    border-bottom: none;
}

.article-body table tbody tr:hover td {
    background: var(--bg-soft);
}

/* Figures */
.article-body figure {
    margin: 24px 0;
}

.article-body figure img {
    border-radius: 14px;
}

.article-body figcaption {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

/* ============ CODE BLOCKS ============ */
.code-block {
    background: var(--code-bg);
    border-radius: 14px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.35);
}

.code-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block__lang {
    color: #94a3b8;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    text-transform: lowercase;
    font-weight: 600;
}

.code-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.code-copy-btn.is-copied {
    background: #16a34a;
    color: #fff;
}

.code-block pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
}

.code-block code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--code-text);
    background: transparent;
    padding: 0;
}

.tk-c {
    color: var(--code-comment);
    font-style: italic;
}

.tk-k {
    color: var(--code-keyword);
}

.tk-s {
    color: var(--code-string);
}

.tk-fn {
    color: var(--code-fn);
}

.tk-t {
    color: var(--code-type);
}

.tk-n {
    color: var(--code-num);
}

.tk-a {
    color: #f472b6;
}

.tk-b {
    color: #67e8f9;
}

.tk-v {
    color: #e2e8f0;
}

.tk-p {
    color: #93c5fd;
}

.article-body :not(pre)>code {
    background: var(--bg-soft);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9em;
    border: 1px solid var(--border);
}

/* ============ TAGS + SHARE ROW ============ */
.article-tags-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 40px 0 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.tags-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tags-line__label {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    margin-right: 4px;
}

.chip {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-row__label {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    margin-right: 4px;
}

.share-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.15s, box-shadow 0.15s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.2);
}

.share-btn--twitter {
    background: #1da1f2;
}

.share-btn--linkedin {
    background: #0a66c2;
}

.share-btn--facebook {
    background: #1877f2;
}

.share-btn--copy {
    background: var(--bg-soft);
    color: var(--text-soft);
    border: 1px solid var(--border);
}

.share-btn--copy:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* ============ PREV/NEXT ============ */
.prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
}

.prev-next__card {
    padding: 18px 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.prev-next__card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-soft-2);
    box-shadow: var(--card-shadow);
}

.prev-next__card--next {
    text-align: right;
    padding-right: 100px;
}

.prev-next__card--prev {
    text-align: left;
}

.prev-next__meta {
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: capitalize;
}

.prev-next__card--next .prev-next__meta {
    justify-content: flex-end;
    color: var(--primary);
}

.prev-next__meta .arrow {
    font-weight: 700;
}

.prev-next__title {
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    line-height: 1.35;
}

.prev-next__card:hover .prev-next__title {
    color: var(--primary);
}

.prev-next__thumb {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 54px;
    border-radius: 10px;
    overflow: hidden;
}

.prev-next__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============ SIDEBAR ============ */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 96px;
}

.side-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}

.side-card__title {
    font-family: "Sora", sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.author-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-soft-2);
}

.author-card__name {
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.author-card__role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.author-card__bio {
    font-size: 13.5px;
    color: var(--text-soft);
    line-height: 1.55;
    margin: 0 0 14px;
}

.author-card__socials {
    display: flex;
    gap: 6px;
}

.social-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.social-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.toc-side {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-s;
}

.toc-side li {
    counter-increment: toc-s;
    margin: 4px 0;
}

.toc-side a {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 13.5px;
    transition: background 0.15s, color 0.15s;
}

.toc-side a::before {
    content: counter(toc-s) ".";
    color: var(--text-muted);
    font-weight: 600;
    min-width: 20px;
}

.toc-side a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.toc-side a.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 600;
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-list li {
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.related-list li:hover {
    transform: translateX(2px);
}

.related-list img {
    width: 68px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.related-list__title {
    font-family: "Sora", sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-list li:hover .related-list__title {
    color: var(--primary);
}

.related-list__read {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.side-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    transition: gap 0.2s;
}

.side-link:hover {
    gap: 10px;
}

.pop-cat {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pop-cat li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.15s;
    cursor: pointer;
}

.pop-cat li:hover {
    background: var(--primary-soft);
}

.pop-cat__name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-soft);
}

.pop-cat__ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pop-cat li[data-cat="ai"] .pop-cat__ico {
    background: #eef4ff;
    color: #2563eb;
}

.pop-cat li[data-cat="ds"] .pop-cat__ico {
    background: #ecfdf5;
    color: #059669;
}

.pop-cat li[data-cat="cs"] .pop-cat__ico {
    background: #f5f3ff;
    color: #7c3aed;
}

.pop-cat li[data-cat="web"] .pop-cat__ico {
    background: #fff7ed;
    color: #ea580c;
}

.pop-cat li[data-cat="prog"] .pop-cat__ico {
    background: #fef2f2;
    color: #e11d48;
}

.pop-cat__count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.pop-cat li:hover .pop-cat__count {
    color: var(--primary);
}

/* Newsletter side card */
.side-card--newsletter {
    background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 100%);
    border: none;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.side-card--newsletter::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(200px 200px at 100% 0%, rgba(255, 255, 255, 0.14), transparent 70%);
    pointer-events: none;
}

.side-card--newsletter>* {
    position: relative;
}

.side-card--newsletter .side-card__title {
    color: #fff;
    font-size: 18px;
    margin-bottom: 8px;
}

.side-card--newsletter p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13.5px;
    margin: 0 0 14px;
    line-height: 1.55;
}

.side-newsletter {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.side-newsletter input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 10px 14px;
    color: #fff;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.side-newsletter input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.side-newsletter button {
    background: #fff;
    color: #1e3a8a;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.side-newsletter button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -4px rgba(0, 0, 0, 0.25);
}

.side-newsletter__note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 12px !important;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    z-index: 300;
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.35);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ============ SITE FOOTER (same as articles page) ============ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 60px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.footer__brand .logo {
    display: inline-block;
    margin-bottom: 14px;
}

.footer__tagline {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 260px;
}

.socials {
    display: flex;
    gap: 8px;
}

.footer-col h4 {
    font-family: "Sora", sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul a {
    color: var(--text-soft);
    font-size: 14px;
    transition: color 0.15s, padding-left 0.2s;
}

.footer-col ul a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.heart {
    color: #ef4444;
    display: inline-block;
    animation: heartBeat 1.4s ease-in-out infinite;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
    .article-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 32px;
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    }

    .footer-grid>.footer-col:last-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--border);
    }

    .footer-grid>.footer-col:last-child h4 {
        grid-column: 1 / -1;
        margin-bottom: 8px;
    }

    .footer-grid>.footer-col:last-child ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
}

@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .article-sidebar {
        position: static;
        grid-template-columns: 1fr 1fr;
        display: grid;
        align-items: start;
    }

    .article-sidebar .side-card--newsletter {
        grid-column: 1 / -1;
    }

    .toc-inline__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {

    .nav-links,
    .search-wrap {
        display: none;
    }

    .account-btn__label,
    .account-btn .chev {
        display: none;
    }

    .account-btn {
        padding: 0 10px 0 8px;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }

    .toc-inline__list {
        grid-template-columns: 1fr 1fr;
    }

    .prev-next {
        grid-template-columns: 1fr;
    }

    .prev-next__card--next {
        padding-right: 100px;
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .footer__brand {
        grid-column: 1 / -1;
    }

    .footer-grid>.footer-col:last-child {
        display: block;
    }

    .footer-grid>.footer-col:last-child ul {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .navbar__inner {
        gap: 10px;
    }

    .breadcrumb {
        font-size: 12.5px;
        padding: 16px 0 12px;
    }

    .article-title {
        font-size: 26px;
    }

    .article-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-actions {
        align-self: stretch;
    }

    .toc-inline {
        padding: 18px 20px;
    }

    .toc-inline__list {
        grid-template-columns: 1fr;
    }

    .workflow {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .workflow__arrow {
        transform: rotate(90deg);
        padding-top: 0;
    }

    .article-tags-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .prev-next__card--next {
        padding-right: 22px;
        text-align: left;
    }

    .prev-next__card--next .prev-next__meta {
        justify-content: flex-start;
    }

    .prev-next__thumb {
        display: none;
    }

    .article-body h2 {
        font-size: 22px;
    }

    .article-body h3 {
        font-size: 18px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .article-hero img {
        aspect-ratio: 16/10;
    }
}


/* =============================================================
   DARK MODE + TOC SCROLLABLE (additive — no existing rules modified)
   ============================================================= */
:root {
    --nav-bg: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] {
    --bg: #070b17;
    --bg-soft: #0b1226;
    --text: #eef2f7;
    --text-soft: #b6c1d8;
    --text-muted: #8b98b3;
    --border: #1a2340;
    --border-strong: #223055;
    --card: #0e1730;
    --primary: #3b82f6;
    --primary-600: #60a5fa;
    --primary-soft: #10214a;
    --primary-soft-2: #172a5e;
    --tag-bg: #172a5e;
    --tag-text: #93c5fd;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.6);
    --card-shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.35), 0 28px 40px -18px rgba(59, 130, 246, 0.35);
    --nav-bg: rgba(7, 11, 23, 0.78);
    /* Keep code block dark tokens readable */
    --code-bg: #05091a;
    --code-text: #e2e8f0;
    --code-comment: #94a3b8;
    --code-keyword: #93c5fd;
    --code-string: #86efac;
    --code-fn: #fbbf24;
    --code-type: #f472b6;
    --code-num: #fdba74;
}

/* Smooth color transitions across the page */
body,
.navbar,
.mobile-nav,
.mobile-nav__link,
.side-card,
.article-body,
.article-body pre,
.article-body blockquote,
.article-body table,
.article-body td,
.article-body th,
.card,
.chip,
.tag-chip,
.author-card,
.toc-inline,
.toc-inline__list a,
.toc-side a,
.related-list a,
.pop-cat a,
.dropdown-menu,
.dropdown-item,
.account-menu,
.account-menu__item,
.account-btn,
.search-input,
.icon-btn,
.share-inline__menu,
.share-inline__menu a,
.site-footer,
.footer-col ul a,
.social-btn,
.prev-next__card {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.navbar {
    background: var(--nav-bg);
}

/* Theme toggle button (matches other modules) */
.theme-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color .2s, background .2s, border-color .2s, transform .18s;
    cursor: pointer;
}

.theme-btn:hover {
    color: var(--primary);
    border-color: var(--primary-soft-2);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.theme-btn:active {
    transform: translateY(0);
}

.theme-btn .ico-moon {
    display: none;
}

.theme-btn .ico-sun {
    display: inline-block;
}

[data-theme="dark"] .theme-btn .ico-moon {
    display: inline-block;
}

[data-theme="dark"] .theme-btn .ico-sun {
    display: none;
}

/* Small dark-mode polish for elements that use hard-coded colors */
[data-theme="dark"] .callout--note {
    background: rgba(59, 130, 246, 0.10);
    border-color: #3b82f6;
}

[data-theme="dark"] .callout--note .callout__ico {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
}

[data-theme="dark"] .callout--tip {
    background: rgba(16, 185, 129, 0.10);
    border-color: #10b981;
}

[data-theme="dark"] .callout--tip .callout__ico {
    background: rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
}

[data-theme="dark"] .callout--warn {
    background: rgba(245, 158, 11, 0.10);
    border-color: #f59e0b;
}

[data-theme="dark"] .callout--warn .callout__ico {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
}

[data-theme="dark"] .callout div strong {
    color: var(--text);
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .newsletter__input {
    background: var(--card);
    color: var(--text);
}

[data-theme="dark"] .search-input::placeholder,
[data-theme="dark"] .newsletter__input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .article-hero img,
[data-theme="dark"] .article__cover img {
    filter: brightness(.92);
}

[data-theme="dark"] .toast {
    background: #0e1730;
    color: var(--text);
    border: 1px solid var(--border);
}

/* ------------- STICKY + SCROLLABLE TOC (side card) ------------- */
/* The `.article-sidebar` is already position:sticky (top:96px) in the existing design.
   We ONLY make the TOC list scrollable when it's long, without altering layout. */
.side-card .toc-side {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 6px;
    /* room for scrollbar so text doesn't shift */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.side-card .toc-side::-webkit-scrollbar {
    width: 6px;
}

.side-card .toc-side::-webkit-scrollbar-track {
    background: transparent;
}

.side-card .toc-side::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
}

.side-card .toc-side::-webkit-scrollbar-thumb:hover {
    background: var(--primary-soft-2);
}

/* Give the active TOC item a subtle side accent (only if not already styled by is-active) */
.toc-side a.is-active {
    position: relative;
}

.toc-side a.is-active::after {
    content: "";
    position: absolute;
    left: -14px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: var(--primary);
}

/* Smooth scrolling for anchor jumps (respected by hash link fallback) */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

@media (max-width: 900px) {
    .theme-btn {
        width: 40px;
        height: 40px;
    }

    .side-card .toc-side {
        max-height: none;
        overflow: visible;
    }
}



.share-btn--whatsapp {
    background: #25d366;
    color: white;

}
