/* 1. Make the entire webpage scroll smoothly (Optional but highly recommended) */
html {
    scroll-behavior: smooth;
}

/* 2. Make the Sidebar Sticky */
.all-topics {
    position: sticky;
    top: 100px; /* This keeps the sidebar 100px from the top of the screen */
    
    /* If your sidebar is inside a flexbox (.blog-layout), this ensures it doesn't stretch and break the sticky effect */
    align-self: start; 
    
    /* Give it a max-height and scrollbar just in case your topic list gets really long */
    max-height: calc(100vh - 120px); 
    overflow-y: auto;
}

/* 3. Add the Top Offset to Your Target Sections */
.sub-section {
    /* This tells the browser to stop exactly 100px BEFORE the top of the screen when a user clicks an anchor link */
    scroll-margin-top: 120px; 
}

/* ==========================================
   BASE STYLES & LAYOUT
========================================== */

/*====================================== blog-banner ==============*/
#overlay {
    position: relative;
    z-index: 1;
}

#overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(30, 29, 29); /* Change 0.6 to adjust darkness */
    z-index: -1;
}

.blog-banner{
    margin: auto;
    width: 1280px;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    padding: 0px 12px;
}

.blog-banner h1{
    font-size: 35px;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
}

.blog-banner .breadcrumbs a{
    font-size: 17px;
    color: white;
}

.blog-banner .breadcrumbs .bread-ico{
    color: var(--accent-hover);
    font-size: 20px;
}

.blog-banner .breadcrumbs .current-post-title{
    color: #0284c7;
    font-size: 17px;
}

.main-content{
    margin: auto;
    display: flex;
    padding: 70px 10px;
    width: 1280px;
    gap: 40px;
}

.post-left-content{
    display: flex;
    gap: 20px;
    width: 80%;
}

.post-left-content .all-topics{
    width: 25%;
    height: 80vh;
    overflow-y: scroll;
}

.all-topics::-webkit-scrollbar {
  display: none;
}

.post-left-content .post-content{
    background: var(--bg-card); 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px; 
    border: 1px solid var(--border-color); 
    transition: background 0.3s;
    width: 75%;
}

.post-meta{
    background: var(--bg-card); 
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--ad-border);
    margin-bottom: 20px;
    width: fit-content;
}

.post-meta p{
    font-size: 14px;
}

.post-description p{
    font-size: 18px;
    font-family: 'Inter', sans-serif;
}

.post-content h2, h3, h4, h5, h6{
    font-family: 'Outfit', sans-serif;
}

.sub-section{
    padding-top: 30px;
    padding-bottom: 30px;
    border-top: 1px solid var(--ad-border) ;
}

.post-list{
    margin-left: 30px;
    margin-bottom: 12px;
    margin-top: 10px;
}

.all-topics .post-list{
    font-size: 15px;
    line-height: 20px;
    margin-left: 15px;
}

.all-topics div h3{
    font-size: 17px;
    line-height: 20px;
}

.post-description h2, h3, p{
    margin-bottom: 10px;
}

/* ==========================================
   GOOGLE ADS PLACEHOLDERS
========================================== */
.ad-placeholder { 
    background-color: var(--ad-bg); 
    border: 2px dashed var(--ad-border); 
    text-align: center; 
    padding: 20px; 
    margin: 30px 0; 
    border-radius: 4px; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    min-height: 100px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-direction: column; 
}

/* ==========================================
   SIDEBAR (30%)
========================================== */
.blog-sidebar { width: 20%; }
.widget { 
    background: var(--bg-card); 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    margin-bottom: 30px; 
    border: 1px solid var(--border-color); 
    transition: background 0.3s; 
}
.widget h3 { 
    font-size: 1.2rem; 
    margin-top: 0; 
    margin-bottom: 15px; 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 10px; 
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { margin-bottom: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.widget li:last-child { border-bottom: none; }


/* ==========================================
   RESPONSIVE CSS (Mobile & Tablet)
========================================== */

/* 1. Prevent overflow on laptops smaller than 1300px */
@media (max-width: 1300px) {
    .blog-banner, 
    .main-content {
        width: 100%; /* Overrides the fixed 1280px */
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* 2. Tablets (iPad, etc.) - Move Sidebar to the bottom */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column; /* Stacks left-content and sidebar */
    }
    .post-left-content {
        width: 100%;
    }
    .blog-sidebar {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .post-description p {
    font-size: 16px;
    }
    
}

/* 3. Small Tablets & Large Phones - Stack Table of Contents */
@media (max-width: 850px) {
    .post-left-content {
        flex-direction: column-reverse; /* Stacks TOC and Post Content */
    }
    .post-left-content .all-topics {
        width: 100%;
        height: auto;
        position: static; /* Disables sticky so it doesn't cover text on mobile */
        margin-bottom: 20px;
    }
    .post-left-content .post-content {
        width: 100%;
    }
    .post-description h2{
      font-size: 25px;
    }
    .sub-section{
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 1px solid var(--ad-border) ;
    }
    .post-left-content .all-topics{
    width: 100%;
    height: 40vh;
}
.breadcum {
   margin-top: 80px;
}

    
}

/* 4. Standard Mobile Screens */
@media (max-width: 768px) {
    .blog-banner {
        height: auto;
        padding: 60px 15px 40px; /* Adjust banner padding for mobile */
    }
    .blog-banner h1 {
        font-size: 26px; /* Smaller title for mobile */
        line-height: 1.3;
    }
    .blog-banner .breadcrumbs a,
    .blog-banner .breadcrumbs .current-post-title {
        font-size: 14px;
    }
    .main-content {
        padding: 40px 15px; /* Reduce side padding to give text more room */
    }
    .post-left-content .post-content {
        padding: 15px; /* Shrinks the inner box padding on mobile */
    }
    .post-description h2{
      font-size: 20px;
    }
}