/* Utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.button.primary {
    background: var(--blog-primary);
    color: #fff;
    border-color: var(--blog-primary);
}

.button.primary:hover {
    box-shadow: 0 10px 20px rgba(var(--blog-primary-rgb), 0.35);
}

.button.ghost {
    background: transparent;
    border-color: rgba(var(--blog-primary-rgb), 0.4);
    color: #1f2a37;
}

.button.ghost:hover {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
}

body.blog-page {
    --blog-primary: #18d26e;
    --blog-primary-rgb: 24, 210, 110;
    --blog-accent: #5cf4b6;
    --blog-accent-rgb: 92, 244, 182;
    --blog-surface: #ffffff;
    background: radial-gradient(circle at top right, rgba(var(--blog-primary-rgb), 0.08), transparent 45%) fixed,
        radial-gradient(circle at 20% 20%, rgba(var(--blog-accent-rgb), 0.25), transparent 50%) fixed,
        #f4f6fb;
    color: #0f172a;
    min-height: 100vh;
}

body.blog-page.blog-theme-blue {
    --blog-primary: #5663ff;
    --blog-primary-rgb: 86, 99, 255;
    --blog-accent: #7edcff;
    --blog-accent-rgb: 126, 220, 255;
}

body.blog-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 80% 0%, rgba(var(--blog-primary-rgb), 0.08), transparent 40%);
    opacity: 0.5;
    pointer-events: none;
}

.blog-main {
    display: block;
    padding-top: 1.5rem;
}

body.blog-page #header.blog-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.9);
    height: 68px;
    padding: 6px 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

body.blog-page #header.blog-header.header-scrolled {
    height: 60px;
    padding: 0;
}

@media (max-width: 991px) {
    .blog-main {
        padding-top: 1rem;
    }
}

.blog-hero {
    padding: 4rem 0 3rem;
    margin-top: 0;
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 48%, #eff7ff 100%);
    color: #0f172a;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 3rem 3rem;
}

.blog-hero::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(86,99,255,0.25) 0%, rgba(255,255,255,0) 65%);
    top: -120px;
    right: -80px;
    z-index: 0;
}

.blog-hero::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(126,220,255,0.3) 0%, rgba(255,255,255,0) 70%);
    bottom: -80px;
    left: -60px;
    z-index: 0;
}

.blog-hero .container {
    position: relative;
    z-index: 1;
}

.blog-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 2rem;
    align-items: stretch;
}

.blog-hero__content h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

.hero-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.meta-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(var(--blog-primary-rgb), 0.12);
    color: var(--blog-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-hero__content .lede {
    font-size: 1.125rem;
    max-width: 640px;
    color: #2f3747;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.blog-hero__panel {
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(var(--blog-primary-rgb), 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-hero__panel p {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.blog-search {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.blog-hero__panel .blog-search {
    flex-direction: column;
    gap: 0.75rem;
}

.blog-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid #dee2e6;
}

.blog-search button {
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--blog-primary);
    color: #fff;
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.hero-stats > div {
    flex: 1;
    min-width: 120px;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: #4f5d75;
    margin: 0;
}

.blog-shell {
    padding: 3.5rem 2rem;
    margin-top: -2rem;
    position: relative;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 2.5rem;
    border: 1px solid rgba(var(--blog-primary-rgb), 0.08);
    box-shadow: 0 40px 120px rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(12px);
}

.blog-shell::before {
    content: "";
    position: absolute;
    inset: 1.5rem;
    border-radius: 2rem;
    border: 1px dashed rgba(var(--blog-primary-rgb), 0.08);
    pointer-events: none;
}

.blog-hero,
.blog-shell {
    scroll-margin-top: 90px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(var(--blog-primary-rgb), 0.08);
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(var(--blog-primary-rgb), 0.55), rgba(var(--blog-accent-rgb), 0.35));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.25;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.post-card:hover::after {
    opacity: 0.6;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 35px 70px rgba(15, 23, 42, 0.18);
}

.post-card--featured {
    grid-column: span 2;
}

.post-card__image {
    position: relative;
    display: block;
    overflow: hidden;
}

.post-card__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, 0.45) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.post-card__image img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card__image img {
    transform: scale(1.05);
}

.post-card:hover .post-card__image::after {
    opacity: 1;
}

.post-card__image .category-pill {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
}

.post-card__body {
    padding: 1.75rem;
}

.post-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.post-card__meta-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-card__body h3 {
    margin: 0.75rem 0 0.35rem;
    font-size: 1.45rem;
}

.post-card__body h3 a {
    color: inherit;
    text-decoration: none;
}

.post-card__body h3 a:hover {
    color: var(--blog-primary);
}

.post-card__subtitle,
.post-card__summary {
    color: #4f5d75;
    margin: 0 0 0.75rem;
}

.post-card__tags {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--blog-primary);
}

.post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.post-card__author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-card__author img,
.avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: var(--blog-primary);
    font-weight: 700;
}

.author-name {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.author-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

.post-card__action {
    font-weight: 600;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--blog-primary-rgb), 0.2);
    background: linear-gradient(120deg, rgba(var(--blog-primary-rgb), 0.08), transparent);
}

.post-card__action span {
    transition: transform 0.3s ease;
}

.post-card__action:hover span {
    transform: translateX(4px);
}

.category-pill,
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.85rem;
    border-radius: 999px;
    background: rgba(var(--blog-primary-rgb), 0.12);
    color: var(--blog-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pill--glow {
    background: linear-gradient(120deg, rgba(var(--blog-primary-rgb), 0.15), rgba(var(--blog-accent-rgb), 0.25));
    box-shadow: 0 6px 15px rgba(var(--blog-primary-rgb), 0.2);
}

.blog-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2.5rem;
    margin-top: 2rem;
}

.blog-layout aside {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.filter-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(var(--blog-primary-rgb), 0.08);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.filter-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(var(--blog-accent-rgb), 0.15), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}

.filter-card + .filter-card {
    margin-top: 1.5rem;
}

.pill-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-list a {
    display: inline-flex;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #dee2e6;
    color: #111;
    font-size: 0.875rem;
}

.pill-list a.active,
.pill-list a:hover {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
}

.empty-state {
    padding: 3rem 2rem;
    border: 2px dashed #dbe4ff;
    border-radius: 1.5rem;
    text-align: center;
}

.blog-article header h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    position: relative;
}

.blog-article header h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.6rem;
    width: 120px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--blog-primary-rgb), 0.9), rgba(var(--blog-accent-rgb), 0.2));
}

.detail-hero {
    background: linear-gradient(135deg, #ffffff, #eef2ff);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 30px 60px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.detail-hero__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-hero__meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.detail-hero__date {
    font-weight: 600;
    color: #4b5563;
}

.detail-hero__extras {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-hero__stats {
    display: flex;
    gap: 1.5rem;
}

.detail-hero__stats span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.share-list {
    list-style: none;
    display: flex;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

.share-list a {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--blog-primary-rgb), 0.3);
    color: #1f2a37;
    font-weight: 600;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.article-meta .author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #0f172a;
}

.article-meta .author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.hero-image img {
    width: 100%;
    border-radius: 1rem;
    margin: 1.5rem 0;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.9;
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef1f8;
}

.article-body pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
}

.article-tags {
    margin-top: 2rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.article-tags a {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(var(--blog-primary-rgb), 0.08);
    color: var(--blog-primary);
    font-weight: 500;
}

.related {
    margin-top: 3rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #425066;
    margin-top: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid rgba(var(--blog-primary-rgb), 0.4);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

@media (max-width: 1200px) {
    .blog-shell {
        padding: 3rem 1.5rem;
    }
}

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

    .blog-layout aside {
        position: static;
    }

    .blog-shell::before {
        inset: 1rem;
    }
}

@media (max-width: 600px) {
    .blog-hero__content h1 {
        font-size: 2rem;
    }

    .blog-search {
        flex-direction: column;
    }

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

    .detail-hero {
        padding: 1.5rem;
    }

    .detail-hero__extras {
        flex-direction: column;
    }

    .post-card__image img {
        height: 180px;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-stats {
        flex-direction: column;
    }

    .post-card__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

