/*
 * TradyBay blog — /articles/* pages.
 * Uses design tokens defined in home-modern.css (--tb-primary, --tb-accent, etc.)
 * so blog stays palette-aligned. NO gradients (palette restraint) — visual
 * character comes from typography, spacing, decorative shapes, and hover states.
 */

.tb-blog {
    background: var(--tb-bg-soft, #f7f8fb);
    padding: 56px 0 88px;
    font-family: var(--tb-font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    color: var(--tb-ink, #0b1220);
    position: relative;
    overflow: hidden;
}

.tb-blog .container {
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

/* ---------- Decorative background ---------- */
.tb-blog::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: var(--tb-primary-50, #eff6ff);
    z-index: 0;
}

.tb-blog::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: var(--tb-accent-50, #fff7ed);
    z-index: 0;
}

/* ---------- Header ---------- */
.tb-blog-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: end;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--tb-line, #e5e7eb);
}

.tb-blog-header .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--tb-primary, #1e40af);
    color: var(--tb-primary, #1e40af);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.tb-blog-header .eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--tb-accent, #f97316);
    border-radius: 50%;
}

.tb-blog-header h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    color: var(--tb-ink, #0b1220);
    margin: 0 0 16px;
    letter-spacing: -0.03em;
    line-height: 1.05;
    max-width: 720px;
}

.tb-blog-header h1 .accent {
    color: var(--tb-accent, #f97316);
    position: relative;
    display: inline-block;
}

.tb-blog-header p {
    color: var(--tb-muted, #64748b);
    max-width: 560px;
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
}

.tb-blog-header-stats {
    display: flex;
    gap: 32px;
    padding: 20px 28px;
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius, 18px);
    box-shadow: var(--tb-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
    flex-shrink: 0;
}

.tb-blog-header-stat {
    text-align: center;
}

.tb-blog-header-stat .num {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: var(--tb-primary, #1e40af);
    letter-spacing: -0.02em;
    line-height: 1;
}

.tb-blog-header-stat .label {
    font-size: 12px;
    color: var(--tb-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-top: 6px;
    display: block;
}

@media (max-width: 768px) {
    .tb-blog-header {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .tb-blog-header-stats {
        align-self: start;
    }
}

/* ---------- Search bar ---------- */
.tb-blog-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: 999px;
    padding: 6px;
    box-shadow: var(--tb-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
    max-width: 480px;
    margin-top: 24px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tb-blog-search:focus-within {
    border-color: var(--tb-primary, #1e40af);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08);
}

.tb-blog-search svg {
    width: 18px;
    height: 18px;
    color: var(--tb-muted, #64748b);
    margin: 0 4px 0 14px;
    flex-shrink: 0;
}

.tb-blog-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 8px;
    font-size: 15px;
    color: var(--tb-ink, #0b1220);
    font-family: inherit;
}

.tb-blog-search input::placeholder {
    color: var(--tb-muted-2, #94a3b8);
}

.tb-blog-search button {
    background: var(--tb-primary, #1e40af);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.tb-blog-search button:hover {
    background: var(--tb-primary-600, #1d4ed8);
}

/* ---------- Filter chips (topics strip) ---------- */
.tb-topics-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tb-line, #e5e7eb);
}

.tb-topics-strip .label {
    font-size: 12px;
    color: var(--tb-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-right: 4px;
}

.tb-topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: 999px;
    font-size: 13px;
    color: var(--tb-ink-2, #334155);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.tb-topic-chip:hover {
    border-color: var(--tb-primary, #1e40af);
    color: var(--tb-primary, #1e40af);
}

.tb-topic-chip.is-active {
    background: var(--tb-primary, #1e40af);
    border-color: var(--tb-primary, #1e40af);
    color: #fff;
}

.tb-topic-chip .count {
    background: var(--tb-line, #e5e7eb);
    color: var(--tb-muted, #64748b);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.tb-topic-chip.is-active .count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.tb-topic-chip:hover .count {
    background: var(--tb-primary-50, #eff6ff);
    color: var(--tb-primary, #1e40af);
}

/* ---------- Featured hero card (page 1) — cover style ---------- */
.tb-featured-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius-lg, 24px);
    overflow: hidden;
    margin-bottom: 48px;
    box-shadow: var(--tb-shadow, 0 8px 24px rgba(15, 23, 42, 0.06));
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

.tb-featured-card::before {
    content: "★ Editor's pick";
    position: absolute;
    top: 24px;
    left: 24px;
    background: var(--tb-accent, #f97316);
    color: #fff;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.32);
}

.tb-featured-media {
    position: relative;
    overflow: hidden;
    background: var(--tb-line-2, #f1f5f9);
    min-height: 380px;
}

.tb-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.tb-featured-card:hover .tb-featured-media img {
    transform: scale(1.06);
}

.tb-featured-body {
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.tb-featured-body::before {
    content: "";
    position: absolute;
    top: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    border: 2px solid var(--tb-accent, #f97316);
    border-radius: 50%;
    opacity: 0.14;
}

.tb-featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tb-featured-meta .cat {
    background: var(--tb-primary-50, #eff6ff);
    color: var(--tb-primary, #1e40af);
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.tb-featured-meta .dot {
    width: 4px;
    height: 4px;
    background: var(--tb-muted-2, #94a3b8);
    border-radius: 50%;
}

.tb-featured-body h2 {
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--tb-ink, #0b1220);
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.tb-featured-body h2 a {
    color: inherit;
    text-decoration: none;
}

.tb-featured-body h2 a:hover {
    color: var(--tb-primary, #1e40af);
}

.tb-featured-body .excerpt {
    color: var(--tb-muted, #64748b);
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tb-featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--tb-primary, #1e40af);
    color: #fff;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    align-self: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tb-featured-cta:hover {
    background: var(--tb-primary-600, #1d4ed8);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--tb-shadow-primary, 0 12px 28px rgba(30, 64, 175, 0.22));
}

.tb-featured-cta svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.tb-featured-cta:hover svg {
    transform: translateX(3px);
}

@media (max-width: 900px) {
    .tb-featured-card {
        grid-template-columns: 1fr;
    }

    .tb-featured-media {
        min-height: 220px;
        aspect-ratio: 16/9;
    }

    .tb-featured-body {
        padding: 28px 24px;
    }
}

/* ---------- Layout grid ---------- */
.tb-blog-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
    .tb-blog-grid {
        grid-template-columns: 1fr;
    }
}

.tb-blog-main {
    min-width: 0;
}

.tb-blog-sidebar {
    position: sticky;
    top: 100px;
}

/* ---------- Section heading ---------- */
.tb-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 24px;
}

.tb-section-head h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--tb-ink, #0b1220);
    margin: 0;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tb-section-head h2::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--tb-accent, #f97316);
    border-radius: 3px;
}

.tb-section-head .count {
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    font-weight: 500;
}

/* ---------- Post card (index/category listings) ----------
 * Grid uses explicit breakpoints (not auto-fill) so column count stays
 * consistent regardless of sidebar visibility. Container caps at 1200px to
 * match the rest of the site, so 3-card layout is the target at desktop
 * (a 4-card layout at 1200 container makes cards uncomfortably narrow).
 *   ≥1024px           → 3 cards per row
 *   ≥640px            → 2 cards per row
 *   <640px            → 1 card per row (stacked)
 */
.tb-blog-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    counter-reset: tb-post;
}

@media (min-width: 640px) {
    .tb-blog-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tb-blog-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tb-blog-card {
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius, 18px);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    counter-increment: tb-post;
}

/* Magazine-style post number in top-right of card */
.tb-blog-card::after {
    content: counter(tb-post, decimal-leading-zero);
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #fff;
    background: rgba(15, 23, 42, 0.55);
    padding: 3px 9px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-variant-numeric: tabular-nums;
}

.tb-blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--tb-shadow, 0 10px 30px rgba(15, 23, 42, 0.08));
    border-color: var(--tb-primary, #1e40af);
}

.tb-blog-card-media {
    aspect-ratio: 16/10;
    background: var(--tb-line-2, #f1f5f9);
    overflow: hidden;
    position: relative;
    display: block;
}

.tb-blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tb-blog-card:hover .tb-blog-card-media img {
    transform: scale(1.06);
}

.tb-blog-card-media .cat-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    color: var(--tb-primary, #1e40af);
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tb-blog-card-body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tb-blog-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--tb-muted, #64748b);
    margin-bottom: 12px;
}

.tb-blog-card-meta .dot {
    width: 3px;
    height: 3px;
    background: var(--tb-muted-2, #94a3b8);
    border-radius: 50%;
}

.tb-blog-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--tb-ink, #0b1220);
    margin: 0 0 10px;
    text-decoration: none;
    letter-spacing: -0.005em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tb-blog-card-title:hover {
    color: var(--tb-primary, #1e40af);
}

.tb-blog-card-excerpt {
    color: var(--tb-muted, #64748b);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tb-blog-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    padding-top: 16px;
    border-top: 1px solid var(--tb-line-2, #f1f5f9);
}

.tb-blog-card-footer .time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.tb-blog-card-footer .time svg {
    width: 13px;
    height: 13px;
    color: var(--tb-muted-2, #94a3b8);
}

.tb-blog-card-read {
    color: var(--tb-primary, #1e40af);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
}

.tb-blog-card-read:hover {
    color: var(--tb-primary-600, #1d4ed8);
    gap: 8px;
}

.tb-blog-card-read svg {
    width: 14px;
    height: 14px;
}

/* ---------- Sidebar ---------- */
.tb-blog-side-card {
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius, 18px);
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--tb-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.tb-blog-side-card h3 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tb-ink, #0b1220);
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tb-blog-side-card h3::before {
    content: "";
    width: 3px;
    height: 16px;
    background: var(--tb-accent, #f97316);
    border-radius: 2px;
}

/* Categories as chips */
.tb-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tb-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--tb-bg-soft, #f7f8fb);
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: 999px;
    font-size: 13px;
    color: var(--tb-ink-2, #334155);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tb-cat-chip:hover {
    background: var(--tb-primary-50, #eff6ff);
    border-color: var(--tb-primary, #1e40af);
    color: var(--tb-primary, #1e40af);
}

.tb-cat-chip .count {
    background: var(--tb-line, #e5e7eb);
    color: var(--tb-muted, #64748b);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.tb-cat-chip:hover .count {
    background: var(--tb-primary, #1e40af);
    color: #fff;
}

/* Recent posts list */
.tb-recent {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tb-recent-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--tb-line-2, #f1f5f9);
    text-decoration: none;
    color: inherit;
}

.tb-recent-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tb-recent-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--tb-line-2, #f1f5f9);
    flex-shrink: 0;
}

.tb-recent-body {
    min-width: 0;
    flex: 1;
}

.tb-recent-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tb-ink, #0b1220);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.tb-recent-item:hover .tb-recent-title {
    color: var(--tb-primary, #1e40af);
}

.tb-recent-meta {
    font-size: 11.5px;
    color: var(--tb-muted-2, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Newsletter subscribe card */
.tb-newsletter-card {
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius, 18px);
    padding: 26px 24px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}

.tb-newsletter-card::before {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--tb-accent-50, #fff7ed);
}

.tb-newsletter-card > * {
    position: relative;
    z-index: 1;
}

.tb-newsletter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--tb-accent-50, #fff7ed);
    color: var(--tb-accent, #f97316);
    border-radius: 12px;
    margin-bottom: 14px;
}

.tb-newsletter-icon svg {
    width: 22px;
    height: 22px;
}

.tb-newsletter-card h4 {
    font-size: 17px;
    font-weight: 800;
    color: var(--tb-ink, #0b1220);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.tb-newsletter-card p {
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    line-height: 1.55;
    margin: 0 0 14px;
}

.tb-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tb-newsletter-form input {
    padding: 10px 14px;
    font-size: 13.5px;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.tb-newsletter-form input:focus {
    border-color: var(--tb-primary, #1e40af);
}

.tb-newsletter-form button {
    padding: 10px 16px;
    background: var(--tb-primary, #1e40af);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.tb-newsletter-form button:hover {
    background: var(--tb-primary-600, #1d4ed8);
}

.tb-newsletter-form .privacy {
    font-size: 11px;
    color: var(--tb-muted-2, #94a3b8);
    text-align: center;
    margin: 4px 0 0;
    line-height: 1.4;
}

/* CTA card in sidebar */
.tb-cta-card {
    background: var(--tb-primary, #1e40af);
    color: #fff;
    border-radius: var(--tb-radius, 18px);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    border: none;
}

.tb-cta-card::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: rgba(249, 115, 22, 0.18);
    border-radius: 50%;
}

.tb-cta-card > * {
    position: relative;
    z-index: 1;
}

.tb-cta-card .cta-eyebrow {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.tb-cta-card h4 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    color: #fff;
}

.tb-cta-card p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    margin: 0 0 20px;
}

.tb-cta-card .btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--tb-accent, #f97316);
    color: #fff;
    padding: 11px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tb-cta-card .btn-cta:hover {
    background: var(--tb-accent-600, #ea580c);
    color: #fff;
    transform: translateY(-1px);
}

.tb-cta-card .btn-cta svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.tb-cta-card .btn-cta:hover svg {
    transform: translateX(3px);
}

/* ---------- Post single (show) ---------- */
/* Reading progress bar — fixed at top, expands as reader scrolls */
.tb-read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--tb-accent, #f97316);
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
    transition: width 0.05s linear;
}

.tb-post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    margin-bottom: 24px;
}

.tb-post-breadcrumb a {
    color: var(--tb-muted, #64748b);
    text-decoration: none;
}

.tb-post-breadcrumb a:hover {
    color: var(--tb-primary, #1e40af);
}

.tb-post-breadcrumb .sep {
    color: var(--tb-muted-2, #94a3b8);
}

/* Cover-style hero — image on top, headcard overlapping */
.tb-post-hero-v2 {
    position: relative;
    margin-bottom: 40px;
}

.tb-post-cover {
    position: relative;
    aspect-ratio: 21/9;
    background: var(--tb-line-2, #f1f5f9);
    border-radius: var(--tb-radius-lg, 24px);
    overflow: hidden;
    box-shadow: var(--tb-shadow, 0 8px 24px rgba(15, 23, 42, 0.08));
}

.tb-post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Decorative corner mark on the cover image (orange L-bracket) */
.tb-post-cover-corner {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
    border-top: 3px solid var(--tb-accent, #f97316);
    border-right: 3px solid var(--tb-accent, #f97316);
    border-top-right-radius: 8px;
    z-index: 2;
}

.tb-post-cover-corner::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    border-top-right-radius: 4px;
}

/* The headcard sits inside a max-width so it overlaps the image nicely */
.tb-post-headcard {
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius-lg, 24px);
    padding: 36px 44px 32px;
    box-shadow: var(--tb-shadow, 0 10px 30px rgba(15, 23, 42, 0.08));
    position: relative;
    z-index: 3;
}

.tb-post-headcard.is-overlapping {
    margin: -90px 32px 0;
}

.tb-post-headcard-top {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tb-post-headcard-top .cat {
    background: var(--tb-primary-50, #eff6ff);
    color: var(--tb-primary, #1e40af);
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.tb-post-headcard-top .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.tb-post-headcard-top .meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--tb-muted-2, #94a3b8);
}

.tb-post-headcard h1 {
    font-size: clamp(26px, 3.6vw, 44px);
    font-weight: 800;
    color: var(--tb-ink, #0b1220);
    line-height: 1.12;
    margin: 0 0 14px;
    letter-spacing: -0.025em;
}

.tb-post-headcard-excerpt {
    font-size: 18px;
    color: var(--tb-muted, #64748b);
    line-height: 1.6;
    margin: 0 0 24px;
    font-weight: 400;
}

/* Share button row */
.tb-post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 22px;
    border-top: 1px solid var(--tb-line-2, #f1f5f9);
    flex-wrap: wrap;
}

.tb-post-actions .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--tb-muted, #64748b);
    font-weight: 700;
    margin-right: 4px;
}

.tb-post-actions a,
.tb-post-actions button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--tb-bg-soft, #f7f8fb);
    border: 1px solid var(--tb-line, #e5e7eb);
    color: var(--tb-ink-2, #334155);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tb-post-actions a:hover,
.tb-post-actions button:hover {
    background: var(--tb-primary, #1e40af);
    border-color: var(--tb-primary, #1e40af);
    color: #fff;
    transform: translateY(-2px);
}

.tb-post-actions button.copied {
    background: var(--tb-accent, #f97316);
    border-color: var(--tb-accent, #f97316);
    color: #fff;
}

.tb-post-actions svg {
    width: 15px;
    height: 15px;
}

/* Drop cap on first paragraph of post body */
.tb-post-body > p:first-of-type::first-letter {
    float: left;
    font-size: 4em;
    line-height: 0.9;
    font-weight: 800;
    color: var(--tb-accent, #f97316);
    margin: 0.05em 0.12em 0 0;
    font-family: inherit;
}

@media (max-width: 900px) {
    .tb-post-cover {
        aspect-ratio: 16/9;
    }

    .tb-post-headcard.is-overlapping {
        margin: -60px 16px 0;
        padding: 26px 22px 24px;
    }

    .tb-post-cover-corner {
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 600px) {
    .tb-post-cover {
        aspect-ratio: 4/3;
        border-radius: var(--tb-radius, 18px);
    }

    .tb-post-headcard.is-overlapping {
        margin: -32px 8px 0;
    }

    .tb-post-body > p:first-of-type::first-letter {
        font-size: 3.2em;
    }
}

/* ---------- Post content (WP HTML rendering) ---------- */
.tb-post-body {
    background: #fff;
    border-radius: var(--tb-radius-lg, 24px);
    padding: 48px;
    border: 1px solid var(--tb-line, #e5e7eb);
    font-size: 17px;
    line-height: 1.8;
    color: var(--tb-ink-2, #334155);
}

.tb-post-body > *:first-child {
    margin-top: 0;
}

.tb-post-body h1,
.tb-post-body h2,
.tb-post-body h3,
.tb-post-body h4,
.tb-post-body h5,
.tb-post-body h6 {
    color: var(--tb-ink, #0b1220);
    font-weight: 800;
    line-height: 1.25;
    margin: 2em 0 0.7em;
    letter-spacing: -0.015em;
}

.tb-post-body h2 { font-size: 28px; }
.tb-post-body h3 { font-size: 22px; }
.tb-post-body h4 { font-size: 19px; }
.tb-post-body p { margin: 0 0 1.3em; }

.tb-post-body a {
    color: var(--tb-primary, #1e40af);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(30, 64, 175, 0.3);
    text-decoration-thickness: 1.5px;
}

.tb-post-body a:hover {
    color: var(--tb-primary-600, #1d4ed8);
    text-decoration-color: currentColor;
}

.tb-post-body ul,
.tb-post-body ol {
    padding-left: 1.5em;
    margin: 0 0 1.3em;
}

.tb-post-body li {
    margin-bottom: 0.5em;
}

.tb-post-body blockquote {
    border-left: 4px solid var(--tb-accent, #f97316);
    padding: 1em 1.4em;
    margin: 1.5em 0;
    background: var(--tb-accent-50, #fff7ed);
    border-radius: 0 14px 14px 0;
    font-style: italic;
    font-size: 18px;
    color: var(--tb-ink, #0b1220);
}

.tb-post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 1.2em 0;
}

.tb-post-body figure {
    margin: 1.5em 0;
}

.tb-post-body figcaption {
    text-align: center;
    font-size: 13px;
    color: var(--tb-muted, #64748b);
    margin-top: 8px;
    font-style: italic;
}

/* WP alignment classes */
.tb-post-body .aligncenter,
.tb-post-body figure.aligncenter img,
.tb-post-body img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.tb-post-body .alignleft,
.tb-post-body img.alignleft {
    float: left;
    margin: 0 1.5em 1em 0;
}

.tb-post-body .alignright,
.tb-post-body img.alignright {
    float: right;
    margin: 0 0 1em 1.5em;
}

.tb-post-body .alignnone,
.tb-post-body img.alignnone {
    display: inline-block;
}

.tb-post-body hr {
    border: none;
    border-top: 1px solid var(--tb-line, #e5e7eb);
    margin: 2.5em 0;
}

.tb-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
}

.tb-post-body table th,
.tb-post-body table td {
    border: 1px solid var(--tb-line, #e5e7eb);
    padding: 12px 16px;
    text-align: left;
}

.tb-post-body table th {
    background: var(--tb-bg-soft, #f7f8fb);
    font-weight: 700;
    color: var(--tb-ink, #0b1220);
}

.tb-post-body pre,
.tb-post-body code {
    background: var(--tb-bg-soft, #f7f8fb);
    border-radius: 8px;
    font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
}

.tb-post-body code {
    padding: 2px 8px;
}

.tb-post-body pre {
    padding: 18px 22px;
    overflow-x: auto;
    margin: 1.2em 0;
    border: 1px solid var(--tb-line, #e5e7eb);
}

.tb-post-body pre code {
    padding: 0;
    background: transparent;
}

.tb-post-body iframe {
    max-width: 100%;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .tb-post-body {
        padding: 28px 22px;
        font-size: 16px;
    }
    .tb-post-body h2 { font-size: 24px; }
    .tb-post-body h3 { font-size: 20px; }
}

/* ---------- Post tags (below body) ---------- */
.tb-post-tags {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 28px;
    padding: 22px 26px;
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: var(--tb-radius, 18px);
    flex-wrap: wrap;
}

.tb-post-tags-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--tb-muted, #64748b);
    padding-top: 6px;
    flex-shrink: 0;
}

.tb-post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.tb-post-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--tb-bg-soft, #f7f8fb);
    color: var(--tb-ink-2, #334155);
    border: 1px solid var(--tb-line, #e5e7eb);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tb-post-tag::before {
    content: "#";
    margin-right: 3px;
    color: var(--tb-accent, #f97316);
    font-weight: 800;
}

.tb-post-tag:hover {
    border-color: var(--tb-primary, #1e40af);
    background: var(--tb-primary-50, #eff6ff);
    color: var(--tb-primary, #1e40af);
}

/* ---------- Related posts ---------- */
.tb-related {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--tb-line, #e5e7eb);
    clear: both;
}

.tb-related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.tb-related h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--tb-ink, #0b1220);
    margin: 0;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tb-related h2::before {
    content: "";
    width: 4px;
    height: 28px;
    background: var(--tb-accent, #f97316);
    border-radius: 3px;
}

/* 3-up grid when few enough related posts */
.tb-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Hide the magazine post-number badge in the related section (context differs) */
.tb-related-grid .tb-blog-card::after,
.tb-related-track .tb-blog-card::after {
    display: none;
}

@media (max-width: 900px) {
    .tb-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tb-related-grid {
        grid-template-columns: 1fr;
    }
}

/* Horizontal scroll carousel when >3 related posts */
.tb-related-controls {
    display: flex;
    gap: 8px;
}

.tb-carousel-nav {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--tb-line, #e5e7eb);
    color: var(--tb-ink, #0b1220);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--tb-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    padding: 0;
}

.tb-carousel-nav svg {
    width: 16px;
    height: 16px;
}

.tb-carousel-nav:hover {
    background: var(--tb-primary, #1e40af);
    border-color: var(--tb-primary, #1e40af);
    color: #fff;
    transform: translateY(-1px);
}

.tb-related-carousel {
    position: relative;
    margin: 0 -4px;
}

.tb-related-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 4px 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tb-related-track::-webkit-scrollbar {
    display: none;
}

.tb-related-track > .tb-blog-card {
    flex: 0 0 calc((100% - 48px) / 3);
    scroll-snap-align: start;
    min-width: 0;
}

@media (max-width: 900px) {
    .tb-related-track > .tb-blog-card {
        flex: 0 0 calc((100% - 24px) / 2);
    }
}

@media (max-width: 600px) {
    .tb-related-track > .tb-blog-card {
        flex: 0 0 86%;
    }
}

/* ---------- Pagination ---------- */
.tb-blog-pagination {
    margin-top: 44px;
}

.tb-blog-pagination nav {
    justify-content: center !important;
}

.tb-blog-pagination .d-sm-flex {
    justify-content: center !important;
}

.tb-blog-pagination .d-sm-flex > div:first-child {
    display: none;
}

.tb-blog-pagination .pagination {
    display: inline-flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.tb-blog-pagination .page-item .page-link {
    border: 1px solid var(--tb-line, #e5e7eb);
    color: var(--tb-ink-2, #334155);
    background: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;
    min-width: 44px;
    text-align: center;
    display: inline-block;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.tb-blog-pagination .page-item.active .page-link {
    background: var(--tb-primary, #1e40af);
    border-color: var(--tb-primary, #1e40af);
    color: #fff;
}

.tb-blog-pagination .page-item .page-link:hover {
    border-color: var(--tb-primary, #1e40af);
    color: var(--tb-primary, #1e40af);
}

.tb-blog-pagination .page-item.active .page-link:hover {
    color: #fff;
}

.tb-blog-pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ---------- Empty state ---------- */
.tb-blog-empty {
    text-align: center;
    padding: 72px 20px;
    background: #fff;
    border-radius: var(--tb-radius, 18px);
    border: 1px dashed var(--tb-line, #e5e7eb);
    color: var(--tb-muted, #64748b);
}

.tb-blog-empty p {
    margin: 0;
    font-size: 15px;
}

/* ============================================================
 * Mobile refinements — consolidated block at end so overrides
 * always win. Covers tablet (≤900) and phone (≤600) breakpoints
 * for every section (header, featured, cards, sidebar, post
 * hero, related, tags, pagination).
 * ============================================================ */

@media (max-width: 900px) {
    .tb-blog {
        padding: 32px 0 56px;
    }

    /* Decorative background circles feel oversized on mobile */
    .tb-blog::before {
        width: 200px;
        height: 200px;
        top: -60px;
        right: -60px;
    }
    .tb-blog::after {
        width: 160px;
        height: 160px;
        bottom: -60px;
        left: -60px;
    }

    .tb-blog-header {
        margin-bottom: 28px;
        padding-bottom: 24px;
    }

    .tb-blog-header .eyebrow {
        font-size: 10px;
        margin-bottom: 14px;
    }

    .tb-blog-header p {
        font-size: 15px;
    }

    /* Search bar: full width, buttons stack neatly */
    .tb-blog-search {
        max-width: 100%;
        margin-top: 18px;
        padding: 5px;
    }
    .tb-blog-search input {
        font-size: 14px;
        padding: 8px 4px;
        min-width: 0;
    }
    .tb-blog-search button {
        padding: 8px 14px;
        font-size: 13px;
    }
    .tb-blog-search svg {
        margin: 0 2px 0 10px;
    }

    /* Stats card centres on its own row instead of squeezing beside title */
    .tb-blog-header-stats {
        width: 100%;
        justify-content: space-around;
        padding: 16px 20px;
        gap: 20px;
    }
    .tb-blog-header-stat .num {
        font-size: 24px;
    }
    .tb-blog-header-stat .label {
        font-size: 11px;
    }

    /* Topics strip: horizontal scroll on mobile so all chips stay one row */
    .tb-topics-strip {
        margin-bottom: 22px;
        padding-bottom: 18px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-right: 4px;
        margin-right: -16px;
    }
    .tb-topics-strip::-webkit-scrollbar {
        display: none;
    }
    .tb-topics-strip .label {
        display: none;
    }
    .tb-topic-chip {
        padding: 7px 13px;
        font-size: 12.5px;
        flex-shrink: 0;
    }

    /* Featured hero card: media has a real height so image doesn't collapse */
    .tb-featured-card {
        margin-bottom: 32px;
    }
    .tb-featured-body {
        padding: 26px 22px;
    }
    .tb-featured-body::before {
        display: none;
    }
    .tb-featured-body h2 {
        font-size: 22px;
    }
    .tb-featured-body .excerpt {
        font-size: 14.5px;
        margin-bottom: 20px;
        -webkit-line-clamp: 3;
    }
    .tb-featured-card::before {
        top: 14px;
        left: 14px;
        padding: 5px 12px;
        font-size: 10px;
    }

    /* Post cards: title stays 15px but padding tightens */
    .tb-blog-cards {
        gap: 18px;
    }
    .tb-blog-card-body {
        padding: 18px 18px 16px;
    }
    .tb-blog-card-media .cat-tag {
        top: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 10px;
    }
    .tb-blog-card::after {
        top: 8px;
        right: 10px;
        padding: 2px 7px;
        font-size: 10px;
    }
    .tb-blog-card-footer {
        padding-top: 12px;
        font-size: 12.5px;
    }

    /* Sidebar cards: reduce padding to save vertical space */
    .tb-blog-side-card,
    .tb-newsletter-card,
    .tb-cta-card {
        padding: 20px 18px;
    }
    .tb-cta-card h4 {
        font-size: 19px;
    }

    /* Related section head: allow arrows to sit below on very narrow */
    .tb-related {
        margin-top: 40px;
        padding-top: 32px;
    }
    .tb-related h2 {
        font-size: 21px;
    }
    .tb-related-head {
        margin-bottom: 20px;
    }

    /* Post breadcrumb — smaller so it doesn't wrap wildly on long titles */
    .tb-post-breadcrumb {
        font-size: 12px;
        margin-bottom: 18px;
        flex-wrap: wrap;
    }

    /* Post detail title: dial down from clamp() default (26-44px) on tablet */
    .tb-post-headcard h1 {
        font-size: 22px;
        line-height: 1.2;
        letter-spacing: -0.015em;
        margin-bottom: 12px;
    }
    .tb-post-headcard-excerpt {
        font-size: 15px;
        margin-bottom: 18px;
    }
    .tb-post-headcard-top {
        gap: 10px;
        margin-bottom: 14px;
        font-size: 12px;
    }

    /* Post tags: label goes above chips on narrow screens */
    .tb-post-tags {
        padding: 18px 20px;
        gap: 10px;
        flex-direction: column;
    }
    .tb-post-tags-label {
        padding-top: 0;
    }
    .tb-post-tag {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* Share buttons row: gap tightens */
    .tb-post-actions {
        gap: 8px;
    }
    .tb-post-actions .label {
        width: 100%;
        margin-bottom: 4px;
    }
    .tb-post-actions a,
    .tb-post-actions button {
        width: 34px;
        height: 34px;
    }

    /* Pagination buttons keep tap size */
    .tb-blog-pagination .page-item .page-link {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 38px;
    }
}

/* Very small phones — extra dial-down */
@media (max-width: 480px) {
    .tb-blog-header h1 {
        font-size: 28px;
    }

    .tb-blog-header-stats {
        padding: 14px 16px;
        gap: 16px;
    }

    .tb-featured-body h2 {
        font-size: 19px;
    }
    .tb-featured-body .excerpt {
        display: none;
    }

    .tb-featured-cta {
        padding: 10px 16px;
        font-size: 13px;
    }

    .tb-blog-card-title {
        font-size: 14px;
    }

    .tb-post-hero-body,
    .tb-post-headcard {
        padding: 22px 18px !important;
    }

    /* Post detail title: further reduce on phones */
    .tb-post-headcard h1 {
        font-size: 19px;
        line-height: 1.25;
    }
    .tb-post-headcard-excerpt {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .tb-related-track > .tb-blog-card {
        flex: 0 0 92%;
    }

    /* Reading progress bar slightly taller for visibility on small screens */
    .tb-read-progress {
        height: 2px;
    }
}

/* Ultra-narrow (folded phones, very small) */
@media (max-width: 360px) {
    .tb-blog .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .tb-blog-header h1 {
        font-size: 24px;
    }
    .tb-featured-body h2 {
        font-size: 17px;
    }
    .tb-post-headcard h1 {
        font-size: 17px;
    }
}
