/* ==========================================
   The AI Morning Read - Responsive Styles
   ========================================== */

/* ==========================================
   Large Desktop (1440px and up)
   ========================================== */

@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
    
    .hero {
        min-height: 75vh;
    }
}

/* ==========================================
   Desktop (1024px - 1439px)
   ========================================== */

@media (max-width: 1439px) {
    .episode-infographic {
        width: 180px;
        height: 108px;
    }
}

/* ==========================================
   Tablet (768px - 1023px)
   ========================================== */

@media (max-width: 1023px) {
    .hero {
        min-height: 60vh;
    }
    
    .hero-content {
        padding: var(--spacing-xl);
        margin-top: 5vh;
    }
    
    .hero-ai {
        font-size: 4.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
    }
    
    .episode-header {
        flex-direction: column;
    }
    
    .episode-infographic {
        width: 100%;
        height: 200px;
    }
    
    .support-card {
        flex-direction: column;
        text-align: center;
    }
    
    .support-content {
        text-align: center;
    }
}

/* ==========================================
   Mobile Landscape / Small Tablet (640px - 767px)
   ========================================== */

@media (max-width: 767px) {
    :root {
        --spacing-lg: 1.25rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 3rem;
    }
    
    .hero {
        min-height: 55vh;
    }
    
    .hero-content {
        padding: var(--spacing-lg);
    }
    
    .hero-ai {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
        letter-spacing: 0.15em;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .episode-card {
        border-radius: var(--radius-md);
    }
    
    .episode-header {
        padding: var(--spacing-md);
    }
    
    .episode-infographic {
        height: 180px;
    }
    
    .episode-title {
        font-size: 1.125rem;
    }
    
    .episode-description {
        font-size: 0.875rem;
    }
    
    .episode-footer {
        padding: var(--spacing-md);
    }
    
    .episode-actions {
        flex-direction: column;
    }
    
    .btn-episode {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* ==========================================
   Mobile Portrait (320px - 639px)
   ========================================== */

@media (max-width: 639px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.25rem;
        --spacing-2xl: 1.75rem;
        --spacing-3xl: 2.5rem;
    }
    
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero {
        min-height: 50vh;
    }
    
    .hero-ai {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }
    
    .hero-tagline {
        font-size: 0.9375rem;
    }
    
    .section-title {
        font-size: 1.375rem;
    }
    
    .episodes-divider {
        margin-bottom: var(--spacing-xl);
    }
    
    .episode-infographic {
        height: 160px;
    }
    
    .episode-meta {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .episode-title {
        font-size: 1rem;
    }
    
    .episode-description {
        -webkit-line-clamp: 2;
    }
    
    .sources-list {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .support-card {
        padding: var(--spacing-lg);
    }
    
    .support-icon {
        width: 48px;
        height: 48px;
    }
    
    .support-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .support-title {
        font-size: 1.125rem;
    }
    
    .support-text {
        font-size: 0.875rem;
    }
    
    .btn-coffee {
        width: 100%;
    }
    
    /* Modal Adjustments */
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-close {
        top: -36px;
        width: 32px;
        height: 32px;
    }
    
    .modal-close svg {
        width: 20px;
        height: 20px;
    }
    
    .player-content {
        padding: var(--spacing-sm);
    }
}

/* ==========================================
   Small Mobile (320px and below)
   ========================================== */

@media (max-width: 359px) {
    .hero-ai {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .episode-title {
        font-size: 0.9375rem;
    }
}

/* ==========================================
   High DPI Screens
   ========================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image {
        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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================
   Dark Mode Support (Optional)
   ========================================== */

@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .hero {
        min-height: auto;
        page-break-after: always;
    }
    
    .hero-buttons,
    .btn-episode,
    .btn-coffee,
    .btn-load-more,
    .modal,
    .support-section {
        display: none !important;
    }
    
    .episode-card {
        box-shadow: none;
        border: 1px solid var(--color-gray-300);
        break-inside: avoid;
    }
    
    .episode-description {
        -webkit-line-clamp: unset;
    }
    
    .footer {
        border-top: 1px solid var(--color-gray-300);
    }
}

/* ==========================================
   Landscape Orientation Adjustments
   ========================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }
    
    .hero-content {
        margin-top: 0;
        padding: var(--spacing-md);
    }
    
    .hero-ai {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: row;
    }
}

/* ==========================================
   Touch Device Optimizations
   ========================================== */

@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .episode-card:hover {
        transform: none;
    }
    
    .episode-infographic:hover img {
        transform: none;
    }
    
    .episode-infographic-overlay {
        opacity: 0;
    }
    
    /* Make touch targets larger */
    .btn {
        min-height: 48px;
    }
    
    .btn-episode {
        min-height: 44px;
    }
    
    .episode-read-more {
        padding: var(--spacing-sm) 0;
    }
    
    .source-link {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}
