/* /where-to-buy — stockist locator. Page-local layout only. */

.page-where-to-buy {
  background: var(--color-bg);
  color: var(--color-black);
  font-family: var(--font-sans);
  letter-spacing: var(--sans-letter-spacing);
}

.page-where-to-buy {
  overflow-x: clip;
}

.page-where-to-buy img {
  max-width: 100%;
  height: auto;
}

.tale-cover {
  position: relative;
}

.wtb-cover .tale-cover__name {
  z-index: 4;
}

.wtb-cover.tale-cover {
  --chichi-cover-object-position: center center;
  overflow: hidden;
}

.wtb-cover__slot {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.wtb-cover__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.page-where-to-buy .wtb-opening.tale-head {
  position: relative;
}

.wtb-opening .tale-head__inner {
  display: flex;
  flex-direction: column;
}

.wtb-opening .tale-head__pre {
  order: 1;
}

.wtb-opening .chichi-chapter-title {
  order: 2;
}

.wtb-opening .tale-head__abstract {
  order: 3;
}

.wtb {
  padding-block: 20px 48px;
  padding-inline: var(--content-inset-inline);
}

.wtb-search-sentinel {
  height: 1px;
  margin-bottom: -1px;
  pointer-events: none;
}

.wtb-search {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  z-index: 20;
  margin-top: 20px;
  margin-inline: calc(-1 * var(--content-inset-inline));
  padding-inline: var(--content-inset-inline);
  padding-bottom: 10px;
  max-width: none;
  background: var(--color-bg);
}

/* Once stuck, paint the header band so list rows cannot show through it. */
.wtb-search.is-stuck::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: calc(var(--header-height) + 16px);
  background: var(--color-bg);
  pointer-events: none;
}

.wtb-search .wtb-label,
.wtb-search .wtb-search-row,
.wtb-search .wtb-status {
  max-width: 40rem;
}

.wtb-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wtb-search-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wtb-search-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.wtb-input,
.wtb-locate,
.wtb-more,
.wtb-view__btn,
.wtb-store__select,
.wtb-store__directions {
  min-height: 44px;
  box-sizing: border-box;
}

.wtb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-black);
  background: var(--color-white);
  color: var(--color-black);
  font: inherit;
  font-size: 16px;
  letter-spacing: inherit;
}

.wtb-locate,
.wtb-more,
.wtb-view__btn {
  border: 1px solid var(--color-black);
  background: var(--color-white);
  color: var(--color-black);
  font: inherit;
  font-size: 16px;
  letter-spacing: inherit;
  cursor: pointer;
  padding-inline: 14px;
}

.wtb-locate {
  flex: 0 0 auto;
}

.wtb-status {
  min-height: 1.5em;
  margin: 8px 0 0;
  line-height: 1.5;
}

.wtb-status p {
  margin: 0;
}

.wtb-status[hidden] {
  display: block;
  visibility: hidden;
}

.wtb-suggest {
  position: fixed;
  z-index: 30;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  background: var(--color-bg);
  color: var(--color-black);
  border: 1px solid var(--color-black);
  box-shadow: var(--shadow-default);
}

.wtb-suggest__option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.wtb-suggest__option.is-active {
  background: var(--color-black);
  color: var(--color-beige);
}

.wtb-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  max-width: 40rem;
}

.wtb-view__btn[aria-selected="true"] {
  background: var(--color-black);
  color: var(--color-beige);
}

.wtb-layout {
  margin-top: 16px;
}

.wtb-region {
  margin: 0;
}

.wtb-region__title {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wtb-store {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding-block: 8px;
  padding-left: 16px;
  border-bottom: 1px solid var(--color-black-30);
  box-shadow: inset 3px 0 0 transparent;
}

.wtb-store[hidden] {
  display: none;
}

.wtb-store.is-selected {
  box-shadow: inset 3px 0 0 var(--color-pink);
}

.wtb-store__select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.page-where-to-buy .wtb-store__select:focus {
  outline: none;
}

.page-where-to-buy .wtb-store__select:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

.page-where-to-buy .wtb-store__select:focus:not(:focus-visible) {
  outline: none;
}

.wtb-store__name {
  font-size: 1.05rem;
  line-height: 1.3;
}

.wtb-store__address,
.wtb-store__town,
.wtb-store__distance {
  margin: 0;
  color: var(--color-black-70);
  font-size: 0.95rem;
  line-height: 1.35;
}

.wtb-store__distance:not([hidden]) {
  color: var(--color-black);
}

.wtb-store__directions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.wtb-more {
  margin-top: 16px;
}

.wtb-note,
.wtb-shop {
  margin: 16px 0 0;
  max-width: 38rem;
  line-height: var(--body-line-height-prose);
}

.wtb-shop {
  color: var(--color-black-70);
  font-size: 0.95rem;
}

.wtb-shop a {
  color: var(--color-black);
}

.wtb-map-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--color-black);
}

.wtb-map {
  flex: 1 1 auto;
  min-height: 240px;
  background: var(--color-black);
}

.wtb-map-credit {
  margin: 0;
  padding: 8px 10px 10px;
  color: var(--color-indaco);
  background: var(--color-black);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
}

.page-where-to-buy .maplibregl-map,
.page-where-to-buy .maplibregl-ctrl-attrib,
.page-where-to-buy .maplibregl-cooperative-gesture-screen,
.page-where-to-buy .wtb-popup {
  font-family: var(--font-sans);
  letter-spacing: var(--sans-letter-spacing);
}

.page-where-to-buy .wtb-popup .maplibregl-popup-content {
  background: var(--color-black);
  color: var(--color-white);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 44px 14px 14px;
}

.page-where-to-buy .wtb-popup .maplibregl-popup-close-button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--color-white);
  background: transparent;
  font-size: 22px;
  line-height: 44px;
}

.page-where-to-buy .wtb-popup .maplibregl-popup-close-button:hover,
.page-where-to-buy .wtb-popup .maplibregl-popup-close-button:focus {
  background: transparent;
  outline: none;
}

.page-where-to-buy .wtb-popup .maplibregl-popup-close-button:focus-visible {
  outline: 1px solid var(--color-white);
  outline-offset: -3px;
}

.page-where-to-buy .wtb-popup .maplibregl-popup-tip {
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
}

.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: var(--color-black);
}

.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: var(--color-black);
}

.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--color-black);
}

.page-where-to-buy .wtb-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--color-black);
}

.wtb-popup__name,
.wtb-popup__address,
.wtb-popup__town,
.wtb-popup__distance {
  margin: 0;
}

.wtb-popup__name {
  font-size: 1.05rem;
  line-height: 1.3;
}

.wtb-popup__address,
.wtb-popup__town,
.wtb-popup__distance {
  margin-top: 2px;
  color: var(--color-beige);
  font-size: 0.95rem;
  line-height: 1.35;
}

.wtb-popup__directions {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.wtb-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 47.99em) {
  .wtb-layout.is-map .wtb-list,
  .wtb-layout.is-map .wtb-after {
    display: none;
  }

  .wtb-layout.is-map .wtb-map-panel {
    display: flex;
    height: calc(100dvh - var(--header-height) - 210px);
    min-height: 280px;
  }
}

@media (min-width: 48em) {
  .wtb-search-row {
    flex-direction: row;
    align-items: stretch;
  }

  .wtb-view {
    display: none;
  }

  .wtb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: start;
  }

  .wtb-map-panel {
    display: flex;
    position: sticky;
    top: calc(var(--header-height) + 12px);
    height: calc(100dvh - var(--header-height) - 24px);
  }
}
