/* ===================================
   Field Stdio - Responsive Styles
   =================================== */

/* Tablet Landscape and Smaller (1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .hero-text h1 {
        font-size: 2.25rem;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .picks-grid {
        grid-template-columns: 1fr;
    }

    .featured-pick {
        grid-row: auto;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    :root {
        font-size: 15px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    /* Header */
    .main-nav {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: var(--color-bg);
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: 0;
    }

    .main-nav li {
        border-bottom: 1px solid var(--color-border);
    }

    .main-nav a {
        display: block;
        padding: var(--spacing-md) 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Hero */
    .hero {
        padding: var(--spacing-xl) 0;
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: flex-start;
    }

    /* Sections */
    .latest-posts,
    .categories-section,
    .editors-picks,
    .posts-listing,
    .about-section,
    .contact-section,
    .additional-info,
    .continue-exploring {
        padding: var(--spacing-xl) 0;
    }

    .newsletter-cta {
        padding: var(--spacing-xl) 0;
    }

    /* Posts Grid */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

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

    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Page Header */
    .page-header {
        padding: var(--spacing-xl) 0;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    /* Article */
    .article-header {
        padding: var(--spacing-md) 0;
    }

    .article-header h1 {
        font-size: 1.75rem;
    }

    .article-subtitle {
        font-size: 1rem;
    }

    .article-meta {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }

    .article-stats {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .article-body {
        padding: var(--spacing-lg) 0;
    }

    /* Related Posts */
    .related-grid {
        grid-template-columns: 1fr;
    }

    /* Newsletter Form */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }

    /* Filters */
    .filters-wrapper {
        gap: var(--spacing-sm);
    }

    .search-box {
        max-width: 100%;
    }

    .category-filters {
        gap: var(--spacing-xs);
    }

    .filter-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    /* Pagination */
    .pagination {
        gap: var(--spacing-xs);
        flex-wrap: wrap;
    }

    .page-btn,
    .page-num {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* About Page */
    .standards-grid {
        grid-template-columns: 1fr;
    }

    .contributors-grid {
        grid-template-columns: 1fr;
    }

    /* Share Buttons */
    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
    }

    /* Thank You */
    .thank-you-actions {
        flex-direction: column;
    }

    .thank-you-actions .btn {
        width: 100%;
    }

    /* Tables */
    .cookie-table {
        font-size: 0.875rem;
    }

    .cookie-table th,
    .cookie-table td {
        padding: var(--spacing-xs);
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 2.5rem;
    }

    .container,
    .container-narrow {
        padding: 0 var(--spacing-sm);
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.125rem; }

    /* Header */
    .header-content {
        padding: var(--spacing-xs) 0;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    /* Hero */
    .hero-text h1 {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9375rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }

    /* Post Cards */
    .post-content {
        padding: var(--spacing-sm);
    }

    .post-content h3 {
        font-size: 1.125rem;
    }

    .post-meta {
        font-size: 0.8125rem;
        gap: var(--spacing-sm);
    }

    /* Category Boxes */
    .category-box {
        padding: var(--spacing-md);
    }

    .category-icon {
        font-size: 2rem;
    }

    /* Page Header */
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* Article */
    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-body .lead {
        font-size: 1rem;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .author-name {
        font-size: 0.9375rem;
    }

    .author-title {
        font-size: 0.8125rem;
    }

    /* Newsletter */
    .cta-content h2 {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer-column h3 {
        font-size: 1.25rem;
    }

    .footer-column h4 {
        font-size: 1rem;
    }

    /* Contact */
    .contact-info-box,
    .contact-form-box {
        padding: var(--spacing-md);
    }

    .contact-icon {
        font-size: 1.25rem;
    }

    /* Form */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem;
        font-size: 0.9375rem;
    }

    /* Thank You */
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    /* Contributors */
    .contributor-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }

    /* Method Steps */
    .method-step {
        gap: var(--spacing-sm);
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* Tables */
    .cookie-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8125rem;
    }

    /* Map Section */
    .map-container iframe {
        height: 300px;
    }

    .map-details {
        grid-template-columns: 1fr;
    }

    .map-detail-item {
        padding: var(--spacing-sm);
    }
}

/* Extra Small Mobile (360px) */
@media (max-width: 360px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }

    .hero-text h1 {
        font-size: 1.25rem;
    }

    .article-header h1 {
        font-size: 1.25rem;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .category-badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .mobile-menu-toggle,
    .newsletter-cta,
    .footer,
    .share-section,
    .related-posts,
    .filters-section,
    .pagination,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .article-body {
        max-width: 100%;
    }

    blockquote {
        border-left: 3px solid #000;
        padding-left: 1em;
        font-style: italic;
    }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: var(--spacing-lg) 0;
    }

    .page-header {
        padding: var(--spacing-lg) 0;
    }

    .main-nav {
        height: calc(100vh - 50px);
        overflow-y: auto;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp borders and shadows for retina displays */
    .post-card,
    .category-box,
    .btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

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

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --color-text: #f9fafb;
        --color-text-light: #d1d5db;
        --color-bg: #111827;
        --color-bg-alt: #1f2937;
        --color-border: #374151;
    }

    .header {
        background-color: var(--color-bg-dark);
    }

    .post-card,
    .category-box,
    .contact-info-box,
    .contact-form-box {
        background-color: var(--color-bg-alt);
    }
    */
}

/* Container Queries Support (Modern Browsers) */
@supports (container-type: inline-size) {
    .posts-grid {
        container-type: inline-size;
    }

    @container (max-width: 600px) {
        .post-card {
            font-size: 0.9rem;
        }
    }
}

/* Focus Visible for Accessibility */
@media (hover: hover) and (pointer: fine) {
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .filter-btn,
    .page-btn {
        min-height: 44px;
        min-width: 44px;
    }

    a,
    button {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    }
}