/* Office map ([xpt_office_map]). Plain CSS, loaded only when the shortcode renders. */

.office-map {
  --office-map-base: #E3E3E2;
  --office-map-active: #ACACAC;
  --office-map-stroke: #FFFFFF;
  --office-map-ink: #2D2A26;
  --office-map-link: #00744B;
  --office-map-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --zoom: 1;
  position: relative;
  margin: 2rem 0;
  color: var(--office-map-ink);
}

.office-map__stage { position: relative; }

.office-map__viewport {
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.office-map__canvas {
  position: relative;
  transform-origin: 0 0;
  transition: transform 500ms var(--office-map-ease);
  cursor: default;
}
.office-map.is-zoomed .office-map__canvas { cursor: grab; }
.office-map.is-dragging .office-map__canvas { cursor: grabbing; transition: none; }

/* The theme styles every <button> through a long :not() chain
   (button:not(.popmake-close):not(:hover)...), which outranks any class
   selector here. Reset, then force the few properties it sets. */
.office-map .office-map__pin,
.office-map .office-map__zoom button,
.office-map .office-map__close {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
}
.office-map .office-map__pin,
.office-map .office-map__close { background: none !important; }
.office-map .office-map__zoom button { background: #FFFFFF !important; color: var(--office-map-ink) !important; }
.office-map .office-map__zoom button:hover { background: #F2F2F2 !important; }

.office-map__svg { display: block; width: 100%; height: auto; }
.office-map__states path {
  fill: var(--office-map-base);
  stroke: var(--office-map-stroke);
  stroke-width: 0.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.office-map__labels text {
  font: 700 5.5px/1 Arial, sans-serif;
  fill: #5B5B5B;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

/* Pins keep their on-screen size at any zoom level. */
.office-map .office-map__pin {
  position: absolute;
  z-index: 1;
  width: 18px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -100%) scale(calc(1 / var(--zoom)));
  transform-origin: 50% 100%;
}
.office-map__pin svg { display: block; width: 100%; height: 100%; overflow: visible; }
.office-map__pin path { fill: var(--pin); stroke: #FFFFFF; stroke-width: 1.5; }
.office-map__pin circle { fill: #FFFFFF; }
.office-map__pin:hover,
.office-map__pin:focus-visible,
.office-map__pin[aria-expanded="true"] { z-index: 3; }
.office-map__pin:focus-visible { outline: 3px solid var(--pin); outline-offset: 2px; border-radius: 4px; }

.office-map__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--office-map-ink);
  color: #FFFFFF;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--office-map-ease);
}
.office-map__pin:hover .office-map__tip,
.office-map__pin:focus-visible .office-map__tip { opacity: 1; }

.office-map__zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.office-map .office-map__zoom button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #D5D5D5;
  border-radius: 4px;
  background: #FFFFFF;
  color: var(--office-map-ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.office-map__details {
  position: absolute;
  z-index: 5;
  left: 8px;
  bottom: 8px;
  width: min(320px, calc(100% - 16px));
  max-height: calc(100% - 16px);
  overflow: auto;
  padding: 20px 20px 16px;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 8px 24px rgba(20, 38, 34, 0.18);
}
.office-map .office-map__close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--office-map-ink);
}

.office-map__office + .office-map__office { margin-top: 16px; padding-top: 16px; border-top: 1px solid #E3E3E2; }
.office-map .office-map__office h3,
.office-map .office-map__office h4 { margin: 0 0 4px; font-size: 18px; line-height: 1.2; max-width: none; }
.office-map .office-map__office address { font-style: normal; }
.office-map .office-map__office p,
.office-map .office-map__office address { margin: 0 0 4px; font-size: 15px; line-height: 1.5; max-width: none; }
.office-map .office-map__office a { color: var(--office-map-link); font-weight: 700; }
.office-map__company { color: #5B5B5B; }

.office-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.office-map__legend li { display: flex; align-items: center; gap: 8px; }
.office-map__swatch { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin); }

.office-map__list { margin-top: 16px; }
.office-map__list summary { cursor: pointer; font-weight: 700; }
.office-map__states-list {
  columns: 3 240px;
  column-gap: 32px;
  margin-top: 16px;
}
.office-map__states-list section { break-inside: avoid; margin-bottom: 20px; }
.office-map__states-list > section > h3 { margin: 0 0 8px; font-size: 20px; }

/* list="open": every office as a card in a grid under the map. */
.office-map__list--open { margin-top: 56px; }
.office-map .office-map__list-title { margin: 0 0 24px; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.1; max-width: none; }
.office-map__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.office-map__card {
  position: relative;
  margin: 0;
  padding: 22px 22px 20px;
  border-top: 4px solid var(--pin);
  border-radius: 2px;
  background: #F4F6F5;
}
.office-map__state {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 3px 8px;
  border-radius: 2px;
  background: #16201D;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.office-map__card .office-map__office { padding-right: 44px; }
.office-map .office-map__card h3 {
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-weight: normal;
  font-size: 19px;
  line-height: 1.25;
}
.office-map .office-map__card :is(p, address) {
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-weight: normal;
  font-size: 15px;
  line-height: 1.5;
}
.office-map .office-map__card .office-map__company { margin-bottom: 12px; font-size: 14px; color: #5F6B67; }
.office-map .office-map__card a {
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-weight: normal;
  text-decoration: none;
}
.office-map .office-map__card a:hover { text-decoration: underline; }

/* Phones: the map is too small to hold the card, so it sits below the map. */
@media (max-width: 639px) {
  .office-map .office-map__pin { width: 14px; height: 19px; }
  .office-map__details {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    max-height: none;
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .office-map__canvas,
  .office-map__tip { transition: none; }
}
