/*
 * Party finder v2
 *
 * The page keeps the existing mobile card experience and introduces a
 * constrained, two-column discovery layout on larger screens.  All values
 * live behind finder-scoped tokens so future pages can evolve independently.
 */
:root {
  --finder-brand: #339cff;
  --finder-ink: #172234;
  --finder-muted: #738198;
  --finder-line: #e2e9f2;
  --finder-surface: #ffffff;
  --finder-page: #f6f8fc;
  --finder-radius: 18px;
  --finder-gap: 24px;
}

.party-finder-page {
  background: var(--finder-page);
}

.party-finder-page .finder-list-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.party-finder-page .finder-list-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--finder-brand) 42%, transparent);
  outline-offset: 3px;
}

.party-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.party-filter-head strong {
  color: var(--finder-ink);
  font-size: 16px;
  font-weight: 850;
}

.party-filter-head button,
.party-filter-toggle {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--finder-line);
  border-radius: 999px;
  background: var(--finder-surface);
  color: var(--finder-muted);
  font-size: 13px;
  font-weight: 750;
}

/* The mobile-only backdrop is created by the finder runtime. Keep the
   control inert and invisible on desktop where the filter rail is inline. */
.party-filter-backdrop {
  display: none;
}

.party-filter-toggle {
  display: none;
}

.list-tools-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.party-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.party-quick-filters button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--finder-line);
  border-radius: 999px;
  background: #fff;
  color: var(--finder-muted);
  font-size: 12px;
  font-weight: 750;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

.party-quick-filters button.on {
  border-color: var(--finder-brand);
  background: var(--finder-brand);
  color: #fff;
}

.party-filter-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 8px;
  margin-top: 2px;
}

.party-filter-actions button {
  min-height: 40px;
  border: 1px solid var(--finder-line);
  border-radius: 11px;
  background: #fff;
  color: var(--finder-muted);
  font-size: 12px;
  font-weight: 800;
}

.party-filter-actions button[data-party-filter-apply] {
  border-color: var(--finder-brand);
  background: var(--finder-brand);
  color: #fff;
}

.finder-preview-features {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.finder-preview-features span {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid #dce9f7;
  border-radius: 999px;
  background: #f6faff;
  color: #66778e;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finder-preview-details {
  min-width: 0;
  color: var(--finder-muted);
}

.finder-preview-details summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: var(--finder-brand);
  font-size: 11px;
  font-weight: 800;
}

.finder-preview-details p {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--finder-muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (min-width: 801px) {
  body.page-list .party-finder-page .party-finder-layout {
    width: min(1440px, calc(100% - 96px));
  }

  body.page-list .party-service-options.has-combined-service {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  body.page-list .party-service-options.has-combined-service .party-service-option b {
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
  }

  body.page-list .party-finder-page .party-results {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(286px, 340px);
    grid-template-areas:
      "toolbar filters"
      "feature filters"
      "list filters"
      "load filters";
    align-items: start;
    gap: var(--finder-gap) 30px;
  }

  body.page-list .party-results > .list-tools {
    grid-area: toolbar;
    min-width: 0;
  }

  body.page-list .party-results > .party-filter-panel {
    grid-area: filters;
    min-width: 0;
    position: sticky;
    top: 112px;
    max-height: calc(100vh - 136px);
    overflow: auto;
  }

  body.page-list .party-results > .service-feature-card {
    grid-area: feature;
    min-width: 0;
  }

  body.page-list .party-results > .party-list {
    grid-area: list;
    min-width: 0;
  }

  body.page-list .party-results > .party-load-more {
    grid-area: load;
  }

  body.page-list .party-results > .party-filter-panel .party-filter-head button {
    display: none;
  }

  body.page-list .party-list .finder-list-card {
    min-height: 340px;
  }

  body.page-list .party-list .finder-preview-details {
    align-self: start;
  }

  body.page-list .party-list .finder-preview-seats {
    margin-top: auto;
  }
}

@media (min-width: 801px) and (max-width: 1180px) {
  body.page-list .party-finder-page .party-finder-layout {
    width: min(960px, calc(100% - 48px));
  }

  body.page-list .party-finder-page .party-results {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
  }

  body.page-list .party-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 800px) {
  .party-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .party-filter-panel {
    display: grid;
    position: fixed;
    z-index: 120;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78vh, 560px);
    margin: 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    overflow: auto;
    border: 1px solid var(--finder-line);
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 42px rgba(24, 50, 82, .16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(105%);
    transition: transform .24s ease, opacity .18s ease;
  }

  .party-filter-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .party-filter-backdrop {
    position: fixed;
    z-index: 110;
    inset: 0;
    display: block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(14, 28, 46, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    appearance: none;
  }

  body.party-filter-open .party-filter-backdrop {
    display: block;
  }

  .party-filter-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .list-tools-actions {
    gap: 8px;
  }

  .list-tools-sort > span {
    display: none;
  }

  .finder-preview-details p {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .party-quick-filters button,
  .party-filter-panel,
  .party-finder-page *,
  .party-finder-page *::before,
  .party-finder-page *::after {
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Party finder search experience · 2026-08
   Search stays visible in the result rail, while the sticky panel contains
   only decision-making filters. */
.party-search-toolbar {
  min-width: 0;
}

.party-search-primary {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 12px 0 17px;
  border: 1px solid #d8e4ef;
  border-radius: 17px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 9px 26px rgba(43, 84, 124, .07);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.party-search-primary:focus-within {
  border-color: #73b8f7;
  box-shadow: 0 0 0 4px rgba(51, 156, 255, .11), 0 12px 30px rgba(43, 84, 124, .08);
}

.party-search-primary svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #6e8196;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.party-search-primary input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172234;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}

.party-search-primary input::placeholder {
  color: #b7c2ce;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -.02em;
  opacity: 1;
}
.party-search-primary input::-webkit-search-cancel-button { display: none; }

.party-search-primary [data-party-search-clear] {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f0f3f6;
  color: #9aa6b2;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.party-search-primary [data-party-search-clear][hidden] { display: none; }

.party-result-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.party-active-filters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.party-active-filters[hidden] { display: none; }

.party-active-filters button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 6px;
  padding: 0 9px 0 11px;
  border: 1px solid #cce3f8;
  border-radius: 999px;
  background: #f2f9ff;
  color: #257bc4;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.party-active-filters button i {
  color: #68a4d5;
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}

.party-active-filters .party-active-filters__clear {
  padding-inline: 6px;
  border-color: transparent;
  background: transparent;
  color: #77879a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.party-filter-head > div {
  display: grid;
  gap: 3px;
}

.party-filter-head > div > span {
  color: #339cff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.party-filter-head strong {
  font-size: 19px;
  letter-spacing: -.04em;
}

.party-filter-section {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid #edf1f5;
}

.party-filter-section legend {
  padding: 0;
  color: #344459;
  font-size: 12px;
  font-weight: 850;
}

.party-filter-section legend small {
  margin-left: 4px;
  color: #97a3b2;
  font-size: 9px;
  font-weight: 700;
}

.party-filter-section button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid #dce5ee;
  border-radius: 11px;
  background: #fff;
  color: #68798d;
  font: inherit;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.party-filter-section button:hover,
.party-filter-section button:focus-visible {
  border-color: #8fc8f7;
  outline: 0;
  color: #247bc4;
}

.party-filter-section button.on,
.party-filter-section button[aria-pressed="true"] {
  border-color: #78bdf6;
  background: #edf7ff;
  color: #147dcc;
  box-shadow: 0 0 0 1px rgba(51, 156, 255, .07) inset;
}

.party-filter-section--host > div {
  display: grid;
  gap: 7px;
}

.party-filter-section--host button {
  position: relative;
  display: grid;
  min-height: 55px;
  align-content: center;
  gap: 3px;
  padding: 8px 38px 8px 12px;
  text-align: left;
}

.party-filter-section--host button > span {
  color: #344459;
  font-size: 12px;
  font-weight: 850;
}

.party-filter-section--host button > small {
  color: #8795a6;
  font-size: 9px;
  font-weight: 650;
}

.party-filter-section--host button::after {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #d8e2ec;
  border-radius: 6px;
  color: transparent;
  content: "✓";
  font-size: 11px;
  transform: translateY(-50%);
}

.party-filter-section--host button[aria-pressed="true"]::after {
  border-color: #339cff;
  background: #339cff;
  color: #fff;
}

.party-filter-choice-grid,
.party-filter-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

/* Duration is a single, compact row: all four options stay visible without
   turning the filter rail into a tall vertical list. */
.party-filter-choice-grid--duration {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.party-filter-choice-grid--duration button {
  min-height: 36px;
  padding: 0 4px;
  font-size: 10px;
  letter-spacing: -.03em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.party-filter-host-grid {
  display: grid;
  gap: 7px;
}

.party-price-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #8492a3;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.party-price-note > span {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  flex: 0 0 16px;
  border: 1px solid #d2dfeb;
  border-radius: 50%;
  color: #6f8093;
  font-size: 9px;
  font-weight: 900;
}

.party-list.is-updating {
  opacity: .62;
  pointer-events: none;
  transition: opacity .16s ease;
}

@media (min-width: 801px) {
  /* Keep all four duration choices on one compact row in the desktop rail. */
  body.page-list .party-filter-panel .party-filter-choice-grid--duration {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  body.page-list .party-filter-panel .party-filter-choice-grid--duration button {
    width: 100%;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }

  body.page-list .party-finder-page .party-results {
    /* Do not stretch short result sets across the available filter-panel
       height. Otherwise services with fewer parties move the feature card
       down while long lists (such as YouTube) stay at the top. */
    align-content: start;
    grid-template-areas:
      "search filters"
      "toolbar filters"
      "active filters"
      "feature filters"
      "list filters"
      "load filters";
    row-gap: 16px;
  }

  body.page-list .party-results > .party-search-toolbar { grid-area: search; }
  body.page-list .party-results > .list-tools { grid-area: toolbar; }
  body.page-list .party-results > .party-active-filters { grid-area: active; }

  body.page-list .party-results > .list-tools {
    min-height: 44px;
    padding-bottom: 12px;
  }

  body.page-list .party-results > .party-filter-panel {
    gap: 15px;
    max-height: calc(100vh - 118px);
    padding: 21px;
    border-color: #dce6ef;
    border-radius: 22px;
    box-shadow: 0 14px 38px rgba(43, 72, 105, .07);
    scrollbar-width: thin;
  }

  body.page-list .party-filter-panel .party-filter-actions {
    display: block;
    margin: 0;
    padding-top: 2px;
  }

  body.page-list .party-filter-panel [data-party-filter-reset] {
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #77879a;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  body.page-list .party-filter-panel [data-party-filter-apply] { display: none; }
}

@media (max-width: 800px) {
  .party-search-toolbar { margin: 0 0 13px; }

  .party-search-primary {
    min-height: 50px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(43, 84, 124, .06);
  }

  .party-search-primary input { height: 46px; font-size: 13px; }

  .party-search-primary input::placeholder {
    color: #bdc8d3;
    font-size: 12px;
    font-weight: 400;
  }

  .party-search-primary [data-party-search-clear] {
    width: 28px;
    min-width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 16px;
  }

  .party-result-heading {
    display: grid;
    gap: 2px;
  }

  .party-active-filters {
    flex-wrap: nowrap;
    margin: 10px -16px 16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .party-active-filters::-webkit-scrollbar { display: none; }
  .party-active-filters button { flex: 0 0 auto; }

  body.page-list .party-filter-panel .party-filter-section {
    display: grid !important;
    gap: 9px !important;
    margin: 0 !important;
    padding: 13px 0 0 !important;
    border-top: 1px solid #edf1f5 !important;
  }

  body.page-list .party-filter-panel .party-filter-section button {
    min-height: 38px;
    border-radius: 10px;
    font-size: 10px;
  }

  body.page-list .party-filter-panel .party-filter-section--host button {
    min-height: 52px;
  }

  body.page-list .party-filter-panel .party-filter-actions {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    margin: 0 -4px -4px;
    padding: 10px 4px 4px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 22%);
  }
}

/* The active-filter rail is hidden until a filter is chosen. Keeping its
   named grid row in the default desktop template still reserves a full row,
   which pushed every non-YouTube feature card down. Only create that row
   while the rail is actually visible so every OTT uses YouTube's baseline. */
@media (min-width: 801px) {
  body.page-list .party-finder-page .party-results {
    grid-template-areas:
      "search filters"
      "toolbar filters"
      "active filters"
      "feature filters"
      "list filters"
      "load filters";
    /* Keep the left content rail independent from the tall sticky filter
       panel in the right column. The feature row must grow with its card;
       only the party-list row may absorb the panel's remaining height. */
    grid-template-rows: 54px 55px 0 max-content minmax(min-content, 1fr) 0;
  }

  body.page-list .party-finder-page .party-results:has(> .party-active-filters:not([hidden])) {
    grid-template-areas:
      "search filters"
      "toolbar filters"
      "active filters"
      "feature filters"
      "list filters"
      "load filters";
    grid-template-rows: 54px 55px 31px max-content minmax(min-content, 1fr) 0;
  }
}

/* The mobile filter is the party-finder sort popup. Keep it compact and
   slightly narrower so the three sort choices read as a focused control. */
.party-filter-section--sort .party-filter-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.party-filter-section--sort .party-filter-choice-grid button {
  white-space: nowrap;
  letter-spacing: -.03em;
}

@media (max-width: 800px) {
  body.page-list .party-filter-panel {
    right: 12px;
    left: 12px;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  body.page-list .party-filter-panel .party-filter-head strong {
    font-size: 17px;
  }

  body.page-list .party-filter-panel .party-filter-head button {
    font-size: 11px;
  }

  body.page-list .party-filter-panel .party-filter-section legend {
    font-size: 10px;
  }

  body.page-list .party-filter-panel .party-filter-section button {
    font-size: 8px;
  }

  body.page-list .party-filter-panel .party-filter-section--host button > span {
    font-size: 10px;
  }

  body.page-list .party-filter-panel .party-filter-section--host button > small {
    font-size: 7px;
  }

  body.page-list .party-filter-panel .party-filter-actions button {
    font-size: 10px;
  }

  body.page-list .party-filter-panel .party-price-note {
    font-size: 8px;
  }
}
