/* ==========================================================================
   CORPEX Blog Styles — Listing, Articles, Categories
   Extends: design-tokens.css, global.css, components.css
   ========================================================================== */

/* ── Blog Hero ── */
.blog-hero {
    background: linear-gradient(135deg, var(--cx-navy) 0%, var(--cx-navy-light) 60%, #0E2952 100%);
    padding: calc(95px + var(--sp-12)) 0 var(--sp-12);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 165, 181, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.blog-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.blog-hero h1 {
    color: var(--cx-white);
    margin-bottom: var(--sp-4);
    position: relative;
    z-index: 1;
}

.blog-hero p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-lg);
    max-width: 640px;
    margin-inline: auto;
    position: relative;
    z-index: 1;
}

.blog-hero .overline {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--cx-teal-light);
    margin-bottom: var(--sp-4);
    padding: var(--sp-1) var(--sp-3);
    background: rgba(0, 165, 181, 0.15);
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
}

/* ── Category Filter Pills ── */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-10);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--cx-gray-600);
    background: var(--cx-white);
    border: 1px solid var(--cx-gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    text-decoration: none;
    min-height: 40px;
}

.filter-pill:hover,
.filter-pill.active {
    color: var(--cx-white);
    background: var(--cx-teal);
    border-color: var(--cx-teal);
}

/* ── Blog Card (listing page) ── */
.blog-card {
    background: var(--cx-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(11, 29, 58, 0.06), 0 8px 32px rgba(11, 29, 58, 0.04);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
        box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cx-gray-100);
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 165, 181, 0.12),
        0 24px 48px rgba(11, 29, 58, 0.08);
    border-color: rgba(0, 165, 181, 0.15);
    color: inherit;
}

.blog-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}

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

.blog-card-body {
    padding: var(--sp-6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-xs);
    color: var(--cx-gray-400);
}

.blog-card-meta .blog-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--cx-teal-dark);
    background: linear-gradient(135deg, rgba(0, 165, 181, 0.08) 0%, rgba(78, 205, 196, 0.12) 100%);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 165, 181, 0.12);
}

.blog-card-meta .read-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-card-meta .read-time svg {
    width: 12px;
    height: 12px;
    stroke: var(--cx-gray-400);
    fill: none;
}

.blog-card-body h3 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--cx-gray-800);
    margin-bottom: var(--sp-3);
    line-height: var(--lh-snug);
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-body h3 {
    color: var(--cx-teal-dark);
}

.blog-card-body p {
    color: var(--cx-gray-500);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
    flex: 1;
    margin-bottom: var(--sp-4);
}

.blog-card-footer {
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--cx-gray-100);
    background: var(--cx-gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-card-footer .blog-date {
    font-size: var(--fs-xs);
    color: var(--cx-gray-400);
}

.blog-card-footer .blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--cx-teal);
    transition: gap 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.blog-card:hover .blog-read-more {
    gap: var(--sp-3);
}

.blog-card-footer .blog-read-more::after {
    content: '→';
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    font-size: var(--fs-base);
}

.blog-card:hover .blog-read-more::after {
    transform: translateX(4px);
}

/* ── Featured Article Card ── */
.blog-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--cx-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(11, 29, 58, 0.06), 0 12px 40px rgba(11, 29, 58, 0.06);
    border: 1px solid var(--cx-gray-100);
    margin-bottom: var(--sp-12);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.5s ease, border-color 0.4s ease;
}

.blog-featured:hover {
    box-shadow: 0 12px 28px rgba(0, 165, 181, 0.12), 0 24px 48px rgba(11, 29, 58, 0.08);
    border-color: rgba(0, 165, 181, 0.15);
    color: inherit;
}

@media (min-width: 768px) {
    .blog-featured {
        grid-template-columns: 1.2fr 1fr;
    }
}

.blog-featured .blog-card-img {
    aspect-ratio: 16 / 10;
}

@media (min-width: 768px) {
    .blog-featured .blog-card-img {
        aspect-ratio: auto;
        height: 100%;
    }
}

.blog-featured .blog-card-body {
    padding: var(--sp-8);
    justify-content: center;
}

.blog-featured .blog-card-body h2 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--sp-4);
    line-height: var(--lh-snug);
    color: var(--cx-gray-800);
}

@media (min-width: 768px) {
    .blog-featured .blog-card-body h2 {
        font-size: var(--fs-3xl);
    }
}

.blog-featured .blog-card-body p {
    font-size: var(--fs-base);
    margin-bottom: var(--sp-6);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--cx-gold);
    margin-bottom: var(--sp-3);
}

.featured-badge svg {
    width: 14px;
    height: 14px;
    fill: var(--cx-gold);
}

/* ── Article Page Layout ── */
.article-hero {
    background: linear-gradient(135deg, var(--cx-navy) 0%, var(--cx-navy-light) 60%, #0E2952 100%);
    padding: calc(95px + var(--sp-12)) 0 var(--sp-16);
    position: relative;
    overflow: hidden;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 165, 181, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.article-hero-inner {
    max-width: 800px;
    margin-inline: auto;
    position: relative;
    z-index: 1;
}

.article-hero .blog-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--cx-teal-light);
    background: rgba(0, 165, 181, 0.15);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    margin-bottom: var(--sp-5);
}

.article-hero h1 {
    color: var(--cx-white);
    font-size: var(--fs-3xl);
    line-height: var(--lh-snug);
    margin-bottom: var(--sp-6);
}

@media (min-width: 768px) {
    .article-hero h1 {
        font-size: var(--fs-4xl);
    }
}

@media (min-width: 1024px) {
    .article-hero h1 {
        font-size: var(--fs-5xl);
    }
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-4);
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-sm);
}

.article-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

.article-meta svg {
    width: 16px;
    height: 16px;
    stroke: var(--cx-teal-light);
    fill: none;
}

.article-meta .meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

/* ── Article Content ── */
.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-10);
    padding-block: var(--sp-12);
}

@media (min-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr 280px;
    }
}

.article-content {
    max-width: 800px;
}

/* Prose typography */
.article-prose {
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    color: var(--cx-gray-700);
}

.article-prose h2 {
    font-size: var(--fs-2xl);
    margin-top: var(--sp-10);
    margin-bottom: var(--sp-4);
    color: var(--cx-navy);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--cx-gray-100);
}

.article-prose h3 {
    font-size: var(--fs-xl);
    margin-top: var(--sp-8);
    margin-bottom: var(--sp-3);
    color: var(--cx-navy);
}

.article-prose h4 {
    font-size: var(--fs-lg);
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-3);
    color: var(--cx-navy);
}

.article-prose p {
    margin-bottom: var(--sp-5);
}

.article-prose ul,
.article-prose ol {
    margin-bottom: var(--sp-5);
    padding-left: var(--sp-6);
}

.article-prose ul {
    list-style: disc;
}

.article-prose ol {
    list-style: decimal;
}

.article-prose li {
    margin-bottom: var(--sp-2);
    line-height: var(--lh-relaxed);
}

.article-prose li::marker {
    color: var(--cx-teal);
}

.article-prose a {
    color: var(--cx-teal);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 165, 181, 0.3);
    transition: text-decoration-color var(--duration-fast);
}

.article-prose a:hover {
    text-decoration-color: var(--cx-teal);
}

.article-prose blockquote {
    border-left: 4px solid var(--cx-teal);
    padding: var(--sp-4) var(--sp-6);
    margin: var(--sp-6) 0;
    background: linear-gradient(135deg, rgba(0, 165, 181, 0.04), rgba(78, 205, 196, 0.04));
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--cx-gray-600);
}

.article-prose blockquote p:last-child {
    margin-bottom: 0;
}

.article-prose img {
    border-radius: var(--radius-lg);
    margin: var(--sp-6) 0;
    box-shadow: var(--shadow-lg);
}

.article-prose strong {
    color: var(--cx-gray-800);
    font-weight: var(--fw-semibold);
}

/* Highlighted callout box */
.article-callout {
    background: linear-gradient(135deg, rgba(0, 165, 181, 0.06) 0%, rgba(78, 205, 196, 0.06) 100%);
    border: 1px solid rgba(0, 165, 181, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    margin: var(--sp-8) 0;
}

.article-callout h4 {
    color: var(--cx-teal-dark);
    margin-top: 0;
    margin-bottom: var(--sp-3);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.article-callout p:last-child {
    margin-bottom: 0;
}

/* ── Table of Contents (Sidebar) ── */
.article-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .article-sidebar {
        display: block;
    }
}

.toc-widget {
    position: sticky;
    top: 120px;
    background: var(--cx-gray-50);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    border: 1px solid var(--cx-gray-100);
}

.toc-widget h4 {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--cx-gray-400);
    margin-bottom: var(--sp-4);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.toc-list a {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--cx-gray-500);
    border-left: 2px solid var(--cx-gray-200);
    transition: color var(--duration-fast), border-color var(--duration-fast);
    text-decoration: none;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--cx-teal);
    border-left-color: var(--cx-teal);
}

.toc-list a.toc-h3 {
    padding-left: var(--sp-6);
    font-size: var(--fs-xs);
}

/* ── Author Box ── */
.author-box {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-6);
    background: var(--cx-gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--cx-gray-100);
    margin-top: var(--sp-10);
}

.author-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: linear-gradient(135deg, var(--cx-teal), var(--cx-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar svg {
    width: 32px;
    height: 32px;
    fill: var(--cx-white);
}

.author-info h4 {
    font-size: var(--fs-base);
    margin-bottom: var(--sp-1);
}

.author-info p {
    font-size: var(--fs-sm);
    color: var(--cx-gray-500);
    margin-bottom: 0;
}

/* ── Related Articles ── */
.related-section {
    padding-block: var(--sp-16);
    background: var(--cx-gray-50);
    border-top: 1px solid var(--cx-gray-100);
}

.related-section .section-header {
    margin-bottom: var(--sp-8);
}

/* ── Article CTA Banner ── */
.article-cta {
    background: linear-gradient(135deg, var(--cx-navy) 0%, var(--cx-navy-light) 100%);
    border-radius: var(--radius-xl);
    padding: var(--sp-10) var(--sp-8);
    text-align: center;
    margin-top: var(--sp-10);
    position: relative;
    overflow: hidden;
}

.article-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 165, 181, 0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.article-cta h3 {
    color: var(--cx-white);
    margin-bottom: var(--sp-3);
    position: relative;
    z-index: 1;
}

.article-cta p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--sp-6);
    max-width: 500px;
    margin-inline: auto;
    position: relative;
    z-index: 1;
}

.article-cta .btn {
    position: relative;
    z-index: 1;
}

/* ── Share Buttons ── */
.share-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) 0;
    border-top: 1px solid var(--cx-gray-100);
    border-bottom: 1px solid var(--cx-gray-100);
    margin: var(--sp-8) 0;
}

.share-bar span {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--cx-gray-500);
}

.share-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--cx-gray-50);
    border: 1px solid var(--cx-gray-200);
    cursor: pointer;
    transition: all var(--duration-fast);
    text-decoration: none;
}

.share-btn:hover {
    background: var(--cx-teal);
    border-color: var(--cx-teal);
}

.share-btn svg {
    width: 16px;
    height: 16px;
    fill: var(--cx-gray-500);
    transition: fill var(--duration-fast);
}

.share-btn:hover svg {
    fill: var(--cx-white);
}

/* ── Tags ── */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: var(--sp-6) 0;
}

.article-tag {
    display: inline-block;
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-xs);
    color: var(--cx-gray-500);
    background: var(--cx-gray-50);
    border: 1px solid var(--cx-gray-200);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--duration-fast);
}

.article-tag:hover {
    color: var(--cx-teal);
    border-color: var(--cx-teal);
    background: rgba(0, 165, 181, 0.04);
}

/* ── Hero Image for Article ── */
.article-hero-image {
    max-width: 900px;
    margin: calc(-1 * var(--sp-10)) auto var(--sp-8);
    position: relative;
    z-index: 2;
    padding-inline: var(--sp-4);
}

.article-hero-image img {
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(11, 29, 58, 0.2);
}

/* ── Blog breadcrumb extension ── */
.blog-breadcrumb {
    padding: var(--sp-4) 0;
    margin-bottom: 0;
}

.blog-breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
}

.blog-breadcrumb a:hover {
    color: var(--cx-teal-light);
}

.blog-breadcrumb .sep {
    color: rgba(255, 255, 255, 0.3);
}

.blog-breadcrumb .current {
    color: rgba(255, 255, 255, 0.7);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .blog-featured {
        grid-template-columns: 1fr;
    }

    .blog-card-body {
        padding: var(--sp-4);
    }

    .article-hero h1 {
        font-size: var(--fs-2xl);
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .article-cta {
        padding: var(--sp-8) var(--sp-6);
    }
}
