/* mobile.css - phone and small-tablet layout for /avo/ pages.
   Desktop (960px and above) is intentionally untouched. */

/* ===== Mid-width top bar: keep the Call button from being cut off ===== */
@media (min-width: 960px) and (max-width: 1180px) {
  .g-topbar__inner { gap: 16px; padding: 14px 20px; }
  .g-topbar__nav { gap: 16px; }
  .g-topbar__cta { padding: 8px 14px; font-size: 11px; }
}

/* ===== Hamburger button and mobile panel (hidden on desktop) ===== */
.g-burger { display: none; }
.g-mobile-panel { display: none; }

@media (max-width: 959px) {
  .g-topbar__inner {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 12px calc(16px + env(safe-area-inset-right, 0px)) 12px calc(16px + env(safe-area-inset-left, 0px));
  }
  .g-topbar__nav, .g-lang, #g-lang-slot { display: none !important; }

  /* Compact Call button stays visible on the right, next to the menu icon */
  .g-topbar__cta {
    justify-self: end;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 10px 14px;
    font-size: 11px; letter-spacing: 0.06em;
    box-sizing: border-box;
  }
  .g-burger { margin-left: 10px; }

  .g-burger {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0;
    background: transparent; border: 1px solid rgba(247, 243, 234, 0.28); border-radius: 8px;
    color: #F7F3EA; cursor: pointer; justify-self: end;
  }
  .g-burger span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }

  .g-mobile-panel {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    background: #0E1F18; color: #F7F3EA;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(212, 165, 114, 0.18);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
  }
  .g-mobile-panel[hidden] { display: none; }

  .g-mp__top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0 12px; margin-bottom: 4px;
    border-bottom: 1px solid rgba(247, 243, 234, 0.12);
  }
  .g-mp__title { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(247, 243, 234, 0.6); }
  .g-mp__close {
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; color: #F7F3EA; font-size: 26px; line-height: 1; cursor: pointer;
  }

  .g-mp__link, .g-mp__btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-height: 48px; padding: 12px 4px;
    background: transparent; border: 0; border-bottom: 1px solid rgba(247, 243, 234, 0.08);
    color: #F7F3EA; font-family: inherit; font-size: 16px; letter-spacing: 0.04em;
    text-decoration: none; text-transform: uppercase; cursor: pointer; text-align: left;
  }
  .g-mp__btn svg { flex: none; transition: transform 160ms ease; }
  .g-mp__sec.open .g-mp__btn svg { transform: rotate(180deg); }

  .g-mp__links { padding: 4px 0 10px; }
  .g-mp__cat {
    display: block; padding: 12px 4px 4px;
    font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #D4A572;
  }
  .g-mp__sublink {
    display: block; min-height: 44px; padding: 12px 14px;
    color: rgba(247, 243, 234, 0.88); font-size: 16px; line-height: 1.35; text-decoration: none;
    overflow-wrap: break-word;
  }
  .g-mp__sublink:hover { color: #F7F3EA; }

  .g-mp__cta {
    display: block; width: 100%; min-height: 48px; margin-top: 14px; padding: 14px 18px;
    background: #A46B30; color: #F7F3EA; border-radius: 999px;
    font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
    text-align: center; box-sizing: border-box;
  }
  .g-mp__cta:hover { background: #8d5a26; }

  /* Sticky header must not cover anchored content */
  [id] { scroll-margin-top: 88px; }
}

/* ===== Content guards on phones ===== */
@media (max-width: 767px) {
  img, video { max-width: 100%; height: auto; }
  iframe { max-width: 100%; }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  main, section, article, p, li, td, th, .g-crumbs { overflow-wrap: break-word; }
  .g-crumbs { overflow-wrap: anywhere; }
}

/* ===== About page (nav2 React header) small-screen fixes ===== */
@media (max-width: 900px) {
  .nav2__dd-menu { min-width: 0; width: min(92vw, 620px); }
}
@media (max-width: 640px) {
  .nav2__dd-menu, .nav2__dd-menu--services {
    min-width: 0; width: min(88vw, 320px);
    grid-template-columns: 1fr;
    left: 0; right: auto; transform: translateY(-6px);
  }
  .nav2__dd.open .nav2__dd-menu { transform: translateY(0); }
  /* The mobile pages dropdown anchors to the viewport so it never runs off the edge */
  .nav2__pages-dd .nav2__dd-menu {
    position: fixed; left: 4vw; right: 4vw; top: 72px; width: auto;
    max-height: 70vh; overflow-y: auto;
  }
  .lang-switcher__menu { left: auto; right: 0; }
  .nav2__phone { white-space: nowrap; }
  /* About page figures carry a desktop offset that pushes them off screen */
  .about-h-figure { margin-left: 0 !important; margin-right: 0 !important; }
}

/* ===== Listing page: neighborhood cards must shrink to fit ===== */
@media (max-width: 720px) {
  .nbhd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .nbhd-grid { grid-template-columns: minmax(0, 1fr); }
}
