/*
 * Hotel Knoll Map
 * Colors and fonts are CSS variables on .hkm-map. To override from a theme,
 * start selectors with ".hkm-wrap .hkm-map" so they win over these rules.
 */

/* Wrapper: sizes the map and lets the layout respond to its own width. */
.hkm-wrap {
  width: 100%;
  container-type: inline-size;
}

/* Add width="full" to the shortcode for a full-viewport-width map. */
.hkm-wrap--full {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}

.hkm-map {
  --hkm-height: 560px;
  --hkm-ink: #2b3444;
  --hkm-accent: #9f6b50;
  --hkm-font-heading: "Instrument Serif", "InstrumentSerif", Georgia, serif;
  --hkm-font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: var(--hkm-height);
  display: flex;
  background: #f2f2f2;
  overflow: hidden;
}

.hkm-map *,
.hkm-map *::before,
.hkm-map *::after {
  box-sizing: border-box;
}

.hkm-map__canvas {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Legend -------------------------------------------------------------- */

.hkm-map .hkm-legend {
  flex: 0 0 270px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 26px 0;
  background: #fff;
  color: var(--hkm-ink);
}

.hkm-map .hkm-legend::-webkit-scrollbar {
  display: none;
}

.hkm-map .hkm-legend__title {
  margin: 0 0 14px;
  padding: 0 24px;
  font-family: var(--hkm-font-heading);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.hkm-map .hkm-legend__list,
.hkm-map .hkm-legend__list li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* "all: unset" strips any theme button styling before we apply our own. */
.hkm-map .hkm-legend__item {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 24px;
  border-left: 3px solid transparent;
  font-family: var(--hkm-font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: left;
  color: var(--hkm-ink);
  cursor: pointer;
}

.hkm-map .hkm-legend__item:is(:hover, :focus, :active) {
  background: #f6f6f6;
  color: var(--hkm-ink);
}

.hkm-map .hkm-legend__item:focus-visible {
  outline: 2px solid var(--hkm-ink);
  outline-offset: -2px;
}

.hkm-map .hkm-legend__item.is-active {
  background: #f2f2f2;
  border-left-color: var(--hkm-accent);
  color: var(--hkm-ink);
}

.hkm-map .hkm-legend__dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hkm-accent);
}

.hkm-map .hkm-legend__name {
  flex: 1;
}

.hkm-map .hkm-legend__time {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8a8f99;
  white-space: nowrap;
}

/* Pins ---------------------------------------------------------------- */

.hkm-map .hkm-pin {
  all: unset;
  position: absolute;
  display: block;
  transform: translate(-50%, -100%);
  line-height: 0;
  cursor: pointer;
}

.hkm-map .hkm-pin svg {
  display: block;
  transition: transform 0.15s ease;
  transform-origin: 50% 100%;
}

.hkm-map .hkm-pin:is(:hover, :focus-visible, .is-active) svg {
  transform: scale(1.14);
}

.hkm-map .hkm-pin:focus-visible {
  outline: 2px solid var(--hkm-ink);
  outline-offset: 2px;
}

.hkm-map .hkm-pin--hotel {
  z-index: 10;
  cursor: default;
}

.hkm-map .hkm-pin--hotel img {
  display: block;
  width: 64px;
  height: 64px;
  max-width: none;
}

/* Card ---------------------------------------------------------------- */

.hkm-map .hkm-card {
  position: absolute;
  transform: translate(-50%, calc(-100% - 54px));
  min-width: 210px;
  padding: 18px 40px 16px 22px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  color: var(--hkm-ink);
}

.hkm-map .hkm-card__title {
  margin: 0 0 12px;
  font-family: var(--hkm-font-heading);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.hkm-map .hkm-card__times {
  display: flex;
  align-items: center;
  font-family: var(--hkm-font-body);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hkm-map .hkm-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hkm-map .hkm-time + .hkm-time {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid #d9d9d9;
}

.hkm-map .hkm-time svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hkm-map .hkm-card__close {
  all: unset;
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 28px;
  text-align: center;
  color: #9a9a9a;
  cursor: pointer;
}

.hkm-map .hkm-card__close:is(:hover, :focus) {
  color: var(--hkm-ink);
}

.hkm-map .hkm-card__close:focus-visible {
  outline: 2px solid var(--hkm-ink);
}

.hkm-map .hkm-message {
  padding: 24px;
  font-family: var(--hkm-font-body);
  color: var(--hkm-ink);
}

/* Narrow containers: map on top, legend below as a single column ------- */

@container (max-width: 700px) {
  .hkm-map {
    flex-direction: column;
    height: auto;
  }

  .hkm-map__canvas {
    flex: none;
    height: min(var(--hkm-height), 75vh);
  }

  .hkm-map .hkm-legend {
    flex: none;
    order: 2;
    overflow: visible;
    padding: 16px 0;
  }

  .hkm-map .hkm-legend__title {
    padding: 0 20px;
  }

  .hkm-map .hkm-legend__item {
    padding: 14px 20px;
  }
}

@container (max-width: 600px) {
  .hkm-map .hkm-card {
    min-width: 0;
    padding: 14px 34px 12px 16px;
  }

  .hkm-map .hkm-card__title {
    font-size: 20px;
  }

  .hkm-map .hkm-card__times {
    font-size: 12px;
  }

  .hkm-map .hkm-time + .hkm-time {
    margin-left: 12px;
    padding-left: 12px;
  }
}
