/* =====================================================
   ZARC ARCHITECTS - MOBILE.CSS
   Dedicated mobile polish layer
   Loaded on all pages, designed mobile-first
   ===================================================== */

/* ── Safe Area (iPhone notch / Dynamic Island) ── */
#site-header {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
#site-footer {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

/* ── Tap highlight — remove iOS blue flash ── */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
a, button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

/* ── iOS momentum scroll on nav menu ── */
.nav-links {
  -webkit-overflow-scrolling: touch;
}

/* ── Prevent text size adjustment on orientation change ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── Touch target minimum size (44px) ── */
.nav-link,
.nav-cta,
.nav-toggle,
.filter-tab,
.view-btn,
.social-link,
.gallery-view-btn,
.lightbox-close {
  min-height: 44px;
  min-width: 44px;
}

/* ── Smooth scroll for anchor links ── */
html {
  scroll-behavior: smooth;
}

/* ── Overflow hidden on body when menu open ── */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ══════════════════════════════════════════
   MOBILE (≤768px) TOUCH POLISH
   ══════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Smoother font rendering ── */
  body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* ── Nav hamburger — bigger tap area ── */
  .nav-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  /* ── Nav open — full screen feel ── */
  .nav-links {
    padding-top: 0.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
  .nav-links li {
    animation: none;
  }

  /* ── Hero: full SVH with no overflow ── */
  #hero {
    height: 100svh;
    height: -webkit-fill-available;
    overflow: hidden;
  }

  /* ── Prevent horizontal scroll ── */
  main, section, footer, header {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* ── Buttons: comfortable thumb tap size ── */
  .btn {
    min-height: 48px;
    touch-action: manipulation;
  }

  /* ── Form inputs: prevent iOS zoom (font-size >= 16px) ── */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important;
    border-radius: 0;
  }

  /* ── Select: better mobile styling ── */
  .form-group select {
    background-color: rgba(255,255,255,0.04);
  }

  /* ── Filter bar: horizontal scroll ── */
  .filter-bar {
    -webkit-overflow-scrolling: touch;
  }
  .filter-inner {
    -webkit-overflow-scrolling: touch;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
    margin-left: calc(-1 * var(--container-pad));
    margin-right: calc(-1 * var(--container-pad));
    width: calc(100% + 2 * var(--container-pad));
  }

  /* ── Gallery items: tap overlay visible ── */
  .gallery-item {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

  /* ── Lightbox: swipe-friendly ── */
  .lightbox-panel {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Marquee: touch pause ── */
  .marquee-strip {
    touch-action: pan-x;
  }

  /* ── Blueprint SVG: hide on tiny screens for perf ── */
  .blueprint-box {
    display: none;
  }

  /* ── Team card: horizontal layout cleanup ── */
  .team-card {
    gap: 1rem;
  }

  /* ── Stats: wrap gracefully ── */
  .stat-row {
    flex-wrap: wrap;
  }

  /* ── Philosophy section: reduce background text ── */
  .section-philosophy::before {
    font-size: 40vw;
    opacity: 0.08;
  }

  /* ── Project info: more readable ── */
  .project-info {
    padding: 0.9rem 0 0.4rem;
  }
  .project-name {
    font-size: 0.9rem;
  }

  /* ── Section label: always show line ── */
  .section-label::before {
    width: 24px;
    opacity: 0.6;
  }

  /* ── Scroll progress bar ── */
  #scroll-progress {
    height: 2px;
    opacity: 0.7;
  }

  /* ── Footer nav: tap-friendly ── */
  .footer-nav a {
    padding: 0.25rem 0;
    display: inline-block;
    min-height: 36px;
    line-height: 36px;
  }
}

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

  /* Blueprint box — completely hidden */
  .blueprint-box { display: none; }

  /* About grid: remove gap for visual tightness */
  .about-grid { gap: 2rem; }

  /* Hero actions stacked */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0 1rem;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Services: compact padding */
  .service-card { padding: 1.5rem 1rem; }
  .service-icon { font-size: 1.2rem; margin-bottom: 0.9rem; }

  /* Pillar: compact */
  .pillar { padding: 1.5rem 1rem; }
  .pillar-num { font-size: 2.2rem; }

  /* Team: full col stacked */
  .team-card { flex-direction: column; padding: 1.5rem 1rem; }
  .team-name { font-size: 0.95rem; }

  /* Contact details */
  .contact-details li { font-size: 0.85rem; }

  /* Social links: bigger */
  .social-link { width: 44px; height: 44px; font-size: 1rem; }

  /* Gallery: single col already handled, just ensure image height */
  .gallery-img-wrap { height: 210px; }

  /* Lightbox full-screen on tiny phones */
  .lightbox { padding: 0; align-items: stretch; justify-content: stretch; }
  .lightbox-panel {
    max-height: 100svh;
    height: 100svh;
    width: 100vw;
    border: none;
    border-radius: 0;
  }

  /* Reduce marquee padding */
  .marquee-strip { padding: 0.75rem 0; }
}

/* ══════════════════════════════════════════
   LANDSCAPE MOBILE (short + wide)
   ══════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  #hero {
    height: auto;
    min-height: 100svh;
    padding: calc(var(--nav-h) + 1.5rem) var(--container-pad) 2rem;
    align-items: flex-start;
  }
  .hero-content {
    padding-top: 0;
    text-align: left;
  }
  .hero-title-zarc { font-size: clamp(3rem, 12vw, 5rem); }
  .hero-title-sub { font-size: clamp(0.6rem, 1.5vw, 0.9rem); }
  .hero-actions { justify-content: flex-start; flex-direction: row; }
  .hero-scroll-hint { display: none; }

  .nav-links {
    max-height: calc(100svh - var(--nav-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
