/* ==========================================================================
   مجله وقت تو — public blog
   Built on the site's --tb-* tokens so light / dark mode follow automatically.
   ========================================================================== */

.blog-shell {
    --blog-gap: 20px;
    --blog-accent: var(--tb-primary, #2563eb);
    --blog-card-radius: var(--tb-radius-md, 18px);
    padding-bottom: 32px;
}

.blog-page .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Shared bits ---------- */

.blog-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--tb-radius-pill, 999px);
    background: var(--tb-primary-soft, #eff4ff);
    color: var(--blog-accent);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--tb-duration, .2s) var(--tb-ease, ease), color var(--tb-duration, .2s);
}
.blog-badge:hover { background: var(--blog-accent); color: #fff; }

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    color: var(--tb-text-muted, #64748b);
    font-size: 12.5px;
}
.blog-meta span { display: inline-flex; align-items: center; gap: 5px; }
.blog-meta i { font-size: 13px; opacity: .8; }

.blog-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
}
.blog-breadcrumb li { display: inline-flex; align-items: center; gap: 4px; color: inherit; opacity: .85; }
.blog-breadcrumb li + li::before { content: "\F284"; font-family: "bootstrap-icons"; font-size: 10px; opacity: .6; }
.blog-breadcrumb a { color: inherit; text-decoration: none; }
.blog-breadcrumb a:hover { text-decoration: underline; }
.blog-breadcrumb li[aria-current] span {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

/* ---------- Hero ---------- */

.blog-hero {
    position: relative;
    overflow: hidden;
    margin: 12px 0 18px;
    padding: 28px 22px 24px;
    border-radius: var(--tb-radius-xl, 28px);
    background: var(--tb-gradient, linear-gradient(to bottom left, #60a5fa, #3b82f6, #4f46e5));
    color: #fff;
    box-shadow: 0 22px 48px -18px rgba(37, 99, 235, .55);
    isolation: isolate;
}
.blog-hero__glow,
.blog-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}
.blog-hero__glow {
    width: 320px;
    height: 320px;
    top: -140px;
    left: -80px;
    background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%);
}
.blog-hero::after {
    width: 260px;
    height: 260px;
    bottom: -150px;
    right: 20%;
    background: radial-gradient(circle, rgba(167, 139, 250, .5), transparent 65%);
}
.blog-hero .blog-breadcrumb { color: rgba(255, 255, 255, .9); }
.blog-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--tb-radius-pill, 999px);
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.blog-hero__title {
    margin: 12px 0 8px;
    color: #fff;
    font-size: clamp(24px, 5vw, 38px);
    font-weight: 800;
    line-height: 1.45;
}
.blog-hero__intro {
    max-width: 640px;
    margin: 0 0 18px;
    color: rgba(255, 255, 255, .9);
    font-size: 14.5px;
    line-height: 2;
}

.blog-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    padding: 6px;
    border-radius: var(--tb-radius-pill, 999px);
    background: var(--tb-surface, #fff);
    box-shadow: var(--tb-shadow-md, 0 10px 28px rgba(15, 23, 42, .09));
}
.blog-search > i {
    position: absolute;
    right: 20px;
    color: var(--tb-text-faint, #94a3b8);
    pointer-events: none;
}
.blog-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 44px 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--tb-text, #0f172a);
    font: inherit;
    font-size: 14px;
}
.blog-search input::-webkit-search-cancel-button { cursor: pointer; }
.blog-search .btn {
    height: 44px;
    padding: 0 22px;
    border-radius: var(--tb-radius-pill, 999px);
    white-space: nowrap;
}
.blog-search--inline { margin: 18px auto 0; border: 1px solid var(--tb-border, #e8eef5); }

/* ---------- Topic chips ---------- */

.blog-chips {
    display: flex;
    gap: 8px;
    margin: 0 -12px 20px;
    padding: 2px 12px 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.blog-chips::-webkit-scrollbar { display: none; }
.blog-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--tb-radius-pill, 999px);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    color: var(--tb-text, #0f172a);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--tb-shadow-xs, 0 1px 2px rgba(15, 23, 42, .06));
    transition: all var(--tb-duration, .2s) var(--tb-ease, ease);
}
.blog-chip em {
    font-style: normal;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: var(--tb-radius-pill, 999px);
    background: var(--tb-surface-alt, #f1f5f9);
    color: var(--tb-text-muted, #64748b);
    font-size: 11px;
    text-align: center;
}
.blog-chip:hover { border-color: var(--blog-accent); color: var(--blog-accent); }
.blog-chip.is-active {
    background: var(--blog-accent);
    border-color: var(--blog-accent);
    color: #fff;
    box-shadow: var(--tb-primary-shadow, 0 8px 18px rgba(37, 99, 235, .26));
}
.blog-chip.is-active em { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- Cards ---------- */

.blog-card__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .35), transparent 45%),
        var(--tb-gradient, linear-gradient(to bottom left, #60a5fa, #3b82f6, #4f46e5));
    color: rgba(255, 255, 255, .9);
    font-size: 40px;
}

.blog-featured {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    margin-bottom: 26px;
    border-radius: var(--tb-radius-xl, 28px);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    box-shadow: var(--tb-shadow, 0 14px 36px rgba(15, 23, 42, .08));
}
.blog-featured__media {
    display: block;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: var(--tb-surface-alt, #f1f5f9);
}
.blog-featured__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--tb-ease, ease);
}
.blog-featured:hover .blog-featured__media img { transform: scale(1.04); }
.blog-featured__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px;
}
.blog-featured__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tb-warning, #f59e0b);
    font-size: 12.5px;
    font-weight: 700;
}
.blog-featured__title {
    margin: 0;
    font-size: clamp(19px, 3.4vw, 26px);
    font-weight: 800;
    line-height: 1.6;
}
.blog-featured__title a,
.blog-card__title a { color: var(--tb-text, #0f172a); text-decoration: none; }
.blog-featured__title a:hover,
.blog-card__title a:hover { color: var(--blog-accent); }
.blog-featured__summary {
    margin: 0;
    color: var(--tb-text-muted, #64748b);
    font-size: 14px;
    line-height: 2;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    color: var(--blog-accent);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}
.blog-readmore i { transition: transform var(--tb-duration, .2s) var(--tb-ease, ease); }
.blog-readmore:hover i { transform: translateX(-4px); }

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--blog-gap);
}
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--blog-card-radius);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    box-shadow: var(--tb-shadow-soft, 0 4px 14px rgba(15, 23, 42, .035));
    transition: transform var(--tb-duration, .2s) var(--tb-ease, ease), box-shadow var(--tb-duration, .2s) var(--tb-ease, ease), border-color var(--tb-duration, .2s);
}
.blog-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: var(--tb-shadow-lg, 0 24px 56px rgba(15, 23, 42, .13));
}
.blog-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--tb-surface-alt, #f1f5f9);
}
.blog-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--tb-ease, ease);
}
.blog-card:hover .blog-card__media img { transform: scale(1.06); }
.blog-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px 18px;
}
.blog-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* The whole card is clickable through the title link. */
.blog-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.blog-card .blog-badge { position: relative; z-index: 2; }
.blog-card__summary {
    margin: 0;
    color: var(--tb-text-muted, #64748b);
    font-size: 13.5px;
    line-height: 1.95;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card .blog-meta {
    width: 100%;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--tb-border, #e8eef5);
}

/* ---------- Layout & aside ---------- */

.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.blog-layout__aside { display: flex; flex-direction: column; gap: 18px; }
.blog-aside-sticky { display: flex; flex-direction: column; gap: 18px; }

.blog-panel {
    padding: 18px;
    border-radius: var(--blog-card-radius);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    box-shadow: var(--tb-shadow-soft, 0 4px 14px rgba(15, 23, 42, .035));
}
.blog-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--tb-text, #0f172a);
    font-size: 15px;
    font-weight: 800;
}
.blog-panel__title i { color: var(--blog-accent); }

.blog-popular { margin: 0; padding: 0; list-style: none; counter-reset: pop; }
.blog-popular li + li { margin-top: 12px; }
.blog-popular__item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.blog-popular__item img,
.blog-popular__ph {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
}
.blog-popular__ph {
    display: grid;
    place-items: center;
    background: var(--tb-primary-soft, #eff4ff);
    color: var(--blog-accent);
    font-size: 22px;
}
.blog-popular__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.blog-popular__text strong {
    color: var(--tb-text, #0f172a);
    font-size: 13.5px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-popular__text small { color: var(--tb-text-faint, #94a3b8); font-size: 11.5px; }
.blog-popular__item:hover strong { color: var(--blog-accent); }

.blog-topic-list { margin: 0; padding: 0; list-style: none; }
.blog-topic-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--tb-text, #0f172a);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--tb-duration, .2s);
}
.blog-topic-list a em {
    font-style: normal;
    color: var(--tb-text-faint, #94a3b8);
    font-size: 12px;
}
.blog-topic-list a:hover,
.blog-topic-list a.is-active { background: var(--tb-primary-soft, #eff4ff); color: var(--blog-accent); }

.blog-cta-card {
    position: relative;
    overflow: hidden;
    padding: 22px 20px;
    border-radius: var(--blog-card-radius);
    background: linear-gradient(135deg, #0f172a, #1e3a8a 60%, #4f46e5);
    color: #fff;
}
.blog-cta-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    top: -70px;
    left: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, .45), transparent 70%);
}
.blog-cta-card__icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .14);
    font-size: 20px;
}
.blog-cta-card h2 { color: #fff; font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.blog-cta-card p { color: rgba(255, 255, 255, .8); font-size: 13px; line-height: 1.9; margin: 0 0 14px; }
.blog-cta-card .btn { position: relative; z-index: 1; border-radius: 12px; font-weight: 700; }

/* ---------- Pagination & empty ---------- */

.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}
.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.blog-pagination a {
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    color: var(--tb-text, #0f172a);
}
.blog-pagination a:hover { border-color: var(--blog-accent); color: var(--blog-accent); }
.blog-pagination .is-active { background: var(--blog-accent); color: #fff; box-shadow: var(--tb-primary-shadow, none); }
.blog-pagination__gap { color: var(--tb-text-faint, #94a3b8); }

.blog-empty {
    padding: 48px 20px;
    border-radius: var(--tb-radius-xl, 28px);
    border: 1px dashed var(--tb-border-strong, #cbd5e1);
    background: var(--tb-surface, #fff);
    text-align: center;
}
.blog-empty--page { margin-top: 24px; padding: 64px 20px; }
.blog-empty__icon {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 24px;
    background: var(--tb-primary-soft, #eff4ff);
    color: var(--blog-accent);
    font-size: 32px;
}
.blog-empty h1,
.blog-empty h2 { color: var(--tb-text, #0f172a); font-size: 19px; font-weight: 800; }
.blog-empty p { max-width: 420px; margin: 8px auto 18px; color: var(--tb-text-muted, #64748b); font-size: 14px; line-height: 2; }

/* ---------- Article ---------- */

.blog-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1100;
    height: 3px;
    pointer-events: none;
}
.blog-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(to left, #60a5fa, #4f46e5);
    transform: scaleX(0);
    transform-origin: right center;
    will-change: transform;
}

.blog-article { min-width: 0; }
.blog-article__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 0 8px;
    color: var(--tb-text-muted, #64748b);
}
.blog-article__header .blog-breadcrumb { margin-bottom: -4px; }
.blog-article__title {
    margin: 0;
    color: var(--tb-text, #0f172a);
    font-size: clamp(24px, 5.2vw, 38px);
    font-weight: 900;
    line-height: 1.55;
    letter-spacing: -.2px;
}
.blog-article__lead {
    margin: 0;
    color: var(--tb-text-muted, #64748b);
    font-size: 16px;
    line-height: 2.05;
}
.blog-article__byline {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
    padding: 14px 0;
    border-top: 1px solid var(--tb-border, #e8eef5);
    border-bottom: 1px solid var(--tb-border, #e8eef5);
}
.blog-article__byline-text { flex: 1 1 auto; min-width: 0; }
.blog-article__byline-text strong { display: block; margin-bottom: 2px; color: var(--tb-text, #0f172a); font-size: 14px; }
.blog-avatar {
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tb-gradient, #3b82f6);
    color: #fff;
    font-weight: 800;
    font-size: 17px;
}
.blog-icon-btn {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--tb-border, #e8eef5);
    border-radius: 50%;
    background: var(--tb-surface, #fff);
    color: var(--tb-text, #0f172a);
    cursor: pointer;
    transition: all var(--tb-duration, .2s);
}
.blog-icon-btn:hover { color: var(--blog-accent); border-color: var(--blog-accent); }

.blog-article__cover {
    margin: 18px 0 8px;
    overflow: hidden;
    border-radius: var(--tb-radius-xl, 28px);
    aspect-ratio: 1200 / 630;
    background: var(--tb-surface-alt, #f1f5f9);
    box-shadow: var(--tb-shadow, 0 14px 36px rgba(15, 23, 42, .08));
}
.blog-article__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.blog-toc {
    margin: 18px 0 4px;
    border-radius: var(--blog-card-radius);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
}
.blog-toc summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    color: var(--tb-text, #0f172a);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
}
.blog-toc summary::-webkit-details-marker { display: none; }
.blog-toc summary::after { content: "\F282"; font-family: "bootstrap-icons"; margin-right: auto; transition: transform var(--tb-duration, .2s); }
.blog-toc[open] summary::after { transform: rotate(180deg); }
.blog-toc ol,
.blog-toc-panel ol { margin: 0; padding: 0 18px 14px; list-style: none; }
.blog-toc-panel ol { padding: 0; }
.blog-toc li a,
.blog-toc-panel li a {
    display: block;
    padding: 6px 10px;
    border-right: 2px solid var(--tb-border, #e8eef5);
    color: var(--tb-text-muted, #64748b);
    font-size: 13.5px;
    line-height: 1.8;
    text-decoration: none;
    transition: all var(--tb-duration, .2s);
}
.blog-toc li.is-h3 a,
.blog-toc-panel li.is-h3 a { padding-right: 24px; font-size: 12.5px; }
.blog-toc li a:hover,
.blog-toc-panel li a:hover,
.blog-toc-panel li a.is-active { border-right-color: var(--blog-accent); color: var(--blog-accent); background: var(--tb-primary-soft, #eff4ff); }
.blog-toc-panel { display: none; }

/* Typography for editor-authored HTML */
.blog-content {
    margin-top: 22px;
    color: var(--tb-text, #0f172a);
    font-size: 16.5px;
    line-height: 2.15;
    overflow-wrap: anywhere;
}
.blog-content > *:first-child { margin-top: 0; }
.blog-content p { margin: 0 0 1.25em; }
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: var(--tb-text, #0f172a);
    font-weight: 800;
    line-height: 1.7;
    scroll-margin-top: 90px;
}
.blog-content h2 {
    position: relative;
    margin: 2em 0 .8em;
    padding-right: 16px;
    font-size: 22px;
}
.blog-content h2::before {
    content: "";
    position: absolute;
    top: .35em;
    bottom: .35em;
    right: 0;
    width: 5px;
    border-radius: 4px;
    background: var(--tb-gradient, #3b82f6);
}
.blog-content h3 { margin: 1.7em 0 .6em; font-size: 18.5px; }
.blog-content h4 { margin: 1.5em 0 .5em; font-size: 16.5px; }
.blog-content a { color: var(--blog-accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.blog-content a:hover { text-decoration-thickness: 2px; }
.blog-content strong { font-weight: 800; }
.blog-content ul,
.blog-content ol { margin: 0 0 1.3em; padding-right: 1.4em; }
.blog-content li { margin-bottom: .4em; }
.blog-content li::marker { color: var(--blog-accent); font-weight: 700; }
.blog-content img {
    display: block;
    max-width: 100%;
    height: auto !important;
    margin: 1.6em auto;
    border-radius: var(--blog-card-radius);
}
.blog-content figure { margin: 1.6em 0; }
.blog-content figcaption { margin-top: -1em; color: var(--tb-text-muted, #64748b); font-size: 13px; text-align: center; }
.blog-content blockquote {
    position: relative;
    margin: 1.8em 0;
    padding: 18px 22px 18px 18px;
    border-radius: var(--blog-card-radius);
    border-right: 4px solid var(--blog-accent);
    background: var(--tb-primary-soft, #eff4ff);
    color: var(--tb-text, #0f172a);
    font-size: 16px;
}
.blog-content blockquote p:last-child { margin-bottom: 0; }
.blog-content hr { margin: 2.4em auto; width: 40%; border: 0; border-top: 2px dashed var(--tb-border-strong, #cbd5e1); opacity: 1; }
.blog-content code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--tb-surface-alt, #f1f5f9);
    font-size: .88em;
    direction: ltr;
    unicode-bidi: embed;
}
.blog-content pre {
    direction: ltr;
    text-align: left;
    padding: 16px;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.7;
}
.blog-content pre code { padding: 0; background: none; color: inherit; }
.blog-content iframe,
.blog-content video { display: block; max-width: 100%; margin: 1.6em auto; border: 0; border-radius: var(--blog-card-radius); }
.blog-table-wrap { margin: 1.6em 0; overflow-x: auto; border-radius: 14px; border: 1px solid var(--tb-border, #e8eef5); }
.blog-content table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.9; }
.blog-content th,
.blog-content td { padding: 10px 14px; border-bottom: 1px solid var(--tb-border, #e8eef5); text-align: right; }
.blog-content th { background: var(--tb-surface-alt, #f1f5f9); font-weight: 800; }
.blog-content tr:last-child td { border-bottom: 0; }

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    color: var(--tb-text-faint, #94a3b8);
}
.blog-tag {
    padding: 5px 12px;
    border-radius: var(--tb-radius-pill, 999px);
    background: var(--tb-surface-alt, #f1f5f9);
    color: var(--tb-text-muted, #64748b);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--tb-duration, .2s);
}
.blog-tag:hover { background: var(--blog-accent); color: #fff; }

.blog-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: var(--blog-card-radius);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    color: var(--tb-text, #0f172a);
    font-size: 14px;
    font-weight: 700;
}
.blog-share__links { display: flex; gap: 8px; }
.blog-share__links a,
.blog-share__links button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--tb-surface-alt, #f1f5f9);
    color: var(--tb-text-muted, #64748b);
    font-size: 17px;
    cursor: pointer;
    transition: all var(--tb-duration, .2s);
}
.blog-share__links a:hover,
.blog-share__links button:hover { color: #fff; transform: translateY(-2px); }
.blog-share__links .is-telegram:hover { background: #229ed9; }
.blog-share__links .is-whatsapp:hover { background: #25d366; }
.blog-share__links .is-x:hover { background: #0f172a; }
.blog-share__links .is-linkedin:hover { background: #0a66c2; }
.blog-share__links button:hover { background: var(--blog-accent); }

.blog-adjacent {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 22px;
}
.blog-adjacent__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border-radius: var(--blog-card-radius);
    border: 1px solid var(--tb-border, #e8eef5);
    background: var(--tb-surface, #fff);
    text-decoration: none;
    transition: all var(--tb-duration, .2s);
}
.blog-adjacent__item small { color: var(--tb-text-faint, #94a3b8); font-size: 12px; }
.blog-adjacent__item strong { color: var(--tb-text, #0f172a); font-size: 14px; line-height: 1.8; }
.blog-adjacent__item.is-next { text-align: left; }
.blog-adjacent__item:hover { border-color: var(--blog-accent); box-shadow: var(--tb-shadow-sm, none); }
.blog-adjacent__item:hover strong { color: var(--blog-accent); }

.blog-cta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
    padding: 26px 22px;
    border-radius: var(--tb-radius-xl, 28px);
    background: var(--tb-gradient, linear-gradient(to bottom left, #60a5fa, #3b82f6, #4f46e5));
    color: #fff;
    box-shadow: 0 22px 48px -18px rgba(37, 99, 235, .55);
}
.blog-cta h2 { color: #fff; font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.blog-cta p { color: rgba(255, 255, 255, .88); font-size: 14px; line-height: 2; margin: 0; }
.blog-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.blog-cta__actions .btn { border-radius: 14px; font-weight: 700; padding-inline: 20px; }

.blog-related { margin-top: 44px; }
.blog-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.blog-section-head h2 { margin: 0; color: var(--tb-text, #0f172a); font-size: 20px; font-weight: 800; }
.blog-section-head a { color: var(--blog-accent); font-size: 13.5px; font-weight: 700; text-decoration: none; }

/* ---------- Home landing teaser ---------- */

.landing-blog .blog-grid { gap: 16px; }
.landing-blog .blog-section-head { margin-bottom: 14px; }

/* ---------- Responsive ---------- */

/* Blog pages render two headers: the inner-page header (_SimpleHeader) for mobile, like the rest of
   the app, and the main header with navigation for desktop. Show one per breakpoint. */
@media (max-width: 991.98px) {
    .blog-page .header.app-home-header { display: none !important; }

    /* The brand header already carries the blue panel, title and subtitle, so the hero
       collapses into a plain search area instead of a second blue box. */
    .blog-hero {
        margin: 14px 0 14px;
        padding: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
        color: var(--tb-text, #0f172a);
    }
    .blog-hero::after,
    .blog-hero__glow,
    .blog-hero__eyebrow,
    .blog-hero .blog-breadcrumb { display: none; }
    .blog-hero__title,
    .blog-hero__intro {
        position: absolute !important;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .blog-search {
        max-width: none;
        border: 1px solid var(--tb-border, #e8eef5);
        box-shadow: var(--tb-shadow-soft, 0 4px 14px rgba(15, 23, 42, .035));
    }
    .blog-search .btn { padding: 0 18px; }
    .blog-shell > .blog-empty--page { margin-top: 16px; }
    .blog-layout--article .blog-breadcrumb { display: none; }
}

@media (min-width: 992px) {
    .blog-page .header.app-brand-header,
    .blog-page .header.app-page-header { display: none !important; }
}
}

@media (min-width: 576px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blog-adjacent { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blog-adjacent__item.is-next:only-child { grid-column: 2; }
    .blog-cta { flex-direction: row; align-items: center; justify-content: space-between; }
    .blog-cta__actions { flex: 0 0 auto; }
}

@media (min-width: 768px) {
    .blog-hero { padding: 40px 40px 34px; }
    .blog-chips { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
    /* Covers carry their own title text, so keep the full 1200×630 frame instead of cropping it. */
    .blog-featured { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
    .blog-featured__media { align-self: stretch; min-width: 0; aspect-ratio: auto; display: flex; align-items: center; background: var(--tb-surface-alt, #f1f5f9); }
    .blog-featured__media img { width: 100%; height: auto; aspect-ratio: 1200 / 630; }
    .blog-featured__body { padding: 32px; }
    .landing-blog .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .blog-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .blog-layout--article { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
    .blog-aside-sticky { position: sticky; top: 90px; }
    .blog-toc { display: none; }
    .blog-toc-panel { display: block; }
    .blog-toc-panel[hidden] { display: none; }
    .blog-toc-panel ol { max-height: 46vh; overflow-y: auto; }
    .blog-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .blog-article__header { padding-top: 26px; }
}

@media (min-width: 1200px) {
    .blog-layout:not(.blog-layout--article) .blog-grid { gap: 24px; }
}

/* ---------- Dark mode tweaks ---------- */

.dark-mode .blog-hero,
.dark-mode .blog-cta { box-shadow: 0 22px 48px -22px rgba(0, 0, 0, .7); }
.dark-mode .blog-cta-card { background: linear-gradient(135deg, #0b1220, #172554 60%, #3730a3); }
.dark-mode .blog-content pre { background: #020617; }

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card__media img,
    .blog-featured__media img { transition: none; }
    .blog-card:hover { transform: none; }
}

@media print {
    .blog-progress,
    .blog-layout__aside,
    .blog-share,
    .blog-cta,
    .blog-related,
    .blog-adjacent,
    .blog-toc,
    header.header,
    footer.footer { display: none !important; }
    .blog-layout--article { display: block; }
}
