/* ==========================================================================
   1. REAL GOOGLE DARK SYSTEM THEME CONFIGURATION & RESET
   ========================================================================== */
:root {
    --bg-main: #000000;               /* Absolute Black Background Layer */
    --surface-card: #1e1f20;          /* Google's Dark Mode Material Container Gray */
    --surface-card-inner: #000000;   
    
    /* Font Color Hierarchies */
    --text-primary: #ffffff;         
    --text-secondary: #e3e3e3;       
    --text-muted: #8ab4f8;           /* High-contrast brand blue */
    --text-date: #aaaeb3;            /* Mid-tone gray metadata */
    --border-color: #3c4043;         /* Standard layout line breaks */
    
    --google-blue: #1a73e8;          
    --google-link-blue: #8ab4f8;     
    
    --font-google: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-google);
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}


/* ==========================================================================
   2. TOP NAVIGATION BAR SYSTEM (Upper Right Alignment)
   ========================================================================== */
.main-header {
    width: 100%;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Forces the navigation utilities completely to the upper right */
.nav-right {
    margin-left: auto; 
}

.nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    align-items: center;
}

.nav-links li a {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.15s, color 0.15s;
}

.nav-links li a:hover {
    background-color: #1e1f20;
    color: var(--text-primary);
}

.nav-links li a.active {
    color: var(--google-link-blue);
    background-color: rgba(138, 180, 248, 0.12);
    font-weight: 700;
}


/* ==========================================================================
   3. SHARED POST FOOTER TAGS AREA (Fixed for Perfect Centering)
   ========================================================================== */
.post-footer-tags-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3.5rem;
}

.btn-prev-post {
    flex: 1;
    display: inline-flex;
    align-items: center;      /* Keeps the chevron and text perfectly leveled */
    justify-content: flex-start;
    gap: 0.15rem;             /* Crucial fix: Creates clean space between symbol and text */
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.15s ease;
}

.btn-next-post {
    flex: 1;
    display: inline-flex;
    align-items: center;      /* Keeps the chevron and text perfectly leveled */
    justify-content: flex-end;
    gap: 0.15rem;             /* Crucial fix: Creates clean space between text and symbol */
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.15s ease;
}

.posted-in-labels {
    flex: 0 0 auto; /* Takes only its exact content width, staying perfectly centered */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0 1.5rem; /* Safe breathing room so tags never touch the side text */
}

.label-prefix {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-date);
    letter-spacing: 0.5px;
}

.footer-tag-link {
    text-decoration: none;
    font-size: 0.75rem;
    color: var(--google-link-blue);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background-color: #121212;
}

.footer-tag-link:hover {
    background-color: #1e1f20;
}

.btn-prev-post:hover,
.btn-next-post:hover {
    color: var(--google-link-blue);
}


/* ==========================================================================
   4. MAIN STRUCTURAL CONTENT SPACING (Homepage Layout)
   ========================================================================== */
.main-content-wrapper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex-grow: 1;
}

.split-layout {
    display: grid;
    grid-template-columns: 1.65fr 1.1fr; 
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 4rem;
}

.featured-container, .latest-container {
    background-color: var(--surface-card);
    border-radius: 16px;
    padding: 1.75rem;
    position: relative;
    border: 1px solid #2d2e30;
}

.featured-text-content {
    min-height: 160px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.section-box-title {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}


/* ==========================================================================
   5. LEFT HERO REPLICA CONTAINER DECORATIONS
   ========================================================================== */
.featured-clickable-wrapper { text-decoration: none; color: inherit; }

.featured-image-holder {
    width: 100%;
    height: 340px;
    background-color: var(--surface-card-inner);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.featured-image-holder img { width: 100%; height: 100%; object-fit: cover; }

.featured-tags {
    font-size: 0.75rem;
    color: var(--google-link-blue);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.featured-article-title {
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.featured-article-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* CAROUSEL ARROWS */
.carousel-arrow-next, .carousel-arrow-prev {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    background-color: #303134;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 10;
}
.carousel-arrow-next { right: -18px; }
.carousel-arrow-prev { left: -18px; }

.carousel-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 1.5rem; }
.carousel-dots .dot { width: 7px; height: 7px; background-color: #5f6368; border-radius: 50%; }
.carousel-dots .dot.active { background-color: #ffffff; }


/* ==========================================================================
   6. RIGHT REPLICA CONTAINER DECORATIONS
   ========================================================================== */
.latest-blog-item { border-bottom: 1px solid var(--border-color); padding-bottom: 1.25rem; margin-bottom: 1.25rem; }
.latest-item-date { font-size: 0.7rem; color: var(--text-date); font-weight: 500; display: block; margin-bottom: 0.4rem; }
.latest-item-title a { text-decoration: none; color: var(--text-primary); font-size: 1.05rem; font-weight: 500; }
.latest-item-title a:hover { color: var(--google-link-blue); }
.latest-item-excerpt { font-size: 0.85rem; color: var(--text-date); margin-top: 0.4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.latest-box-footer-search { margin-top: 1.5rem; }
.box-search-form { display: flex; align-items: center; background-color: #303134; border-radius: 4px; padding: 0.25rem 0.75rem; border: 1px solid transparent; }
.box-input-wrapper { display: flex; align-items: center; flex-grow: 1; gap: 0.5rem; }
.search-icon-placeholder { color: #9aa0a6; font-size: 0.85rem; }
.box-search-input { background: transparent; border: none; outline: none; color: var(--text-primary); font-size: 0.85rem; width: 100%; padding: 0.4rem 0; }
.btn-box-search { background: transparent; border: none; color: var(--google-link-blue); font-weight: 500; font-size: 0.85rem; cursor: pointer; }


/* ==========================================================================
   7. SECTION B: 1:1 HORIZONTAL CATEGORY CAROUSEL SYSTEM
   ========================================================================== */
.topics-feed-system { display: flex; flex-direction: column; gap: 3.5rem; }
.topic-row { display: grid; grid-template-columns: 200px 1fr; align-items: start; gap: 2rem; }

.topic-sidebar {
    position: sticky;
    top: 90px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.topic-sidebar-title { font-size: 1.6rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.75rem; }

.btn-see-posts {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--google-link-blue);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    transition: background-color 0.15s;
}
.btn-see-posts:hover { background-color: rgba(138, 180, 248, 0.08); }

.topic-carousel-container { position: relative; width: 100%; margin: 0; }
.topic-grid-clip { overflow: hidden; width: 100%; }
.topic-grid { display: flex; flex-wrap: nowrap; gap: 20px; width: 100%; transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); }

.topic-card { flex: 0 0 calc((100% - 40px) / 3); box-sizing: border-box; }

.topic-card-title a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7rem;
    margin-bottom: 0.5rem;
}
.topic-card-title a:hover { color: var(--google-link-blue); }

.topic-card-image {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--surface-card);
}
.topic-card-image img { width: 100%; height: 100%; object-fit: cover; }

.topic-row-prev, .topic-row-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(32, 33, 36, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    z-index: 10;
    transition: background-color 0.2s;
}
.topic-row-prev:hover, .topic-row-next:hover { background-color: #303134; }
.topic-row-prev { left: -18px; }
.topic-row-next { right: -18px; }

.topic-row-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 1.5rem; }
.topic-row-dots .sub-dot { width: 7px; height: 7px; background-color: #5f6368; border-radius: 50%; transition: background-color 0.2s; }
.topic-row-dots .sub-dot.active { background-color: #ffffff; }

/* ==========================================================================
   GLOBAL CLEAN BOUNDARY FOOTER LINE
   ========================================================================== */
.main-footer { border-top: 1px solid var(--border-color); padding: 1.5rem 0; margin-top: 5rem; }
.footer-content { max-width: 1400px; margin: 0 auto; padding: 0 2rem; font-size: 0.75rem; color: var(--text-date); }

/* ==========================================================================
   UNIFIED GLOBAL RESPONSIVE RULES
   ========================================================================== */
@media (max-width: 1024px) {
    .main-header {
        padding: 1rem 1.5rem;
    }

    .split-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .topic-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .topic-sidebar {
        position: static;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }

    .btn-see-posts {
        margin-top: 0;
    }

    .carousel-arrow-next,
    .carousel-arrow-prev,
    .topic-row-next,
    .topic-row-prev,
    .topic-row-dots {
        display: none;
    }

    .topic-grid-clip {
        width: 100%;
        overflow: visible;
    }

    .topic-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.25rem;
        width: 100%;
    }

    .topic-card {
        width: 100%;
        max-width: 100%;
    }

    .search-split-layout {
        grid-template-columns: 1fr;
        justify-content: center;
        padding: 0 1.5rem;
    }

    .results-feed-column {
        margin: 0 auto;
        max-width: 700px;
        width: 100%;
    }

    .post-master-container {
        padding: 0 1.5rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .blog-post-article {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 680px) {
    .nav-container {
        padding: 1rem 1rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-links li a {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .topic-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }

    .topic-card-title a {
        height: auto;
        -webkit-line-clamp: initial;
    }

    .featured-image-holder {
        height: 220px;
    }

    .feed-row-item {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .feed-row-thumb {
        width: 100%;
        height: 180px;
    }

    .feed-item-title {
        font-size: 1.2rem;
    }

    .results-feed-column {
        margin: 0 auto;
        width: 100%;
    }

    .post-master-container {
        padding: 0 1rem;
    }

    .post-main-title {
        font-size: 1.75rem;
        word-break: break-word;
    }

    .inline-image-callout img {
        width: 100%;
        height: auto;
    }

    .post-footer-tags-area {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 1.25rem;
        width: 100%;
        padding: 1.25rem 0;
        box-sizing: border-box;
    }

    .btn-prev-post {
        order: 1;
    }

    .btn-next-post {
        order: 2;
    }

    .posted-in-labels {
        order: 3;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .related-post-card {
        width: 100%;
    }
}

/* ==========================================================================
   8. COMPACT CHAPTER BREADCRUMB PAGINATION
   ========================================================================== */
.chapterPagination {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background-color: var(--surface-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.paginationLabel {
    display: block;
    font-size: 0.8rem;
    color: var(--text-date);
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pageNumbersContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.pageNumber {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: #121212;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.pageNumber:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.pageNumber.activePage {
    background-color: rgba(138, 180, 248, 0.15);
    color: var(--google-link-blue);
    border-color: var(--google-link-blue);
    font-weight: 700;
}

.pageNumbersContainer::-webkit-scrollbar {
    width: 6px;
}

.pageNumbersContainer::-webkit-scrollbar-track {
    background: #121212;
    border-radius: 4px;
}

.pageNumbersContainer::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.pageNumbersContainer::-webkit-scrollbar-thumb:hover {
    background: #5f6368;
}

/* ==========================================================================
   9. INLINE CALLOUT IMAGE - UNCONSTRAINED FULL DISPLAY
   ========================================================================== */
.inline-image-callout {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 2.5rem 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.inline-image-callout img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
}