/**
 * Responsive Enhancements
 * 
 * Extra responsive styling en optimalisaties:
 * - Fluid typography aanpassingen
 * - Touch-friendly targets
 * - Ultra-wide display optimalisaties
 * - Print styles
 * - Accessibility verbeteringen
 *
 * @package Hillegom_Online
 */

/* ============================================================
   ULTRA-WIDE DISPLAYS (2000px+)
   ============================================================ */

@media (min-width: 2000px) {
    .content-wrapper {
        max-width: var(--container-width-ultra);
    }

    .header__wrap,
    .nav__wrap {
        max-width: var(--container-width-ultra);
    }

    /* Increase spacing on ultra-wide */
    .site-content {
        padding: calc(var(--spacing-xl) * 1.5) 0;
    }

    .hero-slider {
        height: 600px;
    }

    /* Optimize grid for ultra-wide */
    .foto-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .nieuws-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }

    /* Enhanced typography for large screens */
    .hero-title {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.25rem;
    }
}

/* ============================================================
   LARGE DESKTOP (1800px)
   ============================================================ */

@media (min-width: 1600px) and (max-width: 1999px) {
    .content-wrapper {
        max-width: var(--container-width-large);
    }

    .foto-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .nieuws-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* ============================================================
   TABLET OPTIMIZATIONS
   ============================================================ */

@media (min-width: 768px) and (max-width: 1024px) {
    /* Touch-friendly tap targets */
    .primary-menu > li > a {
        min-height: 44px;
        padding: 0 var(--spacing-md);
    }

    .filter-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .share-btn {
        min-height: 44px;
        padding: var(--spacing-sm) var(--spacing-lg);
    }

    /* Optimize hero for tablets */
    .hero-slider {
        height: 450px;
    }

    .hero-overlay {
        padding: var(--spacing-xl);
    }

    /* Better spacing for tablet */
    .section-header {
        margin-bottom: var(--spacing-md);
    }

    /* Optimize cards for tablets */
    .nieuws-card {
        display: grid;
        grid-template-columns: 200px 1fr;
        grid-template-rows: auto;
    }

    .nieuws-thumbnail {
        grid-row: 1 / -1;
        aspect-ratio: 1;
    }
}

/* ============================================================
   MOBILE OPTIMIZATIONS
   ============================================================ */

@media (max-width: 768px) {
    /* Ensure all interactive elements are touch-friendly */
    a,
    button,
    .filter-btn,
    .share-btn,
    .read-more {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Improve text readability on mobile */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Prevent horizontal scroll */
    .site {
        overflow-x: hidden;
    }

    /* Mobile-friendly tables */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack agenda items vertically on mobile */
    .agenda-item {
        padding: var(--spacing-sm);
    }

    .agenda-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    /* Improve form inputs on mobile */
    input[type="text"],
    input[type="email"],
    input[type="search"],
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Mobile-friendly footer */
    .footer-widgets-row {
        gap: var(--spacing-lg);
    }

    /* Optimize hero for mobile */
    .hero-title {
        font-size: 1.5rem;
    }

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

    /* Mobile content spacing */
    .entry-content > * + * {
        margin-top: var(--spacing-sm);
    }

    /* Featured image full width on mobile (nieuwsberichten en fotoreportages) */
    .single-post .entry-featured-image,
    .single-fotoreportage .entry-featured-image {
        float: none;
        max-width: 100%;
        margin: 0 0 1.5rem 0;
    }
}

/* ============================================================
   SMALL MOBILE (320px-480px)
   ============================================================ */

@media (max-width: 480px) {
    /* Reduce spacing on very small screens */
    :root {
        --spacing-2xl: 2rem;
        --spacing-xl: 1.5rem;
        --spacing-lg: 1rem;
    }

    /* Compact header */
    .header__top {
        padding: var(--spacing-xs);
    }

    /* Stack social counters vertically */
    .social-counter-link {
        flex-direction: column;
        text-align: center;
    }

    /* Compact cards */
    .nieuws-content {
        padding: var(--spacing-md);
    }

    /* Smaller hero */
    .hero-slider {
        height: 250px;
    }

    .hero-overlay {
        padding: var(--spacing-md);
    }

    /* Compact pagination */
    .pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        font-size: var(--font-size-xs);
    }

    /* Smaller buttons */
    .filter-btn {
        min-height: 36px;
        min-width: 36px;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ============================================================
   LANDSCAPE MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 900px) and (orientation: landscape) {
    /* Reduce header height in landscape */
    .header__top {
        height: 60px;
    }

    .logo__wrap {
        width: 150px;
    }

    .hero-slider {
        height: 300px;
    }

    /* Compact navigation */
    .main-navigation {
        height: 40px;
    }

    .nav__wrap {
        padding: 0 var(--spacing-sm);
    }
}

/* ============================================================
   HIGH RESOLUTION DISPLAYS (Retina)
   ============================================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders */
    .nieuws-card,
    .foto-card,
    .widget,
    .agenda-item {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    /* Crisper text */
    body {
        -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;
    }

    /* Keep essential transforms but remove transitions */
    .nieuws-card:hover,
    .foto-card:hover,
    .share-btn:hover {
        transform: none;
    }
}

/* ============================================================
   DARK MODE SUPPORT (Optional)
   ============================================================ */

@media (prefers-color-scheme: dark) {
    /* Add dark mode variables if needed in future */
    /* This is a placeholder for potential dark mode implementation */
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    /* Hide non-essential elements */
    .site-header,
    .main-navigation,
    .widget-area,
    .site-footer,
    .share-buttons,
    .post-navigation,
    .pagination,
    .hero-nav,
    .hero-dots,
    .filter-btn,
    .menu-toggle {
        display: none !important;
    }

    /* Full width content */
    .content-wrapper {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    /* Optimize typography for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    h1 {
        font-size: 24pt;
    }

    h2 {
        font-size: 18pt;
    }

    h3 {
        font-size: 14pt;
    }

    /* Break content intelligently */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

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

    .entry-content {
        orphans: 3;
        widows: 3;
    }

    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-weight: normal;
    }

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    /* Remove shadows and transitions */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        transition: none !important;
    }
}

/* ============================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================ */

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--primary-green);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-green);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .primary-menu > li > a {
        border-bottom-width: 4px;
    }

    .filter-btn {
        border-width: 3px;
    }

    .nieuws-card,
    .foto-card,
    .widget {
        border: 2px solid var(--text-color);
    }
}

/* ============================================================
   UTILITY RESPONSIVE CLASSES
   ============================================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

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

/* ============================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================ */

/* GPU acceleration for smooth animations */
.nieuws-card,
.foto-card,
.hero-slide,
.primary-menu .sub-menu {
    will-change: transform;
}

/* Lazy load images optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Smooth scrolling for modern browsers */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ============================================================
   CONTAINER QUERIES (Future-proofing)
   ============================================================ */

@supports (container-type: inline-size) {
    /* Container queries will be added as browser support improves */
    /* This is a placeholder for future implementation */
}
