.place-finder {
  --clr-text: #333;
  --clr-radio: #d70000;
  --clr-filter-background: #f6f5f5;
  --clr-status-background: #3b3935;
  --tra-short: 250ms;
  --tra-very-short: 125ms;
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  font-size: 14px;
  interpolate-size: allow-keywords;  
  border: 1px solid rgb(0 0 0 / 0.1);
}

.place-finder .map {
  height: 70svh;
}

.place-finder .smart-zoom {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 1em;
  background: var(--clr-filter-background);
  align-items: stretch;
  line-height: 1.3;
}

.place-finder .smart-zoom, .place-finder .smart-zoom * {
  font-family: inherit;
  font-size: inherit;
  font-weight: normal;
  color: var(--clr-text);
}

.place-finder .smart-zoom .radio-set {
  @container (min-width: 750px) {text-align: center;}
  text-wrap: balance;
  label {
    display: inline-flex;
    gap: 0.4em;
    align-items: center;
    padding: 0 0.3em;    
  }
}

.place-finder .smart-zoom .radio-set input[type="radio"] {
  appearance: none;
  margin: 0;
  font: inherit;
  color: var(--clr-status-background);
  background-color: #ccc;
  width: 0.85em;
  height: 0.85em;
  border: none;
  border-radius: 50%;
  box-sizing: border-box;
  outline: none;
  &:focus-visible {outline: 2px solid -webkit-focus-ring-color;}
  &:checked {background: var(--clr-radio);}
}

.place-finder .above {
  color: white;
  background: var(--clr-status-background);
  padding: 0.25em 1em;
  display: flex;
  gap: 1em;
  justify-content: space-between;
  align-items: center;
  line-height: 1.2;
  .status img {
    width: 1em;
    margin: 0 5px;
    position: relative;
    top: 2px;
  }
  .filters2 {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1em;
    img {
      width: 1.5em;
      cursor: pointer;
    }
  }
}

.place-finder .near {
  display: inline-flex;
  align-items: center;
  padding: 0 0.3em;
}

.place-finder .near-widget {
  position: relative;
  display: inline-block;
  margin-left: 5px;
  z-index: 5;
}

.place-finder .near-widget .near-input {
  width: 20em;
  max-width: 67cqw;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #888;
  padding: 3px 8px;
  color: currentColor;
}

.place-finder .near-widget .results-list {
  position: absolute;
  background: white;
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  width: max-content;
  box-shadow: 0 0 6px #888;
/*  appearance: none; */
  outline: none;
  &:empty {display: none;}
  li {
    list-style: none;
    font-size: smaller;
    padding: 3px 8px;
    &:hover {background-color: #f0f0f0; cursor: pointer;}
  }
  &[data-selected-index="0"] li:nth-child(1) {background-color: #e5f3ff;}
  &[data-selected-index="1"] li:nth-child(2) {background-color: #e5f3ff;}
  &[data-selected-index="2"] li:nth-child(3) {background-color: #e5f3ff;}
  &[data-selected-index="3"] li:nth-child(4) {background-color: #e5f3ff;}
  &[data-selected-index="4"] li:nth-child(5) {background-color: #e5f3ff;}
}

.place-finder .filter-panel {
  position: absolute;
  margin-top: 0;
  top: 0;
  right: -260px;
  bottom: 0;
  width: 260px;
  max-width: 100%;
  background-color: white;
  padding: 1em;
  box-sizing: border-box;
  box-shadow: 0 0 5px rgb(0 0 0 / 0.25);
  transition: var(--tra-short);
  overflow: auto;
  z-index: 9;
  opacity: 0;
  &.expanded {
    right: 0;
    opacity: 1;
  }
  > :first-child {
    margin: -1em -1em 0.2em;
    padding: 1em 0.75em 1em 1em;
    position: sticky;
    top: -1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--clr-status-background);
    color: white;
  }
  .close-button {
    margin: 0;
    width: 1.5em;
    height: 1.5em;
    border-radius: 0.25em;
    display: flex;
    justify-content: center;
    align-items: center;
    svg {
      width: 1em;
      height: 1em;
      line {stroke: white;}
    }
    &:hover {
      background: white;
      svg line {stroke: black;}
    }
  }
  h3 {margin: 0; color: inherit;}
  label {font-weight: normal;}
  .radio-set {
    padding-top: 1em;
    label {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.25em;
      line-height: 1.4;
      cursor: pointer;
      .counter {
        font-size: smaller;
        color: #888;
      }
    }
  }
  details {
    border-bottom: 1px solid #eee;
    padding: 1em 0;
    summary {
      font-weight: bold;
      list-style: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      &::-webkit-details-marker {display: none;}      /* safari */
      img {transition: var(--tra-very-short);}
    }
    &[open] summary img {
      transform: rotate(-180deg);
    }
    &::details-content {
      height: 0;
      overflow: clip;
      transition: 250ms allow-discrete;
    }
    &[open]::details-content {
      height: auto;
    }
  }
}

.place-finder .place-panel {
  position: relative;
  margin-top: -15svh;
  border-radius: 1em 1em 0 0;
  background-color: white;
  box-shadow: 0 0 5px rgb(0 0 0 / 0.1);
  transition: 500ms;
  display: none;
  .toggle-btn {display: none;}
  &.expanded {display: block;}
  &.empty {display: none;}

  @container (min-width: 600px) {
    display: block;
    position: absolute;
    margin-top: 0;
    border-radius: 1em 0 0 1em;
    top: 0;
    right: -360px;
    width: 360px;
    height: 100%;
    background: white;
    z-index: 8;
    transition: 0.3s ease-in-out;
    box-shadow: none;
    .toggle-btn {
      position: absolute;
      top: 50%;
      left: -24px;
      transform: translateY(-50%);
      width: 24px;
      height: 48px;
      padding: 0;
      background: aliceblue;
      border: 1px solid #dadce0;
      border-right: none;
      border-radius: 8px 0 0 8px;
      box-shadow: 0 0 5px rgb(0 0 0 / 0.1);
      clip-path: inset(-15px 0px -15px -15px);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    &.expanded {
      transform: translateX(-100%);
      box-shadow: 0 0 5px rgb(0 0 0 / 0.1);
      .toggle-btn {background: white;}
      .arrow {transform: rotate(180deg);}
    }
  }
}

.place-finder .place-panel :is(.panel-trim, .panel-content) {
  height: 100%;
}

.place-finder .place-panel .panel-trim {
  border-radius: 1em 0 0 1em;
  overflow: hidden;
}

.place-finder .place-panel .panel-content {
  overflow: auto;
  padding: 1em;
  box-sizing: border-box;
}

.place-finder .place-panel .apf-primary-image {
  margin: -1em -1em 1em;
  border-top-left-radius: 1em;
  img {width: 100%; display: block;}
  display: none;
  @container (min-width: 600px) {
    display: block;
  }
}

.place-finder .place-panel .apf-title {
  margin: 0;
  font-size: 1.25em;
  font-weight: 600;
}

.place-finder .place-panel .apf-type {
  display: inline-flex;
  gap: 0.5em;
  align-items: center;
  padding: 0em 1em;
  border-radius: 99em;
  background-color: #888;
  color: white;
  font-size: smaller;
  margin-top: 0.75em;
  margin-bottom: 1em;
  line-height: 2.1;
  img {height: 1em;} 
}

/*
.place-finder .place-panel :is(.apf-address, .apf-website, .apf-socials) {
  img {width: 30px;}
  svg {
    display: inline-block;
    width: 30px;
    height: 30px;
    &:hover {fill: var(--clr-radio);}
  }
}
*/

.place-finder .place-panel {

  :is(.apf-address, .apf-website) {
    display: flex;
    gap: 0.75em;
    align-items: center;
    text-decoration: none;
    margin: 0 -1em;
    padding: 0.4em 1em;
    line-height: 1.25;
    &:hover {background: var(--clr-filter-background); color: inherit;}
    img, svg {width: 20px; height: 20px; flex-shrink: 0;}
  }
  .apf-website {
    margin-bottom: 0.5em;
    overflow-wrap: anywhere;
  }
  .apf-socials {
    margin-top: 1em;
    display: flex;
    gap: 0.75em;
    align-items: center;
    img, svg {width: 30px; height: 30px;}
    svg {
      display: inline-block;
      &:hover {fill: var(--clr-radio);}
    }
  /*
    .website {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M415.9 344L225 344C227.9 408.5 242.2 467.9 262.5 511.4C273.9 535.9 286.2 553.2 297.6 563.8C308.8 574.3 316.5 576 320.5 576C324.5 576 332.2 574.3 343.4 563.8C354.8 553.2 367.1 535.8 378.5 511.4C398.8 467.9 413.1 408.5 416 344zM224.9 296L415.8 296C413 231.5 398.7 172.1 378.4 128.6C367 104.2 354.7 86.8 343.3 76.2C332.1 65.7 324.4 64 320.4 64C316.4 64 308.7 65.7 297.5 76.2C286.1 86.8 273.8 104.2 262.4 128.6C242.1 172.1 227.8 231.5 224.9 296zM176.9 296C180.4 210.4 202.5 130.9 234.8 78.7C142.7 111.3 74.9 195.2 65.5 296L176.9 296zM65.5 344C74.9 444.8 142.7 528.7 234.8 561.3C202.5 509.1 180.4 429.6 176.9 344L65.5 344zM463.9 344C460.4 429.6 438.3 509.1 406 561.3C498.1 528.6 565.9 444.8 575.3 344L463.9 344zM575.3 296C565.9 195.2 498.1 111.3 406 78.7C438.3 130.9 460.4 210.4 463.9 296L575.3 296z'/%3E%3C/svg%3E");
    }
  */
  }
  .apf-description {line-height: 1.4; margin: 1em 0;}
  .apf-section-title {font-size: 1.15em; margin: 1em 0 0.5em; font-weight: 600;}
  .apf-photos:empty, .apf-photos-title:has(+ .apf-photos:empty) {display: none;}
  @media (min-width: 600px) {
    .apf-photos > .primary, .apf-section-title:has(+ .apf-photos > .primary:only-child) {display: none;}
  }
  ul {
    margin-left: 0;
    padding-left: 1.5em;
    line-height: 1.4;
  }
  .apf-people {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    li {
      display: grid;
      grid-template-columns: 4em 1fr;
      gap: 0.75em;
      align-items: center;
      > :last-child > :first-child {font-weight: 500;}
      > :last-child > :last-child {font-style: italic;}
    }
    img {width: 100%; border-radius: 0.5em;}
  }
}
