/* ==========================================================================
   PREMIUM ARTICLE LAYOUT - The Atlantic / NYT Style
   Five Key Improvements for Elite Digital Publication Design
   ========================================================================== */

/* 🔧 FIX: Remove white space at the very top */
body {
    margin: 0 !important;
    padding: 0 !important;
}

.top-nav-bar,
.top-bar {
    margin-top: 0 !important;
}

/* ========================================
   🎯 AGGRESSIVE WHITESPACE ELIMINATION
   Newspaper-tight layout: Header → Content
   ======================================== */

/* 1. NAVBAR - Remove all bottom spacing */
.main-navbar,
nav.navbar,
.navbar {
    margin-bottom: 0 !important;
    padding-bottom: 15px !important;
    /* Keep internal padding only */
}

/* 2. MAIN CONTAINERS - Zero top spacing */
.bg-light-styled,
.container-fluid,
main,
section,
.py-5,
.py-4,
.py-3 {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 3. BOOTSTRAP CONTAINERS - Force tight spacing */
.container,
.container-lg,
.container-fluid {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Override Bootstrap utility classes */
.pt-5,
.pt-4,
.pt-3 {
    padding-top: 0 !important;
}

.mt-5,
.mt-4,
.mt-3 {
    margin-top: 0 !important;
}

/* 4. ARTICLE BOX - No top margin/padding */
.article-main-box {
    margin-top: 0 !important;
    padding-top: 30px !important;
    /* Internal padding only */
}

/* 5. ARTICLE HEADER - Zero margin */
.article-header,
header.mb-4,
.article-main-box>header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 6. BREADCRUMB - Minimal spacing */
nav[aria-label="breadcrumb"],
.breadcrumb {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    padding-top: 0 !important;
}

/* 7. CAROUSEL/HERO SECTIONS - Tight to header */
.hero-section,
.featured-section,
.carousel-section,
.section-band {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 8. ROWS - No top spacing */
.row {
    margin-top: 0 !important;
}

/* 9. FIRST CONTENT ELEMENT - Absolutely no gap */
body>main>*:first-child,
body>section:first-child,
body>.container:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 🔧 FIX: Prevent content from scrolling under sticky header */
/* Header Stack - Highest Priority */
.top-nav-bar,
.top-bar {
    position: relative !important;
    z-index: 2000 !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.main-navbar,
nav.navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1999 !important;
    background-color: #0c2444 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Content Stack - Lower Priority */
.bg-light-styled,
.container,
.article-main-box,
.article-body,
#article-content-body,
.row,
.col-lg-8,
.col-lg-4 {
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure all text elements stay below header */
p,
h1,
h2,
h3,
h4,
h5,
h6,
div,
span {
    position: relative;
    z-index: 1;
}

/* Sidebar stays below header but above content */
.sticky-top {
    z-index: 10 !important;
}

/* 1. 🎯 GOLDEN RATIO READING WIDTH - Perfect for Readability */
.article-body,
#article-content-body {
    max-width: 720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px;
    padding-right: 20px;
}

/* Ensure parent container allows centering */
.article-main-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 2. 💎 PREMIUM TYPOGRAPHY UPGRADE - High-End Serif */
.article-body,
#article-content-body {
    font-family: 'Georgia', 'Merriweather', serif !important;
    font-size: 1.2rem !important;
    /* ~19px - Perfect reading size */
    line-height: 1.8 !important;
    /* Air between lines - feels expensive */
    color: #222 !important;
    /* Softer black - less eye strain */
    font-weight: 400 !important;
    letter-spacing: 0.01em !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
}

.article-body p,
#article-content-body p {
    margin-bottom: 1.8rem !important;
    text-align: left !important;
    /* Left-aligned like The Atlantic */
}

/* 3. 📌 STICKY SIDEBAR - Always Visible */
.sticky-top {
    position: sticky !important;
    top: 100px !important;
    /* Adjusts based on navbar height */
    align-self: flex-start;
    /* Keeps it at the top of the flex container */
    max-height: calc(100vh - 120px);
    /* Prevents it from being taller than viewport */
    overflow-y: auto;
    /* Scroll if content is too long */
}

/* 4. ✨ ELEGANT DROP CAP - Refined & Flush */
.article-body>p:first-of-type::first-letter,
#article-content-body>p:first-of-type::first-letter {
    float: left !important;
    font-size: 4.5rem !important;
    line-height: 0.8 !important;
    margin-right: 12px !important;
    margin-top: 5px !important;
    /* Sits flush with top */
    color: #001F3F !important;
    /* Brand Navy */
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
}

/* 5. 🎨 ADDITIONAL POLISH - Premium Details */

/* Headers aligned with reading column */
header {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Meta bar aligned with reading column */
.meta-bar {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Featured image aligned with reading column */
.article-main-box>div>.text-center {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Headings stay within reading column */
.article-body h2,
.article-body h3,
.article-body h4,
#article-content-body h2,
#article-content-body h3,
#article-content-body h4 {
    max-width: 720px;
    font-family: 'Georgia', serif !important;
    color: #222 !important;
}

.article-body h2,
#article-content-body h2 {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
}

.article-body h3,
#article-content-body h3 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin-top: 2rem !important;
    margin-bottom: 0.8rem !important;
}

/* Blockquotes - Elegant & Simple */
.article-body blockquote,
#article-content-body blockquote {
    max-width: 680px !important;
    margin: 2rem auto !important;
    padding: 1.5rem 2rem !important;
    border-left: 4px solid #001F3F !important;
    background: #f9f9f9 !important;
    font-family: 'Georgia', serif !important;
    font-size: 1.25rem !important;
    font-style: italic !important;
    color: #444 !important;
    line-height: 1.6 !important;
}

/* Links - Subtle & Professional */
.article-body a:not(.btn),
#article-content-body a:not(.btn) {
    color: #001F3F !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(0, 31, 63, 0.3) !important;
    text-underline-offset: 2px !important;
    transition: all 0.2s ease !important;
}

.article-body a:not(.btn):hover,
#article-content-body a:not(.btn):hover {
    text-decoration-color: #001F3F !important;
    background: rgba(0, 31, 63, 0.05) !important;
}

/* Images - Full width within reading column */
.article-body img,
#article-content-body img {
    max-width: 100% !important;
    height: auto !important;
    margin: 2rem 0 !important;
    border-radius: 2px !important;
}

/* Bold text - Slightly heavier */
.article-body strong,
.article-body b,
#article-content-body strong,
#article-content-body b {
    font-weight: 700 !important;
    color: #111 !important;
}

/* 📱 RESPONSIVE - Mobile Adjustments */
@media (max-width: 768px) {

    .article-body,
    #article-content-body {
        max-width: 100% !important;
        font-size: 1.1rem !important;
    }

    .article-body>p:first-of-type::first-letter,
    #article-content-body>p:first-of-type::first-letter {
        font-size: 3.5rem !important;
        margin-right: 8px !important;
    }

    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}