/* Campus Map block */
section.wsp-campus-map {
  --cm-navy: #141641;
  --cm-blue: #19a2dc;
  --cm-yellow: #ffc109;
  --cm-muted: #4f5668;
  --cm-line: #e3e8ef;
  --cm-tint: #f4f8fb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "map list";
  max-width: 1400px;
  margin: 0 auto;
  padding: 0; /* the theme pads every section */
  background: #fff;
  color: var(--cm-navy);
  text-align: left;
}
.wsp-campus-map button { font: inherit; color: inherit; cursor: pointer; }
.wsp-campus-map .cm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Filters: the same pills as the Events block's filters, floating over the
   top of the map (clear of the zoom controls) on desktop */
.wsp-campus-map .cm-chips {
  grid-area: map;
  align-self: start;
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 80px 0 16px;
  pointer-events: none; /* the gaps between chips still drag the map */
}
.wsp-campus-map .cm-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 999px;
  border: 2px solid var(--cm-navy); background: #fff;
  color: var(--cm-navy);
  font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 2px 8px rgb(20 22 65 / .2);
  pointer-events: auto;
  transition: background-color .15s, color .15s;
}
.wsp-campus-map .cm-chip:hover,
.wsp-campus-map .cm-chip[aria-pressed="true"] { background: var(--cm-navy); color: #fff; }

/* Map */
.wsp-campus-map .cm-map {
  grid-area: map;
  position: relative;
  aspect-ratio: 1285 / 772;
  overflow: hidden;
}
.wsp-campus-map .cm-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: block;
  touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.wsp-campus-map .cm-svg.is-home { touch-action: pan-y; }
.wsp-campus-map .cm-svg.is-dragging { cursor: grabbing; }

.wsp-campus-map .cm-hotspot {
  cursor: pointer;
  fill: transparent;
  stroke: transparent; stroke-width: 3; vector-effect: non-scaling-stroke;
  transition: fill .15s, stroke .15s;
}
.wsp-campus-map .cm-alias { pointer-events: none; }
.wsp-campus-map .cm-hotspot:hover { fill: rgb(255 255 255 / .22); stroke: var(--cm-navy); }
.wsp-campus-map .cm-hotspot.is-active { fill: transparent; stroke: var(--cm-yellow); stroke-width: 4; }
.wsp-campus-map .cm-spotlight {
  fill: rgb(20 22 65 / .5); pointer-events: none;
  opacity: 0; transition: opacity .25s;
}
.wsp-campus-map .cm-spotlight.is-on { opacity: 1; }

.wsp-campus-map .cm-zoom {
  position: absolute; top: 16px; right: 16px;
  display: flex; flex-direction: column;
  background: var(--cm-navy);
  box-shadow: 0 2px 10px rgb(20 22 65 / .25);
}
.wsp-campus-map .cm-zoom button {
  display: grid; place-items: center;
  width: 42px; height: 42px; padding: 0; border: 0; background: var(--cm-navy);
  font-size: 24px; line-height: 1; color: #fff;
  transition: background-color .15s, color .15s;
}
.wsp-campus-map .cm-zoom button + button { border-top: 1px solid rgb(255 255 255 / .18); }
.wsp-campus-map .cm-zoom button:hover { background: var(--cm-yellow); color: var(--cm-navy); }
.wsp-campus-map .cm-zoom svg { width: 18px; height: 18px; }

.wsp-campus-map .cm-tip {
  position: absolute; pointer-events: none;
  padding: 7px 12px;
  background: var(--cm-navy); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; transform: translate(-50%, calc(-100% - 14px));
  opacity: 0; transition: opacity .1s;
}
.wsp-campus-map .cm-tip.is-on { opacity: 1; }

.wsp-campus-map .cm-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgb(20 22 65 / .55); color: #fff;
  font-size: 18px; font-weight: 600; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.wsp-campus-map .cm-hint.is-on { opacity: 1; }

/* Info card: styled like the Events grid cards. Over the map on desktop,
   under it on phones. */
.wsp-campus-map .cm-card {
  grid-area: map;
  align-self: end; justify-self: start;
  position: relative; z-index: 1;
  width: min(380px, calc(100% - 40px));
  margin: 20px;
  padding: 22px 24px 24px;
  background: var(--cm-navy); color: #fff;
  border-top: 4px solid var(--cm-yellow);
  box-shadow: 0 8px 30px rgb(20 22 65 / .3);
}
.wsp-campus-map .cm-card[hidden] { display: none; }
.wsp-campus-map .cm-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cm-blue);
}
/* Buildings' navy dot would vanish on the navy card */
.wsp-campus-map .cm-card .cm-dot { box-shadow: 0 0 0 2px rgb(255 255 255 / .85); }
.wsp-campus-map .cm-name {
  margin: 8px 40px 0 0;
  font-size: 24px; line-height: 1.15; font-weight: 700; text-transform: uppercase;
  color: #fff;
}
.wsp-campus-map .cm-sub { margin: 4px 0 0; font-size: 14px; color: rgb(255 255 255 / .75); }
.wsp-campus-map .cm-sub:empty { display: none; }
.wsp-campus-map .cm-desc { margin: 12px 0 0; white-space: pre-line; font-size: 15px; line-height: 1.55; color: rgb(255 255 255 / .9); }
.wsp-campus-map .cm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
/* The site's yellow button (Rent Now, Contact) */
.wsp-campus-map .cm-btn {
  display: inline-flex; align-items: center;
  padding: 10px 24px; border: 2px solid var(--cm-yellow);
  background: var(--cm-yellow); color: var(--cm-navy) !important; text-decoration: none !important;
  font-size: 15px; font-weight: 700; line-height: 1.2;
  transition: background-color .15s, border-color .15s, color .15s;
}
.wsp-campus-map .cm-btn:hover { background: #fff; border-color: #fff; }
.wsp-campus-map .cm-btn-ghost { background: transparent; border-color: #fff; color: #fff !important; }
.wsp-campus-map .cm-btn-ghost:hover { background: #fff; color: var(--cm-navy) !important; }
.wsp-campus-map .cm-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; padding: 0; border: 0;
  background: transparent; font-size: 26px; line-height: 1; color: #fff;
}
.wsp-campus-map .cm-close:hover { color: var(--cm-yellow); }

/* List */
.wsp-campus-map .cm-list {
  grid-area: list;
  position: relative;
  border-left: 1px solid var(--cm-line);
}
/* Absolutely filled so the list scrolls instead of stretching the map */
.wsp-campus-map .cm-list-inner {
  position: absolute; inset: 0;
  overflow-y: auto; padding: 8px 0 24px;
  overscroll-behavior: contain;
}
.wsp-campus-map .cm-group[hidden] { display: none; }
.wsp-campus-map .cm-group + .cm-group { margin-top: 8px; }
.wsp-campus-map .cm-group h3 {
  margin: 0; padding: 18px 24px 8px;
  font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cm-navy);
}
.wsp-campus-map .cm-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 11px 24px; border: 0; background: none; text-align: left;
  box-shadow: inset 4px 0 0 transparent;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.wsp-campus-map .cm-item:hover { background: var(--cm-tint); box-shadow: inset 4px 0 0 var(--cm-blue); }
.wsp-campus-map .cm-item[aria-pressed="true"] { background: var(--cm-navy); color: #fff; box-shadow: inset 4px 0 0 var(--cm-yellow); }
.wsp-campus-map .cm-item-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; }
.wsp-campus-map .cm-item-sub { display: block; margin-top: 1px; font-size: 13px; color: var(--cm-muted); }
.wsp-campus-map .cm-item[aria-pressed="true"] .cm-item-sub { color: rgb(255 255 255 / .75); }

.wsp-campus-map :focus-visible { outline: 3px solid var(--cm-blue); outline-offset: 2px; }

/* Below desktop width, stack: chips in their own row, then the map, the
   info card and the list */
@media (max-width: 1023px) {
  section.wsp-campus-map {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "chips" "map" "card" "list";
  }
  .wsp-campus-map .cm-chips {
    grid-area: chips;
    pointer-events: auto;
    border-bottom: 1px solid var(--cm-line);
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding: 14px 16px;
  }
  .wsp-campus-map .cm-chip { box-shadow: none; }
  .wsp-campus-map .cm-chips::-webkit-scrollbar { display: none; }
  .wsp-campus-map .cm-card {
    grid-area: card;
    width: auto; margin: 0;
    padding: 20px 20px 22px;
    box-shadow: none;
  }
  .wsp-campus-map .cm-name { font-size: 20px; }
  .wsp-campus-map .cm-list { border-left: 0; }
  .wsp-campus-map .cm-group h3,
  .wsp-campus-map .cm-item { padding-left: 20px; padding-right: 20px; }
  .wsp-campus-map .cm-list-inner { position: static; max-height: 360px; }
}

/* Phones: a square map and smaller controls */
@media (max-width: 767px) {
  .wsp-campus-map .cm-chip { padding: 7px 16px; font-size: 14px; }
  .wsp-campus-map .cm-map { aspect-ratio: 1 / 1; }
  .wsp-campus-map .cm-zoom { top: 10px; right: 10px; }
  .wsp-campus-map .cm-zoom button { width: 38px; height: 38px; }
}
