/**
 * Mailers Near Me — homepage/account entry only.
 * Prefix body.pk-mnm-host so rules beat Berlin globals (e.g. body.pk-mnm-host h3 color).
 * Vertical rhythm mirrors .spotlight / .spotlight-content.
 */

body.pk-mnm-host .mnm-band {
  background: var(--pk-abs-black, #202A37);
  color: var(--pk-abs-white, #fff);
  padding: 40px 0;
}

body.pk-mnm-host .mnm-card {
  max-width: var(--pk-abs-container, 1280px);
  margin: 0 auto;
  padding: 0 var(--pk-page-gutter-x, 32px);
  box-sizing: border-box;
  font-family: var(--pk-abs-sans, Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

body.pk-mnm-host .mnm-card *,
body.pk-mnm-host .mnm-card *::before,
body.pk-mnm-host .mnm-card *::after {
  box-sizing: border-box;
}

body.pk-mnm-host .mnm-content .eyebrow {
  margin-bottom: 18px;
}

/* Beat body.home-abs h3 { color: --pk-abs-text }. Orange is unique to MNM (Guide stays white). */
body.pk-mnm-host .mnm-band .mnm-content h3 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  margin: 0 0 24px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--pk-abs-yellow, #E89030);
  max-width: 480px;
}

body.pk-mnm-host .mnm-content > p {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 28px;
  max-width: 440px;
}

body.pk-mnm-host .mnm-address-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
}

body.pk-mnm-host .mnm-address-label {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

body.pk-mnm-host .mnm-address-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: 16px/1.2 var(--pk-abs-sans, Roboto, sans-serif);
}

body.pk-mnm-host .mnm-address-form input { color-scheme: dark; }

/* Google Places Autocomplete dropdown — dark mode (container is appended to <body>). */
body.pk-mnm-host .pac-container {
  background: #2a3541;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  margin-top: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-family: var(--pk-abs-sans, Roboto, sans-serif);
  z-index: 100001;
}
body.pk-mnm-host .pac-item {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #aeb6be;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}
body.pk-mnm-host .pac-item:first-child { border-top: 0; }
body.pk-mnm-host .pac-item:hover,
body.pk-mnm-host .pac-item-selected {
  background: rgba(255, 255, 255, 0.08);
}
body.pk-mnm-host .pac-item-query {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}
body.pk-mnm-host .pac-matched {
  color: var(--pk-abs-yellow, #E89030);
  font-weight: 700;
}
body.pk-mnm-host .pac-icon {
  filter: invert(0.75);
}
/* Keep Google attribution visible on dark: light monochrome logo. */
body.pk-mnm-host .pac-logo:after {
  filter: brightness(0) invert(0.85);
}

body.pk-mnm-host .mnm-address-form input:focus {
  outline: none;
  border-color: var(--pk-abs-green-bright, #17A24C);
  border-width: 2px;
}

body.pk-mnm-host .mnm-address-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

body.pk-mnm-host .mnm-address-form .btn.mnm-open {
  align-self: stretch;
  width: 100%;
  height: auto;
  min-height: 52px;
  white-space: normal;
  text-align: center;
}

body.pk-mnm-host .mnm-privacy-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

body.pk-mnm-host .mnm-privacy-badge svg {
  flex: none;
}

/* Map column */
body.pk-mnm-host .mnm-home-visual {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 270px;
  overflow: hidden;
  border-radius: 12px;
  background: #1a222c;
}

body.pk-mnm-host .mnm-home-visual .mnm-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: center / cover no-repeat;
  opacity: 0.65;
  animation: mnm-map-approach 1.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

/* Live Leaflet/OSM map replaces the static demo image. */
body.pk-mnm-host .mnm-home-visual .mnm-map.is-live {
  background: #1a222c;
  opacity: 1;
  animation: none;
}

body.pk-mnm-host .mnm-home-visual .leaflet-container {
  background: #1a222c;
  font-family: var(--pk-abs-sans, Roboto, sans-serif);
}

/* OSM raster tiles → dark map (CSS filter; swap tile URL via pk_mnm_tile_url if a dark provider is added). */
body.pk-mnm-host .mnm-home-visual .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.92) saturate(0.55);
}

body.pk-mnm-host .mnm-home-visual::after {
  content: '© OpenStreetMap contributors';
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 3;
  font: 9px/1.2 var(--pk-abs-sans, Roboto, sans-serif);
  color: #d4dbe0;
  pointer-events: none;
}

body.pk-mnm-host .mnm-home-visual .mnm-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--pk-abs-green-bright, #17A24C);
  border: 3px solid #202A37;
  z-index: 2;
  box-shadow: 0 0 0 10px rgba(23, 162, 76, 0.12);
}

/* Cards are absolutely placed from JS (business lat/lng → Leaflet pixels). */
body.pk-mnm-host .mnm-businesses {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

body.pk-mnm-host .mnm-businesses > span {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  width: max-content;
  max-width: min(200px, 52%);
  min-width: 0;
  background: #fff;
  color: #202A37;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16, 24, 32, 0.28);
  /* Fade out in place, then fade in at the next business's map spot. */
  transition: opacity 0.38s ease, scale 0.38s ease;
  will-change: opacity, scale;
}

body.pk-mnm-host .mnm-businesses > span.is-out {
  opacity: 0;
  scale: 0.94;
}

@media (prefers-reduced-motion: reduce) {
  body.pk-mnm-host .mnm-businesses > span {
    transition: none;
  }
}

body.pk-mnm-host .mnm-businesses .local-business-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

body.pk-mnm-host .mnm-businesses .mnm-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eef2;
  color: #202A37;
  font-weight: 800;
  font-size: 12px;
}

body.pk-mnm-host .mnm-businesses .local-business-copy {
  min-width: 0;
}

body.pk-mnm-host .mnm-businesses .local-business-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

body.pk-mnm-host .mnm-businesses .local-business-copy small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: #69737c;
  margin-top: 3px;
}

@keyframes mnm-map-approach {
  from { transform: scale(0.8); opacity: 0.2; }
  to { transform: scale(1.12); opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
  body.pk-mnm-host .mnm-home-visual .mnm-map {
    animation: none;
    transform: none;
  }
}

/* Mobile / ≤820: heading → map → form */
@media (max-width: 820px) {
  body.pk-mnm-host .mnm-card.mnm-home {
    display: flex;
    flex-direction: column;
  }

  body.pk-mnm-host .mnm-home-visual {
    order: 2;
    height: 258px;
    min-height: 258px;
    margin: 8px 0 18px;
  }

  body.pk-mnm-host .mnm-content {
    display: contents;
  }

  body.pk-mnm-host .mnm-content .eyebrow { order: 1; }
  body.pk-mnm-host .mnm-band .mnm-content h3 { order: 1; max-width: none; }
  body.pk-mnm-host .mnm-content > p { order: 1; max-width: none; margin-bottom: 16px; }
  body.pk-mnm-host .mnm-address-form { order: 3; max-width: none; width: 100%; }
}

@media (max-width: 640px) {
  body.pk-mnm-host .mnm-card {
    padding-left: 22px;
    padding-right: 22px;
  }
}

/* Desktop ≥821: equal columns; map stretches; content pad matches .spotlight-content */
@media (min-width: 821px) {
  body.pk-mnm-host .mnm-card.mnm-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 32px;
    align-items: stretch;
  }

  body.pk-mnm-host .mnm-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0;
    min-width: 0;
  }

  body.pk-mnm-host .mnm-home-visual {
    height: auto;
    /* Guide visual is ~4/3 of ≤440px ≈ 330px; keep map at least that tall. */
    min-height: 360px;
    align-self: stretch;
  }

  body.pk-mnm-host .mnm-businesses > span {
    max-width: min(210px, 48%);
    padding: 10px;
    gap: 8px;
  }

  body.pk-mnm-host .mnm-businesses .local-business-image,
  body.pk-mnm-host .mnm-businesses .mnm-mono {
    width: 34px;
    height: 34px;
  }

  body.pk-mnm-host .mnm-businesses .local-business-copy strong { font-size: 14px; }
  body.pk-mnm-host .mnm-businesses .local-business-copy small { font-size: 12px; }
}

/* Account Home tile (free users only; injected by JS). */
.mnm-account-tile {
  margin: 24px 0;
}

.mnm-account-tile .mnm-card {
  padding: 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: var(--pk-abs-black, #202A37);
}

.mnm-account-tile .mnm-home-visual {
  display: none;
}

.mnm-account-tile .mnm-content h3 {
  font-size: 26px;
  max-width: 440px;
  color: var(--pk-abs-yellow, #E89030);
}

/* home band: same no-blue press behaviour as the sheet */
body.pk-mnm-host .mnm-band,body.pk-mnm-host .mnm-band *{-webkit-tap-highlight-color:transparent}
body.pk-mnm-host .mnm-band .btn:focus,body.pk-mnm-host .mnm-band .btn.focus,body.pk-mnm-host .mnm-band .btn:active,body.pk-mnm-host .mnm-band button:focus,body.pk-mnm-host .mnm-band button:active{outline:0;box-shadow:none}
body.pk-mnm-host .mnm-band .btn-primary:focus,body.pk-mnm-host .mnm-band .btn-primary:active{background:var(--pk-abs-green-bright,#17A24C);border-color:var(--pk-abs-green-bright,#17A24C);color:#fff}
body.pk-mnm-host .mnm-band .btn-primary:hover{background:#2A6C4C;border-color:#2A6C4C}
body.pk-mnm-host .mnm-band .btn:focus-visible{outline:2px solid #E89030;outline-offset:2px}
