/**
 * Responsive Styles - Mobile First
 * Scale UP from mobile using min-width queries
 *
 * @package Rhymefest
 * @version 2.3.0
 */

/* ============================================
   MOBILE ONLY (max-width: 575px) - Phones only
   ============================================ */
@media (max-width: 575px) {
    /* Fix horizontal scroll - mobile fix (avoid overflow-x:hidden on html to prevent iOS scroll lock) */
    html {
        overflow-x: clip;
    }
    
    body {
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Catch any overflowing elements (use clip on section to avoid scroll container issues) */
    .site-wrapper,
    #page,
    .site-content,
    main,
    article,
    .container {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    section {
        max-width: 100vw;
        overflow-x: clip;
    }
    
    /* Hide stats on mobile */
    .about-stats {
        display: none !important;
    }
    
    /* Popup - fit on screen without scrolling */
    .donation-popup-overlay {
        padding: 0.5rem;
    }
    
    .donation-popup-container {
        padding: 1rem 1rem 1.25rem;
        max-height: 100vh;
        max-height: 100dvh;
        overflow-y: auto;
        margin: 0;
        width: calc(100% - 1rem);
    }
    
    /* Center campaign logo in popup */
    .popup-logo {
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .popup-logo img {
        max-height: 40px;
        margin: 0 auto;
    }
    
    /* Reduce popup content spacing */
    .popup-content {
        gap: 0.75rem;
    }
    
    /* Smaller video on mobile */
    .popup-video .video-wrapper {
        padding-bottom: 50%;
    }
    
    /* Tighten popup text */
    .popup-headline {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .popup-subtext {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .popup-cta-text {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
    }
    
    /* Smaller donation buttons */
    .donation-amount-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.9375rem;
    }
    
    .donation-buttons-grid {
        gap: 0.375rem;
    }
    
    /* Reduce continue button margin */
    .popup-continue-btn {
        margin-top: 0.75rem;
        font-size: 0.75rem;
        padding: 0.5rem 1.5rem;
    }
    
    /* Close button positioning */
    .popup-close {
        top: 0.25rem;
        right: 0.25rem;
        padding: 0.375rem;
    }
    
    .popup-close svg {
        width: 20px;
        height: 20px;
    }
    
    /* Mobile menu - logo at top */
    .main-navigation {
        padding-top: 1.5rem;
    }
    
    .mobile-menu-logo img {
        max-height: 50px;
        width: auto;
    }
    
    /* Issues & Events - padding-top must clear skyline divider (120px at mobile) */
    .issues-section,
    .events-section {
        padding-top: 150px;
    }
}

/* mobile-menu-logo visibility is controlled dynamically via 
   rhymefest_output_dynamic_nav_css() at the nav breakpoint */

/* ============================================
   TABLET (min-width: 576px)
   ============================================ */
@media (min-width: 576px) {
    .section {
        padding: 70px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Hero */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-title span {
        display: inline;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        max-width: none;
    }
    
    .hero-buttons .btn {
        width: auto;
    }
    
    .hero-image {
        max-width: 320px;
    }
    
    /* Page Header */
    .page-header h1 {
        font-size: 2.25rem;
    }
    
    /* About */
    .about-content h2 {
        font-size: 2rem;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Issues */
    .issues-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Endorsements */
    .endorsements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .endorsement-logo {
        width: 80px;
        height: 80px;
    }
    
    /* Events */
    .event-date-box {
        min-width: 90px;
    }
    
    .event-day {
        font-size: 2rem;
    }
    
    /* News/Press */
    .news-grid,
    .press-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Social */
    .social-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* CTA - padding-top must clear skyline divider (180px at this breakpoint) */
    .cta-section {
        padding: 220px 0 60px;
    }
    
    .cta-section h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .cta-buttons .btn {
        min-width: auto;
    }
    
    /* Issues & Events - padding-top must clear skyline divider (180px at this breakpoint) */
    .issues-section,
    .events-section {
        padding-top: 220px;
    }
}

/* ============================================
   TABLET LANDSCAPE (min-width: 768px)
   ============================================ */
@media (min-width: 768px) {
    .section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .section-subtitle {
        font-size: 1.0625rem;
    }
    
    /* Hero */
    .hero-section {
        min-height: 90vh;
        padding: 120px 0 80px;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-image {
        max-width: 360px;
    }
    
    /* About */
    .about-section::before {
        width: 8px;
    }
    
    .about-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: center;
    }
    
    .about-image {
        order: 0;
    }
    
    .about-content h2 {
        font-size: 2.25rem;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Issues */
    .issues-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .issue-card {
        padding: 2rem;
    }
    
    .issue-icon {
        width: 60px;
        height: 60px;
    }
    
    .issue-card h3 {
        font-size: 1.25rem;
    }
    
    /* Endorsements */
    .endorsements-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .endorsement-card {
        padding: 1.5rem;
    }
    
    .endorsement-name {
        font-size: 1rem;
    }
    
    /* Events */
    .events-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .event-date-box {
        min-width: 100px;
        padding: 1.5rem;
    }
    
    .event-day {
        font-size: 2.5rem;
    }
    
    .event-content {
        padding: 1.5rem;
    }
    
    .event-card h3 {
        font-size: 1.25rem;
    }
    
    /* News/Press */
    .news-grid,
    .press-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .news-card h3,
    .press-content h3 {
        font-size: 1.125rem;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .blog-content {
        padding: 1.5rem;
    }
    
    /* Social */
    .social-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
    
    .social-card {
        padding: 1.75rem 1.5rem;
    }
    
    .social-icon {
        width: 56px;
        height: 56px;
    }
    
    .social-embed-container {
        max-width: 500px;
        padding: 1.5rem;
    }
    
    /* CTA - padding-top must clear skyline divider (240px at this breakpoint) */
    .cta-section {
        padding: 280px 0 60px;
    }
    
    .cta-section h2 {
        font-size: 2.25rem;
    }
    
    .cta-section p {
        font-size: 1.125rem;
    }
    
    /* Issues & Events - padding-top must clear skyline divider (240px at this breakpoint) */
    .issues-section,
    .events-section {
        padding-top: 280px;
    }
    
    /* Video Gallery */
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Image Gallery - Tablet */
    .gallery-grid {
        gap: 0.875rem;
    }
    .gallery-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .gallery-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .gallery-cols-4 { grid-template-columns: repeat(3, 1fr); }
    .gallery-cols-6 { grid-template-columns: repeat(3, 1fr); }
    
    /* Header - Logo sizing at tablet */
    .header-inner {
        padding: 1rem 0;
    }
    
    .site-logo img {
        max-height: 70px;
    }
    
    .site-logo-text {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
        gap: 2rem;
    }
    
    .footer-brand {
        grid-column: span 2;
    }
    
    .social-links {
        justify-content: flex-start;
    }
    
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
    
    /* Page Header */
    .page-header {
        padding: 140px 0 140px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header p {
        font-size: 1.125rem;
    }
}

/* ============================================
   DESKTOP (min-width: 1024px)
   ============================================ */
@media (min-width: 1024px) {
    .section {
        padding: 100px 0;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
    
    /* Header - Larger logo on desktop */
    .site-logo img {
        max-height: 80px;
    }
    
    .site-logo-text {
        font-size: 1.625rem;
    }
    
    .page-header {
        padding: 150px 0 180px;
    }
    
    .page-header h1 {
        font-size: 3.5rem;
    }
    
    .page-header p {
        font-size: 1.25rem;
    }
    
    /* Hero - Side by side layout */
    .hero-section {
        min-height: 100vh;
    }
    
    .hero-section > .container {
        flex-direction: row;
        text-align: left;
        gap: 4rem;
    }
    
    .hero-content {
        order: 1;
        flex: 1;
        max-width: 600px;
    }
    
    .hero-title {
        font-size: 3.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-buttons {
        justify-content: flex-start;
    }
    
    .hero-image {
        order: 2;
        max-width: 420px;
        flex: 0 0 auto;
    }
    
    /* About */
    .about-grid {
        gap: 4rem;
    }
    
    /* Issues */
    .issues-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Endorsements */
    .endorsements-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    /* News/Press/Blog */
    .news-grid,
    .press-grid,
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Social */
    .social-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 800px;
        margin: 0 auto;
    }
    
    .social-card {
        padding: 2rem 1.5rem;
    }
    
    /* CTA - padding-top must clear skyline divider (300px at this breakpoint) */
    .cta-section {
        padding: 340px 0 60px;
    }
    
    .cta-section h2 {
        font-size: 2.5rem;
    }
    
    .cta-section p {
        font-size: 1.25rem;
    }
    
    /* Issues & Events - padding-top must clear skyline divider (300px at this breakpoint) */
    .issues-section,
    .events-section {
        padding-top: 340px;
    }
    
    /* Video Gallery */
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Video Showcase - Desktop Layout */
    .video-showcase {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .video-featured {
        flex: 2;
        min-width: 0;
    }
    
    .video-thumbnails {
        flex: 1;
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 280px;
    }
    
    .video-thumb {
        display: flex;
        flex-direction: column;
    }
    
    /* Image Gallery - Desktop */
    .gallery-grid {
        gap: 1rem;
    }
    .gallery-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .gallery-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .gallery-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .gallery-cols-6 { grid-template-columns: repeat(6, 1fr); }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 3rem;
    }
    
    .footer-brand {
        grid-column: auto;
    }
}

/* ============================================
   LARGE DESKTOP (min-width: 1200px)
   ============================================ */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-image {
        max-width: 480px;
    }
    
    .section-title {
        font-size: 2.75rem;
    }
    
    /* Issues, Events, CTA - padding-top must clear skyline divider (300px at this breakpoint) */
    .issues-section,
    .events-section {
        padding-top: 360px;
    }
    
    .cta-section {
        padding: 360px 0 60px;
    }
}

/* ============================================
   WORDPRESS ADMIN BAR FIXES
   ============================================ */
@media screen and (min-width: 783px) {
    body.admin-bar .site-header {
        top: 32px;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
    
    body.admin-bar .hero-section {
        padding-top: 146px;
    }
}

/* ============================================
   VOLUNTEER PAGE - RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .opportunities-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .volunteer-signup-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .volunteer-intro {
        padding: 40px 0;
    }
    
    .volunteer-opportunities {
        padding: 60px 0;
    }
    
    .volunteer-signup {
        padding: 60px 0;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .volunteer-photo-strip {
        padding: 40px 0 0;
    }

    .volunteer-photos-grid.photos-count-3,
    .volunteer-photos-grid.photos-count-4 {
        grid-template-columns: 1fr 1fr;
    }

    .volunteer-photo-item {
        aspect-ratio: 3 / 2;
    }

    .volunteer-impact {
        padding: 60px 0;
    }

    .volunteer-impact-wrapper.has-image {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .volunteer-impact-wrapper.has-image .volunteer-impact-quote-icon {
        display: flex;
        justify-content: center;
    }

    .volunteer-impact-image {
        max-width: 280px;
        margin: 0 auto;
    }

    .volunteer-impact-blockquote {
        font-size: 1.25rem;
    }

    .contact-cta-content h2 {
        font-size: 1.75rem;
    }

    .contact-cta-content p {
        font-size: 1.0625rem;
    }

    .contact-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .contact-cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .opportunities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .opportunities-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   ABOUT PAGE - RESPONSIVE (Enhanced)
   ============================================ */
@media (max-width: 991px) {
    .about-page .about-intro-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-page .about-intro-image {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .about-page .community-highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-page .priorities-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .about-page .about-hero h1 {
        font-size: 2.5rem;
    }
    
    .about-page .about-hero-subtitle {
        font-size: 1.125rem;
    }
    
    .about-page .about-intro-section,
    .about-page .about-story-section,
    .about-page .about-community-section,
    .about-page .about-artistry-section,
    .about-page .about-stats-section,
    .about-page .about-family-section {
        padding: 40px 0;
    }
    
    .about-page .about-video-section--dark {
        padding: 200px 0 40px;
    }
    
    .about-page .about-priorities-section {
        padding: 200px 0 40px;
    }
    
    .about-page .about-intro-content h2 {
        font-size: 1.75rem;
    }
    
    .about-page .about-awards-badges {
        justify-content: center;
    }
    
    .about-page .video-bio-wrapper {
        gap: 2rem;
    }
    
    .about-page .video-bio-embed {
        margin-bottom: 1.5rem;
    }
    
    .about-page .video-bio-content .section-title {
        margin-bottom: 1rem;
    }
    
    .about-page .video-bio-text {
        font-size: 1rem;
    }
    
    .about-page .community-highlights-grid {
        grid-template-columns: 1fr;
    }
    
    .about-page .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .about-page .stat-number {
        font-size: 2rem;
    }
    
    .about-page .stat-label {
        font-size: 0.75rem;
    }
    
    .about-page .family-content h2 {
        font-size: 1.75rem;
    }
}

/* About page dark sections - skyline-aware padding at all breakpoints
   These values must always exceed the skyline divider height at each breakpoint:
   mobile: 140px skyline → 200px padding | 576px: 180px → 240px | 768px: 240px → 300px | 1200px: 300px → 360px
   Canonical values are in layout.css; only override here for mobile bottom-padding reduction */

/* ============================================
   CONTACT PAGE - RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form-wrapper {
        padding: 1.5rem;
    }
}

/* ============================================
   CTA SECTION - RESPONSIVE
   ============================================ */
@media (max-width: 575px) {
    .cta-section {
        padding: 200px 0 40px;
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}



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

/* Touch targets: minimum 44x44px for all interactive elements */
@media (max-width: 767px) {
    /* Nav menu links */
    .nav-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 8px 12px;
    }

    /* Footer links */
    .footer-links a,
    .footer-nav a,
    .footer-bottom a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 6px 4px;
    }

    /* Social links in footer */
    .social-links a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* All buttons */
    .btn, button, input[type="submit"] {
        min-height: 44px;
    }

    /* Reduce header height on mobile */
    .site-header {
        padding: 8px 0;
    }

    .site-header .container {
        padding-top: 0;
        padding-bottom: 0;
    }

    .header-inner {
        min-height: 48px;
    }

    .site-logo img,
    .custom-logo {
        max-height: 40px;
        width: auto;
    }

    /* Menu toggle hamburger - touch target */
    .menu-toggle {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Footer responsive */
    .footer-links-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .footer-logo-centered img,
    .footer-logo-centered .custom-logo {
        max-height: 60px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    /* Page header responsive */
    .page-header {
        padding: 100px 0 80px;
    }

    .page-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .page-header p {
        font-size: 1rem;
    }
}

@media (max-width: 575px) {
    /* Further reduce header */
    .site-header {
        padding: 6px 0;
    }

    .site-logo img,
    .custom-logo {
        max-height: 36px;
    }

    /* Hero section stacking */
    .hero-section > .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        order: 2;
        align-items: center;
    }

    .hero-image {
        order: 1;
        margin-bottom: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    /* Stats band - ensure single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Issue cards single column */
    .issues-grid {
        grid-template-columns: 1fr;
    }

    /* Events */
    .event-card {
        flex-direction: column;
    }

    /* Tighter section padding on mobile */
    .section {
        padding: 40px 0;
    }

    .footer-links-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Page header compact */
    .page-header {
        padding: 80px 0 60px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* Tablet hero layout - stack text and image */
@media (min-width: 576px) and (max-width: 1023px) {
    .hero-section > .container {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .hero-content {
        order: 2;
        align-items: center;
        max-width: 600px;
    }

    .hero-image {
        order: 1;
        max-width: 350px;
        margin-bottom: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }
}

/* ============================================
   REDUCED MOTION PREFERENCE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    .section-badge {
        border: 2px solid currentColor;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .endorsement-card,
    .issue-card,
    .event-card,
    .news-card,
    .blog-card,
    .press-card {
        border-width: 2px;
    }
}
