/*
 * ============================================================
 *  KenStack AI News — Responsive Stylesheet
 *  Covers breakpoints from 1440px → 360px
 *  DO NOT change the base (desktop) styles — extend only.
 * ============================================================
 *
 *  Table of Contents
 *  -----------------
 *  1.  Global Helpers & Base overrides for fluid typography
 *  2.  Hamburger button (hidden on desktop)
 *  3.  Mobile Overlay / Backdrop
 *  4.  @media (max-width: 1440px)  — Large Desktop
 *  5.  @media (max-width: 1200px)  — Desktop / Laptop
 *  6.  @media (max-width: 1024px)  — Laptop
 *  7.  @media (max-width: 992px)   — Tablet Landscape  (hamburger ON)
 *  8.  @media (max-width: 768px)   — Tablet Portrait
 *  9.  @media (max-width: 576px)   — Large Mobile
 *  10. @media (max-width: 480px)   — Small Mobile
 *  11. @media (max-width: 360px)   — Extra-small Devices
 *  12. Accessibility & Performance helpers
 * ============================================================
 */


/* ============================================================
   1. Global — fluid typography & image safety
   ============================================================ */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fluid headings using clamp() */
.hero-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.875rem); /* 29px → 46px */
}

.header-content h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.625rem); /* 26px → 42px */
}

.newsletter-section h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.contact-left h3,
.event-details h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
}

.header-left h3,
.widget-title {
    font-size: clamp(1rem, 2vw, 1.375rem);
}

/* Prevent horizontal overflow site-wide */
html, body {
    overflow-x: hidden;
}

/* Hide mobile drawer footer on desktop */
.mobile-drawer-footer {
    display: none;
}

/* ============================================================
   2. Hamburger Button — always in the DOM, visible on mobile
   ============================================================ */

.hamburger-btn {
    display: none;               /* hidden on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: background 0.3s ease;
    position: relative;          /* ensures z-index works */
    z-index: 5;                  /* sits above siblings in nav-right */
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.hamburger-btn .bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.35s ease, opacity 0.35s ease, width 0.35s ease;
    transform-origin: center;
}

/* Animated X state */
.hamburger-btn.open .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open .bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
.hamburger-btn.open .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   3. Mobile menu overlay / backdrop
   ============================================================ */

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 95;  /* BELOW navbar z-index (100) — so hamburger stays always clickable */
    opacity: 0;
    transition: opacity 0.35s ease;
}

.mobile-overlay.visible {
    display: block;
    opacity: 1;
}

/* ============================================================
   Mobile Nav Drawer — base styles (slide-in from right)
   Activated below 992 px via JS class .mobile-open on .navbar
   ============================================================ */

@media (max-width: 992px) {

    /* --- Navbar Layout ------------------------------------ */
    .nav-container {
        position: relative;
    }

    .hamburger-btn {
        display: flex;
        /* no order needed — naturally last inside nav-right */
    }

    /* Hide extra nav-right items on tablet — shown in mobile drawer instead */
    .nav-right .icon-btn.profile-btn,
    .nav-right .btn-subscribe,
    .nav-right a.icon-btn[aria-label="Website"],
    .nav-right a.icon-btn[aria-label="LinkedIn"],
    .nav-right a.icon-btn[aria-label="Instagram"] {
        display: none;
    }

    /* Hide desktop nav links — become fixed drawer */
    .nav-center {
        position: fixed;
        top: 0;
        right: -320px;         /* start off-screen */
        width: min(320px, 85vw);
        height: 100vh;
        background: linear-gradient(180deg, #111c72 0%, #182f96 100%);
        z-index: 200;          /* above navbar (100) and overlay (95) */
        overflow-y: auto;
        padding: 80px 0 30px;
        transition: right 0.38s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
    }

    /* Open state — triggered by JS adding class to .navbar */
    .navbar.mobile-open .nav-center {
        right: 0;
    }

    /* Mobile nav list — vertical stack */
    .nav-center ul {
        display: flex !important; /* override base hidden */
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 16px;
    }

    .nav-center ul li {
        width: 100%;
    }

    .nav-center a {
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        width: 100%;
        justify-content: center;
        color: rgba(255, 255, 255, 0.9);
    }

    /* Dropdown toggle chevron */
    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    /* Mega menu — accordion inside mobile drawer */
    .mega-menu {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.06);
        border-radius: 10px;
        margin: 4px 0 8px;
        padding: 12px;
    }

    .dropdown-item.show .mega-menu {
        display: block !important;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .mega-menu-heading {
        color: rgba(255, 255, 255, 0.9);
        border-bottom-color: rgba(255, 255, 255, 0.15);
        font-size: 13px;
    }

    .mega-menu-heading i {
        color: #ffd633;
    }

    .nav-center .mega-menu .mega-menu-list a {
        color: rgba(255, 255, 255, 0.75) !important;
        font-size: 13px;
        padding: 7px 10px;
    }

    .nav-center .mega-menu .mega-menu-list a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
        text-decoration: none;
    }

    .events-dropdown-grid {
        grid-template-columns: 1fr;
    }

    .nav-center .mega-menu .events-list a {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    .nav-center .mega-menu .events-list a .event-title {
        color: rgba(255, 255, 255, 0.95);
    }

    .nav-center .mega-menu .events-list a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    .event-desc {
        color: rgba(255, 255, 255, 0.55);
    }

    /* --- Nav Right — compact ----------------------------- */
    .nav-right {
        gap: 8px;
    }

    .btn-subscribe {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Mobile close button inside drawer */
    .mobile-drawer-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 16px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-drawer-header .drawer-brand {
        font-size: 16px;
        font-weight: 700;
        color: #ffffff;
    }

    .mobile-drawer-close {
        background: transparent;
        border: none;
        color: #ffffff;
        font-size: 22px;
        cursor: pointer;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }

    .mobile-drawer-close:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    /* Mobile drawer footer — hidden icons revealed in drawer */
    .mobile-drawer-footer {
        display: block;
        padding: 8px 16px 20px;
        margin-top: 8px;
    }

    .mobile-drawer-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.12);
        margin-bottom: 18px;
    }

    .mobile-drawer-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 18px;
    }

    .mobile-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 12px 8px;
        color: rgba(255, 255, 255, 0.85);
        font-size: 11px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        text-decoration: none;
        transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
        text-align: center;
    }

    .mobile-action-btn i {
        font-size: 18px;
        color: #ffd633;
    }

    .mobile-action-btn:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 215, 51, 0.4);
        transform: translateY(-2px);
        color: #ffffff;
    }

    .mobile-subscribe-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: linear-gradient(135deg, #ffd633, #f0c200);
        color: #000000;
        font-weight: 700;
        font-size: 14px;
        padding: 14px 20px;
        border-radius: 50px;
        text-decoration: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        width: 100%;
    }

    .mobile-subscribe-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 214, 51, 0.45);
        color: #000000;
    }

    .mobile-subscribe-btn i {
        font-size: 15px;
    }
}


/* ============================================================
   4. @media (max-width: 1440px)  — Large Desktop
   ============================================================ */

@media (max-width: 1440px) {

    /* --- Container widths --------------------------------- */
    .main-content,
    .nav-container,
    .footer-container,
    .ai-news-container,
    .search-filters-section,
    .breadcrumb-container,
    .page-header {
        max-width: 1280px;
    }

    /* --- Mega menu width ---------------------------------- */
    .categories-mega-menu {
        width: min(1100px, 90vw);
    }
}


/* ============================================================
   5. @media (max-width: 1200px)  — Desktop / mid-laptop
   ============================================================ */

@media (max-width: 1200px) {

    /* --- Hero -------------------------------------------- */
    .hero-card {
        padding: 0 36px;
    }

    .hero-content h2 {
        font-size: clamp(1.75rem, 3.5vw, 2.4rem);
    }

    /* --- Home layout ------------------------------------- */
    .top-row {
        grid-template-columns: 62% calc(38% - 20px);
    }

    .bottom-row {
        grid-template-columns: 62% calc(38% - 20px);
    }

    /* --- Mega menu --------------------------------------- */
    .categories-mega-menu {
        width: min(960px, 92vw);
    }

    /* --- AI News page ------------------------------------ */
    .ai-news-container {
        grid-template-columns: 1fr;
    }

    .ai-news-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .news-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* --- Page header ------------------------------------- */
    .header-content h1 {
        font-size: clamp(1.6rem, 3vw, 2.2rem);
    }

    /* --- Footer ------------------------------------------ */
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
        gap: 28px;
    }
}


/* ============================================================
   6. @media (max-width: 1024px)  — Laptop
   ============================================================ */

@media (max-width: 1024px) {

    /* --- Navbar ------------------------------------------ */
    .nav-center a {
        padding: 8px 12px;
        font-size: 12px;
    }

    .nav-right {
        gap: 10px;
    }

    .btn-subscribe {
        padding: 8px 18px;
        font-size: 13px;
    }

    /* --- Home layout ------------------------------------- */
    .top-row {
        grid-template-columns: 58% calc(42% - 20px);
    }

    .bottom-row {
        grid-template-columns: 60% calc(40% - 20px);
    }

    /* --- Hero -------------------------------------------- */
    .hero-card {
        padding: 0 28px;
    }

    .hero-content h2 {
        font-size: clamp(1.6rem, 3vw, 2.1rem);
    }

    /* --- News grid --------------------------------------- */
    .news-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    /* --- Events section ---------------------------------- */
    .events-section {
        padding: 30px;
    }

    /* --- Contact ----------------------------------------- */
    .contact-container {
        gap: 28px;
    }

    /* --- Footer ------------------------------------------ */
    .footer-container {
        grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
        gap: 24px;
    }
}


/* ============================================================
   7. @media (max-width: 992px)  — Tablet Landscape
       Hamburger menu is now active (styles above in mobile nav)
   ============================================================ */

@media (max-width: 992px) {

    /* --- Navbar ------------------------------------------ */
    .navbar {
        height: 64px;
    }

    /* --- Home layout — stack panels vertically ----------- */
    .top-row {
        grid-template-columns: 1fr;
    }

    .bottom-row {
        grid-template-columns: 1fr;
    }

    /* Trending panel — horizontal scroll on tablet */
    .trending-panel {
        height: auto;
        padding: 20px;
    }

    .trending-wrapper {
        height: 280px;
    }

    /* --- Hero -------------------------------------------- */
    .hero-card {
        height: auto;
        min-height: 260px;
        padding: 36px 28px;
    }

    .hero-content {
        max-width: 100%;
    }

    /* --- Bottom row right sidebar ----------------------- */
    .right-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    .right-sidebar > * {
        flex: 1 1 280px;
    }

    /* --- News grid --------------------------------------- */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* --- Categories grid --------------------------------- */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- AI News sidebar — horizontal grid -------------- */
    .ai-news-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* --- Newsletter -------------------------------------- */
    .newsletter-section {
        padding: 50px 28px;
        margin-top: 30px;
    }

    .newsletter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .newsletter-form input,
    .btn-subscribe-large {
        width: 100%;
    }

    /* --- Events ----------------------------------------- */
    .events-section {
        padding: 28px 20px;
        margin-top: 30px;
    }

    .timeline-content {
        gap: 15px;
    }

    /* --- FAQ -------------------------------------------- */
    .faq-section {
        padding: 28px 20px;
        margin-top: 30px;
    }

    /* --- Contact ----------------------------------------- */
    .contact-section {
        padding: 28px 20px;
        margin-top: 30px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    /* --- Footer ------------------------------------------ */
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }

    /* --- Section padding reduction ----------------------- */
    .main-content {
        padding: 16px;
    }

    /* --- Page header (AI News page) --------------------- */
    .page-header {
        padding: 50px 30px;
        margin: 0 20px 32px;
    }

    .header-stats {
        flex-wrap: wrap;
        gap: 20px;
    }

    /* --- Search filters ---------------------------------- */
    .secondary-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-dropdown select {
        min-width: 160px;
    }
}


/* ============================================================
   8. @media (max-width: 768px)  — Tablet Portrait
   ============================================================ */

@media (max-width: 768px) {

    /* --- Navbar ------------------------------------------ */
    .navbar {
        height: 60px;
        border-radius: 0 0 10px 10px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .brand h1 {
        font-size: 17px;
    }

    .brand p {
        display: none; /* hide tagline on small screens */
    }

    .logo-icon {
        width: 38px;
        height: 34px;
    }

    /* Reduce right icon buttons */
    .nav-right .icon-btn:not(.profile-btn) {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    /* --- Hero -------------------------------------------- */
    .hero-card {
        padding: 28px 20px;
        min-height: 220px;
        text-align: center;
        flex-direction: column;
        align-items: center;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-content h2 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .hero-content p {
        font-size: 14px;
    }

    .btn-yellow {
        margin: 0 auto;
        width: fit-content;
        min-height: 44px;
    }

    /* --- Home: news grid --------------------------------- */
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-img {
        height: 160px;
    }

    /* --- Home: right sidebar — stack -------------------- */
    .right-sidebar {
        flex-direction: column;
    }

    /* --- Categories grid --------------------------------- */
    .categories-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .category-pill {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* --- Latest news section ----------------------------- */
    .latest-news-card,
    .categories-card,
    .ad-card {
        padding: 20px;
    }

    /* --- News cards (AI News page) ----------------------- */
    .news-list-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* --- Timeline ---------------------------------------- */
    .timeline-content {
        flex-direction: column;
    }

    .event-img {
        width: 100%;
        height: 200px;
        border-radius: 10px;
    }

    .timeline::before {
        left: 18px;
    }

    .timeline-dot {
        left: -7px;
    }

    /* --- Newsletter -------------------------------------- */
    .newsletter-section {
        padding: 40px 20px;
        border-radius: 14px;
    }

    /* --- FAQ -------------------------------------------- */
    .faq-question {
        font-size: 15px;
        padding: 16px;
    }

    /* --- Contact ----------------------------------------- */
    .contact-form {
        padding: 20px;
    }

    /* --- AI news sidebar — single column ---------------- */
    .ai-news-sidebar {
        grid-template-columns: 1fr;
    }

    /* --- AI news page header ----------------------------- */
    .page-header {
        padding: 36px 20px;
        margin: 0 16px 24px;
    }

    .header-stats {
        gap: 16px;
    }

    .stat-value {
        font-size: 18px;
    }

    /* --- Filters ----------------------------------------- */
    .filter-pill {
        padding: 7px 14px;
        font-size: 12px;
        min-height: 36px;
    }

    .type-btn {
        font-size: 13px;
        min-height: 36px;
    }

    /* --- Load more button -------------------------------- */
    .load-more-btn {
        width: 100%;
        justify-content: center;
        min-height: 50px;
    }

    /* --- Footer ------------------------------------------ */
    .footer {
        padding: 48px 16px 16px;
        margin-top: 40px;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    /* --- Section spacing --------------------------------- */
    .main-content {
        padding: 12px;
    }

    .newsletter-section,
    .events-section,
    .faq-section,
    .contact-section {
        margin-top: 20px;
    }
}


/* ============================================================
   9. @media (max-width: 576px)  — Large Mobile
   ============================================================ */

@media (max-width: 576px) {

    /* --- Navbar ------------------------------------------ */
    .brand p {
        display: none;
    }

    /* Hide some social icon buttons to avoid overflow */
    .nav-right .icon-btn:not(.profile-btn):not([aria-label="Search"]) {
        display: none;
    }

    .nav-right {
        gap: 6px;
    }

    /* --- Mega Menu & Dropdowns --- */
    .mega-menu-grid,
    .events-dropdown-grid {
        grid-template-columns: 1fr;
    }

    /* --- Hero -------------------------------------------- */
    .hero-card {
        padding: 24px 16px;
        border-radius: 14px;
    }

    .hero-content h2 {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
    }

    .btn-yellow {
        padding: 11px 22px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    /* --- Trending panel ---------------------------------- */
    .trending-panel {
        padding: 16px;
    }

    .trending-thumb {
        width: 50px;
        height: 50px;
    }

    .trending-info h4 {
        font-size: 13px;
    }

    /* --- News grid --------------------------------------- */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .news-list-grid {
        gap: 16px;
    }

    /* --- Categories -------------------------------------- */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-pill {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* --- Section headers --------------------------------- */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-left h3 {
        font-size: clamp(1rem, 4.5vw, 1.2rem);
    }

    /* --- News cards -------------------------------------- */
    .news-list-item .item-content {
        padding: 18px;
    }

    .news-list-item h3 {
        font-size: 16px;
    }

    .news-list-item .img-wrapper {
        height: 180px;
    }

    /* --- Events ------------------------------------------ */
    .event-details h4 {
        font-size: 17px;
    }

    .event-meta {
        flex-direction: column;
        gap: 6px;
    }

    .btn-primary-outline {
        min-height: 44px;
        width: 100%;
        text-align: center;
    }

    /* --- Newsletter -------------------------------------- */
    .newsletter-form {
        gap: 12px;
    }

    .newsletter-form input {
        padding: 12px 18px;
        font-size: 14px;
    }

    .btn-subscribe-large {
        min-height: 48px;
        font-size: 14px;
    }

    /* --- Contact ----------------------------------------- */
    .contact-left h3 {
        font-size: 1.3rem;
    }

    .info-item span {
        font-size: 13px;
    }

    .btn-primary {
        min-height: 48px;
        font-size: 14px;
    }

    /* --- Footer ------------------------------------------ */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-col {
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-col ul {
        align-items: center;
    }

    .mini-newsletter {
        max-width: 340px;
        margin: 0 auto;
    }

    /* --- FAQ -------------------------------------------- */
    .faq-question {
        font-size: 14px;
        padding: 14px;
    }

    /* --- Form buttons ------------------------------------ */
    .btn-subscribe {
        padding: 9px 16px;
        font-size: 13px;
    }

    /* --- AI News page header ----------------------------- */
    .page-header {
        padding: 30px 16px;
        margin: 0 12px 20px;
    }

    .header-stats {
        flex-direction: column;
        gap: 12px;
    }

    /* --- Search ------------------------------------------ */
    .search-bar {
        padding: 4px 16px;
    }

    .search-bar input {
        font-size: 15px;
        padding: 12px 0;
    }

    /* --- Filters ----------------------------------------- */
    .topic-filters {
        gap: 8px;
    }

    .filter-pill {
        font-size: 12px;
        padding: 7px 12px;
    }

    .content-type-filters {
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .type-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* --- Scroll to top ----------------------------------- */
    .scroll-to-top {
        bottom: 20px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 17px;
    }

    /* --- Sidebar widgets --------------------------------- */
    .sidebar-widget {
        padding: 18px;
    }

    .widget-title {
        font-size: 15px;
    }
}


/* ============================================================
   10. @media (max-width: 480px)  — Small Mobile
   ============================================================ */

@media (max-width: 480px) {

    /* --- Hero -------------------------------------------- */
    .hero-card {
        padding: 20px 14px;
    }

    .hero-content h2 {
        font-size: clamp(1.25rem, 6.5vw, 1.6rem);
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 13px;
    }

    /* --- News items -------------------------------------- */
    .news-list-item .img-wrapper {
        height: 160px;
    }

    .news-content h4 {
        font-size: 15px;
    }

    /* --- Trending ---------------------------------------- */
    .trending-wrapper {
        height: 240px;
    }

    .trending-card {
        gap: 10px;
        padding: 8px;
    }

    .trending-thumb {
        width: 44px;
        height: 44px;
    }

    /* --- FAQ -------------------------------------------- */
    .faq-section {
        padding: 20px 14px;
    }

    /* --- Contact ----------------------------------------- */
    .contact-section {
        padding: 20px 14px;
    }

    /* --- Events ------------------------------------------ */
    .events-section {
        padding: 20px 14px;
    }

    /* --- Newsletter -------------------------------------- */
    .newsletter-section {
        padding: 32px 14px;
    }

    /* --- Footer ------------------------------------------ */
    .footer {
        padding: 36px 12px 12px;
    }

    /* --- Nav brand --------------------------------------- */
    .brand h1 {
        font-size: 15px;
    }

    /* --- AI News page header ----------------------------- */
    .page-header {
        margin: 0 8px 16px;
        padding: 24px 14px;
    }

    /* --- Load more --------------------------------------- */
    .load-more-btn {
        font-size: 14px;
        padding: 13px 24px;
    }

    /* --- Section card padding ---------------------------- */
    .latest-news-card,
    .categories-card {
        padding: 16px;
    }
}


/* ============================================================
   11. @media (max-width: 360px)  — Extra-small Devices
   ============================================================ */

@media (max-width: 360px) {

    /* --- Global ------------------------------------------ */
    .main-content {
        padding: 8px;
    }

    /* --- Navbar ------------------------------------------ */
    .navbar {
        height: 56px;
    }

    .nav-container {
        padding: 0 10px;
    }

    .brand h1 {
        font-size: 14px;
    }

    .logo-icon {
        width: 32px;
        height: 30px;
    }

    .btn-subscribe {
        padding: 7px 12px;
        font-size: 12px;
    }

    /* --- Hero -------------------------------------------- */
    .hero-card {
        padding: 18px 12px;
        border-radius: 12px;
    }

    .hero-content h2 {
        font-size: 1.2rem;
    }

    .btn-yellow {
        font-size: 13px;
        padding: 10px 18px;
        gap: 8px;
    }

    /* --- Cards ------------------------------------------- */
    .news-list-item .item-content {
        padding: 14px;
    }

    .news-list-item h3 {
        font-size: 14px;
    }

    .news-list-item p {
        font-size: 13px;
    }

    /* --- Categories -------------------------------------- */
    .category-pill {
        font-size: 12px;
        padding: 9px 12px;
    }

    /* --- Footer ------------------------------------------ */
    .footer-container {
        gap: 20px;
    }

    .footer-brand h2 {
        font-size: 18px;
    }

    /* --- Contact ----------------------------------------- */
    .contact-socials a {
        width: 36px;
        height: 36px;
    }

    /* --- AI News ----------------------------------------- */
    .page-header {
        margin: 0 4px 12px;
        padding: 20px 12px;
    }

    .header-content h1 {
        font-size: 1.4rem;
    }

    .stat-value {
        font-size: 16px;
    }

    /* --- Filter pills ------------------------------------ */
    .filter-pill {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* --- Sidebar ----------------------------------------- */
    .sidebar-widget {
        padding: 14px;
    }

    /* --- Scroll to top ----------------------------------- */
    .scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 16px;
        right: 12px;
    }

    /* --- Timeline ---------------------------------------- */
    .timeline {
        padding-left: 14px;
    }

    .timeline::before {
        left: 14px;
    }

    .timeline-dot {
        left: -8px;
        width: 10px;
        height: 10px;
    }

    .event-img {
        height: 160px;
    }
}


/* ============================================================
   12. Accessibility & Performance helpers
   ============================================================ */

/* Visible focus indicator */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #ffd633;
    outline-offset: 2px;
}

/* Lazy-load images — prevent layout shift */
img[loading="lazy"] {
    background-color: #e2e8f0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .trending-list {
        animation: none !important;
    }
}

/* Ensure touch targets are at least 44×44 px */
@media (max-width: 992px) {
    a, button, [role="button"] {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Exception: inline text links */
    p a, li a, .breadcrumb a, .footer-col ul a,
    .compact-info a, .tag, .view-all {
        min-height: unset;
        display: inline;
    }
}

/* Scrollbar — thin on mobile browsers */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
}
