/*
 * Macclesfield & District Riding Club
 * Responsive Styles - Mobile First
 */

/* ===== TABLET AND BELOW (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    :root {
        --header-height: var(--header-height-mobile);
    }

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

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

    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl);
    }

    .timeline::before {
        left: 30px;
    }

    .timeline__item {
        grid-template-columns: 60px 1fr;
    }

    .timeline__item:nth-child(odd) .timeline__content,
    .timeline__item:nth-child(even) .timeline__content {
        grid-column: 2;
        text-align: left;
    }

    .timeline__marker {
        grid-column: 1;
        justify-self: center;
    }

    /* Mobile Navigation */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: var(--space-2xl);
        transition: right var(--transition-base);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    .nav--active {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    .nav__link {
        font-size: var(--text-lg);
        color: var(--color-text) !important;
    }

    .nav__toggle {
        display: flex;
    }

    .header--transparent .nav__link {
        color: var(--color-text) !important;
    }
}

/* ===== TABLET PORTRAIT AND BELOW (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Hero adjustments */
    .hero {
        min-height: 90vh;
    }

    .hero__content {
        padding: var(--space-2xl) var(--space-md);
    }

    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero__buttons .btn {
        width: 100%;
        max-width: 280px;
    }

    .hero__scroll {
        display: none;
    }

    /* Section adjustments */
    .section {
        padding: var(--space-3xl) 0;
    }

    .section--large {
        padding: var(--space-4xl) 0;
    }

    /* Grid adjustments */
    .grid--2,
    .grid--2-1,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .stat {
        padding: var(--space-md);
    }

    /* Footer */
    .footer__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer__brand {
        max-width: none;
    }

    .footer__social {
        justify-content: center;
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Event list */
    .event-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .event-item__date {
        justify-self: center;
    }

    .event-item__location {
        justify-content: center;
    }

    /* Contact info */
    .contact-info__item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    /* CTA */
    .cta {
        padding: var(--space-2xl);
    }

    /* Quote */
    .quote {
        padding: var(--space-2xl) var(--space-lg);
    }

    .quote::before {
        font-size: 4rem;
        top: var(--space-md);
        left: var(--space-md);
    }

    /* Timeline mobile */
    .timeline::before {
        left: 20px;
    }

    .timeline__item {
        grid-template-columns: 40px 1fr;
        gap: var(--space-md);
    }

    .timeline__marker {
        width: 16px;
        height: 16px;
    }

    /* Gallery */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    /* Page header */
    .page-header {
        padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
    }
}

/* ===== MOBILE SMALL (max-width: 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

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

    .stat__number {
        font-size: var(--text-3xl);
    }

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

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

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

    .btn--large {
        padding: var(--space-md) var(--space-xl);
        font-size: var(--text-base);
    }

    .card__content {
        padding: var(--space-lg);
    }

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

    .feature__icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .affiliations {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .affiliations img {
        height: 50px;
    }
}

/* ===== LARGE SCREENS (min-width: 1400px) ===== */
@media (min-width: 1400px) {
    .container {
        padding: 0 var(--space-2xl);
    }

    .hero__content {
        max-width: 1000px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .nav,
    .hero__scroll,
    .btn {
        display: none !important;
    }

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

    .hero {
        min-height: auto;
        padding: 20pt 0;
        background: none;
    }

    .hero__overlay {
        display: none;
    }

    .hero__content {
        color: #000;
    }

    .section {
        padding: 20pt 0;
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
}

/* ===== 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;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000;
        --color-text-light: #333;
        --color-border: #000;
    }

    .btn {
        border-width: 3px;
    }

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

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --color-background: #1a1a1a;
        --color-background-alt: #242424;
        --color-text: #f5f5f5;
        --color-text-light: #b0b0b0;
        --color-border: #333;
    }

    .card,
    .event-item,
    .contact-info__item,
    .committee__member {
        background-color: var(--color-background-alt);
    }

    .nav {
        background-color: var(--color-background);
    }
    */
}
