/* ==========================================================================
   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-sm);
    border: none;
    height: 420px;
    /* banner height — adjust if desired */
    position: relative;
    background: transparent;
    /* Fallback background color for slider */
}

/* Hero Slide - for multiple slides with opacity transition */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    text-decoration: none;
    display: block;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* 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: 2rem 2.5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
    color: #fff;
    pointer-events: none;
    text-align: left;
}

.hero-slide-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-slide-subtitle {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

@media (max-width: 768px) {
    .hero-slide-title {
        font-size: 1.5rem;
    }

    .hero-slide-subtitle {
        font-size: 0.95rem;
    }

    .hero-overlay {
        padding: 1.5rem;
    }
}

/* 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;
}

/* PAGE TITLE HEADER - Centered, uppercase for category/tag pages */
.page-title-header {
    justify-content: center;
    text-align: center;
    margin: 2.5rem 0 2rem;
}

.page-title-header .page-title {
    text-transform: uppercase;
    font-size: 2rem;
    letter-spacing: 0.08em;
    color: var(--sky-600);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.page-title-header .page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--sky-600), var(--hotpink-500));
    border-radius: 2px;
}

/* BLOG GRID & CARDS */
.blog-section {
    padding: 2.5rem 0 4rem;
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

.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;
}

/* ==========================================================================
   SEARCH FEATURE STYLES
   ========================================================================== */

/* Search Toggle Button in Navbar */
.search-toggle-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    margin-left: 1rem;
}

.search-toggle-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.search-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Search Container */
.search-container {
    width: 90%;
    max-width: 700px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Header */
.search-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.2rem;
    padding: 0.5rem 0;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
}

#search-input::placeholder {
    color: var(--muted);
}

.search-close-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-close-btn:hover {
    color: var(--text-primary);
}

/* Search Results */
.search-results {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background: var(--bg);
}

.search-result-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.search-result-category {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 500;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.search-hint {
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .search-container {
        width: 95%;
        margin-top: 2rem;
    }

    #search-input {
        font-size: 1rem;
    }

    .search-result-image {
        width: 50px;
        height: 50px;
    }
}

/* ===== UPDATE TOAST / CACHE NOTIFICATION ===== */
.update-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    animation: slideUp 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.update-toast span {
    font-size: 0.95rem;
    font-weight: 500;
}

.update-toast button {
    background: var(--sky-600);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-toast button:hover {
    background: var(--sky-400);
    transform: scale(1.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile toast */
@media (max-width: 480px) {
    .update-toast {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ===== IMAGE LIGHTBOX ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-overlay.closing {
    opacity: 0;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    box-sizing: border-box;
}

.lightbox-controls {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-btn.lightbox-close {
    background: rgba(239, 68, 68, 0.7);
}

.lightbox-btn.lightbox-close:hover {
    background: rgba(239, 68, 68, 1);
}

.lightbox-zoom-level {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    padding: 0 8px;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: zoom-out;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-caption {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-align: center;
    max-width: 80%;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    margin: 0;
}

.lightbox-caption:empty {
    display: none;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-content {
        padding: 70px 10px 50px;
    }

    .lightbox-controls {
        top: 10px;
        padding: 6px 12px;
        gap: 6px;
    }

    .lightbox-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .lightbox-zoom-level {
        font-size: 0.8rem;
        min-width: 40px;
    }
}

/* ===== ARTICLE IMAGES (clickable) ===== */
.article-img {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ===== VIDEO CONTAINER ===== */
.video-container {
    background: #000;
}

.video-container video {
    background: #000;
}

/* ===== COPY BUTTON STATES ===== */
.btn-copy {
    transition: all 0.2s ease;
}

/* ===== POST META TOP (Category Left, Date Right) ===== */
.post-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.post-title .title-text {
    flex: 1;
}

.post-title .arrow-icon {
    flex-shrink: 0;
    color: var(--sky-600);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.post-card:hover .post-title .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

/* ===== MODERN PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.page-btn.page-num {
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
}

.page-btn.page-num:hover {
    border-color: var(--sky-600);
    color: var(--sky-600);
}

.page-btn.page-num.active {
    background: var(--sky-600);
    border-color: var(--sky-600);
    color: white;
    font-weight: 600;
}

.page-btn-nav {
    gap: 0.35rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.page-btn-nav:hover:not(.disabled) {
    border-color: var(--sky-600);
    color: var(--sky-600);
    box-shadow: var(--shadow-md);
}

.page-btn-nav.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn-nav ion-icon {
    font-size: 1.1rem;
}

.page-ellipsis {
    color: var(--muted-2);
    font-size: 0.8rem;
    padding: 0 0.25rem;
}

/* ===== IMAGE PLACEHOLDER ===== */
.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--muted-2);
    font-size: 3rem;
}