/* ==========================================================================
   EXPLog — Final Consolidated CSS (v2)
   - Fixes requested:
     * code block: background + border = same color (black)
     * related thumbnails: correct cover
     * banner/slider: width aligned with main container (exact horizontal alignment)
   - Fonts: Poppins + Noto Sans
   ========================================================================== */

/* Import fonts (unicode-friendly + rounded) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;600;700&family=Poppins:wght@400;600;700&display=swap');

:root {
    /* Colors */
    --sky-600: #1DA1F2;
    --sky-400: #66C3FF;
    --hotpink-700: #E11D74;
    --hotpink-500: #FF2D7A;
    --bg: #FBFDFF;
    --card: #FFFFFF;
    --muted: #6B7280;
    --muted-2: #94A3B8;
    --border: #E6EEF8;

    /* Code block background (single color for bg + border) */
    --code-bg: #000000;
    /* <-- black; change here if needed */
    --code-text: #F7FAFF;

    /* Compatibility Aliases */
    --primary: var(--sky-600);
    --text-primary: #0F1724;
    --text-secondary: var(--muted);

    --shadow-sm: 0 6px 16px rgba(30, 78, 120, 0.07);
    --shadow-md: 0 10px 30px rgba(17, 24, 39, 0.08);
    --radius-base: 14px;
    --radius-lg: 20px;
    --container: 1180px;
    --gap-lg: 2.25rem;
    --gap-md: 1.25rem;
    --gap-sm: 0.75rem;
    --line-height: 1.6;
    --max-read-width: 820px;
}

/* Reset / base */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg) 0%, #F7FBFF 100%);
    color: var(--text-primary);
    font-family: "Poppins", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: var(--line-height);
    font-size: 16px;
    padding-top: 76px;
    /* compensation for fixed navbar */
}

/* Container util - single source of truth for main content width and padding */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* NAVBAR (FIXED) - Bootstrap 5 Compatible */
.navbar {
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85)) !important;
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
}

.nav-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    height: 40px;
    width: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--sky-600);
}

/* Links - Bootstrap Nav Styling */
.navbar-nav .nav-link {
    color: var(--muted) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem !important;
    border-radius: 10px;
    transition: all .18s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--sky-600) !important;
    transform: translateY(-2px);
}

/* avatar / actions - hidden by default */
.user-avatar {
    display: none;
}

.nav-actions {
    display: none;
}

/* Navbar toggler styling */
.navbar-toggler {
    border: 1px solid var(--border);
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ===== HERO / BANNER / SLIDER =====
   Goal: hero-image-wrapper must align exactly with .container content width
   Strategy:
    - Use a single "hero-inner" wrapper that inherits the same width/padding as .container
    - Fallback: if hero-image-wrapper is a direct child of .hero, the .hero-image-wrapper will use the same max-width and padding
*/
.hero {
    padding: 2rem 0;
    display: block;
    text-align: center;
}

/* hero inner provides the same width/padding constraints as .container */
.hero-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

/* hero content */
.hero-content {
    max-width: 740px;
    margin: 0 auto 2rem;
}

.hero-category {
    display: inline-block;
    background: linear-gradient(90deg, rgba(29, 161, 242, 0.08), rgba(225, 29, 116, 0.06));
    color: var(--hotpink-700);
    font-weight: 700;
    font-size: 0.9rem;
    padding: .45rem .7rem;
    border-radius: 999px;
    letter-spacing: .04em;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.06;
    margin: 0 0 .85rem;
    color: #07203B;
    font-weight: 700;
    letter-spacing: -0.01em;
}

@media (max-width:520px) {
    .hero-title {
        font-size: 1.75rem;
    }
}

.hero-desc {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 680px;
    margin: 0 auto;
}

/* HERO IMAGE WRAPPER
   Two ways it can be present in HTML:
   1) <div class="hero"><div class="hero-inner"><div class="hero-image-wrapper">...</div></div></div>
   2) <div class="hero"><div class="hero-image-wrapper">...</div></div>
   The rules below cover both cases; in either case the visible width of the banner will match the main .container content.
*/
.hero-image-wrapper {
    /* ensure it does not exceed the main container width */
    width: 100%;
    margin: 0 auto;
    /* same horizontal padding as .container to align inner content edges */
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(10, 40, 66, 0.03);
    height: 420px;
    /* banner height — adjust if desired */
    position: relative;
    /* background: linear-gradient(180deg, var(--sky-400), rgba(255, 255, 255, 0)); */
}

/* If hero-image-wrapper contains an inner "frame" div (common in sliders) target it too */
.hero-image-wrapper>.frame,
.hero-image-wrapper>.slide {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* image inside hero must cover frame exactly */
.hero-image-wrapper img,
.hero-image-wrapper .card-image,
.hero-image-wrapper .frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .5s ease;
}

.hero-image-wrapper:hover img {
    transform: scale(1.03);
}

/* overlay callout */
.hero-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.35));
    color: #fff;
    pointer-events: none;
}

/* SLIDER CONTROLS (positioned inside hero-image-wrapper) */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    z-index: 30;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.prev-btn {
    left: calc((100% - var(--container))/2 + 1rem);
}

/* align relative to container edges */
.next-btn {
    right: calc((100% - var(--container))/2 + 1rem);
}

/* aligns controls visually with container */
/* The calc above keeps prev/next buttons horizontally aligned with the container content edges.
     It works whether hero-image-wrapper is full width of viewport or constrained inside a container. */

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 30;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all .3s ease;
}

.slider-dot.active {
    background: white;
    transform: scale(1.2);
}

/* SECTION HEADERS */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1.25rem;
}

.section-header h2 {
    font-size: 1.6rem;
    color: #07203B;
    margin: 0;
    font-weight: 700;
}

/* BLOG GRID & CARDS */
.blog-section {
    padding: 2.5rem 0 4rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap-lg);
}

.post-card {
    background: var(--card);
    border-radius: var(--radius-base);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
    border: 1px solid rgba(10, 40, 66, 0.03);
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.card-image-wrapper {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .4s ease;
}

.post-card:hover .card-image {
    transform: scale(1.06);
}

.post-content {
    padding: 1.15rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.post-category {
    color: var(--sky-600);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #07122a;
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    line-height: 1.25;
}

.post-summary {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
    margin-top: .25rem;
}

/* meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .6rem;
}

.meta-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.meta-info {
    font-size: .9rem;
    color: var(--muted-2);
}

.meta-author {
    font-weight: 600;
    color: #07122a;
}

.meta-date {
    font-size: .85rem;
    color: var(--muted-2);
}

/* ARTICLE VIEW */
.article-container {
    max-width: var(--max-read-width);
    margin: 0 auto;
    padding: 3.25rem 1.25rem;
    background: transparent;
}

.article-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.article-title {
    font-size: 2rem;
    color: #07122a;
    font-weight: 700;
    margin: 0 0 .5rem;
    line-height: 1.12;
}

.article-category {
    color: var(--sky-600);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .6rem;
}

.article-hero {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
    width: 100%;
}

.article-hero img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

/* Article Tags */
.article-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tag-btn {
    display: inline-block;
    background: rgba(29, 161, 242, 0.1);
    color: var(--sky-600);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(29, 161, 242, 0.2);
}

.tag-btn:hover {
    background: var(--sky-600);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

/* MARKDOWN BODY - CLASSIC "BEAUTIFUL" VERSION */
.markdown-body {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: justify;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1em;
    font-weight: 700;
    line-height: 1.3;
}

.markdown-body h1 {
    font-size: 2.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5em;
}

.markdown-body h2 {
    font-size: 1.875rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5em;
}

.markdown-body p {
    margin-bottom: 1.5em;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    padding-right: 1em;
}

.markdown-body li {
    margin-bottom: 0.5em;
}

.markdown-body img {
    margin: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: block;
    max-width: 100%;
}

.markdown-body a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* -----------------------------
   1) Code block — unified background + border color
   ----------------------------- */
.markdown-body pre {
    background: var(--code-bg);
    /* same color as border */
    color: var(--code-text);
    padding: 1.25rem;
    border-radius: 12px;
    overflow: auto;
    border: 1px solid #000000;
    /* border same as background */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* Inline code styled to sit well with black blocks; separate small accent */
.markdown-body code {
    background: #000000;
    color: #FF9CCF;
    padding: .12rem .36rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
}

/* RELATED GRID OVERRIDES - thumbnails fixed */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width:768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-grid .card-image-wrapper {
    height: 140px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    display: block;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.02));
}

.related-grid .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .35s ease;
}

.related-grid .post-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

.related-grid .post-card:hover .card-image {
    transform: scale(1.04);
}

.related-grid .post-content {
    gap: 0.15rem;
}

.related-grid .post-title {
    font-size: 0.9rem;
    line-height: 1.3;
}

.related-grid .post-summary {
    display: none;
}

/* CODE COPY BTN */
.code-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
}

.btn-copy {
    position: absolute;
    top: .6rem;
    right: .6rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    padding: .45rem .7rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

/* Buttons */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}

.btn-back:hover {
    color: var(--sky-600);
    transform: translateX(-4px);
}

/* Navigation Buttons (Prev/Next) */
.nav-btn {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    width: 45%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-base);
    background: var(--card);
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--sky-600);
    box-shadow: var(--shadow-sm);
}

.nav-label {
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.nav-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA & small UI */
.cta-section {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--sky-400), rgba(225, 29, 116, 0.06));
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(10, 40, 66, 0.03);
}

.btn-primary {
    background: linear-gradient(90deg, var(--sky-600), var(--hotpink-500));
    color: #fff;
    padding: .85rem 1.1rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(29, 161, 242, 0.12);
}

.btn-primary:hover {
    transform: translateY(-3px);
    opacity: .98;
}

/* FOOTER */
.footer {
    background: linear-gradient(180deg, #021825, #052233);
    color: rgba(255, 255, 255, 0.85);
    padding: 2.25rem 0;
    margin-top: 3rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    align-items: center;
}

.footer .logo-area {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    font-weight: 700;
}

.footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: .95rem;
}

/* Responsive tweaks */
@media (max-width:1200px) {
    :root {
        --container: 1000px;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero-image-wrapper {
        height: 360px;
    }
}

@media (max-width:980px) {
    /* Bootstrap handles nav-links visibility via collapse */

    .post-meta {
        gap: .6rem;
    }

    .blog-grid {
        gap: 1.5rem;
    }

    .hero-image-wrapper {
        height: 300px;
    }
}

@media (max-width:640px) {
    .container {
        padding: 0 0.9rem;
    }

    .hero-inner {
        padding: 0 0.9rem;
    }

    /* keep hero padding consistent on small screens */
    .hero-image-wrapper {
        height: 220px;
    }

    .related-grid .card-image-wrapper {
        height: 110px;
    }

    .post-title {
        font-size: 1rem;
    }

    .post-summary {
        font-size: .95rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
    }
}

/* SMALL HELPERS */
.kicker {
    font-size: .9rem;
    color: var(--sky-600);
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.round {
    border-radius: 12px;
}