/* ==========================================
   Premium Article Page — NYTimes Style
   ========================================== */

/* ----- Design Tokens ----- */
.article-layout {
    --art-black: #121212;
    --art-dark: #333;
    --art-gray: #666;
    --art-light: #999;
    --art-muted: #ccc;
    --art-rule: #e2e2e2;
    --art-bg: #fff;
    --art-bg-alt: #f7f7f5;
    --art-accent: #567b95;
    --art-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --art-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --art-content-w: 720px;
    --art-wide-w: 900px;
    --art-transition: 0.22s ease;
}

/* ----- Reading Progress Bar ----- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--art-accent);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ----- BBC-Style Split Hero ----- */
.art-hero-split {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    height: 400px;
    background: #0f172a;
}

.art-split-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 32px;
    color: #fff;
}

.art-split-cat {
    display: inline-block;
    font-family: var(--art-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d97706;
    text-decoration: none;
    margin-bottom: 12px;
    transition: color var(--art-transition);
}

.art-split-cat:hover {
    color: #fbbf24;
}

.art-split-title {
    font-family: var(--art-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}

.art-split-excerpt {
    font-family: var(--art-sans);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0 0 16px;
}

.art-split-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid #334155;
}

.art-split-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.art-split-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #b91c1c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.art-split-author-name {
    font-family: var(--art-sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    text-decoration: none;
}

.art-split-author-name:hover {
    color: #d97706;
}

.art-split-dots {
    display: flex;
    gap: 6px;
    font-family: var(--art-sans);
    font-size: 0.75rem;
    color: #64748b;
}

.art-split-dots span::after {
    content: '·';
    margin-left: 6px;
    color: #475569;
}

.art-split-dots span:last-child::after {
    content: '';
    margin-left: 0;
}

/* Right: Image */
.art-split-image {
    position: relative;
    overflow: hidden;
}

.art-split-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.art-split-noimg {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #334155;
}

.art-split-caption {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: var(--art-sans);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 2px;
}

/* Responsive split hero */
@media (max-width: 768px) {
    .art-hero-split {
        grid-template-columns: 1fr;
        height: auto;
    }

    .art-split-info {
        padding: 24px 20px;
        order: 2;
    }

    .art-split-image {
        order: 1;
        height: 250px;
    }

    .art-split-image img {
        width: 100%;
        height: 250px;
        object-fit: cover;
        display: block;
    }

    .art-split-title {
        font-size: 1.5rem;
    }
}

.art-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--art-black);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--art-sans);
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.art-author-info {
    font-family: var(--art-sans);
    font-size: 0.82rem;
    color: var(--art-gray);
    text-align: left;
}

.art-author-name {
    font-weight: 600;
    color: var(--art-black);
    text-decoration: none;
    transition: color var(--art-transition);
}

.art-author-name:hover {
    color: var(--art-accent);
    text-decoration: none;
}

.art-meta-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--art-sans);
    font-size: 0.78rem;
    color: var(--art-light);
}

.art-meta-dots span::before {
    content: '·';
    margin-right: 8px;
}

.art-meta-dots span:first-child::before {
    content: none;
}

/* ----- Article Body Wrapper ----- */
.art-body-wrap {
    max-width: var(--art-wide-w);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 40px;
    position: relative;
}

@media (max-width: 860px) {
    .art-body-wrap {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ----- Table of Contents ----- */
.art-toc {
    position: sticky;
    top: 80px;
    align-self: start;
    padding-top: 30px;
}

.art-toc-title {
    font-family: var(--art-sans);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--art-light);
    margin-bottom: 12px;
}

.art-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--art-rule);
}

.art-toc-list li {
    padding: 4px 0 4px 14px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    transition: border-color var(--art-transition);
}

.art-toc-list li.active {
    border-left-color: var(--art-accent);
}

.art-toc-list a {
    font-family: var(--art-sans);
    font-size: 0.75rem;
    color: var(--art-gray);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    transition: color var(--art-transition);
}

.art-toc-list li.active a {
    color: var(--art-black);
    font-weight: 600;
}

.art-toc-list a:hover {
    color: var(--art-black);
    text-decoration: none;
}

.art-toc-list .toc-h3 {
    padding-left: 26px;
    font-size: 0.7rem;
}

@media (max-width: 860px) {
    .art-toc {
        position: static;
        padding: 16px 0;
        border-bottom: 1px solid var(--art-rule);
        margin-bottom: 20px;
    }

    .art-toc-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        border-left: none;
    }

    .art-toc-list li {
        border-left: none;
        padding: 4px 10px;
        background: var(--art-bg-alt);
        border-radius: 4px;
        margin: 0;
    }

    .art-toc-list .toc-h3 {
        display: none;
    }
}

/* ----- Article Content Column ----- */
.art-content {
    padding-top: 30px;
    padding-bottom: 30px;
    max-width: var(--art-content-w);
}

.art-content>*:first-child {
    margin-top: 0;
}

/* Drop cap */
.art-content>p:first-of-type::first-letter {
    font-family: var(--art-serif);
    font-size: 4.2rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 6px;
    color: var(--art-black);
}

.art-content p {
    font-family: var(--art-sans);
    font-size: 1.125rem;
    line-height: 1.82;
    color: var(--art-dark);
    margin-bottom: 1.5rem;
}

/* Collapse empty paragraphs and divs */
.art-content p:empty,
.art-content div:empty {
    display: none;
}

.art-content p br:only-child {
    display: none;
}

.art-content h2 {
    font-family: var(--art-serif);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--art-black);
    margin: 2.5rem 0 1rem;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid var(--art-rule);
}

.art-content h3 {
    font-family: var(--art-serif);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--art-black);
    margin: 2rem 0 0.75rem;
}

.art-content h4 {
    font-family: var(--art-sans);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--art-black);
    margin: 1.5rem 0 0.5rem;
}

.art-content ul,
.art-content ol {
    margin: 0 0 1.5rem 1.5rem;
    font-family: var(--art-sans);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--art-dark);
}

.art-content li {
    margin-bottom: 0.5rem;
}

.art-content blockquote {
    border-left: 3px solid var(--art-black);
    padding: 8px 0 8px 24px;
    margin: 2rem 0;
    font-family: var(--art-serif);
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--art-gray);
}

.art-content img {
    width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.art-content pre {
    background: var(--art-bg-alt);
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.art-content code {
    font-size: 0.9em;
    background: var(--art-bg-alt);
    padding: 2px 6px;
    border-radius: 3px;
}

.art-content pre code {
    background: none;
    padding: 0;
}

.art-content a {
    color: var(--art-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.art-content a:hover {
    color: var(--art-black);
}

.art-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.art-content th,
.art-content td {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    text-align: left;
}

.art-content th {
    font-weight: 700;
    background: #1e293b;
    color: #fff;
    border-color: #334155;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.art-content tr:nth-child(even) {
    background: #f8f9fa;
}

.art-content tr:nth-child(odd) {
    background: #ffffff;
}

.art-content tbody tr:hover {
    background: #eef2ff;
}

/* ----- Tags ----- */
.art-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 0;
    border-top: 1px solid var(--art-rule);
    margin-top: 10px;
}

.art-tag {
    display: inline-block;
    font-family: var(--art-sans);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--art-gray);
    background: var(--art-bg-alt);
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--art-transition);
    border: 1px solid var(--art-rule);
}

.art-tag:hover {
    background: var(--art-black);
    color: #fff;
    border-color: var(--art-black);
    text-decoration: none;
}

/* ----- Author Box (Bottom) ----- */
.art-author-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 30px;
    background: var(--art-bg-alt);
    border-radius: 8px;
    margin: 30px 0;
    max-width: var(--art-content-w);
}

.art-author-box-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--art-black);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--art-sans);
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.art-author-box h4 {
    font-family: var(--art-sans);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.art-author-box h4 a {
    color: var(--art-black);
    text-decoration: none;
}

.art-author-box h4 a:hover {
    color: var(--art-accent);
}

.art-author-box p {
    font-family: var(--art-sans);
    font-size: 0.88rem;
    color: var(--art-gray);
    line-height: 1.5;
    margin: 0;
}

/* ----- Share Bar (Floating) ----- */
.art-share-bar {
    position: fixed;
    left: max(calc((100vw - 900px) / 2 - 80px), 12px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.art-share-bar.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.art-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--art-rule);
    background: var(--art-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--art-gray);
    transition: all var(--art-transition);
}

.art-share-btn:hover {
    background: var(--art-black);
    color: #fff;
    border-color: var(--art-black);
}

.art-share-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

@media (max-width: 1100px) {
    .art-share-bar {
        position: fixed;
        left: auto;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        flex-direction: row;
        justify-content: center;
        gap: 6px;
        background: var(--art-bg);
        border-top: 1px solid var(--art-rule);
        padding: 10px 20px;
        width: 100%;
        box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.06);
    }

    .art-share-btn {
        width: 36px;
        height: 36px;
    }
}

/* ----- Related Articles ----- */
.art-related {
    max-width: var(--art-wide-w);
    margin: 0 auto;
    padding: 0 20px 50px;
}

.art-related-header {
    border-top: 2px solid var(--art-black);
    padding-top: 6px;
    margin-bottom: 20px;
}

.art-related-header h3 {
    font-family: var(--art-sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--art-black);
}

.art-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .art-related-grid {
        grid-template-columns: 1fr;
    }
}

.art-related-card {
    display: flex;
    flex-direction: column;
}

.art-related-card a {
    display: block;
    text-decoration: none;
}

.art-related-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--art-bg-alt);
    margin-bottom: 10px;
    transition: opacity var(--art-transition);
    border-radius: 4px;
}

.art-related-card a:hover img {
    opacity: 0.88;
}

.art-related-card .no-img-sm {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: linear-gradient(135deg, #f8f8f8 0%, #eee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--art-muted);
    font-size: 1.5rem;
    margin-bottom: 10px;
    border-radius: 4px;
}

.art-related-card h4 {
    font-family: var(--art-serif);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--art-black);
    margin-bottom: 6px;
    transition: color var(--art-transition);
}

.art-related-card a:hover h4 {
    color: var(--art-accent);
}

.art-related-card .art-related-excerpt {
    font-family: var(--art-sans);
    font-size: 0.82rem;
    color: var(--art-gray);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.art-related-card .art-related-meta {
    font-family: var(--art-sans);
    font-size: 0.7rem;
    color: var(--art-light);
    margin-top: 6px;
}

/* ----- Loading State ----- */
.art-loading {
    text-align: center;
    padding: 80px 20px;
}

.art-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--art-rule);
    border-top-color: var(--art-black);
    border-radius: 50%;
    animation: art-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes art-spin {
    to {
        transform: rotate(360deg);
    }
}

.art-loading-text {
    font-family: var(--art-sans);
    font-size: 0.85rem;
    color: var(--art-light);
}

/* ----- 404 State ----- */
.art-404 {
    text-align: center;
    padding: 80px 20px;
    max-width: var(--art-content-w);
    margin: 0 auto;
}

.art-404 h2 {
    font-family: var(--art-serif);
    font-size: 2rem;
    color: var(--art-black);
    margin-bottom: 10px;
}

.art-404 p {
    font-family: var(--art-sans);
    color: var(--art-gray);
}

/* ----- Responsive ----- */
@media (max-width: 600px) {
    .art-header h1 {
        font-size: 1.8rem;
    }

    .art-header .art-excerpt {
        font-size: 1rem;
    }

    .art-hero img {
        height: 280px;
    }

    .art-content p {
        font-size: 1.05rem;
    }

    .art-content>p:first-of-type::first-letter {
        font-size: 3.2rem;
    }

    .art-author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}


/* Mobile Article Image Fix */
@media screen and (max-width: 768px) {
  /* Har div aur image ko target karo jo article header mein hai */
  .article-header img, 
  .feature-image, 
  [class*="feature"] img {
    height: 300px !important; 
    min-height: 300px !important;
    width: 100% !important;
    max-height: 400px !important;
    object-fit: cover !important;
    display: block !important;
  }
}