﻿/* Apple-style Animations & Interactions */

/* Page Load Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Stagger Animation on Load */
.TodayPickPost {
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-out) forwards;
}

    .TodayPickPost:nth-child(1) {
        animation-delay: 0s;
    }

    .TodayPickPost:nth-child(2) {
        animation-delay: 0.1s;
    }

    .TodayPickPost:nth-child(3) {
        animation-delay: 0.2s;
    }

    .TodayPickPost:nth-child(4) {
        animation-delay: 0.3s;
    }

    .TodayPickPost:nth-child(5) {
        animation-delay: 0.4s;
    }

    .TodayPickPost:nth-child(6) {
        animation-delay: 0.5s;
    }

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus States */
a:focus,
button:focus {
    outline: 3px solid var(--color-blue);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--color-blue);
    color: white;
}

/* Intersection Observer Animation */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s var(--ease-out);
}

    .fade-in-section.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Image Loading Enhancement */
.PickPostImageThumb {
    position: relative;
    background: var(--color-gray-03);
}

    .PickPostImageThumb::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
        animation: shimmer 1.5s infinite;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .PickPostImageThumb.loading::before {
        opacity: 1;
    }

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Touch Feedback */
@media (hover: none) {
    .TodayPickPost:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

/* Reduced Motion Support */
@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 */
@media (prefers-color-scheme: dark) {
    :root {
        --color-black: #f5f5f7;
        --color-gray-01: #a1a1a6;
        --color-gray-02: #c7c7cc;
        --color-gray-03: #1d1d1f;
        --color-gray-04: #000000;
        --color-blue: #2997ff;
        --color-blue-hover: #42a1ff;
    }

    body {
        background: #000;
    }

    .MostRecent,
    #SecondRow .TodayPickPost {
        background: #1d1d1f;
    }

    .TodayMostRecent,
    #ThirdRow .FourSmallerPiece .TodayPickPost {
        border-color: rgba(255,255,255,0.1);
    }
}

/* Performance Optimizations */
.TodayPickPost {
    will-change: transform;
}

.PickPostImageThumb img {
    will-change: transform;
    transform: translateZ(0);
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    z-index: 100;
}

    .skip-to-content:focus {
        top: 8px;
    }
