/* =========================================
   PROFESSIONAL BLOG ARTICLE DESIGN
   Zairotics Engineering Blog
========================================= */

:root {
    /* Professional Color Palette */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --secondary: #7C3AED;
    --accent: #06B6D4;

    /* Neutral Colors */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 1. Modern Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}

.progress-track {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

/* 2. Container & Grid System */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* 3. Hero Section */
.article-hero {
    padding: 40px 0 0;
    background: linear-gradient(to bottom, white, var(--gray-50));
}

.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-500);
}

.breadcrumb-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.breadcrumb-link:hover {
    background: var(--gray-100);
    color: var(--primary);
    transform: translateX(-2px);
}

.breadcrumb-link svg {
    transition: transform 0.2s;
}

.breadcrumb-link:hover svg {
    transform: translateX(-2px);
}

.breadcrumb-separator {
    color: var(--gray-300);
}

.breadcrumb-current {
    color: var(--gray-800);
    font-weight: 600;
}

/* 4. Main Grid Layout */
.article-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 80px;
    padding: 40px 0 80px;
}

@media (max-width: 1024px) {
    .article-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

/* 5. Article Main Content */
.article-main {
    min-width: 0;
}

.article-header {
    margin-bottom: 48px;
}

.article-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.category-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
}

.article-stats {
    display: flex;
    gap: 24px;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
}

.article-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .article-title {
        font-size: 36px;
    }
}

/* 6. Author Card */
.author-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.author-avatar svg {
    width: 100%;
    height: 100%;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.author-role {
    font-size: 14px;
    color: var(--gray-500);
}

/* 7. Hero Image */
.article-hero-image {
    margin: 32px 0 48px;
    position: relative;
}

.article-hero-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.image-caption {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 12px;
    font-style: italic;
}

/* 8. Article Content */
.article-body-wrapper {
    background: white;
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

@media (max-width: 768px) {
    .article-body-wrapper {
        padding: 32px 24px;
    }
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--gray-700);
}

.article-content p {
    margin-bottom: 1.75em;
}

.article-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 2em 0 1em;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    scroll-margin-top: 100px;
}

.article-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 1.5em 0 0.75em;
    scroll-margin-top: 100px;
}

.article-content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 24px;
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: auto;
    margin: 2em 0;
    border: 1px solid var(--gray-800);
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 2px 6px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 24px;
    margin: 2em 0;
    color: var(--gray-600);
    font-style: italic;
    background: var(--gray-50);
    padding: 24px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.article-gallery-group {
    margin: 3.5rem 0;
    width: 100%;
}

/* Custom Gallery Grid */
.gallery-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
}

.gallery-col-6 {
    flex: 0 0 calc(50% - 10px);
    width: calc(50% - 10px);
    min-width: 0;
}

.article-content-image {
    width: 100%;
    overflow: hidden;
}

.article-content-image img {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Paired Images forced height & cover */
.gallery-row .article-content-image img {
    height: 500px;
    object-fit: cover;
}

/* Single/Horizontal full view */
.gallery-single-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.gallery-single-container .article-content-image {
    max-width: 850px;
}

.gallery-single-container.vertical-single .article-content-image {
    max-width: 500px;
}

.article-content-image img:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 600px) {
    .gallery-row {
        flex-direction: column;
    }

    .gallery-col-6 {
        flex: 0 0 100%;
        width: 100%;
    }

    .gallery-row .article-content-image img {
        height: auto;
        aspect-ratio: 4/5;
    }
}

/* 9. Article Tools */
.article-tools {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.share-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-buttons {
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--gray-600);
    font-size: 18px;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.share-btn.x-twitter:hover {
    background: #000;
    border-color: #000;
    color: white !important;
}

.share-btn.linkedin:hover {
    background: #0077B5;
    border-color: #0077B5;
    color: white !important;
}

.share-btn.whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: white !important;
}

.share-btn.copy:hover {
    background: var(--gray-800);
    border-color: var(--gray-800);
    color: white !important;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}


.action-btn.contact {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.action-btn.contact:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 10. Sidebar */
.sidebar-sticky {
    position: sticky;
    top: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (max-width: 1024px) {
    .sidebar-sticky {
        position: static;
    }
}

.sidebar-widget {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.widget-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.toc-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

/* 11. TOC Navigation */
.toc-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.toc-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
    border-color: var(--gray-200);
}

.toc-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toc-item.active .toc-dot {
    background: white;
}

.toc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    flex-shrink: 0;
}

.toc-item.toc-h3 {
    padding-left: 32px;
}

.toc-text {
    flex: 1;
    line-height: 1.4;
}

/* 12. Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
    color: white;
    border: none;
}

.newsletter-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.newsletter-widget h3 {
    color: white;
    margin-bottom: 8px;
}

.newsletter-widget p {
    color: var(--gray-300);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-700);
    background: var(--gray-800);
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
}

.newsletter-form input::placeholder {
    color: var(--gray-400);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.newsletter-form button {
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

/* 13. Topics Widget */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.topic-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.topic-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.topic-icon {
    font-size: 16px;
}

/* 14. CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    text-align: center;
}

.cta-content h3 {
    color: white;
    margin-bottom: 8px;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    gap: 12px;
}

.cta-button svg {
    transition: transform 0.2s;
}

.cta-button:hover svg {
    transform: translateX(4px);
}

/* 15. Mobile Responsiveness */
@media (max-width: 768px) {
    .article-tools {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }

    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* 16. Animation for interactive elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.share-btn.copied {
    animation: pulse 0.6s ease;
    background: #10B981;
    border-color: #10B981;
    color: white;
}