/* Map-home composition (the homepage and city map views): the map and the memories are the
   page, "Add your memory" is its one filled button, and everything else is quiet, grouped or
   one click away. Keep reader, Blox and search-result drawers unchanged. Tokens only. */
.map-home-shell {
  --map-home-target: calc(var(--ds-space-10) + var(--ds-space-1));
  /* One margin from the viewport edge, and one elevation, for every floating thing on the map. */
  --map-home-edge: var(--ds-space-4);
  --map-home-float: var(--ds-shadow-card);
  --map-home-panel-width: 416px;
}
.map-home-shell :is(.map-home-panel, .mb-discovery) {
  font-family: var(--ds-font-sans);
  color: var(--ds-ink);
}
.map-home-shell .map-home-panel {
  background: var(--ds-card);
  border-radius: var(--ds-radius-xl);
  box-shadow: var(--map-home-float);
}
.map-home-shell .map-home-panel .block-panel-content {
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}

/* The intro. A guest reads the headline, its sentence and one line of hub links. */
.map-home-shell .map-intro {
  padding: var(--ds-space-5) var(--ds-space-5) var(--ds-space-4);
  gap: var(--ds-space-3);
  border-bottom: 0;
  background: var(--ds-card);
}
/* A signed-in member has read it: only the page's H1 stays, for assistive technology. */
.map-home-shell .map-intro--member {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.map-home-shell .map-intro--member .seo-page-header > :not(h1) { display: none; }
.map-home-eyebrow {
  margin: 0;
  color: var(--ds-link);
  font: 700 var(--ds-font-size-overline)/var(--ds-line-height-overline) var(--ds-font-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.map-home-shell .map-intro .seo-page-header h1 {
  margin: 0;
  color: var(--ds-ink);
  font: 600 var(--ds-font-size-h3)/var(--ds-line-height-h3) var(--ds-font-display);
  overflow-wrap: break-word;
}
.map-home-shell .map-intro .seo-answer-line {
  margin-top: var(--ds-space-2);
  font: var(--ds-font-size-body)/var(--ds-line-height-body) var(--ds-font-sans);
}
.map-home-shell .map-intro .seo-header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--ds-space-5);
  padding: 0;
  margin: var(--ds-space-2) 0 0;
  overflow: visible;
}
.map-home-shell :is(.map-intro .seo-header-nav, .map-home-foot) a {
  display: inline-flex;
  align-items: center;
  min-height: var(--ds-space-8);
  padding: 0;
  border: 0;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-ink-soft);
  font: 500 var(--ds-font-size-bodySm)/var(--ds-line-height-bodySm) var(--ds-font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.map-home-shell :is(.map-intro .seo-header-nav, .map-home-foot) a:hover {
  background: transparent;
  color: var(--ds-ink);
  text-decoration: underline;
}
/* The discovery shells keep their disclosure (seo-page-header.html). */
.map-home-topics { margin-top: var(--ds-space-2); }
.map-home-shell :is(.map-home-topics, .map-home-moments) > summary {
  display: list-item;
  min-height: var(--map-home-target);
  padding: var(--ds-space-3) 0;
  color: var(--ds-ink-soft);
  font: 500 var(--ds-font-size-bodySm)/var(--ds-line-height-bodySm) var(--ds-font-sans);
  cursor: pointer;
}
.map-home-shell .map-home-topics .seo-header-nav { margin-top: 0; }

/* The memories lead: a modest label, one row of tabs, then the cards. */
.map-home-shell .map-home-featured { padding: var(--ds-space-4) var(--ds-space-5) var(--ds-space-5); }
.map-home-shell .map-intro:not(.map-intro--member) ~ .map-home-featured { padding-top: 0; }
.map-home-shell .map-home-section-title {
  margin: 0;
  color: var(--ds-ink-soft);
  font: 600 var(--ds-font-size-caption)/var(--ds-line-height-caption) var(--ds-font-sans);
}
.map-home-shell .featured-memories-container {
  padding: 0;
  background: transparent;
  font-family: var(--ds-font-sans);
}
.map-home-shell .featured-memories-container > .tabs {
  display: flex;
  gap: var(--ds-space-5);
  padding: 0;
  margin: 0 0 var(--ds-space-4);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--ds-line);
  border-radius: 0;
  background: transparent;
}
.map-home-shell .featured-memories-container > .tabs::-webkit-scrollbar { display: none; }
.map-home-shell .featured-memories-container > .tabs > .tab-btn {
  flex: none;
  min-height: var(--map-home-target);
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ds-ink-soft);
  font: 600 var(--ds-font-size-label)/var(--ds-line-height-label) var(--ds-font-sans);
  white-space: nowrap;
  box-shadow: none;
}
.map-home-shell .featured-memories-container > .tabs > .tab-btn:hover { color: var(--ds-ink); }
.map-home-shell .featured-memories-container > .tabs > .tab-btn.active {
  border-bottom-color: var(--ds-brand);
  color: var(--ds-ink);
}
/* Cards: one radius, no shadow at rest inside the panel, and the whole card answers the pointer. */
.map-home-shell .map-home-panel .memory-list { margin-top: 0; }
.map-home-shell .map-home-panel .memory-feed-card .memory-element {
  margin-bottom: var(--ds-space-3);
  border-color: var(--ds-line);
  border-radius: var(--ds-radius-lg);
  box-shadow: none;
  transition: box-shadow 150ms cubic-bezier(.4, 0, .2, 1), border-color 150ms cubic-bezier(.4, 0, .2, 1),
    transform 150ms cubic-bezier(.4, 0, .2, 1);
}
/* Two lines of title instead of one cut short: the title is what invites the click. */
.map-home-shell .map-home-panel .memory-feed-card .memory-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font: 600 var(--ds-font-size-body)/var(--ds-line-height-body) var(--ds-font-sans);
  white-space: normal;
  overflow-wrap: anywhere;
}
.map-home-shell .map-home-panel .memory-feed-card:hover .memory-element {
  border-color: var(--ds-input-border);
  box-shadow: var(--ds-shadow-card);
  transform: translateY(-1px);
}
.map-home-shell .map-home-panel .memory-feed-card:active .memory-element { box-shadow: none; transform: none; }
.map-home-shell .map-home-panel .memory-element:has(.seo-card-overlay-link:focus-visible) {
  outline: 3px solid var(--ds-focus);
  outline-offset: 2px;
}
.map-home-shell .map-home-panel .seo-card-overlay-link:focus-visible { outline: 0; }
/* The page has one filled button. Everything else that loads or retries is an outline. */
.map-home-shell .map-home-panel .load-more-container { padding: var(--ds-space-2) 0 0 !important; }
.map-home-shell .map-home-panel .load-more-btn,
.map-home-secondary,
.map-home-shell :is(.nearby-retry, .nearby-load-more) {
  min-height: var(--ds-space-12);
  padding: var(--ds-space-3) var(--ds-space-5) !important;
  border: 1px solid var(--ds-input-border) !important;
  border-radius: var(--ds-radius-md) !important;
  background: var(--ds-card) !important;
  color: var(--ds-ink) !important;
  font: 600 var(--ds-font-size-bodySm)/var(--ds-line-height-bodySm) var(--ds-font-sans);
  cursor: pointer;
}
.map-home-shell .map-home-panel .load-more-btn:hover,
.map-home-secondary:hover,
.map-home-shell :is(.nearby-retry, .nearby-load-more):hover { background: var(--ds-surface) !important; }
.map-home-shell .map-home-moments { margin: 0 var(--ds-space-5); border-top: 1px solid var(--ds-line); }
.map-home-shell .map-home-moments > summary {
  padding: var(--ds-space-4) 0;
  color: var(--ds-ink);
  font-size: var(--ds-font-size-bodySm);
  line-height: var(--ds-line-height-bodySm);
}
/* Foot of the feed column (includes/map-home-foot.html): the ways out, as quiet lines of text. */
.map-home-foot {
  display: flex;
  flex-direction: column;
  padding: var(--ds-space-3) var(--ds-space-5) var(--ds-space-5);
  border-top: 1px solid var(--ds-line);
  background: var(--ds-card);
}
.map-home-foot__line { display: flex; flex-wrap: wrap; gap: 0 var(--ds-space-5); margin: 0; }
.map-home-shell :is(.map-home-topics, .map-home-moments, .map-home-foot, .map-intro, .featured-memories-container, .footer-ui) :is(a, button, summary):focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: var(--ds-space-1);
}

/* The one filled button. */
.map-home-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  width: 100%;
  height: var(--ds-space-12);
  padding: 0 var(--ds-space-6);
  border: 0;
  border-radius: var(--ds-radius-md);
  background: var(--ds-brand);
  color: var(--ds-on-cta);
  font: 600 var(--ds-font-size-body)/var(--ds-line-height-body) var(--ds-font-sans);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
.map-home-primary:hover { background: var(--ds-brand-hover); }
.map-home-primary__icon { font-size: var(--ds-font-size-h3); }
.map-home-shell .discover-memory-distance {
  display: block;
  margin-top: var(--ds-space-1);
  color: var(--ds-ink-soft);
  font: 400 var(--ds-font-size-caption)/var(--ds-line-height-caption) var(--ds-font-sans);
}
.map-home-shell .discover-nearby-heading h3 {
  margin: 0;
  font: 600 var(--ds-font-size-h4)/var(--ds-line-height-h4) var(--ds-font-sans);
}
.map-home-shell .discover-nearby-heading p {
  margin: var(--ds-space-1) 0 var(--ds-space-4);
  color: var(--ds-ink-soft);
  font: 400 var(--ds-font-size-bodySm)/var(--ds-line-height-bodySm) var(--ds-font-sans);
}
.map-home-secondary:focus-visible,
.map-home-shell :is(.nearby-retry, .nearby-load-more):focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: var(--ds-space-1);
}
/* The Discover tab's states: an icon, a sentence and, where there is something to do, one outline button. */
.map-home-state {
  padding: var(--ds-space-6);
  color: var(--ds-ink-soft);
  font: 400 var(--ds-font-size-body)/var(--ds-line-height-body) var(--ds-font-sans);
  text-align: center;
}
.map-home-state p { margin: var(--ds-space-2) 0 var(--ds-space-3); }
.map-home-state > .material-icons-outlined { color: var(--ds-ink-faint); font-size: var(--ds-space-10); }
/* The home action floats over the middle of the map that the panel leaves free, with no card
   of its own, including in a desktop response resized below the mobile breakpoint. */
.map-home-shell.server-desktop .footer-ui:has(> .map-home-primary) {
  position: fixed !important;
  left: calc(50% + (var(--map-home-panel-width) + var(--map-home-edge)) / 2);
  right: auto;
  /* Above the map's credit line, which must stay readable. */
  bottom: var(--ds-space-12);
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100vw - var(--ds-space-8));
  padding: 0 !important;
  border: 0;
  border-radius: var(--ds-radius-md);
  background: transparent;
  box-shadow: var(--ds-shadow-elevated);
}
.map-home-shell .map-home-primary { box-sizing: border-box; }
/* Map controls on the classic shell: the same edge margin as the panel, and Map / Aerial as
   one small two-option toggle under the zoom buttons instead of a card of thumbnails. */
.search-results:not(.map-first-shell) #map .maplibregl-ctrl-top-right {
  top: calc(var(--map-header-height, 64px) + var(--ds-space-4));
  right: var(--ds-space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--ds-space-2);
}
.search-results:not(.map-first-shell) #map .maplibregl-ctrl-top-right > .maplibregl-ctrl { float: none; margin: 0; }
.search-results:not(.map-first-shell) #map .maplibregl-ctrl-top-right > .maplibregl-ctrl-group { box-shadow: var(--ds-shadow-card); }
.search-results:not(.map-first-shell) #map .mb-map-view-control {
  width: auto;
  padding: var(--ds-space-1);
  border: 0;
  border-radius: var(--ds-radius-md);
  background: var(--ds-card);
  box-shadow: var(--ds-shadow-card);
  color: var(--ds-ink);
}
.search-results:not(.map-first-shell) #map .mb-map-view-options { gap: var(--ds-space-1); }
.search-results:not(.map-first-shell) #map .mb-map-view-preview { display: none; }
.search-results:not(.map-first-shell) #map .mb-map-view-control .mb-map-view-option {
  flex: none;
  flex-direction: row;
  justify-content: center;
  min-height: var(--ds-space-8);
  padding: 0 var(--ds-space-3);
  border: 0;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-ink-soft);
  font: 600 var(--ds-font-size-caption)/var(--ds-line-height-caption) var(--ds-font-sans);
}
.search-results:not(.map-first-shell) #map .mb-map-view-control .mb-map-view-option:hover { background: var(--ds-surface); color: var(--ds-ink); }
.search-results:not(.map-first-shell) #map .mb-map-view-control .mb-map-view-option[aria-pressed="true"] {
  background: color-mix(in srgb, var(--ds-brand) 16%, var(--ds-card));
  color: var(--ds-ink);
}
.search-results:not(.map-first-shell) #map .mb-map-view-control .mb-map-view-option:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 2px;
}
.search-results:not(.map-first-shell) #map .mb-map-view-status {
  max-width: 200px;
  margin: var(--ds-space-1) var(--ds-space-2);
  color: var(--ds-ink-soft);
  font: 400 var(--ds-font-size-caption)/var(--ds-line-height-caption) var(--ds-font-sans);
}
/* Experimental shelves share the same typography and the repaired carousel. */
.map-home-shell .mb-discovery { font-family: var(--ds-font-sans); }
.map-home-shell .mb-discovery .map-intro { padding: var(--ds-space-5); }
@media (min-width: 813px) {
  .map-home-shell.server-desktop .map-home-panel {
    width: min(var(--map-home-panel-width), calc(100vw - var(--ds-space-8)));
  }
  .map-home-shell.server-desktop .map-home-panel .block-panel-content {
    max-height: calc(100dvh - 96px);
  }
}
@media (max-width: 812px) {
  .map-home-shell .map-intro { padding: var(--ds-space-5) var(--ds-space-4) var(--ds-space-3); }
  .map-home-shell .map-home-moments { margin-inline: var(--ds-space-4); }
  .map-home-shell :is(.map-intro .seo-header-nav, .map-home-foot) a { min-height: var(--map-home-target); }
  .map-home-foot { padding-inline: var(--ds-space-4); }
  .search-results:not(.map-first-shell) #map .mb-map-view-control .mb-map-view-option { min-height: var(--map-home-target); }
  /* Resizing a desktop window keeps its server-rendered desktop markup.
     Do not inherit the mobile drawer's collapsed 68px panel in that case. */
  .map-home-shell.server-desktop .block-interface:has(> .map-home-panel) {
    position: relative;
    bottom: auto;
    width: 100%;
    overflow: visible;
  }
  .map-home-shell.server-desktop .map-home-panel {
    width: min(var(--map-home-panel-width), calc(100vw - var(--ds-space-8)));
    min-height: 0;
    max-height: none;
  }
  .map-home-shell.server-desktop .map-home-panel .block-panel-content {
    max-height: calc(100dvh - 192px);
  }
  .map-home-shell.server-desktop .footer-ui:has(> .map-home-primary) { left: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .map-home-shell .map-home-panel .memory-feed-card .memory-element { transition: none; }
  /* Two lines of title instead of one cut short: the title is what invites the click. */
.map-home-shell .map-home-panel .memory-feed-card .memory-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font: 600 var(--ds-font-size-body)/var(--ds-line-height-body) var(--ds-font-sans);
  white-space: normal;
  overflow-wrap: anywhere;
}
.map-home-shell .map-home-panel .memory-feed-card:hover .memory-element { transform: none; }
}
