/* ==========================================================================
   📱 ULTRA-AGGRESSIVE MOBILE RESPONSIVE FIXES
   Overrides all previous styles to ensure mobile compliance.
   ========================================================================== */

/* 1. Global Overflow Fix */
html,
body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative;
}

/* 2. Container Fixes */
.container,
.container-fluid {
    width: 100% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    margin-right: auto !important;
    margin-left: auto !important;
    overflow-x: hidden !important;
}

/* 3. Header & Navbar Mobile Fixes */
@media (max-width: 991px) {
    .sticky-header-container {
        position: sticky !important;
        top: 0 !important;
        width: 100% !important;
    }

    /* Top Bar - Show Date on Mobile but smaller */
    .top-nav-bar {
        justify-content: space-between !important;
        padding: 0 10px !important;
    }

    .top-nav-bar .date-text {
        display: block !important;
        font-size: 0.6rem !important;
        padding-left: 15px !important;
        /* Make space for icon */
    }

    .top-bar-icons {
        margin: 0 !important;
        /* Fixed alignment */
        display: flex !important;
        gap: 10px !important;
    }

    /* Main Navbar */
    .main-navbar {
        padding: 10px 0 !important;
    }

    .brand-logo .word-horn {
        font-size: 24px !important;
    }

    .brand-logo .word-analysis {
        font-size: 9px !important;
    }

    .navbar-toggler {
        margin-right: 0 !important;
        padding: 6px 10px !important;
    }

    /* Collapse Menu */
    .navbar-collapse {
        background: #0a1628 !important;
        /* Premium Navy */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 20px !important;
        z-index: 9999;
        margin-top: 5px;
        border-top: 2px solid #FFC107;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

/* 4. Homepage Hero Section Mobile Fixes */
@media (max-width: 768px) {

    /* Hero Carousel */
    #heroCarousel .carousel-item {
        height: auto !important;
        min-height: unset !important;
        /* Reduced from 480px */
    }

    #heroCarousel img {
        height: auto !important;
        object-fit: contain !important;
    }

    /* Mobile Text Sizing for Hero */
    #heroCarousel .post-title,
    #heroCarousel .display-4 {
        font-size: 22px !important;
        /* Further reduced */
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
    }

    /* Adjust gradient overlay padding */
    #heroCarousel .position-absolute {
        padding: 15px !important;
        /* Reduced padding */
        background: linear-gradient(to top, rgba(10, 22, 40, 1) 0%, rgba(10, 22, 40, 0.8) 60%, transparent 100%) !important;
        bottom: 0 !important;
    }

    /* Hide Navigation Arrows/Indicators on Mobile to prevent overlap */
    #heroCarousel .carousel-control-prev,
    #heroCarousel .carousel-control-next {
        display: none !important;
    }
}

/* 5. Content Sections Mobile Fixes */
@media (max-width: 768px) {
    .section-title {
        font-size: 24px !important;
        flex-wrap: wrap;
        margin-bottom: 20px !important;
    }

    .title-accent {
        font-size: 14px !important;
        display: block;
        width: 100%;
        margin-bottom: 4px;
    }

    .col-lg-8 .card .post-title {
        font-size: 22px !important;
    }

    /* Horizontal Scroll Areas */
    .horizontal-scroll-layout {
        padding: 10px 0 20px !important;
        gap: 15px !important;
    }

    .h-item {
        width: 260px !important;
    }
}

/* 6. Footer & Generic Text */
@media (max-width: 768px) {

    p,
    .card-text {
        font-size: 16px !important;
    }

    h1,
    h2,
    h3 {
        word-wrap: break-word !important;
    }

    footer,
    .footer-section,
    #footer {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    footer .row>div {
        margin-bottom: 20px !important;
    }

    /* Hide descriptions/excerpts on mobile - ONLY TITLE */
    .card-text,
    .article-excerpt,
    p.text-muted,
    .tech-new-card p,
    .opinion-new-card p {
        display: none !important;
    }

    /* Exceptions for footer or specific areas if needed later */
    footer p {
        display: block !important;
    }
}