/* ============================================
   THE STUDIO CO. — MOBILE RESPONSIVE OVERRIDES
   ============================================
   This file provides mobile-specific fixes that
   cannot be added to style.css. It handles:
   - Logo scaling
   - Nav bar adjustments
   - Hero section sizing
   - Grid/gap reductions
   - Gallery layout fixes
   - Iframe responsive sizing
   - Touch-friendly tap targets
   - Typography adjustments
   ============================================ */

/* ============================================
   TABLET BREAKPOINT (≤1024px)
   ============================================ */
@media (max-width: 1024px) {

  /* Nav bar height reduction */
  .nav-inner {
    height: 60px;
  }

  /* Logo shrink for tablet */
  .nav-logo img,
  .footer-brand .nav-logo img {
    height: 80px !important;
  }

  /* Hero padding adjustment */
  .hero,
  .page-hero {
    padding-top: 60px;
  }

  /* Reduce large inline gaps on grid-2 */
  .grid-2 {
    gap: 40px !important;
  }
}

/* ============================================
   MOBILE BREAKPOINT (≤767px)
   ============================================ */
@media (max-width: 767px) {

  /* ---- NAVIGATION ---- */
  .nav-inner {
    height: 56px;
  }

  /* Logo shrink for mobile */
  .nav-logo img,
  .footer-brand .nav-logo img {
    height: 50px !important;
  }

  /* ---- HERO SECTIONS ---- */
  .hero {
    min-height: 85vh;
    padding-top: 56px;
  }

  .page-hero {
    min-height: 40vh;
    padding-top: 56px;
  }

  .hero-content {
    padding: 0 4px;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .hero .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .hero .btn-group .btn,
  .hero .btn-group .btn-primary,
  .hero .btn-group .btn-outline {
    width: 100%;
    text-align: center;
  }

  /* Hero video background */
  .hero-bg video {
    min-height: 100%;
    min-width: 100%;
    object-fit: cover;
  }

  /* ---- TYPOGRAPHY ---- */
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  h2 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  h3 {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
  }

  /* ---- GRID / LAYOUT ---- */
  .grid-2 {
    gap: 30px !important;
  }

  .grid-3,
  .grid-4 {
    gap: 24px !important;
  }

  /* Section header spacing */
  .section-header {
    margin-bottom: 40px;
  }

  /* ---- STATS BAR ---- */
  .stats-bar {
    gap: 20px !important;
    padding: 24px 0;
  }

  .stat-item .stat-value {
    font-size: 0.95rem;
  }

  .stat-item .stat-label {
    font-size: 0.7rem;
  }

  .stat-divider {
    display: none;
  }

  /* ---- AMENITIES ---- */
  .amenity-item {
    padding: 20px 0;
  }

  /* ---- STUDIO SET CARDS (homepage) ---- */
  .studio-card .placeholder-image,
  .studio-card img {
    aspect-ratio: 4/3;
  }

  /* ---- GALLERY GRID ---- */
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 6px;
  }

  .gallery-grid img {
    grid-column: auto !important;
  }

  /* ---- PRICING CARDS ---- */
  .pricing-card {
    padding: 24px 20px;
  }

  /* ---- PERKS GRID ---- */
  .perk-item {
    padding: 20px 0;
  }

  /* ---- SAVINGS ROW ---- */
  .savings-row {
    font-size: 0.9rem;
    padding: 16px 0;
  }

  .savings-row.highlight {
    font-size: 1rem;
  }

  /* ---- TESTIMONIALS ---- */
  .testimonial {
    padding: 30px 0;
  }

  .testimonial blockquote {
    font-size: clamp(1rem, 4vw, 1.3rem);
  }

  /* ---- FAQ ---- */
  .faq-item summary {
    font-size: 0.95rem;
    padding: 20px 0;
  }

  .faq-answer {
    font-size: 0.9rem;
  }

  /* ---- BUTTONS ---- */
  .btn,
  .btn-primary,
  .btn-outline,
  .btn-outline-dark {
    padding: 14px 28px;
    font-size: 0.75rem;
  }

  /* Full-width CTA buttons on mobile */
  .cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .cta-buttons .btn-primary,
  .cta-buttons .btn-outline {
    width: 100%;
    text-align: center;
  }

  /* ---- CONTACT FORM ---- */
  .contact-form input,
  .contact-form textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
    margin-bottom: 24px;
  }

  .contact-form textarea {
    min-height: 100px;
  }

  /* ---- IFRAMES (Acuity Scheduling) ---- */
  .acuity-embed {
    min-height: 600px;
    height: 600px;
  }

  /* ---- MAPS ---- */
  .map-embed {
    height: 300px;
  }

  iframe[src*="google.com/maps"] {
    height: 300px !important;
  }

  /* ---- NEWSLETTER FORM ---- */
  .newsletter-form {
    flex-direction: column;
    gap: 0;
  }

  .newsletter-form input {
    border-right: 1px solid rgba(255,255,255,0.15);
    border-bottom: none;
  }

  .newsletter-form button {
    width: 100%;
    padding: 16px;
  }

  /* ---- PASSWORD FORM (Members) ---- */
  .password-input-wrap {
    flex-direction: column;
    gap: 0;
  }

  .password-input-wrap input {
    border-right: 1px solid rgba(255,255,255,0.15);
    border-bottom: none;
  }

  .password-input-wrap button {
    width: 100%;
  }

  /* ---- FOOTER ---- */
  .site-footer {
    padding: 50px 0 30px;
  }

  .footer-brand .nav-logo img {
    height: 50px !important;
  }

  .footer-brand p {
    max-width: 100%;
  }

  /* ---- TOUCH TARGETS ---- */
  /* Ensure all interactive elements are at least 44px tall */
  a.hover-link,
  .nav-login,
  .footer-col a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ---- INLINE ELEMENT FIXES ---- */
  /* Prevent horizontal overflow from inline fixed-width elements */
  .container {
    overflow-x: hidden;
  }

  /* WhatsApp QR code */
  img[alt="WhatsApp QR Code"] {
    width: 120px !important;
    height: 120px !important;
  }

  /* Gallery section heading pricing subtitle */
  .section-heading span {
    display: block;
    margin-left: 0 !important;
    margin-top: 8px;
  }

  /* ---- PAGE-SPECIFIC FIXES ---- */

  /* Homepage: 4-column amenities grid → 2 columns */
  .section .container > div[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px 16px !important;
  }

  /* Homepage: 24 Flower Garden pricing cards */
  .section .container > div[style*="display: flex"][style*="gap: 1rem"] {
    flex-direction: column !important;
  }

  /* Homepage/About/Equipment: grid-2 inline gap override */
  .grid-2[style*="gap: 60px"] {
    gap: 30px !important;
  }

  /* Memberships: grid-2 Level Up section */
  .grid-2[style*="gap: 60px"] {
    gap: 30px !important;
  }

  /* Memberships: pricing summary box */
  div[style*="text-align: center"][style*="padding: 40px"] {
    padding: 24px 16px !important;
    font-size: 16px !important;
  }

  /* Bookings: grid-2 with 40px gap */
  .grid-2[style*="gap: 40px"] {
    gap: 24px !important;
  }

  /* Equipment: video containers - prevent overflow */
  video {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Ensure all images respect container */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Homepage: hero overlay and CTA buttons */
  .hero .btn-group a {
    min-width: 0;
    width: 100%;
  }

  /* Mobile nav: logo in mobile view */
  .mobile-nav .btn {
    width: 80%;
    text-align: center;
  }
}

/* ============================================
   SMALL MOBILE (≤480px)
   ============================================ */
@media (max-width: 480px) {

  /* Even smaller logo */
  .nav-logo img,
  .footer-brand .nav-logo img {
    height: 40px !important;
  }

  /* Reduce section padding further */
  .section {
    padding: 40px 0;
  }

  /* Tighter container padding */
  .container {
    padding: 0 16px;
  }

  /* Hero adjustments */
  .hero {
    min-height: 75vh;
  }

  .page-hero {
    min-height: 35vh;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  /* Stats bar — stack vertically */
  .stats-bar {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* Buttons — always full width */
  .btn,
  .btn-primary,
  .btn-outline,
  .btn-outline-dark {
    display: block;
    width: 100%;
    text-align: center;
  }

  /* Acuity iframe smaller */
  .acuity-embed {
    min-height: 500px;
    height: 500px;
  }

  /* Amenities grid → 1 column on small phones */
  .section .container > div[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Stack any remaining 2-column grids */
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* ============================================
   SAFE AREA INSETS (notched phones)
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
  }

  .site-nav {
    padding-top: env(safe-area-inset-top);
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
