/* ==========================================================================
   FAITH BAPTIST CHURCH - RESPONSIVE STYLES
   Mobile, Tablet, and Desktop Breakpoints (Evidence-Based Audit Optimization)
   ========================================================================== */

/* ==========================================================================
   1. LARGE DESKTOP & WIDE MONITORS (min-width: 1280px)
   ========================================================================== */
@media (min-width: 1280px) {
  .container {
    max-width: 1360px;
  }
}

/* ==========================================================================
   2. LAPTOPS & TABLETS (max-width: 1080px)
   Navigation Drawer & Medium Layout Shifts
   ========================================================================== */
@media (max-width: 1080px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .top-bar-right {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--white-smoke);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--navy-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .mobile-toggle:hover {
    background: var(--blue-soft);
    color: var(--blue-royal);
  }

  /* Mobile Sliding Navigation Drawer */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background-color: var(--navy-deepest);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem 2rem;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.6);
    transition: right var(--transition-normal);
    z-index: 1000;
    overflow-y: auto;
    gap: 0.5rem;
  }

  .nav-menu.is-open {
    right: 0;
  }

  .nav-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--white-pure);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: all var(--transition-fast);
  }

  .nav-menu-close:hover {
    background: var(--red-primary);
    border-color: var(--red-primary);
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    color: var(--white-pure);
    font-size: 1.1rem;
    padding: 0.85rem 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--gold-light);
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: 0.5rem 1rem;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    display: none;
    width: 100%;
  }

  .nav-item.active-dropdown .dropdown-menu {
    display: block;
  }

  .dropdown-link {
    color: var(--gray-300);
    padding: 0.6rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  }

  .dropdown-link:last-child {
    border-bottom: none;
  }

  .dropdown-link:hover {
    color: var(--white-pure);
    background: transparent;
    padding-left: 0.5rem;
  }

  /* Header action buttons on tablet */
  .header-actions .btn-red {
    display: none;
  }

  .feature-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-cards-overlap {
    margin-top: -2.5rem;
  }

  .sermon-player-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sermon-art-box {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .giving-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

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

  .ministries-grid,
  .sermon-grid,
  .events-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   3. TABLETS & LARGE PHONES (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-content {
    padding-top: 3rem;
    padding-bottom: 4.5rem;
  }

  .hero-title {
    font-size: clamp(1.85rem, 7vw, 2.75rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .hero-buttons .btn {
    width: 100%;
    min-height: 48px;
  }

  /* Countdown Banner */
  .countdown-banner {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }

  .countdown-content h3 {
    font-size: 1.4rem;
  }

  .countdown-timer-wrap {
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }

  .countdown-unit {
    min-width: 65px;
    padding: 0.75rem 0.5rem;
    flex: 1;
    max-width: 80px;
  }

  .countdown-digit {
    font-size: 1.6rem;
  }

  .countdown-label {
    font-size: 0.65rem;
  }

  /* Grids collapse to 1 column */
  .grid-2,
  .grid-3,
  .grid-4,
  .ministries-grid,
  .sermon-grid,
  .events-grid,
  .visit-steps-grid,
  .gallery-grid,
  .footer-grid,
  .pillar-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Audio player card */
  .sermon-player-box {
    padding: 1.5rem;
  }

  .audio-controls-wrap {
    padding: 1rem;
  }

  .audio-main-row {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .btn-play-pause {
    width: 48px;
    height: 48px;
  }

  .audio-progress-container {
    width: 100%;
    order: 3;
  }

  .audio-extra-actions {
    margin-left: auto;
  }

  /* Giving Card */
  .giving-portal-wrap {
    padding: 1.5rem 1rem;
  }

  .amount-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .btn-amount {
    padding: 0.75rem 0.5rem;
    min-height: 46px;
  }

  /* Welcome Badge */
  .welcome-floating-badge {
    position: static;
    max-width: 100%;
    margin-top: 1.25rem;
    transform: none;
  }

  /* Scripture Card */
  .scripture-box {
    padding: 2rem 1.25rem;
  }

  .scripture-verse-text {
    font-size: 1.2rem;
  }

  /* Footer */
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   4. SMALL MOBILE SCREENS (max-width: 480px)
   iOS Zoom prevention, header fitting, and touch optimization
   ========================================================================== */
@media (max-width: 480px) {
  .header-inner {
    padding: 0.5rem 0;
    gap: 0.75rem;
  }

  .brand-logo {
    gap: 0.6rem;
  }

  .brand-logo-img {
    width: 48px;
    height: 48px;
  }

  .brand-title {
    font-size: 1.08rem;
  }

  .brand-tagline {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .header-actions .btn-navy {
    display: none;
  }

  .top-bar-item {
    font-size: 0.78rem;
  }

  /* iOS Auto-Zoom Prevention: Inputs must be at least 16px */
  .form-input,
  .form-select,
  .form-textarea,
  .input-custom-amount {
    font-size: 16px !important;
    padding: 0.8rem 1rem;
  }

  .custom-currency-symbol {
    font-size: 16px;
    left: 1rem;
  }

  .input-custom-amount {
    padding-left: 2.2rem;
  }

  .card {
    padding: 1.5rem 1.25rem;
  }

  .feature-card {
    padding: 1.75rem 1.25rem;
  }

  .feature-schedule-row {
    font-size: 0.84rem;
  }

  .btn-lg {
    padding: 0.95rem 1.5rem;
    font-size: 0.98rem;
  }

  .countdown-unit {
    min-width: 55px;
    padding: 0.6rem 0.35rem;
  }

  .countdown-digit {
    font-size: 1.4rem;
  }

  .countdown-label {
    font-size: 0.6rem;
  }

  .lightbox-modal {
    padding: 1rem;
  }

  .lightbox-content {
    max-width: 100%;
    padding: 1.5rem 1rem !important;
  }

  .toast-notice {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.88rem;
  }
}
