/**
 * Cross-browser / Safari layout fixes for the public website.
 * Load after page CSS so these rules win on shared selectors.
 */

/* Safer default images — never force a fixed height globally */
img {
  max-width: 100%;
  height: auto;
}

.logo img,
header .logo img {
  height: 50px !important;
  width: auto !important;
  max-height: 50px;
  object-fit: contain;
  display: block;
}

/* Avoid clipping that breaks sticky headers in Safari */
html {
  overflow-x: clip;
}

@supports not (overflow-x: clip) {
  html {
    overflow-x: hidden;
  }
}

body {
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

@supports not (overflow-x: clip) {
  body {
    overflow-x: hidden;
  }
}

/* iOS Safari viewport-height menus */
.nav-links {
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
}

/* Flex gap fallback for older Safari */
.nav-menu ul {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}

.nav-menu ul > li + li {
  margin-left: 0;
}

@supports not (gap: 1rem) {
  .nav-menu ul > li + li {
    margin-left: 40px;
  }

  @media (max-width: 768px) {
    .nav-menu ul > li + li {
      margin-left: 0;
      margin-top: 15px;
    }
  }

  @media (min-width: 769px) and (max-width: 1024px) {
    .nav-menu ul > li + li {
      margin-left: 24px;
    }
  }
}

/* Backdrop blur — Safari needs -webkit- prefix with matching values */
.property-info {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.property-modal {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.property-overlay {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Header row stays aligned on iPad Safari (no forced top margin) */
@media (min-width: 769px) and (max-width: 1024px) {
  .container1 {
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
  }

  nav.nav-menu {
    margin-top: 0 !important;
    width: auto;
  }
}

/* Sticky filters: keep working when possible */
.filter-section {
  position: -webkit-sticky;
  position: sticky;
}

/* Aspect-ratio cards: give Safari a height floor */
.property-card1,
.builder-card,
.video-thumbnail {
  min-height: 1px;
}

/* Smooth transform centering for modals across engines */
.modal-content {
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}
