.blog-toolbar {
    display: grid;
    gap: 18px;
    margin-bottom: 30px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.blog-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(16, 35, 61, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary);
    font-weight: 800;
    transition: transform 260ms ease, background 260ms ease, color 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.blog-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.blog-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 14px 28px rgba(14, 47, 86, 0.22);
}

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

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 249, 253, 0.95));
    border: 1px solid rgba(16, 35, 61, 0.08);
    box-shadow: var(--shadow-sm);
    animation: cardEntrance 580ms cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: opacity 260ms ease, transform 260ms ease, box-shadow 260ms ease;
}

.post-card img {
    width: 100%;
    height: 214px;
    object-fit: cover;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 420ms ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.post-card:hover img {
    transform: scale(1.06);
    filter: saturate(1.08);
}

.post-card-body {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 250px;
    padding: 22px;
    flex: 1;
}

.post-card-meta {
    display: grid;
    gap: 10px;
}

.post-card-category {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 107, 53, 0.12);
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-card-meta small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.post-card h2 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.post-card p {
    margin: 0;
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.72;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.post-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    margin-top: auto;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(14, 47, 86, 0.2);
    transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.post-link i {
    font-size: 0.94rem;
    transition: transform 220ms ease;
}

.post-link:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    box-shadow: 0 18px 34px rgba(255, 107, 53, 0.24);
}

.post-link:hover i {
    transform: translateX(4px);
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(320px, 360px);
    gap: 28px;
    align-items: start;
}

.post-article {
    padding: 30px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(16, 35, 61, 0.08);
    box-shadow: var(--shadow-sm);
}

.post-hero-media {
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 24px;
}

.post-hero-media-contain {
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(255, 107, 53, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.95));
    border: 1px solid rgba(16, 35, 61, 0.08);
}

.post-hero-image {
    display: block;
    width: 100%;
    border-radius: 24px;
}

.post-hero-media-cover .post-hero-image {
    max-height: 480px;
    object-fit: cover;
}

.post-hero-media-contain .post-hero-image {
    width: min(100%, calc(var(--media-natural-width, 1600) * 1px));
    max-height: min(480px, calc(var(--media-natural-height, 1200) * 1px));
    object-fit: contain;
    object-position: center;
}

.post-content {
    display: grid;
    gap: 18px;
}

.post-content p {
    color: var(--text);
    font-size: 1.03rem;
    line-height: 1.9;
}

.post-sidebar {
    position: sticky;
    top: 110px;
}

.post-sidebar-card {
    padding: 26px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(255, 107, 53, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.95));
    border: 1px solid rgba(16, 35, 61, 0.08);
    box-shadow: 0 24px 54px rgba(16, 35, 61, 0.12);
    display: grid;
    gap: 18px;
    overflow: hidden;
}

.post-sidebar-card h3 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    line-height: 1.3;
}

.post-sidebar-card > p {
    margin: 0;
    color: var(--text);
    line-height: 1.8;
}

.page-header-post-detail {
    padding-bottom: 40px;
}

.post-detail-heading {
    max-width: 860px;
}

.rich-copy h2,
.rich-copy h3 {
    margin: 12px 0 10px;
    color: var(--primary);
}

.rich-copy ul,
.rich-copy ol {
    margin: 0 0 18px;
    padding-left: 22px;
    color: var(--text);
    line-height: 1.85;
}

.rich-copy blockquote {
    margin: 10px 0 18px;
    padding: 18px 22px;
    border-left: 4px solid rgba(255, 107, 53, 0.42);
    border-radius: 0 22px 22px 0;
    background: rgba(255, 107, 53, 0.08);
    color: var(--primary);
    font-weight: 700;
}

.rich-copy a {
    color: var(--secondary);
    font-weight: 800;
}

.post-share-box {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(14, 47, 86, 0.05);
    border: 1px solid rgba(16, 35, 61, 0.06);
}

.post-share-box span {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-share-box small {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.post-share-box a {
    display: block;
    color: var(--secondary);
    font-weight: 700;
    line-height: 1.75;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-sidebar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-sidebar-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(16, 35, 61, 0.06);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 800;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        position: static;
    }

    .post-hero-media-contain {
        padding: 18px;
    }

    .post-hero-media-contain .post-hero-image {
        max-height: min(360px, calc(var(--media-natural-height, 1200) * 1px));
    }
}

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

    .post-card-body {
        min-height: auto;
    }
}

.post-sidebar-list {
    display: grid;
    gap: 12px;
}

.post-sidebar-list a {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(14, 47, 86, 0.05);
    border: 1px solid rgba(16, 35, 61, 0.06);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.post-sidebar-list a:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 107, 53, 0.25);
    box-shadow: var(--shadow-sm);
}

.post-sidebar-list strong {
    color: var(--primary);
    line-height: 1.55;
}

.post-sidebar-list span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}
