/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Enhancements — Heart Warriors
   Enhanced mobile UX, touch interactions, and responsive design
   ═══════════════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────────────────
   MOBILE-FIRST IMPROVEMENTS
   ──────────────────────────────────────────────────────────────────────────── */

/* Better touch targets (minimum 44x44px for accessibility) */
@media (max-width: 768px) {
  
  /* ── Enhanced Touch Targets ── */
  .btn, .nav-link, .filter-btn, .social-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
  }
  
  /* ── Improved Typography ── */
  body {
    font-size: 16px; /* Prevent iOS zoom on input focus */
    -webkit-text-size-adjust: 100%;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 16px;
  }
  
  .section-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  
  .card-title {
    font-size: 1.1rem;
    line-height: 1.4;
  }
  
  /* ── Better Spacing ── */
  .container {
    padding: 0 16px;
  }
  
  .section {
    padding: 40px 0;
  }
  
  /* ── Enhanced Navigation ── */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
  }
  
  .navbar {
    padding: 12px 0;
  }
  
  .navbar-brand {
    flex: 1;
  }
  
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  
  .brand-name {
    font-size: 1.1rem;
  }
  
  .brand-sub {
    font-size: .75rem;
  }
  
  .hamburger {
    width: 44px;
    height: 44px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
  }
  
  .hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--red-main);
    transition: all .3s ease;
    border-radius: 2px;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    padding: 80px 20px 20px;
    overflow-y: auto;
    transition: right .3s ease;
    z-index: 1000;
  }
  
  .nav-menu.open {
    right: 0;
  }
  
  .nav-menu li {
    margin-bottom: 8px;
  }
  
  .nav-link {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all .2s ease;
  }
  
  .nav-link:hover, .nav-link.active {
    background: var(--red-pale);
    color: var(--red-main);
  }
  
  .nav-cta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
  }
  
  .dark-mode-toggle {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    padding: 12px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
  }
  
  /* Mobile menu overlay */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    transition: opacity .3s ease;
  }
  
  .nav-overlay.active {
    display: block;
    opacity: 1;
  }
  
  /* ── Enhanced Hero Section ── */
  .hero {
    min-height: auto;
    padding: 60px 0 40px;
  }
  
  .hero-content {
    text-align: center;
  }
  
  .hero-badge {
    font-size: .85rem;
    padding: 8px 16px;
    margin-bottom: 16px;
  }
  
  .hero-desc {
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 24px;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
  }
  
  .hero-stat {
    text-align: center;
  }
  
  .stat-num {
    font-size: 1.8rem;
  }
  
  .stat-label {
    font-size: .8rem;
  }
  
  /* ── Enhanced Cards ── */
  .card {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  
  .card:active {
    transform: scale(0.98);
  }
  
  .card-img {
    aspect-ratio: 16/9;
    object-fit: cover;
  }
  
  .card-body {
    padding: 16px;
  }
  
  .card-title {
    margin-bottom: 8px;
    line-height: 1.3;
  }
  
  .card-excerpt {
    font-size: .9rem;
    line-height: 1.5;
    color: var(--text-muted);
  }
  
  /* ── Enhanced Stats Bar ── */
  .stats-bar {
    padding: 32px 0;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .stat-item {
    text-align: center;
    padding: 20px 12px;
  }
  
  .stat-item .num {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  
  .stat-item .label {
    font-size: .85rem;
    line-height: 1.3;
  }
  
  /* ── Enhanced Mission/Vision Cards ── */
  .mv-grid {
    gap: 20px;
  }
  
  .mv-card {
    padding: 24px;
  }
  
  .mv-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }
  
  .mv-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }
  
  .mv-card p {
    font-size: .9rem;
    line-height: 1.6;
  }
  
  /* ── Enhanced Forms ── */
  .form-control, .form-input {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    transition: border-color .2s ease;
  }
  
  .form-control:focus, .form-input:focus {
    border-color: var(--red-main);
    outline: none;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .1);
  }
  
  textarea.form-control {
    min-height: 120px;
    resize: vertical;
  }
  
  /* ── Enhanced Footer ── */
  .site-footer {
    padding: 40px 0 20px;
  }
  
  .footer-grid {
    gap: 32px;
  }
  
  .footer-brand {
    margin-bottom: 16px;
  }
  
  .footer-desc {
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 16px;
  }
  
  .footer-social {
    gap: 12px;
  }
  
  .social-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
  }
  
  .footer-col h4 {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .footer-links a {
    display: block;
    padding: 8px 0;
    font-size: .9rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding-top: 24px;
    font-size: .85rem;
  }
  
  /* ── Enhanced Gallery ── */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  
  .gallery-item.wide {
    grid-column: span 2;
  }
  
  .gallery-item.tall {
    grid-row: span 2;
  }
  
  /* ── Enhanced Page Hero ── */
  .page-hero {
    padding: 80px 0 40px;
    min-height: auto;
  }
  
  .page-hero h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
  }
  
  .page-hero p {
    font-size: .95rem;
  }
  
  .breadcrumb {
    font-size: .85rem;
    margin-top: 16px;
  }
  
  /* ── Enhanced Filters ── */
  .news-filter, .events-filter {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
  }
  
  .filter-btn {
    padding: 10px 16px;
    font-size: .85rem;
    white-space: nowrap;
  }
  
  /* ── Enhanced Topbar ── */
  .topbar {
    display: none; /* Hide on mobile for cleaner look */
  }
  
  /* ── Improved Touch Feedback ── */
  .btn:active,
  .card:active,
  .filter-btn:active,
  .nav-link:active {
    transform: scale(0.97);
  }
  
  /* ── Better Image Loading ── */
  img {
    background: var(--gray-100);
  }
  
  /* ── Enhanced Lightbox ── */
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
  
  .lightbox-close {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    top: 16px;
    right: 16px;
  }
  
  /* ── Smooth Scrolling ── */
  html {
    scroll-padding-top: 80px;
  }
  
  /* ── Better Loading States ── */
  .loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* ── Enhanced Toast Notifications ── */
  .toast {
    max-width: calc(100vw - 32px);
    margin: 0 16px;
    font-size: .9rem;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   EXTRA SMALL DEVICES (< 480px)
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  
  /* ── Ultra-compact layout ── */
  .container {
    padding: 0 12px;
  }
  
  .section {
    padding: 32px 0;
  }
  
  .hero-title {
    font-size: 1.6rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .gallery-item.wide,
  .gallery-item.tall {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: .9rem;
  }
  
  .btn-lg {
    padding: 14px 24px;
    font-size: .95rem;
  }
  
  .card-body {
    padding: 14px;
  }
  
  .mv-card {
    padding: 20px;
  }
  
  .footer-social {
    justify-content: center;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   LANDSCAPE MOBILE (height < 500px)
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-height: 500px) and (orientation: landscape) {
  
  .hero {
    padding: 40px 0 30px;
  }
  
  .page-hero {
    padding: 60px 0 30px;
  }
  
  .section {
    padding: 40px 0;
  }
  
  .nav-menu {
    padding: 60px 20px 20px;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   ACCESSIBILITY ENHANCEMENTS
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  
  /* Focus visible for keyboard navigation */
  *:focus-visible {
    outline: 3px solid var(--red-main);
    outline-offset: 2px;
  }
  
  /* Reduce motion for users who prefer it */
  @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 support */
  @media (prefers-contrast: high) {
    .btn {
      border-width: 3px;
    }
    
    .card {
      border: 2px solid var(--gray-400);
    }
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   PERFORMANCE OPTIMIZATIONS
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  
  /* GPU acceleration for smooth animations */
  .nav-menu,
  .hamburger span,
  .card,
  .btn {
    will-change: transform;
  }
  
  /* Optimize repaints */
  .hero,
  .section {
    contain: layout style paint;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   MISSING MOBILE FIXES — Touch targets, fonts, lightbox, overflow
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 18px;
    font-size: .9rem;
  }

  .page-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
  }

  .hero-dot {
    width: 14px;
    height: 14px;
    margin: 4px;
  }

  .dark-mode-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .footer-links a {
    padding: 10px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .sister-nav-logo,
  .sister-nav-link {
    width: 44px;
    height: 44px;
  }

  .section-label { font-size: .875rem; }
  .card-category { font-size: .875rem; }
  .card-meta { font-size: .875rem; }
  .brand-sub { font-size: .8rem; }
  .hero-badge { font-size: .875rem; }
  .stat-item .label { font-size: .875rem; }
  .filter-btn { font-size: .875rem; }

  .lightbox-inner { position: relative; padding: 0 50px; }
  .lightbox-prev { left: 4px !important; position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; }
  .lightbox-next { right: 4px !important; position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; }

  .news-search-wrap { max-width: 100%; width: 100%; }
  .hero-scroll { display: none; }

  .sister-programs-bar .container { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sister-link { max-width: 100%; width: 100%; }

  .gallery-item video { pointer-events: none; }

  .about-intro { grid-template-columns: 1fr; gap: 32px; }
  .events-grid { grid-template-columns: 1fr; }

  .cover-banner-img { max-height: 220px; object-fit: cover; object-position: center top; }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stat .stat-num { font-size: 1.4rem; }
  .hero-stat .stat-label { font-size: .7rem; }
  .clock-date { display: none; }
  .brand-sub { display: none; }
  .lightbox-inner { padding: 0 44px; }
  .lightbox-inner img, .lightbox-inner video { max-width: 100%; max-height: 70vh; }
}
