/* ==========================================================================
   AGENCE LEWIS - ARTICLE DESIGN SYSTEM (PINK SIGNATURE)
   ========================================================================== */

:root {
    --lewis-black: #050505;
    --lewis-white: #FFFFFF;
    --lewis-pink: #E0528B;
    --lewis-pink-glow: rgba(224, 82, 139, 0.6);
    --lewis-pink-dim: rgba(224, 82, 139, 0.1);
    --lewis-dark: #1A1A1A;
    --font-heading: 'fieldwork-hum', serif;
    --font-body: 'fieldwork', sans-serif;
}

body.article-page {
    background-color: var(--lewis-black);
    color: var(--lewis-white);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--lewis-white);
    line-height: 1.2;
}

.article-body h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    /* 40px desktop / 28px mobile */
    font-weight: 600;
    margin-top: 60px;
    margin-bottom: 30px;
    padding-left: 20px;
    border-left: 5px solid var(--lewis-pink);
    position: relative;
    text-shadow: 0 0 20px rgba(224, 82, 139, 0.3);
}

.article-body h3 {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    /* 28px desktop / 22px mobile */
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.article-body p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    /* 18px / 16px */
    color: #cccccc;
    margin-bottom: 24px;
    font-weight: 400;
}

.article-body ul,
.article-body ol {
    margin-bottom: 30px;
    padding-left: 20px;
}

.article-body li {
    font-size: 1.125rem;
    color: #cccccc;
    margin-bottom: 12px;
    position: relative;
    padding-left: 10px;
}

.article-body ul li::marker {
    color: var(--lewis-pink);
    font-size: 1.2em;
}

/* --- HERO STYLES --- */

/* Hero Standard (Blog Style Premium) */
.article-hero-standard {
    padding: 180px 0 100px;
    /* Increased top padding */
    text-align: center;
    background: radial-gradient(ellipse 150% 100% at 50% -10px, rgba(224, 82, 139, 0.2) 0%, rgba(5, 5, 5, 0) 70%);
    position: relative;
}

.article-hero-standard h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    max-width: 1000px;
    margin: 30px auto;
    background: linear-gradient(135deg, #fff 0%, #E0528B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Split (Homepage Style) */
.article-hero-split {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 180px 0 100px;
    /* Increased top padding */

    /* Force Dark Background */
    background: linear-gradient(135deg, #050505 0%, #1a1a1a 100%) !important;
    position: relative;
    overflow: hidden;
}

.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.split-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 30px;
}

.split-image {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.split-image img {
    width: 100%;
    display: block;
    transition: transform 0.7s ease;
}

.split-image:hover img {
    transform: scale(1.05);
}

/* Hero Immersive (Full Screen) */
.article-hero-immersive {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-size: cover;
    background-position: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.3), #050505);
    z-index: 1;
}

.immersive-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    padding: 0 20px;
}

.immersive-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    margin-bottom: 40px;
}

/* --- COMPONENTS --- */

/* Badges */
.badge-glass {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(224, 82, 139, 0.12);
    /* Solid but subtle dark pink */
    border: 1.5px solid rgba(224, 82, 139, 0.4);
    /* Refined border */
    padding: 12px 28px;
    border-radius: 50px;
    margin-bottom: 40px;
    /* Increased margin */
    font-size: 0.95rem;
    color: var(--lewis-pink);
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Article Images */
figure {
    margin: 60px 0;
}

.article-img {
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle white border */
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.article-img:hover {
    transform: translateY(-5px);
    border-color: rgba(224, 82, 139, 0.3);
    /* Pink border on hover */
}

figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    margin-top: 15px;
    font-style: italic;
}

/* Quote Block */
blockquote {
    border-left: 4px solid var(--lewis-pink);
    margin: 50px 0;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 10px 10px 0;
    font-size: 1.4rem;
    font-weight: 300;
    color: white;
    font-style: italic;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: var(--lewis-pink);
    border: none;
    border-radius: 50px;
    padding: 18px 36px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 30px rgba(224, 82, 139, 0.2);
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(224, 82, 139, 0.4);
}

/* --- AUTHOR CARD --- */
.author-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 20px;
    margin-top: 80px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.author-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--lewis-pink);
}

.author-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: white;
}

.author-role {
    color: var(--lewis-pink);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .split-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .article-hero-split {
        padding: 120px 0 60px;
        min-height: auto;
    }

    .split-image {
        margin-top: 40px;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .immersive-content h1 {
        font-size: 3rem;
    }

    .article-hero-standard,
    .article-hero-split {
        padding-top: 130px !important;
        padding-bottom: 50px !important;
    }

    .article-hero-standard h1 {
        margin: 15px auto;
    }
}

/* --- REFINED SPLIT LAYOUT (2 Columns) --- */
.article-split-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px;
}

.article-sidebar-sticky {
    position: sticky;
    top: 120px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 20px;
}

.article-content-col {
    min-width: 0;
    /* Prevents overflow */
}

/* TOC Styling */
.toc-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.toc-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lewis-pink);
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-link {
    display: block;
    color: #888;
    text-decoration: none;
    padding: 4px 0;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    padding-left: 15px;
    margin-left: -17px;
}

.toc-link:hover,
.toc-link.active {
    color: var(--lewis-pink);
    /* Changed to pink to ensure visibility and contrast */
    border-left-color: var(--lewis-pink);
    background-color: transparent;
    /* Prevent any background shift */
}

/* Reading Progress */
.reading-progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-circular {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(var(--lewis-pink) var(--scroll-percentage, 0%), rgba(255, 255, 255, 0.1) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    position: relative;
}

.progress-circular::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--lewis-black);
    border-radius: 50%;
    z-index: 1;
}

.progress-value {
    position: relative;
    z-index: 2;
}

.progress-text span {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

/* Metadata in Hero */
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
}

.meta-divider {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .article-split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 20px;
    }

    .article-sidebar-sticky {
        display: none;
        /* Hide sticky sidebar on mobile */
    }

    .badge-glass {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 25px;
    }

    .toc-container,
    .reading-progress-container {
        display: none !important;
        /* Simplify mobile view */
    }
}

@media (max-width: 480px) {

    .article-hero-standard,
    .article-hero-split {
        padding-top: 110px !important;
    }
}

/* --- INTERNAL LINK CARDS --- */
.link-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.link-card {
    background: rgba(255, 255, 255, 0.05);
    /* Slightly more visible */
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Stronger border */
    border-radius: 16px;
    padding: 25px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    backdrop-filter: blur(10px);
    /* Glassmorphism */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.link-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--lewis-pink);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(224, 82, 139, 0.15);
    /* Pink glow */
}

.link-card h4 {
    color: white;
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}

/* ==========================================================================
   Responsive Article Tables
   ========================================================================== */

/* The table wrapper */
.article-body div[style*="overflow-x: auto"],
.table-responsive-wrapper {
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    background: rgba(0, 0, 0, 0.15);
    /* Slight dark background */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin: 30px 0;
    width: 100%;
}

/* Custom Webkit Scrollbar for the table wrapper */
.article-body div[style*="overflow-x: auto"]::-webkit-scrollbar,
.table-responsive-wrapper::-webkit-scrollbar {
    height: 8px;
    /* Slightly thicker for usability */
}

.article-body div[style*="overflow-x: auto"]::-webkit-scrollbar-track,
.table-responsive-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.article-body div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb,
.table-responsive-wrapper::-webkit-scrollbar-thumb {
    background: rgba(224, 82, 139, 0.4);
    /* Lewis Pink subtle */
    border-radius: 10px;
    border: 2px solid transparent;
    /* Padding trick */
    background-clip: padding-box;
}

.article-body div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb:hover,
.table-responsive-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(224, 82, 139, 0.8);
}

/* Table styling override for mobile */
@media (max-width: 768px) {

    .article-body table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    .article-body table::-webkit-scrollbar {
        height: 6px;
    }

    /* ==========================================================================
   FAQ Icon Animation Fix (Global for Articles)
   ========================================================================== */
    .article-body .faq-item {
        cursor: pointer;
    }

    .article-body .faq-icon {
        display: inline-block;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
        line-height: 1;
    }

    .article-body .faq-item.active .faq-icon {
        transform: rotate(45deg);
    }

    .article-body .faq-answer {
        display: none;
        padding-top: 15px;
        color: rgba(255, 255, 255, 0.85);
        line-height: 1.6;
    }

    .article-body .faq-item.active .faq-answer {
        display: block;
        animation: faqFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes faqFadeIn {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .article-body table::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.02);
    }

    .article-body table::-webkit-scrollbar-thumb {
        background: rgba(224, 82, 139, 0.4);
        border-radius: 10px;
    }

    .article-body table th,
    .article-body table td {
        white-space: nowrap;
        /* Prevent column squishing */
        font-size: 0.9rem !important;
        padding: 14px 18px !important;
    }
}

.link-card p {
    font-size: 0.95rem;
    color: #cccccc;
    margin-bottom: 20px;
    flex-grow: 1;
}

.link-card .card-cta {
    color: var(--lewis-pink);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Compact TOC Styling */
.toc-box {
    padding: 20px !important;
    margin-bottom: 25px !important;
}

.toc-list li {
    margin-bottom: 6px !important;
}

.toc-link {
    padding: 3px 0 !important;
    font-size: 0.9rem !important;
}