/* Shared iframe modals — desktop sizes preserved; narrow-viewport padding only */

body.contact-modal-open {
  overflow: hidden;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.contact-modal[hidden] {
  display: none !important;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 20, 0.62);
  backdrop-filter: blur(5px);
}

.contact-modal-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  height: auto;
  max-height: min(94vh, 980px);
  overflow: hidden;
  border: 1px solid rgba(220, 210, 192, 0.95);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
  display: block;
  box-sizing: border-box;
}

.contact-modal-frame {
  width: 100%;
  height: auto;
  border: 0;
  display: block;
  background: #fff;
}

/* Members HOA map modal — full layout on large screens */
.members-map-modal .contact-modal-shell.members-map-modal-shell {
  width: min(1280px, 100%);
  height: min(88vh, 940px);
  max-height: calc(100vh - 2rem);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: width 0.2s ease, height 0.2s ease, border-radius 0.2s ease;
}

.members-map-modal.is-map-expanded {
  padding: 0;
  display: block;
  overflow: hidden;
}

.members-map-modal .members-map-modal-shell.is-expanded {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  z-index: 2;
}

.members-map-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(221, 212, 196, 0.95);
  background: linear-gradient(180deg, #fff, #f9f4ea);
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.members-map-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #2e2a24;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.members-map-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.members-map-modal-actions .btn {
  min-width: 5.5rem;
}

.members-map-modal-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 480px;
  height: calc(88vh - 64px);
  border: 0;
  display: block;
  background: #f5f1ea;
}

.members-map-modal .members-map-modal-shell.is-expanded .members-map-modal-frame {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .contact-modal {
    padding: 0.5rem;
  }

  .contact-modal-shell {
    width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 18px;
  }

  .members-map-modal .contact-modal-shell.members-map-modal-shell {
    width: 100%;
    height: min(92vh, 100%);
    border-radius: 18px;
  }

  .members-map-modal-header {
    flex-wrap: wrap;
  }

  .members-map-modal-frame {
    min-height: 360px;
    height: calc(92vh - 72px);
  }
}

@media (max-width: 560px) {
  .contact-modal {
    padding: 0.35rem;
  }

  .members-map-modal-actions .btn {
    min-width: 0;
    flex: 1 1 auto;
  }
}
