﻿/* Apple-style Responsive Design */

/* Large Desktop (1920px and up) */
@media screen and (min-width: 1920px) {
    #ContentArea {
        max-width: 1680px;
    }

    .TodayPickHeadline h3 {
        font-size: var(--text-4xl);
    }

    .TodayPickBigOne .PickPostTitle a {
        font-size: var(--text-3xl);
    }
}

/* Tablet Landscape (835px to 1067px) */
@media screen and (max-width: 1067px) {
    #ContentArea {
        padding: 0 var(--space-md);
    }

    #FirstRow {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .TodayPick23 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }

    #ThirdRow .row {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .TodayPickHeadline h3 {
        font-size: var(--text-2xl);
    }
}

/* Tablet Portrait (735px to 834px) */
@media screen and (max-width: 834px) {
    #SecondRow .row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    .TodayPickBigOne .TextPart {
        padding: var(--space-2xl);
    }

    .TodayPickBigOne .PickPostTitle a {
        font-size: var(--text-xl);
    }

    .TodayPickBigOne .PickPostTeaser a {
        font-size: var(--text-base);
    }
}

/* Large Phone (428px to 734px) */
@media screen and (max-width: 734px) {
    :root {
        --text-base: 16px;
        --text-lg: 19px;
        --text-xl: 24px;
        --text-2xl: 32px;
        --text-3xl: 40px;
        --text-4xl: 48px;
    }

    #ContentArea {
        padding: 0 var(--space-sm);
    }

    #FirstRow, #SecondRow, #ThirdRow, #FourthRow {
        margin-bottom: var(--space-3xl);
    }

    .TodayPick23 {
        grid-template-columns: 1fr;
    }

    #SecondRow .row {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .MostRecent {
        padding: var(--space-xl);
        margin-top: var(--space-xl);
    }

    .TodayMostRecent {
        flex-direction: column;
        gap: var(--space-md);
    }

        .TodayMostRecent .PickPostImageThumb {
            width: 100%;
            height: 200px;
        }

    #ThirdRow .FourSmallerPiece .TodayPickPost {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    #ThirdRow .FourSmallerPiece .PickPostImageThumb {
        width: 100%;
        height: 200px;
        order: -1;
    }
}

/* Small Phone (375px to 427px) */
@media screen and (max-width: 427px) {
    .TodayPickBigOne .TodayPickPost {
        aspect-ratio: 4/3;
    }

    .TodayPickBigOne .TextPart {
        padding: var(--space-xl);
    }

    .TodayPickBigOne .PickPostTitle a {
        font-size: var(--text-lg);
        -webkit-line-clamp: 3;
    }

    .TodayPickHeadline h3 {
        font-size: var(--text-xl);
    }

    .TodayPick23 .TodayPickPost {
        aspect-ratio: 16/12;
    }
}

/* Extra Small Phone (320px to 374px) */
@media screen and (max-width: 374px) {
    :root {
        --space-xs: 2px;
        --space-sm: 4px;
        --space-md: 8px;
        --space-lg: 12px;
        --space-xl: 16px;
        --space-2xl: 24px;
        --space-3xl: 32px;
        --space-4xl: 48px;
    }

    body {
        font-size: 14px;
    }

    .TodayPickBigOne .PickPostTitle a {
        font-size: var(--text-base);
    }

    .premium-outline {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* High Resolution Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi), screen and (min-resolution: 2dppx) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .PickPostImageThumb img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .TodayPickPost {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

        .TodayPickPost:active {
            transform: scale(0.98);
            transition: transform 0.1s;
        }

    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Landscape Orientation */
@media screen and (orientation: landscape) and (max-height: 500px) {
    #FirstRow {
        margin-bottom: var(--space-2xl);
    }

    .TodayPickBigOne .TodayPickPost {
        aspect-ratio: 21/9;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    #FirstRow, #SecondRow, #ThirdRow, #FourthRow {
        break-inside: avoid;
    }

    .PickPostImageThumb {
        max-height: 200px;
    }

    a {
        text-decoration: underline;
    }

    .premium-outline {
        border: 1px solid black;
        background: white;
        color: black;
    }
}

/* Accessibility - 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;
    }
}

/* Accessibility - High Contrast */
@media (prefers-contrast: high) {
    :root {
        --color-black: #000;
        --color-gray-01: #666;
        --color-gray-03: #eee;
        --color-gray-04: #fff;
        --color-blue: #0050d0;
    }

    .TodayPickPost {
        border: 2px solid currentColor;
    }

    .premium-outline {
        border: 2px solid currentColor;
    }
}
