/* ============================================================
   MOBILE RESPONSIVE FIXES — homepage (mobile-fixes.css)
   Add <link rel="stylesheet" href="mobile-fixes.css"> AFTER
   your main style.css link.
   ============================================================ */

/* ── 1. CATEGORY ITEMS AS LINKS ───────────────────────────── */
/* The mobile category items are now <a> tags so they need
   their default anchor styling removed */
.ad2category-item {
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;          /* slightly tighter than desktop */
    flex-shrink: 0;
    background-image: linear-gradient(-225deg, #5D9FFF 0%, #B8DCFF 48%, #6BBBFF 100%);
    border-radius: 18px;
    padding: 10px 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ad2category-item:active,
.ad2category-item:hover {
    transform: scale(0.97);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Icon: support both emoji spans AND <img> tags */
.ad2icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}

.ad2icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Category label text */
.ad2category-item span:last-child {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

/* ── 2. MOBILE BANNER WRAPPER ──────────────────────────────── */
.ad2mobile-home {
    padding: 16px 14px 20px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
}

/* ── 3. CATEGORY SLIDER — smooth scroll, no scrollbar ─────── */
.ad2category-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;   /* prevents shadow clipping */
    margin-bottom: 16px;
}

.ad2category-slider::-webkit-scrollbar {
    display: none;
}

/* ── 4. PROMO SLIDER ────────────────────────────────────────── */
.ad2promo-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    margin: 0;               /* reset the 20px top margin from base */
}

.ad2promo-slides {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: 100%;
}

.ad2promo-slide {
    min-width: 100%;
    flex: 0 0 100%;
}

.ad2promo-slide img,
.ad2promo-slide a img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    object-fit: cover;
    /* Prevent tall images stretching on small phones */
    max-height: 200px;
}

/* Slider nav buttons */
.ad2-prev,
.ad2-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    /* Make buttons easier to tap */
    -webkit-tap-highlight-color: transparent;
}

.ad2-prev { left: 8px; }
.ad2-next { right: 8px; }

.ad2-prev:hover,
.ad2-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ── 5. CATEGORY HEADER ─────────────────────────────────────── */
.ad2category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ad2category-header h3 {
    color: #fff;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.ad2category-header a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s;
}

.ad2category-header a:hover {
    background: rgba(255,255,255,0.15);
}



/* ── 7. EXTRA SMALL PHONES (≤ 380px) ──────────────────────── */
@media (max-width: 380px) {

    .ad2mobile-home {
        padding: 12px 10px 16px;
    }

    .ad2category-item {
        min-width: 120px;
        padding: 8px 10px;
        gap: 8px;
    }

    .ad2icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
        font-size: 18px;
    }

    .ad2icon img {
        width: 22px;
        height: 22px;
    }

    .ad2category-item span:last-child {
        font-size: 13px;
    }

    .ad2promo-slide img,
    .ad2promo-slide a img {
        max-height: 160px;
    }

    .posts-grid {
        gap: 8px !important;
    }

    .post-thumbnail {
        height: 110px;
    }
}

/* ── 8. PREVENT HORIZONTAL OVERFLOW ────────────────────────── */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .ad-mobile {
        width: 100%;
        overflow-x: hidden;
    }

    /* Ensure no-results message is readable */
    .no-results {
        text-align: center;
        padding: 2rem 1rem;
        color: #64748b;
    }

    .no-results i {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
        display: block;
    }
}


.ad2category-slider a,
.ad2category-slider a:hover,
.ad2category-slider a:visited,
.ad2category-slider a:active {
    text-decoration: none;
}