/**
 * Responsive Styles - Mobile First Design
 */

/* Tablet and below */
@media (max-width: 1024px) {
    .header-inner {
        padding: 0.75rem 0;
    }
    
    .hero-section {
        padding: 4rem 0;
    }
    
    .about-item {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-item.reverse {
        direction: ltr;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .post-content-wrapper {
        padding: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header */
    .header-inner {
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: flex;
        order: 3;
    }
    
    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--darker-bg);
        padding: 5rem 2rem 2rem;
        transition: left 0.4s ease;
        z-index: 9999;
        overflow-y: auto;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .nav-menu-wrapper.active {
        left: 0;
    }
    
    .primary-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .primary-menu > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .primary-menu a {
        padding: 1rem 0;
        border-radius: 0;
    }
    
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        margin-top: 0.5rem;
        display: none;
    }
    
    .menu-item-has-children.open .sub-menu {
        display: block;
    }
    
    .header-actions {
        order: 2;
        gap: 0.3rem;
    }
    
    .header-action-btn {
        padding: 0.5rem;
    }
    
    .header-action-btn .lang-text,
    .header-action-btn span:not(.hamburger) {
        display: none;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta-buttons {
        flex-direction: column;
    }
    
    .cta-button {
        width: 100%;
        justify-content: center;
    }
    
    .app-info-table {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .info-item {
        padding: 1rem;
    }
    
    /* Blog Grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Single Post */
    .post-featured-image {
        height: 300px;
    }
    
    .post-featured-image.parallax-image {
        background-attachment: scroll;
    }
    
    .post-content-wrapper {
        margin-top: -50px;
        padding: 1.5rem;
    }
    
    .entry-title {
        font-size: 1.75rem;
    }
    
    .entry-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }
    
    .entry-content h1 {
        font-size: 1.75rem;
        padding-left: 1rem;
    }
    
    .entry-content h2 {
        font-size: 1.5rem;
    }
    
    .entry-content h3 {
        font-size: 1.25rem;
    }
    
    .entry-content h4 {
        font-size: 1.1rem;
    }
    
    .entry-content h5 {
        font-size: 1rem;
    }
    
    .entry-content p {
        text-indent: 1rem;
        font-size: 1rem;
    }
    
    .share-buttons {
        gap: 0.5rem;
    }
    
    .share-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .share-btn span {
        display: none;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin: 0 auto;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
    .comment-body {
        flex-direction: column;
    }
    
    .comment-avatar {
        align-self: center;
    }
    
    /* Footer */
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-menu {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    /* Screenshots */
    .screenshots-carousel {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.25rem;
    }
    
    .app-info-table {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .search-popup-content {
        padding: 1rem;
    }
    
    .search-field {
        font-size: 1rem;
        padding: 1rem 3.5rem 1rem 1rem;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .post-featured-image {
        height: 250px;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .search-popup,
    .social-share,
    .post-navigation,
    .comments-area,
    .back-to-top {
        display: none;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .post-content-wrapper {
        box-shadow: none;
        background: #fff;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-logo,
    .blog-card-image img,
    .post-featured-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-bg: #0a0e27;
        --darker-bg: #060a1f;
    }
}

/* Utilities */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .header-action-btn,
    .cta-button,
    .blog-card-readmore {
        min-height: 44px;
        min-width: 44px;
    }
    
    .primary-menu a {
        padding: 1rem;
    }
}
