/* ============================================
   UNIVERSAL ARTICLE CSS
   For all article/blog pages on AhbTech

   IMPORTANT: <body> must have class="article-page"
   (already added in article.php). Every rule below is
   scoped under .article-page so it can never lose a
   specificity fight against home.css's .container /
   .article-content rules, no matter what order the
   stylesheets load in or whether home.css gets included
   twice via header.html.
   ============================================ */

/* ===== FONT AWESOME CDN ===== */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

/* ============================================
   ARTICLE HERO SECTION
   ============================================ */
.article-page .article-hero {
    background: linear-gradient(145deg, #0a1628 0%, #1a3a6a 100%);
    color: #ffffff;
    padding: 40px 0 40px;
    text-align: center;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.article-page .article-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.article-page .article-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.article-page .article-hero .container {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    width: 92%;
    margin: 0 auto;
    padding: 0 20px;
}

.article-page .article-hero .breadcrumb {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.article-page .article-hero .breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.article-page .article-hero .breadcrumb a:hover {
    color: #ffffff;
}

.article-page .article-hero .breadcrumb .separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.3);
}

.article-page .article-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    max-width: 1000px;
    margin: 0 auto 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-page .article-hero .meta {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.article-page .article-hero .meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.article-page .article-hero .meta i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ============================================
   ARTICLE BODY - FULL WIDTH LAYOUT
   ============================================ */
.article-page .article-body {
    padding: 30px 0 60px;
    background: #f5f8fc;
}

/* Wide container on desktop — this is what makes the article area wide. */
.article-page .article-body .container {
    max-width: 1800px;
    width: 92%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== WRAPPER: MAIN + SIDEBAR ===== */
.article-page .article-wrapper {
    display: grid;
    grid-template-columns: 1fr 25%;
    gap: 15px;
    align-items: start;
}

/* ===== MAIN CONTENT (wide, takes remaining space) ===== */
.article-page .article-main {
    min-width: 0; /* required so grid children don't overflow */
    width: 100%;
}

/* Scoped so this NEVER collides with home.css's .article-content */
.article-page .article-content {
    background: #ffffff;
    padding: 50px 55px;
    border-radius: 20px;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8edf4;
}

/* ===== RIGHT SIDEBAR (desktop only, ~20% width, fixed/sticky) ===== */
.article-page .article-sidebar {
    display: none !IMPORTANT;
    width: 110%;
    position: sticky;
    top: 100px;
    align-self: start;
}

/* ============================================
   SIDEBAR: RELATED ARTICLES
   ============================================ */
.article-page .article-sidebar .related-articles {
    background: #ffffff;
    padding: 18px 14px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8edf4;
}

.article-page .article-sidebar .related-articles h3 {
    font-size: 1.05rem;
    color: #0a1628;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f4fa;
}

.article-page .article-sidebar .related-articles h3 i {
    color: #2563eb;
    margin-right: 6px;
}

.article-page .article-sidebar .related-articles .related-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-page .article-sidebar .related-articles .related-item {
    display: block;
    padding: 8px 10px;
    background: #f5f8fc;
    border-radius: 10px;
    border: 1px solid #e8edf4;
    text-decoration: none;
    transition: all 0.25s ease;
}

.article-page .article-sidebar .related-articles .related-item:hover {
    background: #eef4ff;
    border-color: #2563eb;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.article-page .article-sidebar .related-articles .related-item .related-thumbnail {
    width: 100%;
    height: 90px;
    border-radius: 5px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 5px;
}

.article-page .article-sidebar .related-articles .related-item .related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.article-page .article-sidebar .related-articles .related-item:hover .related-thumbnail img {
    transform: scale(1.03);
}

.article-page .article-sidebar .related-articles .related-item h5 {
    color: #0a1628;
    font-size: 0.5rem;
    margin: 0 0 4px;
    font-weight: 600;
    line-height: 1.3;
}

.article-page .article-sidebar .related-articles .related-item span {
    font-size: 0.5rem;
    color: #94a3b8;
}

.article-page .article-sidebar .related-articles .related-item span i {
    margin-right: 2px;
}

.article-page .article-sidebar .related-articles .related-item .related-author {
    font-size: 0.5rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

/* ============================================
   MOBILE RELATED ARTICLES (hidden on desktop by default)
   ============================================ */
.article-page .mobile-related {
    display: none;
}

/* ============================================
   FEATURED IMAGE
   ============================================ */
.article-page .article-content .featured-image {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 30px;
    overflow: hidden;
    background: #e2e8f0;
    aspect-ratio: 16/9;
}

.article-page .article-content .featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.article-page .article-content .featured-image img:hover {
    transform: scale(1.01);
}

/* ============================================
   HEADINGS
   ============================================ */
.article-page .article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0a1628;
    margin: 40px 0 16px;
    padding-top: 10px;
    border-top: 2px solid #f0f4fa;
    letter-spacing: -0.3px;
}

.article-page .article-content h2:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.article-page .article-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #0a1628;
    margin: 28px 0 12px;
    letter-spacing: -0.2px;
}

.article-page .article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0a1628;
    margin: 20px 0 10px;
}

/* ============================================
   PARAGRAPHS
   ============================================ */
.article-page .article-content p {
    color: #1e293b;
    font-size: 1.08rem;
    line-height: 1.9;
    margin-bottom: 18px;
}

.article-page .article-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   LISTS
   ============================================ */
.article-page .article-content ul,
.article-page .article-content ol {
    color: #1e293b;
    font-size: 1.08rem;
    line-height: 1.9;
    margin: 0 0 20px 28px;
}

.article-page .article-content li {
    margin-bottom: 10px;
}

.article-page .article-content ul li::marker {
    color: #2563eb;
}

/* ============================================
   HIGHLIGHT BOX
   ============================================ */
.article-page .article-content .highlight-box {
    background: #eef4ff;
    border-left: 5px solid #2563eb;
    padding: 20px 28px;
    border-radius: 0 12px 12px 0;
    margin: 24px 0;
}

.article-page .article-content .highlight-box strong {
    color: #0a1628;
}

.article-page .article-content .highlight-box i {
    color: #2563eb;
    margin-right: 8px;
}

/* ============================================
   KEY TAKEAWAY
   ============================================ */
.article-page .article-content .key-takeaway {
    background: #0a1628;
    color: #e8edf4;
    padding: 24px 32px;
    border-radius: 16px;
    margin: 30px 0;
}

.article-page .article-content .key-takeaway h4 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.article-page .article-content .key-takeaway i {
    color: #60a5fa;
    margin-right: 8px;
}

.article-page .article-content .key-takeaway p {
    color: #cbd5e1;
    margin-bottom: 0;
}

/* ============================================
   CALL TO ACTION
   ============================================ */
.article-page .article-content .article-cta {
    background: linear-gradient(145deg, #0a1628, #1a3a6a);
    color: #ffffff;
    padding: 32px 38px;
    border-radius: 16px;
    margin: 32px 0;
    text-align: center;
}

.article-page .article-content .article-cta h4 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.article-page .article-content .article-cta i {
    margin-right: 8px;
    color: #60a5fa;
}

.article-page .article-content .article-cta p {
    color: #cbd5e1;
    margin-bottom: 16px;
}

.article-page .article-content .article-cta .cta-link {
    display: inline-block;
    background: #ffffff;
    color: #0a1628;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.article-page .article-content .article-cta .cta-link i {
    color: #0a1628;
    margin-left: 6px;
}

.article-page .article-content .article-cta .cta-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    background: #f0f4fa;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.article-page .article-content .toc {
    background: #f5f8fc;
    padding: 20px 28px;
    border-radius: 16px;
    margin: 24px 0 32px;
    border: 1px solid #e8edf4;
}

.article-page .article-content .toc h4 {
    font-size: 1rem;
    color: #0a1628;
    margin-bottom: 10px;
    font-weight: 700;
}

.article-page .article-content .toc h4 i {
    color: #2563eb;
    margin-right: 8px;
}

.article-page .article-content .toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
}

.article-page .article-content .toc ul li {
    margin-bottom: 0;
}

.article-page .article-content .toc ul li a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-page .article-content .toc ul li a:hover {
    color: #1a4b8a;
    text-decoration: underline;
}

/* ============================================
   AUTHOR BIO
   ============================================ */
.article-page .article-content .author-bio {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    background: #f5f8fc;
    border-radius: 16px;
    margin-top: 40px;
    border: 1px solid #e8edf4;
}

.article-page .article-content .author-bio .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2563eb, #1a4b8a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.article-page .article-content .author-bio .bio-text h4 {
    font-size: 1rem;
    color: #0a1628;
    margin-bottom: 4px;
}

.article-page .article-content .author-bio .bio-text p {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 0;
    line-height: 1.6;
}

/* ============================================
   SHARE SECTION
   ============================================ */
.article-page .article-content .share-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 0;
    padding-top: 24px;
    border-top: 2px solid #f0f4fa;
    flex-wrap: wrap;
}

.article-page .article-content .share-section .share-label {
    font-weight: 600;
    color: #0a1628;
    font-size: 0.95rem;
}

.article-page .article-content .share-section .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.article-page .article-content .share-section .share-btn i {
    font-size: 0.95rem;
}

.article-page .article-content .share-section .share-btn.twitter {
    background: #1DA1F2;
    color: #ffffff;
}

.article-page .article-content .share-section .share-btn.linkedin {
    background: #0A66C2;
    color: #ffffff;
}

.article-page .article-content .share-section .share-btn.facebook {
    background: #1877F2;
    color: #ffffff;
}

.article-page .article-content .share-section .share-btn.email {
    background: #64748b;
    color: #ffffff;
}

.article-page .article-content .share-section .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* ===== TABLETS & SMALL LAPTOPS (< 992px) ===== */
@media (max-width: 992px) {
    .article-page .article-hero {
        padding: 30px 0 30px;
    }

    .article-page .article-hero h1 {
        font-size: 2.4rem;
    }

    .article-page .article-body {
        padding: 20px 0 40px;
    }

    .article-page .article-content {
        padding: 40px 36px;
    }
}

/* ===== LAYOUT SWITCH: sidebar -> bottom (< 600px) ===== */
@media (max-width: 600px) {
    .article-page .article-wrapper {
        display: block;
    }

    .article-page .article-main {
        width: 100%;
    }

    .article-page .article-content {
        padding: 24px 18px;
        border-radius: 14px;
    }

    /* Show mobile related articles, 2x2 grid */
    .article-page .mobile-related {
        display: block;
        margin-top: 30px;
        padding-top: 30px;
        border-top: 2px solid #f0f4fa;
    }

    .article-page .mobile-related .related-articles {
        background: transparent;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    .article-page .mobile-related .related-articles h3 {
        font-size: 1.2rem;
        color: #0a1628;
        margin: 0 0 16px 0;
        padding-bottom: 12px;
        border-bottom: 2px solid #f0f4fa;
    }

    .article-page .mobile-related .related-articles h3 i {
        color: #2563eb;
        margin-right: 8px;
    }

    .article-page .mobile-related .related-articles .related-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .article-page .mobile-related .related-articles .related-item {
        padding: 16px 18px;
        background: #f5f8fc;
        border-radius: 12px;
        border: 1px solid #e8edf4;
        text-decoration: none;
        transition: all 0.25s ease;
    }

    .article-page .mobile-related .related-articles .related-item:hover {
        background: #eef4ff;
        border-color: #2563eb;
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    }

    .article-page .mobile-related .related-articles .related-item .related-thumbnail {
        width: 100%;
        height: 100px;
        border-radius: 6px;
        overflow: hidden;
        background: #e2e8f0;
        margin-bottom: 10px;
    }

    .article-page .mobile-related .related-articles .related-item .related-thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

    .article-page .mobile-related .related-articles .related-item:hover .related-thumbnail img {
        transform: scale(1.03);
    }

    .article-page .mobile-related .related-articles .related-item h5 {
        color: #0a1628;
        font-size: 0.95rem;
        margin: 0 0 4px;
        font-weight: 600;
        line-height: 1.3;
    }

    .article-page .mobile-related .related-articles .related-item span {
        font-size: 0.8rem;
        color: #94a3b8;
    }

    .article-page .mobile-related .related-articles .related-item span i {
        margin-right: 4px;
    }

    .article-page .mobile-related .related-articles .related-item .related-author {
        font-size: 0.75rem;
        color: #64748b;
        display: block;
        margin-top: 4px;
    }

    .article-page .article-content .toc ul {
        flex-direction: column;
        gap: 4px;
    }
}

/* ===== MOBILE DEVICES (< 480px) — fine typography ===== */
@media (max-width: 480px) {
    .article-page .article-hero {
        padding: 20px 0 20px;
    }

    .article-page .article-hero h1 {
        font-size: 1.4rem;
    }

    .article-page .article-hero .meta {
        font-size: 0.7rem;
        gap: 8px;
    }

    .article-page .article-body .container {
        width: 96%;
        padding: 0 12px;
    }

    .article-page .article-content {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .article-page .article-content h2 {
        font-size: 1.4rem;
    }

    .article-page .article-content h3 {
        font-size: 1.1rem;
    }

    .article-page .article-content p {
        font-size: 0.98rem;
    }

    .article-page .article-content ul,
    .article-page .article-content ol {
        font-size: 0.98rem;
        margin-left: 16px;
    }

    .article-page .article-content .featured-image {
        border-radius: 8px;
    }

    .article-page .article-content .author-bio {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .article-page .article-content .author-bio .avatar {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .article-page .article-content .key-takeaway {
        padding: 18px 20px;
    }

    .article-page .article-content .highlight-box {
        padding: 16px 18px;
    }

    .article-page .article-content .article-cta {
        padding: 20px 18px;
    }

    .article-page .article-content .share-section {
        justify-content: center;
        gap: 10px;
    }

    .article-page .article-content .share-section .share-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .article-page .article-content .share-section .share-btn i {
        font-size: 0.8rem;
    }

    .article-page .article-content .toc {
        padding: 16px 18px;
    }

    /* Single column on very small screens */
    .article-page .mobile-related .related-articles .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width:850px){
    .article-page .article-sidebar{
        display: block !important;
    }
} 

@media (max-width: 849px) {
    .article-page .article-sidebar {
        display: none !important;
    }
}