/**
 * RevvedUpCars Mobile UX Enhancements
 * Comprehensive mobile optimization for better user experience
 */

/* ================================
   Global Mobile Improvements
   ================================ */

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

@media (max-width: 992px) {
    a, button {
        -webkit-tap-highlight-color: rgba(197, 214, 49, 0.3);
    }
    
    button, .btn, .revved-menu-toggle {
        touch-action: manipulation;
    }
}

/* ================================
   Mobile Header Improvements
   ================================ */
@media (max-width: 992px) {
    .revved-header {
        position: sticky;
        top: 0;
        z-index: 9999;
    }
    
    .revved-header-content {
        padding: 8px 16px;
    }
    
    .revved-logo img {
        max-height: 36px;
    }
    
    .revved-menu-toggle {
        width: 48px;
        height: 48px;
        padding: 12px;
    }
    
    .revved-search {
        order: -1;
        flex: 1;
        max-width: 55%;
        margin-right: auto;
        margin-left: 10px;
    }
    
    .revved-search-input {
        width: 100%;
        padding: 10px 14px;
        font-size: 16px;
    }
}

/* ================================
   Mobile Navigation Improvements
   ================================ */
@media (max-width: 992px) {
    .revved-nav {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .revved-menu > li > a {
        padding: 16px 0;
        font-size: 17px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .revved-menu .sub-menu {
        padding: 8px 16px;
        margin-top: 8px;
    }
    
    .revved-menu .sub-menu li a {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* ================================
   Mobile Typography Improvements
   ================================ */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1, .h1 {
        font-size: 26px;
        line-height: 1.2;
    }
    
    h2, .h2 {
        font-size: 22px;
        line-height: 1.25;
    }
    
    h3, .h3 {
        font-size: 18px;
    }
    
    h4, .h4 {
        font-size: 16px;
    }
    
    .card-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .card-excerpt {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .section-title {
        font-size: 22px;
    }
}

/* ================================
   Mobile Card/Grid Improvements
   ================================ */
@media (max-width: 768px) {
    .article-grid,
    .post-grid,
    .car-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-grid-4,
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .article-card,
    .post-card,
    .story-card {
        border-radius: 12px;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .hero-card-1 {
        min-height: 300px;
    }
    
    .hero-card-1 .card-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .article-grid-4,
    .trending-grid {
        grid-template-columns: 1fr;
    }
    
    .card-image {
        height: 200px;
    }
}

/* ================================
   Mobile Footer Improvements
   ================================ */
@media (max-width: 768px) {
    .revved-footer {
        padding: 40px 16px 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-social a {
        width: 44px;
        height: 44px;
    }
    
    .footer-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }
    
    .footer-menu li {
        margin: 0;
    }
    
    .footer-menu a {
        padding: 8px;
        display: inline-block;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 12px;
        padding-top: 20px;
    }
}

/* ================================
   Mobile Spacing Improvements
   ================================ */
@media (max-width: 768px) {
    .container,
    .revved-container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    section {
        padding-top: 32px;
        padding-bottom: 32px;
    }
    
    .section-header {
        margin-bottom: 20px;
    }
}

/* ================================
   Mobile Button Improvements
   ================================ */
@media (max-width: 768px) {
    .btn,
    button:not(.revved-menu-toggle),
    input[type="submit"],
    input[type="button"] {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .view-all-link,
    .read-more {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ================================
   Mobile Form Improvements
   ================================ */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 8px;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
}

/* ================================
   Mobile Single Article Improvements
   ================================ */
@media (max-width: 768px) {
    .single-post-header {
        padding: 20px 0;
    }
    
    .single-post-title {
        font-size: 24px;
        line-height: 1.25;
    }
    
    .single-post-content {
        font-size: 17px;
        line-height: 1.7;
    }
    
    .single-post-content p {
        margin-bottom: 1.25em;
    }
    
    .single-post-content img {
        border-radius: 8px;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ================================
   Mobile Scroll Improvements
   ================================ */
@media (max-width: 992px) {
    html {
        scroll-behavior: smooth;
    }
    
    .horizontal-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .horizontal-scroll {
        -ms-overflow-style: none;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .horizontal-scroll > * {
        scroll-snap-align: start;
    }
}

/* ================================
   Mobile Accessibility Improvements
   ================================ */
@media (max-width: 992px) {
    a:focus,
    button:focus,
    input:focus {
        outline: 2px solid #C5D631;
        outline-offset: 2px;
    }
}

/* ================================
   Mobile Performance
   ================================ */
@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll !important;
    }
}

/* ================================
   Mobile Submenu Toggle
   ================================ */
@media (max-width: 992px) {
    .menu-item-has-children .sub-menu {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .menu-item-has-children.active .sub-menu {
        max-height: 500px;
        opacity: 1;
    }
    
    .menu-item-has-children > a::after {
        content: '+';
        font-size: 18px;
        font-weight: 300;
        margin-left: auto;
        transition: transform 0.3s ease;
    }
    
    .menu-item-has-children.active > a::after {
        content: '−';
    }
}

/* ================================
   Body Scroll Lock When Menu Open
   ================================ */
body.menu-open {
    overflow: hidden;
}
