/* Discovery dialog and its optional homepage hero entry point. */

.ss-discovery-hero,
.ss-discovery-hero *,
.ss-discovery,
.ss-discovery * {
  box-sizing: border-box;
}

.ss-discovery-hero {
  width: min(860px, 100%);
  margin: 0 auto;
  color: var(--ss-color-ink, #172126);
}

.ss-discovery-hero__button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  width: 100%;
  min-height: 76px;
  padding: 8px 10px 8px clamp(20px, 4vw, 32px);
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(9, 20, 25, 0.16);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.ss-discovery-hero__button:hover,
.ss-discovery-hero__button:focus-visible {
  border-color: rgba(23, 33, 38, 0.32);
  box-shadow: 0 18px 48px rgba(9, 20, 25, 0.22);
  color: inherit;
  text-decoration: none;
}

.ss-discovery-hero__button:focus-visible,
.ss-discovery :focus-visible {
  outline: 3px solid var(--ss-color-focus, #8aa37f);
  outline-offset: 3px;
}

.ss-discovery-hero__icon,
.ss-discovery__search-icon {
  display: inline-grid;
  place-items: center;
  color: #59666c;
}

.ss-discovery-hero__icon svg {
  width: 27px;
  height: 27px;
}

.ss-discovery-hero__prompt {
  min-width: 0;
  overflow: hidden;
  color: #667178;
  font-size: clamp(17px, 2.1vw, 24px);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-discovery-hero__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 clamp(22px, 4vw, 34px);
  border-radius: 999px;
  background: var(--ss-color-accent, #7f9276);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ss-discovery-hero__suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.ss-discovery-hero__suggestions-label {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  font-size: 14px;
  font-weight: 650;
}

body.home #hero-content .ss-discovery-hero__suggestion {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 5px 17px;
  border: 1px solid #e3e8df;
  border-radius: 999px;
  background: #f5f3ef;
  color: #304532;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

body.home #hero-content .ss-discovery-hero__suggestion:hover,
body.home #hero-content .ss-discovery-hero__suggestion:focus-visible {
  background: #e2e9dc;
  color: #243826;
  text-decoration: none;
}

.ss-discovery {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--ss-color-ink, #172126);
  font-family: inherit;
}

.ss-discovery[open] {
  display: grid;
  place-items: center;
}

.ss-discovery::backdrop {
  background: rgba(9, 18, 22, 0.66);
  backdrop-filter: blur(5px);
}

html.ss-discovery-open,
body.ss-discovery-open {
  overscroll-behavior: none;
}

.ss-discovery__panel {
  position: relative;
  width: min(1280px, calc(100vw - 36px));
  height: 94dvh;
  max-height: 94dvh;
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.ss-discovery__body {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
}

#ss-discovery-dialog .ss-discovery__close {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #d7dcd8;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  color: #172126;
  box-shadow: 0 5px 18px rgba(18, 29, 33, 0.1);
  font: inherit;
  text-shadow: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

#ss-discovery-dialog .ss-discovery__close:hover,
#ss-discovery-dialog .ss-discovery__close:focus {
  border-color: #aeb8b0;
  background: #f5f6f3;
  color: #172126;
  box-shadow: 0 7px 20px rgba(18, 29, 33, 0.14);
}

.ss-discovery__close svg,
.ss-discovery__clear-query svg {
  width: 18px;
  height: 18px;
}

.ss-discovery__filters {
  min-width: 0;
  padding: 20px 20px 32px;
  overflow: auto;
  background: #f3f2ef;
  scrollbar-width: thin;
}

.ss-discovery__search {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 12px 0 15px;
  border: 1px solid #e2e4df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(21, 31, 35, 0.045);
}

.ss-discovery__search:focus-within {
  border-color: #8da083;
  box-shadow: 0 0 0 3px rgba(127, 146, 118, 0.14);
}

.ss-discovery__search-icon svg {
  width: 19px;
  height: 19px;
}

#ss-discovery-dialog input.ss-discovery__query {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #172126;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

#ss-discovery-dialog input.ss-discovery__query:focus {
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

#ss-discovery-dialog input.ss-discovery__query::placeholder {
  overflow: hidden;
  color: #858c8e;
  font-size: 13px;
  text-overflow: ellipsis;
  opacity: 1;
}

.ss-discovery__query::-webkit-search-cancel-button {
  display: none;
}

#ss-discovery-dialog .ss-discovery__clear-query {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #eceeea;
  color: #354147;
  box-shadow: none;
  font: inherit;
  text-shadow: none;
  cursor: pointer;
}

#ss-discovery-dialog .ss-discovery__clear-query:hover,
#ss-discovery-dialog .ss-discovery__clear-query:focus {
  border-color: #d6dad5;
  background: #dfe3dd;
  color: #172126;
  box-shadow: none;
}

#ss-discovery-dialog .ss-discovery__clear-query svg {
  width: 13px;
  height: 13px;
}

#ss-discovery-dialog .ss-discovery__clear-query[hidden] {
  display: none;
}

.ss-discovery__filter-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 26px;
  margin: 20px 1px 9px;
  color: #555f61;
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#ss-discovery-dialog .ss-discovery__reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  min-height: 26px;
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: #5f7059;
  box-shadow: none;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  cursor: pointer;
}

#ss-discovery-dialog .ss-discovery__reset::before {
  content: "×";
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

#ss-discovery-dialog .ss-discovery__reset:hover,
#ss-discovery-dialog .ss-discovery__reset:focus {
  background: transparent;
  color: #304a2c;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ss-discovery__facet {
  margin-top: 18px;
}

.ss-discovery__facet[hidden],
#ss-discovery-dialog .ss-discovery__reset[hidden] {
  display: none;
}

.ss-discovery__facet h3 {
  margin: 0 1px 8px;
  color: #687174;
  font-family: Manrope, sans-serif;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ss-discovery__facet-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ss-discovery__facet-options--months {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#ss-discovery-dialog .ss-discovery__facet-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid #e1e3df;
  border-radius: 11px;
  background: #fff;
  color: #263036;
  box-shadow: none;
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  text-shadow: none;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#ss-discovery-dialog .ss-discovery__facet-button:hover,
#ss-discovery-dialog .ss-discovery__facet-button:focus {
  border-color: #aab7a5;
  background: #f9faf7;
  color: #263036;
  box-shadow: 0 3px 10px rgba(31, 48, 35, 0.07);
}

#ss-discovery-dialog .ss-discovery__facet-button[aria-pressed="true"],
#ss-discovery-dialog .ss-discovery__facet-button[aria-pressed="true"]:hover,
#ss-discovery-dialog .ss-discovery__facet-button[aria-pressed="true"]:focus,
#ss-discovery-dialog .ss-discovery__facet-button[aria-pressed="true"]:active {
  border-color: #a9d296;
  background: #d3edc7;
  color: #254321;
  box-shadow: 0 3px 11px rgba(58, 107, 52, 0.09);
}

#ss-discovery-dialog .ss-discovery__facet-button[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 2px solid #f3f2ef;
  border-radius: 50%;
  background: #3f7441;
  color: #fff;
  font-size: 10px;
}

.ss-discovery__facet-button--wide {
  grid-column: 1 / -1;
}

.ss-discovery__facet-icon {
  flex: 0 0 auto;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

.ss-discovery__facet-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

#ss-discovery-dialog .ss-discovery__facet-options--months .ss-discovery__facet-button {
  justify-content: center;
  padding-inline: 5px;
  text-align: center;
}

.ss-discovery__more-toggle {
  display: none;
}

.ss-discovery__results {
  min-width: 0;
  padding: 28px clamp(22px, 3vw, 38px) 42px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.ss-discovery__results-heading {
  min-height: 46px;
  padding-right: 70px;
}

.ss-discovery__count {
  margin: 8px 0 20px;
  color: #60696c;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.ss-discovery__status:empty {
  display: none;
}

.ss-discovery__status {
  margin: 8px 0 16px;
  color: #536067;
  font-size: 14px;
}

.ss-discovery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ss-discovery__grid[aria-busy="true"] {
  min-height: 220px;
  background: linear-gradient(100deg, #f5f5f3 20%, #ebeeea 35%, #f5f5f3 50%);
  background-size: 300% 100%;
  border-radius: 18px;
  animation: ss-discovery-loading 1.15s linear infinite;
}

@keyframes ss-discovery-loading {
  to { background-position: -150% 0; }
}

.ss-discovery-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 17px;
  background: #dce2dd;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

.ss-discovery-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 30% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(5, 13, 16, 0.86));
  pointer-events: none;
}

.ss-discovery-card__image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(.2,.7,.2,1);
}

.ss-discovery-card:hover .ss-discovery-card__image,
.ss-discovery-card:focus-visible .ss-discovery-card__image {
  transform: scale(1.045);
}

.ss-discovery-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(24, 35, 39, 0.58);
  color: #fff;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.ss-discovery-card__body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px 17px 17px;
}

.ss-discovery-card__title {
  display: block;
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 1.55vw, 24px);
  font-weight: 750;
  line-height: 1.05;
}

.ss-discovery-card__summary {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ss-discovery__empty {
  max-width: 560px;
  margin: 44px auto;
  padding: 34px;
  border-radius: 18px;
  background: #f4f5f2;
  text-align: center;
}

.ss-discovery__empty h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.ss-discovery__empty p {
  margin: 0 0 16px;
  color: #59666c;
}

.ss-discovery__empty a {
  color: #4f6848;
  font-weight: 700;
}

#ss-discovery-dialog .ss-discovery__load-more {
  display: block;
  min-height: 48px;
  margin: 28px auto 0;
  padding: 10px 26px;
  border: 1px solid #798d72;
  border-radius: 999px;
  background: #fff;
  color: #354b31;
  box-shadow: none;
  font-family: Manrope, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
  cursor: pointer;
}

#ss-discovery-dialog .ss-discovery__load-more:hover,
#ss-discovery-dialog .ss-discovery__load-more:focus {
  border-color: #536e4c;
  background: #f5f8f3;
  color: #294325;
  box-shadow: none;
}

.ss-discovery__load-more[hidden],
.ss-discovery__empty[hidden] {
  display: none;
}

@media (max-width: 959px) {
  .ss-discovery__panel {
    width: 100vw;
    height: var(--ss-overlay-height, 100dvh);
    max-height: var(--ss-overlay-height, 100dvh);
    border-radius: 0;
  }

  .ss-discovery__body {
    display: flex;
    flex-direction: column;
  }

  #ss-discovery-dialog .ss-discovery__close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
  }

  .ss-discovery__filters {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    max-height: min(430px, calc(var(--ss-overlay-height, 100dvh) * .54));
    padding: max(14px, env(safe-area-inset-top)) 14px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 0 5px 16px rgba(14, 24, 28, 0.08);
  }

  .ss-discovery__search {
    width: calc(100% - 60px);
    min-height: 54px;
  }

  .ss-discovery__filter-heading {
    margin: 9px 2px 0;
    min-height: 26px;
  }

  .ss-discovery__facet {
    margin-top: 14px;
  }

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

  .ss-discovery__facet-options,
  .ss-discovery__facet-options--months {
    display: flex;
    gap: 9px;
    width: 100%;
    overflow-x: auto;
    padding: 2px 2px 5px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .ss-discovery__facet-options::-webkit-scrollbar {
    display: none;
  }

  #ss-discovery-dialog .ss-discovery__facet-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 96px;
    min-height: 44px;
    padding: 8px 14px;
    scroll-snap-align: start;
  }

  #ss-discovery-dialog .ss-discovery__facet-options--months .ss-discovery__facet-button {
    min-width: 64px;
  }

  #ss-discovery-dialog .ss-discovery__more-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-height: 44px;
    margin: 6px auto 0;
    padding: 7px 17px;
    border: 1px solid #b9d9ab;
    border-radius: 999px;
    background: #d3edc7;
    color: #294325;
    box-shadow: none;
    font-family: Manrope, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: none;
    cursor: pointer;
  }

  #ss-discovery-dialog .ss-discovery__more-toggle:hover,
  #ss-discovery-dialog .ss-discovery__more-toggle:focus {
    border-color: #99c387;
    background: #c6e7b7;
    color: #203d1c;
    box-shadow: none;
  }

  .ss-discovery__more-toggle[aria-expanded="true"] span:last-child {
    transform: rotate(180deg);
  }

  .ss-discovery__more-filters {
    display: none;
  }

  .ss-discovery__more-filters.is-open {
    display: block;
  }

  .ss-discovery__filters:has(.ss-discovery__more-filters.is-open) {
    max-height: min(68dvh, 610px);
  }

  .ss-discovery__results {
    flex: 1 1 auto;
    padding: 18px 14px max(28px, env(safe-area-inset-bottom));
  }

  .ss-discovery__results-heading {
    min-height: 28px;
    padding: 0;
  }

  .ss-discovery__count {
    margin: 3px 2px 14px;
  }

  .ss-discovery__grid {
    gap: 12px;
  }

  .ss-discovery-card {
    border-radius: 15px;
  }

  .ss-discovery-card__body {
    padding: 18px 13px 13px;
  }

  .ss-discovery-card__title {
    overflow: hidden;
    font-size: clamp(17px, 5vw, 22px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ss-discovery-card__summary {
    font-size: 13px;
  }

  .ss-discovery-card__badge {
    top: 9px;
    right: 9px;
    font-size: 10px;
  }

  .ss-discovery-hero__button {
    grid-template-columns: 22px minmax(0, 1fr) 48px;
    gap: 10px;
    min-height: 64px;
    padding: 7px 7px 7px 16px;
  }

  .ss-discovery-hero__action {
    width: 48px;
    height: 48px;
    min-height: 48px;
    flex-shrink: 0;
    gap: 0;
    padding: 0;
    font-size: 0;
    line-height: 1;
    background: #476048;
  }

  .ss-discovery-hero__prompt {
    font-size: 16px;
  }

  #ss-discovery-dialog {
    position: fixed;
    top: var(--ss-overlay-top, 0px);
    bottom: auto;
    height: var(--ss-overlay-height, 100dvh);
  }

  #ss-discovery-dialog .ss-discovery__close {
    position: absolute;
  }

  .ss-discovery-hero__action span {
    font-size: 24px;
  }

  .ss-discovery-hero__suggestions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .ss-discovery-hero__suggestions::-webkit-scrollbar {
    display: none;
  }

  .ss-discovery-hero__suggestions-label,
  .ss-discovery-hero__suggestion {
    flex: 0 0 auto;
  }
}

@media (min-width: 340px) and (max-width: 959px) {
  .ss-discovery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 339px) {
  .ss-discovery__grid {
    grid-template-columns: 1fr;
  }

  .ss-discovery-hero__suggestions-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-discovery *,
  .ss-discovery-hero * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
