.blog-page,
.blog-article-bg {
    --blog-shell-width: 1180px;
    --blog-surface: rgba(255, 255, 255, 0.8);
    --blog-surface-strong: rgba(255, 255, 255, 0.94);
    --blog-surface-soft: rgba(244, 247, 255, 0.9);
    --blog-border: rgba(15, 23, 42, 0.1);
    --blog-border-strong: rgba(37, 99, 235, 0.2);
    --blog-shadow: 0 22px 56px rgba(15, 23, 42, 0.12);
    --blog-chip-bg: rgba(255, 255, 255, 0.84);
    --blog-chip-hover: rgba(37, 99, 235, 0.08);
    --blog-search-bg: rgba(255, 255, 255, 0.92);
    --blog-nav-btn-bg: rgba(255, 255, 255, 0.86);
    --blog-nav-btn-border: rgba(15, 23, 42, 0.12);
    --blog-link: #1d4ed8;
    --blog-link-hover: #0f172a;
    --blog-cover-fallback:
        radial-gradient(120% 120% at 0% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
        radial-gradient(110% 110% at 100% 100%, rgba(6, 182, 212, 0.16), transparent 50%),
        linear-gradient(180deg, rgba(238, 244, 255, 0.96), rgba(255, 255, 255, 0.98));
    --blog-hero-card:
        radial-gradient(140% 130% at 100% 0%, rgba(37, 99, 235, 0.16), transparent 58%),
        radial-gradient(120% 120% at 0% 100%, rgba(6, 182, 212, 0.14), transparent 54%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
}

html[data-bs-theme="dark"] .blog-page,
html[data-bs-theme="dark"] .blog-article-bg {
    --blog-surface: rgba(34, 38, 44, 0.88);
    --blog-surface-strong: rgba(27, 30, 34, 0.94);
    --blog-surface-soft: rgba(42, 47, 54, 0.92);
    --blog-border: rgba(148, 163, 184, 0.22);
    --blog-border-strong: rgba(47, 109, 246, 0.42);
    --blog-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
    --blog-chip-bg: rgba(34, 38, 44, 0.88);
    --blog-chip-hover: rgba(47, 109, 246, 0.18);
    --blog-search-bg: rgba(23, 26, 30, 0.92);
    --blog-nav-btn-bg: rgba(23, 26, 30, 0.94);
    --blog-nav-btn-border: rgba(148, 163, 184, 0.26);
    --blog-link: #93c5fd;
    --blog-link-hover: #f8fbff;
    --blog-cover-fallback:
        radial-gradient(120% 120% at 0% 0%, rgba(47, 109, 246, 0.26), transparent 55%),
        radial-gradient(110% 110% at 100% 100%, rgba(31, 75, 184, 0.24), transparent 50%),
        linear-gradient(180deg, rgba(27, 30, 34, 0.98), rgba(17, 24, 39, 0.98));
    --blog-hero-card:
        radial-gradient(140% 130% at 100% 0%, rgba(47, 109, 246, 0.24), transparent 58%),
        radial-gradient(120% 120% at 0% 100%, rgba(31, 75, 184, 0.22), transparent 54%),
        linear-gradient(180deg, rgba(34, 38, 44, 0.98), rgba(23, 26, 30, 0.98));
}

.blog-page .container,
.blog-article-bg .container {
    max-width: var(--blog-shell-width);
}

.blog-page {
    padding: 44px 0 88px;
    background: transparent;
}

html[data-bs-theme="dark"] .blog-page {
    background: transparent;
}

.blog-hero {
    margin-bottom: 30px;
}

.blog-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
    gap: 28px;
    align-items: start;
}

.blog-hero-copy {
    max-width: 680px;
    padding-top: 0;
}

.blog-hero .eyebrow,
.highlight-label {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.blog-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 4.4vw, 50px);
    line-height: 1.04;
    font-weight: 900;
    color: var(--text);
    text-wrap: balance;
}

.blog-hero .sub {
    margin: 0 0 22px;
    max-width: 60ch;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-dim);
}

.blog-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--blog-border);
    background: var(--blog-surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    color: var(--text-dim);
    backdrop-filter: blur(10px);
}

html[data-bs-theme="dark"] .badge-pill {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.badge-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
}

.blog-hero-highlight {
    position: relative;
    min-height: 100%;
    display: flex;
    align-items: stretch;
}

.highlight-card {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px 24px 78px;
    border-radius: 26px;
    border: 1px solid var(--blog-border-strong);
    background: var(--blog-hero-card);
    box-shadow: var(--blog-shadow);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.highlight-card.is-hidden {
    display: none;
}

.highlight-title {
    margin: 0 0 12px;
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.24;
    font-weight: 850;
    color: var(--text);
}

.highlight-text {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dim);
}

.highlight-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: auto;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-dim);
}

.highlight-link,
.card-link,
.card-title-link {
    color: var(--blog-link);
    text-decoration: none;
    transition: color 0.16s ease, transform 0.16s ease;
}

.highlight-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

.highlight-link:hover,
.card-link:hover,
.card-title-link:hover {
    color: var(--blog-link-hover);
}

.highlight-link:hover .arrow,
.card-link:hover .arrow {
    transform: translateX(2px);
}

.highlight-link .arrow,
.card-link .arrow {
    transition: transform 0.16s ease;
}

.hero-highlight-nav {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: flex;
    gap: 8px;
}

.hero-nav-btn,
.chip,
.page-btn {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.hero-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border-color: var(--blog-nav-btn-border);
    background: var(--blog-nav-btn-bg);
    color: var(--text);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.hero-nav-btn:hover {
    border-color: var(--blog-border-strong);
    background: var(--blog-surface-strong);
}

.blog-filters {
    margin-bottom: 26px;
}

.filters-inner {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 18px 24px;
    align-items: start;
}

.filters-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.filters-sub {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dim);
}

.filters-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 12px 16px;
    align-items: start;
}

.blog-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.chip {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border-color: var(--blog-border);
    background: var(--blog-chip-bg);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease,
        color 0.16s ease;
}

.chip:hover {
    transform: translateY(-1px);
    background: var(--blog-chip-hover);
    border-color: var(--blog-border-strong);
    color: var(--text);
}

.chip-active {
    border-color: var(--blog-border-strong);
    background:
        radial-gradient(140% 140% at 0% 0%, rgba(37, 99, 235, 0.18), transparent 58%),
        radial-gradient(140% 140% at 100% 100%, rgba(6, 182, 212, 0.14), transparent 54%),
        var(--blog-chip-bg);
    color: var(--text);
}

html[data-bs-theme="dark"] .chip-active {
    background:
        radial-gradient(140% 140% at 0% 0%, rgba(47, 109, 246, 0.26), transparent 58%),
        radial-gradient(140% 140% at 100% 100%, rgba(31, 75, 184, 0.22), transparent 54%),
        var(--blog-chip-bg);
}

#blog-search-form {
    width: 100%;
    min-width: 0;
    max-width: 320px;
    margin-left: 0;
}

.blog-search-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--blog-border);
    background: var(--blog-search-bg);
    color: var(--text);
    font-size: 13px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

html[data-bs-theme="dark"] .blog-search-input {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.blog-search-input::placeholder {
    color: var(--text-dim);
}

.blog-grid-section {
    margin-top: 6px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.blog-card,
.blog-empty-state {
    border-radius: 24px;
    border: 1px solid var(--blog-border);
    background: var(--blog-surface-strong);
    box-shadow: var(--blog-shadow);
    backdrop-filter: blur(12px);
}

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease,
        background 0.16s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--blog-border-strong);
    background: var(--blog-surface-strong);
}

.card-cover-link {
    display: block;
    text-decoration: none;
}

.cover-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin: 16px 16px 0;
    border-radius: 18px;
    background: var(--blog-cover-fallback);
}

.cover-wrapper img,
.cover-fallback {
    width: 100%;
    height: 100%;
    display: block;
}

.cover-wrapper img {
    object-fit: cover;
    transition: transform 0.26s ease, filter 0.26s ease;
}

.cover-fallback {
    background: var(--blog-cover-fallback);
}

.blog-card:hover .cover-wrapper img {
    transform: scale(1.02);
    filter: saturate(1.05);
}

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 18px 18px;
}

.card-top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    margin-bottom: 10px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card-title {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 850;
    color: var(--text);
}

.card-title-link {
    color: inherit;
}

.card-excerpt {
    margin: 0 0 18px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.author {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    color: #08111f;
    font-size: 13px;
    font-weight: 900;
}

.author-name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.author-role {
    margin: 0;
    font-size: 11px;
    color: var(--text-dim);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
}

.blog-empty-state {
    grid-column: 1 / -1;
    padding: 34px 28px;
    text-align: center;
}

.blog-empty-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 850;
    color: var(--text);
}

.blog-empty-copy {
    margin: 0;
    color: var(--text-dim);
}

.blog-pagination {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.page-btn {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    border-color: var(--blog-border);
    background: var(--blog-chip-bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease,
        transform 0.16s ease;
}

.page-btn:hover {
    transform: translateY(-1px);
    border-color: var(--blog-border-strong);
    background: var(--blog-chip-hover);
}

.page-indicator {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
}

.hero-nav-btn:focus-visible,
.chip:focus-visible,
.page-btn:focus-visible,
.blog-search-input:focus-visible,
.highlight-link:focus-visible,
.card-link:focus-visible,
.card-title-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.pill-green {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.22);
}

.pill-purple {
    background: rgba(168, 85, 247, 0.12);
    color: #9333ea;
    border-color: rgba(168, 85, 247, 0.24);
}

.pill-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.22);
}

.pill-orange {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.24);
}

.pill-cyan {
    background: rgba(6, 182, 212, 0.12);
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.24);
}

.pill-yellow {
    background: rgba(234, 179, 8, 0.12);
    color: #ca8a04;
    border-color: rgba(234, 179, 8, 0.24);
}

html[data-bs-theme="dark"] .pill-green {
    color: #86efac;
}

html[data-bs-theme="dark"] .pill-purple {
    color: #d8b4fe;
}

html[data-bs-theme="dark"] .pill-blue {
    color: #bfdbfe;
}

html[data-bs-theme="dark"] .pill-orange {
    color: #fcd34d;
}

html[data-bs-theme="dark"] .pill-cyan {
    color: #67e8f9;
}

html[data-bs-theme="dark"] .pill-yellow {
    color: #fde047;
}

@media (max-width: 1199.98px) {
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .blog-page {
        padding-top: 34px;
    }

    .blog-hero-inner,
    .filters-inner {
        grid-template-columns: 1fr;
    }

    .filters-right {
        grid-template-columns: 1fr;
    }

    #blog-search-form {
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .blog-hero {
        margin-bottom: 28px;
    }

    .highlight-card {
        padding: 22px 20px 74px;
    }

    .blog-chip-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 2px 2px 6px;
        margin: 0 -2px;
        scrollbar-width: none;
    }

    .blog-chip-row::-webkit-scrollbar {
        display: none;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .blog-page {
        padding-top: 22px;
        padding-bottom: 64px;
    }

    .blog-hero {
        margin-bottom: 24px;
    }

    .blog-hero h1 {
        font-size: 30px;
    }

    .blog-hero .sub {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .badge-pill {
        min-height: 36px;
        padding: 7px 12px;
        font-size: 12px;
    }

    .highlight-card {
        padding: 18px 18px 62px;
        border-radius: 22px;
    }

    .highlight-title {
        font-size: 22px;
    }

    .filters-inner {
        gap: 14px;
    }

    .filters-title {
        font-size: 17px;
    }

    .cover-wrapper {
        margin: 14px 14px 0;
    }

    .card-body {
        padding: 16px;
    }

    .blog-empty-state {
        padding: 26px 16px;
    }

    .hero-highlight-nav {
        right: 14px;
        bottom: 14px;
    }
}
