/* ================================
   BLOG STYLES
   Project ONE - Blog Index & Article Pages
   ================================ */

/* Override custom cursor for blog article pages - show default cursor */
body:has(.blog-article),
body:has(.article-wrapper),
body:has(.blog-article) *,
body:has(.article-wrapper) * {
    cursor: auto !important;
}

/* Fallback for browsers without :has() support */
.blog-article,
.blog-article *,
.article-wrapper,
.article-wrapper * {
    cursor: auto !important;
}

/* Hide custom cursor elements on blog article pages */
body:has(.blog-article) .cursor,
body:has(.blog-article) .cursor-follower,
body:has(.article-wrapper) .cursor,
body:has(.article-wrapper) .cursor-follower {
    display: none !important;
}

/* ================================
   BLOG INDEX PAGE - MINIMAL REDESIGN
   ================================ */

/* Main Blog Section */
.blog-section {
    padding: 140px 0 100px;
    background: var(--bg-primary);
}

.blog-section .container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Minimal Header */
.blog-header {
    margin-bottom: 48px;
}

.blog-header__title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.blog-header__subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Featured Article */
.blog-featured {
    background: var(--bg-elevated);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.blog-featured:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.12);
}

.blog-featured__link {
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-decoration: none;
    color: inherit;
}

.blog-featured__image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
}

.blog-featured__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-featured:hover .blog-featured__image img {
    transform: scale(1.03);
}

.blog-featured__content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.blog-featured__tag {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-featured__reading-time::before {
    content: '\2022';
    margin-right: 12px;
}

.blog-featured__title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.blog-featured:hover .blog-featured__title {
    color: var(--accent);
}

.blog-featured__excerpt {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.blog-featured__cta {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.blog-featured:hover .blog-featured__cta {
    gap: 12px;
}

.blog-featured__cta .arrow {
    transition: transform 0.3s ease;
}

.blog-featured:hover .blog-featured__cta .arrow {
    transform: translateX(4px);
}

/* More Articles Section */
.blog-more {
    margin-top: 80px;
}

.blog-more__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.blog-more .blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .blog-section {
        padding: 120px 0 80px;
    }

    .blog-section .container {
        padding: 0 20px;
    }

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

    .blog-featured__image {
        aspect-ratio: 16/9;
    }

    .blog-featured__content {
        padding: 28px;
    }

    .blog-featured__title {
        font-size: 1.5rem;
    }
}

/* Light theme */
[data-theme="light"] .blog-featured {
    border-color: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .blog-featured:hover {
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.08);
}

/* ================================
   LEGACY - Blog Grid (keep for future use)
   ================================ */

/* Blog Grid Section */
.blog-grid-section {
    padding: 40px 0 120px;
    background: var(--bg-primary);
}

.blog-grid-section .container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

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

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

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

    .blog-hero {
        padding: 140px 0 40px;
    }

    .blog-hero .container,
    .blog-grid-section .container {
        padding: 0 24px;
    }
}

/* ================================
   BLOG CARD COMPONENT
   ================================ */

.blog-card {
    position: relative;
    background: var(--bg-elevated);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15);
}

.blog-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Card Image */
.blog-card__image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

/* Card Content */
.blog-card__content {
    padding: 28px;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.blog-card__reading-time::before {
    content: '\2022';
    margin-right: 8px;
}

.blog-card__title {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card__title {
    color: var(--accent-primary);
}

.blog-card__excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__cta {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.blog-card:hover .blog-card__cta {
    gap: 12px;
}

.blog-card__cta .arrow {
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card__cta .arrow {
    transform: translateX(4px);
}

/* ================================
   PAGINATION
   ================================ */

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 80px;
}

.pagination__link {
    padding: 12px 20px;
    background: var(--bg-elevated);
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.pagination__link:hover {
    background: var(--accent-primary);
    color: white;
}

.pagination__link--active {
    background: var(--accent-primary);
    color: white;
}

.pagination__link--disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ================================
   EMPTY STATE
   ================================ */

.blog-empty {
    text-align: center;
    padding: 80px 40px;
}

.blog-empty__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.blog-empty__text {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* ================================
   BLOG POST ARTICLE STYLES
   ================================ */

/* Article Container */
.blog-article {
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

/* Premium ambient glow effect */
.blog-article::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .blog-article::before {
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
}

.blog-article > * {
    position: relative;
    z-index: 1;
}

.container-blog {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 640px) {
    .blog-article {
        padding-top: 120px;
    }

    .container-blog {
        padding: 0 24px;
    }
}

/* Article Header */
.blog-article__header {
    margin-bottom: 48px;
}

.blog-article__title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.blog-article__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.blog-article__reading-time::before {
    content: '\2022';
    margin-right: 16px;
}

.blog-article__lead {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 800px;
}

/* Hero Image */
.blog-article__hero-image {
    margin-bottom: 64px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.blog-article__hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 640px) {
    .blog-article__hero-image {
        border-radius: 12px;
        margin-bottom: 48px;
    }
}

/* ================================
   ARTICLE BODY - TYPOGRAPHY
   Optimized for dark theme readability
   ================================ */

.blog-article__body {
    max-width: 720px;
    margin: 0 auto;
}

/* Paragraphs */
.blog-article__body p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.75em;
}

/* Headings */
.blog-article__body h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1.25rem;
}

.blog-article__body h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-article__body h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* First heading after lead shouldn't have top margin */
.blog-article__body > h2:first-child,
.blog-article__body > h3:first-child {
    margin-top: 0;
}

/* Links */
.blog-article__body a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.blog-article__body a:hover {
    color: var(--accent-secondary);
}

/* Lists */
.blog-article__body ul,
.blog-article__body ol {
    margin-bottom: 1.75em;
    padding-left: 1.5em;
}

.blog-article__body li {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 0.5em;
}

.blog-article__body li::marker {
    color: var(--accent-primary);
}

/* Blockquotes */
.blog-article__body blockquote {
    margin: 2rem 0;
    padding: 24px 28px;
    background: var(--bg-elevated);
    border-left: 4px solid var(--accent-primary);
    border-radius: 12px;
}

.blog-article__body blockquote p {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 0;
}

.blog-article__body blockquote p:last-child {
    margin-bottom: 0;
}

/* Code - Inline */
.blog-article__body code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9em;
    padding: 0.2em 0.5em;
    background: var(--bg-elevated);
    border-radius: 4px;
    color: var(--accent-primary);
}

/* Code - Block */
.blog-article__body pre {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-elevated);
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.blog-article__body pre code {
    padding: 0;
    background: none;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Images within article */
.blog-article__figure {
    margin: 2.5rem 0;
}

.blog-article__figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

.blog-article__figure figcaption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

/* Horizontal Rule */
.blog-article__body hr {
    margin: 3rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text-muted), transparent);
}

/* Strong / Bold */
.blog-article__body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Tables */
.blog-article__body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.blog-article__body th,
.blog-article__body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.blog-article__body th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.blog-article__body td {
    color: var(--text-secondary);
}

/* ================================
   ARTICLE FOOTER
   ================================ */

.blog-article__footer {
    margin-top: 80px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.blog-article__author {
    padding: 32px 0;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 40px;
}

.blog-article__author .author-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.blog-article__author .author-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.blog-article__author .author-role {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* CTA Section - Matches case study pattern */
.blog-article__footer .case-cta-concise {
    margin-top: 0;
}

/* ================================
   BLOG NAV ADJUSTMENTS
   ================================ */

/* Navigation for blog post pages */
.blog-post-nav .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Back to blog link - matches case study */
.back-link-blog {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, gap 0.3s ease;
}

.back-link-blog:hover {
    color: var(--text-primary);
    gap: 12px;
}

/* ================================
   LIGHT THEME ADJUSTMENTS
   ================================ */

[data-theme="light"] .blog-card {
    border-color: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .blog-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .blog-article__body blockquote {
    background: var(--bg-secondary);
}

[data-theme="light"] .blog-article__body pre {
    border-color: rgba(99, 102, 241, 0.08);
}

/* ================================
   ANIMATIONS (GSAP ScrollTrigger)
   ================================ */

/* Initial state for cards - animated by JS */
.blog-card.animate-in {
    opacity: 0;
    transform: translateY(40px);
}

/* Article content reveal - animated by JS */
.blog-article__body.animate-in > * {
    opacity: 0;
    transform: translateY(30px);
}

/* ================================
   BLOG ARTICLE CTA SECTION
   ================================ */

.blog-article__cta {
    margin-top: 48px;
    padding: 48px;
    background: var(--bg-elevated);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    text-align: center;
}

.blog-article__cta h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.blog-article__cta p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.blog-article__cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

[data-theme="light"] .blog-article__cta {
    border-color: rgba(99, 102, 241, 0.08);
}

@media (max-width: 640px) {
    .blog-article__cta {
        padding: 32px 24px;
    }

    .blog-article__cta h2 {
        font-size: 1.25rem;
    }
}
