/* ==============================================
   Mobile overrides for a desktop-first base.
   style.css defines the desktop layout (e.g. #about/#contact
   .split are 1fr 1fr); the breakpoints below collapse those
   to single-column for tablet and phone. Largest max-width
   wins last, so keep rules ordered general -> specific.
   ============================================= */

/* =============================================
   NAV — hamburger up to iPad Pro 13" landscape (1366px)
   Below this the full desktop nav (2 logos + 5 links +
   5 social icons) overflows and clips on tablets.
   ============================================= */
@media (max-width: 1366px) {
  .nav-inner { position: relative; }
  .nav-inner > .social-icons { display: none !important; }
  .hamburger {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 1.5rem; padding: 0.25rem; margin-left: auto;
  }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(255,255,255,0.99);
    padding: 1rem 1.5rem 1.5rem; gap: 0.9rem;
    border-bottom: 2px solid rgba(253,209,106,0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 200;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1rem; }
  .mobile-social {
    display: none; flex-wrap: wrap; gap: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(253,209,106,0.2);
    margin-top: 0.25rem;
  }
  .nav-links.open .mobile-social { display: flex; }
}

/* =============================================
   TABLET & MOBILE — max 1024px
   Covers all phones, all iPads (portrait + landscape)
   ============================================= */
@media (max-width: 1024px) {

  .reveal, .reveal-left, .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .stack-img { opacity: 1 !important; }

  #navbar { padding: 0.5rem 0 !important; }
  .nav-inner { padding: 0 1rem; gap: 1.5rem; position: relative; margin: 0; }
  .logo-remax    { height: 28px !important; padding-right: 0.4rem; margin-right: 0.1rem; }
  .logo img      { height: 30px; }
  .logo-name-img { height: 20px; }

  .container { padding: 0 1rem; }
  section    { padding: 3rem 0; }

  #top { min-height: 100svh; padding-top: 60px; }
  .slide { background-position: center top; }
  .banner-content { padding: 0 1.25rem; }
  .banner-content h1 { font-size: clamp(1.6rem, 5vw, 2.8rem); }
  .slider-dots   { bottom: 3.5rem; }
  .slider-arrows { bottom: 3rem; right: 1rem; }
  .slider-cta-inner { flex-direction: column; padding: 0 !important; }
  .slider-cta-left,
  .slider-cta-right { width: 100%; text-align: center; padding: 0.9rem 1rem; font-size: 0.9rem; }
  .slider-cta-left { border-bottom: 1px solid rgba(0,0,0,0.08); }

  /* Stack the two-column grids — these are hardcoded 1fr 1fr in style.css */
  #about .split,
  #contact .split { grid-template-columns: 1fr; gap: 2.5rem; }

  .about-photo { max-width: 60%; margin: 0 auto; }
  .about-social-mobile { display: flex !important; }

  .cards { gap: 1rem; }
  .card  { flex: 1 1 100%; max-width: 100%; }

  .markets-grid  { grid-template-columns: repeat(2, 1fr); }
  .markets-grid2 { width: 70%; }

  .widget-placeholder { min-height: 0; padding: 0; }
  .widget-inner { width: 100%; }

  .contact-social { flex-wrap: wrap; }

  /* Consent checkbox: tone down the desktop 1.5x scale on touch devices */
  .contact-form input[type="checkbox"] {
    transform: none;
    width: 20px;
    height: 20px;
    margin: 2px 8px 0 0;
    vertical-align: top;
  }

  .footer-inner    { flex-direction: column; gap: 1rem; padding: 0 1rem; text-align: center; }
  .footer-remax img { height: 40px; }
  .footer-name-img  { height: 44px; }
  .footer-remax .footer-copy { font-size: 0.6rem;}
}

/* =============================================
   SMALL PHONES — max 480px
   ============================================= */
@media (max-width: 480px) {
  .logo-remax    { height: 24px !important; }
  .logo img      { height: 26px; }
  .logo-name-img { height: 17px; }
  .about-photo   { max-width: 85%; }
  .markets-grid  { grid-template-columns: 1fr; }
  .markets-grid2 { width: 100%; }
  .banner-content h1 { font-size: 1.7rem; }

  .container { padding: 0 1.1rem; }
  .section-tag { font-size: 1rem; }
  .btn-nav { padding: 0.5rem 1rem; }

  /* Keep touch targets comfortable on small screens */
  .contact-form input,
  .contact-form select,
  .contact-form textarea { font-size: 16px; } /* prevents iOS zoom-on-focus */

  /* Consent checkbox: desktop scales it 1.5x which is too big on phones.
     Reset the scale and tighten margins so it sits neatly by the text. */
  .contact-form input[type="checkbox"] {
    transform: none;
    width: 18px;
    height: 18px;
    margin: 2px 8px 0 0;
    vertical-align: top;
    flex-shrink: 0;
  }
}

/* =============================================
   LANDSCAPE PHONES — short viewport
   ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
  #navbar { padding: 0.3rem 0 !important; }
  .logo-remax    { height: 22px !important; }
  .logo img      { height: 24px; }
  .logo-name-img { height: 16px; }
  .nav-links { max-height: calc(100vh - 45px); overflow-y: auto; }

  #top { padding-top: 45px; }
  .banner-content h1 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
  .slider-dots   { bottom: 1.5rem; }
  .slider-arrows { bottom: 1rem; right: 0.75rem; }
  .slider-cta-inner { flex-direction: row !important; }
  .slider-cta-left,
  .slider-cta-right { width: auto !important; padding: 0.5rem 1rem !important; font-size: 0.8rem; }
  .slider-cta-left { border-bottom: none !important; border-right: 1px solid rgba(0,0,0,0.08); }

  section { padding: 1.5rem 0; }
  .about-photo { max-width: 40%; }
  .card { flex: 1 1 calc(50% - 0.5rem); max-width: calc(50% - 0.5rem); }
  .markets-grid { grid-template-columns: repeat(3, 1fr); }
  .market-img   { height: 120px; }
  .footer-inner { flex-direction: row !important; }
}
