/* "Find your nearest Tap" and "Our partners" (markup from scripts/places.mjs).

   Locations: the list on the left, the map held on the right. The site in the
   middle of the screen is the one in focus: its row opens and the map flies to
   it (locations.js). Rows keep one height whether open or not, so nothing jumps.
   On phones the map is a slim strip held at the top of the section.

   Partners: the navy section is held while one partner at a time takes the stage
   (spotlight.js). Only opacity and transform change as it steps. With reduced
   motion, or without JavaScript, the five are simply stacked. */

/* Locations */

.loc__inner {
  padding-top: var(--section);
  padding-bottom: var(--section);
}

.loc__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
}

.loc__near {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.loc__near:hover {
  color: var(--accent-deep);
}

.loc__near:disabled {
  opacity: 0.6;
  cursor: default;
}

/* One quiet row of words. The one in use is underlined in orange. */
.loc__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 20px;
}

.loc__filters button {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}

.loc__filters button:hover {
  color: var(--navy);
}

.loc__filters button[aria-pressed='true'] {
  border-bottom-color: var(--accent);
  color: var(--navy);
  font-weight: 500;
}

.loc__status {
  min-height: 1.5em;
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-soft);
}

.loc__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  margin-top: 24px;
}

.loc__list {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.loc-site {
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
}

.loc-site[hidden] {
  display: none;
}

.loc-site__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.loc-site__name {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.1;
}

.loc-site__area {
  margin-top: 2px;
  font-size: 16px;
  color: var(--ink-soft);
}

.loc-site__dist {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--navy);
}

.loc-site__hours {
  flex: 0 1 auto;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: right;
}

.loc-site__hours b {
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
}

.loc-site__detail {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.loc-site__addr {
  font-size: 16px;
  font-style: normal;
  color: var(--ink-soft);
}

.loc-site__offers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.loc-site__offers li {
  padding: 3px 11px;
  border-radius: 999px;
  background: #EEEAE3;
  font-size: 14px;
  line-height: 1.5;
  transition: background-color var(--ease), color var(--ease);
}

.loc-site__offers li.is-on {
  background: var(--navy);
  color: var(--white);
}

.loc-site__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}

.loc-site__go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--ease);
}

.loc-site__go::after {
  content: '';
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  rotate: 45deg;
}

.loc-site__go:hover {
  background: var(--accent-deep);
  color: var(--white);
}

.loc-site__tel {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* The photos: one at a time, swiped or scrolled sideways, with small dots below. */
.loc-gallery {
  position: relative;
}

.loc-gallery__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 14px;
}

.loc-gallery__track::-webkit-scrollbar {
  display: none;
}

.loc-gallery__slide {
  flex: 0 0 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: var(--line);
  scroll-snap-align: start;
}

.loc-gallery__slide picture,
.loc-gallery__slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.loc-gallery__slide img {
  object-fit: cover;
}

/* An upright photo is shown whole, on a soft copy of itself. */
.loc-gallery__slide img.is-tall {
  object-fit: contain;
  background: #DCD8D0;
}

.loc-gallery__dots {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.loc-gallery__dots i {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  transition: background-color var(--ease);
}

.loc-gallery__dots i.is-on {
  background: var(--navy);
}

/* Arrows for a mouse, over the photo's edges (added by locations.js). */
.loc-gallery__step {
  position: absolute;
  top: calc(50% - 22px - 7px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(20, 33, 61, 0.2);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--ease);
}

.loc-gallery__step::before {
  content: '';
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  rotate: 45deg;
  translate: -2px 0;
}

.loc-gallery__step--prev {
  left: 12px;
}

.loc-gallery__step--prev::before {
  rotate: -135deg;
  translate: 2px 0;
}

.loc-gallery__step--next {
  right: 12px;
}

.loc-gallery:hover .loc-gallery__step:not(:disabled),
.loc-gallery__step:focus-visible {
  opacity: 1;
}

.loc-gallery__step:disabled {
  cursor: default;
}

/* With scripts: the site in focus is clear, the rest step back to one quiet line. */
.js .loc-site {
  cursor: pointer;
}

.js .loc-site__row {
  opacity: 0.42;
  transition: opacity 0.35s ease;
}

.js .loc-site__detail {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.js .loc-site.is-on .loc-site__row {
  opacity: 1;
}

.js .loc-site.is-on .loc-site__detail {
  opacity: 1;
  pointer-events: auto;
}

/* The map, held beside the list. */
.loc__mapcol {
  position: relative;
  min-width: 0;
}

html:not(.js) .loc__mapcol {
  display: none;
}

html:not(.js) .loc__grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px;
}

.site-map {
  position: sticky;
  top: 10vh;
  height: 80vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ECEAE6;
  isolation: isolate;
}

.site-map__canvas {
  position: absolute;
  inset: 0;
  background: #ECEAE6;
  font-family: var(--font-body);
}

.site-map__note {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 500;
  width: min(340px, calc(100% - 40px));
  padding: 14px 18px;
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.12);
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  translate: -50% -50%;
}

/* The standard OpenStreetMap tiles, toned down to sit with the page: mostly
   grey, a little lighter, with the pins as the only strong colour. */
.site-map .leaflet-tile-pane {
  filter: grayscale(0.88) contrast(0.9) brightness(1.06);
}

.site-map .leaflet-container {
  background: #ECEAE6;
  font: inherit;
}

.site-map .leaflet-container a {
  color: var(--navy);
}

.site-map .leaflet-control-attribution {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.site-map .leaflet-bar {
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.12);
}

.site-map .leaflet-bar a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  color: var(--navy);
}

.map-pin {
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.map-pin svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 2px rgba(20, 33, 61, 0.28));
  transform-origin: 50% 100%;
  transition: transform 0.35s ease;
}

.map-pin path {
  fill: var(--navy);
  stroke: var(--white);
  stroke-width: 1.5;
  transition: fill 0.35s ease;
}

.map-pin circle {
  fill: var(--white);
}

.map-pin:hover svg {
  transform: scale(1.12);
}

/* The site in focus: larger and orange. The others fade. */
.map-pin.is-on svg {
  transform: scale(1.4);
}

.map-pin.is-on path {
  fill: var(--accent);
}

.site-map.has-focus .map-pin:not(.is-on),
.site-map.has-focus .map-label:not(.is-on) {
  opacity: 0.45;
}

/* A site the filter leaves out fades further, whatever is in focus. */
.site-map .map-pin.is-out,
.site-map .map-label.is-out {
  opacity: 0.15;
}

.map-pin:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.site-map .map-label {
  padding: 2px 8px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(20, 33, 61, 0.2);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.site-map .map-label::before {
  display: none;
}

.site-map .map-label.is-on {
  background: var(--navy);
  color: var(--white);
}

/* Partners */

.spot {
  --spot-step: 75vh;
}

.spot__track {
  position: relative;
}

.spot__steps {
  display: none;
}

.spot__stage {
  padding-top: var(--section);
  padding-bottom: 32px;
}

.spot__grid {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.spot__count,
.spot__glow {
  display: none;
}

/* Stacked (reduced motion, or no scripts): each partner is a block of its own. */
.spot__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 64px;
  align-items: center;
}

.spot__cat {
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 112px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0.005em;
}

.spot__who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 22px;
}

.spot__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 64px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--white);
}

.spot__logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.spot__where {
  font-size: 17px;
  color: var(--on-navy);
}

.spot__sites {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.spot__sites a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--navy-rule);
  border-radius: 999px;
  color: var(--white);
  font-size: 15px;
  text-decoration: none;
  transition: border-color var(--ease), background-color var(--ease);
}

.spot__sites a:hover {
  border-color: var(--accent-soft);
  color: var(--white);
}

.spot__visit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 10px;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* An arrow leaving the box: this one opens another website. */
.spot__visit::after {
  content: '';
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.spot__visit:hover {
  color: var(--accent-soft);
}

.spot__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(155deg, #1C2C52, #26385F);
}

.spot__photo picture,
.spot__photo img {
  display: block;
  width: 100%;
  height: 100%;
}

.spot__photo img {
  object-fit: cover;
}

.spot__also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding-top: 24px;
  padding-bottom: var(--section);
  font-size: 15px;
  color: var(--on-navy-mute);
}

.spot__also-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 64px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--white);
  transition: translate 0.3s ease, box-shadow 0.3s ease;
}

.spot__also-tile:hover {
  translate: 0 -2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.spot__also-tile img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* The spotlight: the stage is held for five steps of scrolling, one per partner.
   Each partner's words sit in one place and its photo in another; only the one
   in focus shows. */
.motion .spot__track {
  height: calc(100svh + 5 * var(--spot-step));
}

.motion .spot__steps {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

.motion .spot__steps i {
  display: block;
  height: var(--spot-step);
}

.motion .spot__stage {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: 100vh;
  height: 100svh;
  padding: 0;
  overflow: hidden;
}

.motion .spot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  grid-template-areas:
    '. photo'
    'head photo'
    'count photo'
    'text photo'
    '. photo';
  gap: 0 64px;
  width: 100%;
}

.motion .spot__item {
  display: contents;
}

.motion .spot__head {
  grid-area: head;
}

.motion .spot__count {
  grid-area: count;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-navy-mute);
  font-variant-numeric: tabular-nums;
}

.spot__bar {
  position: relative;
  flex: 0 0 140px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--navy-rule);
}

.spot__bar i {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0.2);
  transform-origin: 0 50%;
  transition: transform 0.5s ease;
}

.motion .spot__text {
  grid-area: text;
  align-self: start;
  margin-top: 22px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.motion .spot__photo {
  grid-area: photo;
  align-self: center;
  justify-self: end;
  width: 100%;
  height: min(72vh, 720px);
  aspect-ratio: auto;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.motion .spot__item.is-on .spot__text,
.motion .spot__item.is-on .spot__photo {
  opacity: 1;
  transform: none;
}

.motion .spot__item:not(.is-on) .spot__text {
  pointer-events: none;
}

.motion .spot__glow {
  grid-area: photo;
  display: block;
  align-self: center;
  height: min(72vh, 720px);
  margin: -8%;
  background: radial-gradient(closest-side, rgba(232, 89, 12, 0.26), rgba(232, 89, 12, 0));
  pointer-events: none;
}

.motion .spot__also {
  padding-top: 8px;
}

/* Small laptops and tablets */
@media (max-width: 1040px) {
  .loc__grid {
    gap: 36px;
  }

  .motion .spot__grid {
    gap: 0 40px;
  }
}

/* Phones: the map is a slim strip held at the top of the section, and the list
   scrolls under it. Partners: the photo on top, the words under it. */
@media (max-width: 759px) {
  .loc__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 12px;
  }

  .loc__filters {
    flex-wrap: nowrap;
    gap: 0 20px;
    margin: 12px calc(var(--gutter) * -1) 0;
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .loc__filters::-webkit-scrollbar {
    display: none;
  }

  .loc__filters button {
    flex: none;
  }

  .loc__mapcol {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 0 10px;
    background: var(--paper);
  }

  .site-map {
    position: relative;
    top: 0;
    height: 30vh;
    height: 30svh;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .site-map .leaflet-control-zoom {
    display: none;
  }

  .loc-site {
    padding: 20px 0 24px;
    scroll-margin-top: calc(30svh + 20px);
  }

  .loc-site__row {
    flex-wrap: wrap;
  }

  .loc-site__name {
    font-size: 26px;
  }

  .loc-site__hours {
    text-align: left;
  }

  .loc-site__detail {
    gap: 14px;
    margin-top: 14px;
  }

  .loc-site__offers li {
    font-size: 15px;
  }

  .loc-gallery__step {
    display: none;
  }

  .spot__item {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .spot__photo {
    order: -1;
  }

  .spot__logo {
    width: 104px;
    height: 54px;
  }

  .spot__where {
    font-size: 16px;
  }

  .motion .spot__stage {
    align-items: safe center;
    padding: 12px 0;
  }

  .motion .spot__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: 'photo' 'head' 'count' 'text';
  }

  .motion .spot__photo,
  .motion .spot__glow {
    justify-self: stretch;
    height: 34vh;
    height: 34svh;
    margin: 0 0 18px;
  }

  .motion .spot__glow {
    display: none;
  }

  .motion .spot__head .band__lede {
    font-size: 16px;
  }

  .motion .spot__count {
    margin-top: 14px;
  }

  .motion .spot__text {
    margin-top: 14px;
  }

  .spot__cat {
    font-size: clamp(54px, 15vw, 72px);
  }

  .spot__who {
    margin-top: 14px;
  }

  .spot__sites {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .loc-site__row,
  .js .loc-site__detail,
  .map-pin,
  .map-pin svg,
  .site-map .map-label {
    transition: none;
  }
}

/* Square logos fill more of their tile than the wide ones. */
.spot__logo--gulf,
.spot__logo--electrajet,
.spot__logo--washme {
  padding: 5px;
}
