/*
Theme Name: Sheshi UI Contract
Version: 0.24.0
Description: Terminal accessibility, hierarchy and responsive component rules.
*/

:root {
  --sheshi-bg: #171717;
  --sheshi-surface: #1d1d1f;
  --sheshi-surface-raised: #242423;
  --sheshi-border: #3a3a38;
  --sheshi-text-primary: #f5f3ef;
  --sheshi-text-secondary: #b4afa8;
  --sheshi-text-meta: #9a948c;
  --sheshi-text-disabled: #7f7f7f;
  --sheshi-accent-fill: #d23a3e;
  --sheshi-accent-text: #ee7a72;
  --sheshi-status-official: #a7e2c3;
  --sheshi-status-official-bg: #173629;
  --sheshi-status-official-border: #285440;
  --sheshi-muted: var(--sheshi-text-secondary);
  --sheshi-line: var(--sheshi-border);
}

body.sheshi-shell,
body.sheshi-home {
  color: var(--sheshi-text-primary);
  background: var(--sheshi-bg) !important;
}

body.sheshi-shell p,
body.sheshi-home p,
body.sheshi-shell .entry-content,
body.sheshi-home .entry-content { color: var(--sheshi-text-secondary); }

body.sheshi-shell small,
body.sheshi-home small,
body.sheshi-shell .sheshi-profile-meta-line,
body.sheshi-shell .sheshi-result-facts,
body.sheshi-shell .sheshi-contact-source,
body.sheshi-home .sheshi-discovery-languages { color: var(--sheshi-text-meta); }

body.sheshi-shell .sheshi-kicker,
body.sheshi-home .sheshi-kicker,
body.sheshi-shell .sheshi-eyebrow,
body.sheshi-home .sheshi-eyebrow,
body.sheshi-shell .sheshi-text-link,
body.sheshi-home .sheshi-text-link,
body.sheshi-shell .entry-content a,
body.sheshi-home .entry-content a,
body.single-listing .sheshi-profile-contact dd a,
body.single-listing .sheshi-profile-socials a,
body.single-listing .sheshi-contact-source a,
body.single-listing .sheshi-transparency-links a,
body.sheshi-shell .sheshi-route-link { color: var(--sheshi-accent-text) !important; }

/* One filled red action per viewport: page task wins over navigation. */
body.sheshi-shell .sheshi-nav-cta,
body.sheshi-home .sheshi-nav-cta {
  border: 1px solid var(--sheshi-border);
  color: var(--sheshi-text-primary);
  background: transparent;
  box-shadow: none;
}

body.sheshi-shell .sheshi-nav-cta:hover,
body.sheshi-shell .sheshi-nav-cta:focus-visible,
body.sheshi-home .sheshi-nav-cta:hover,
body.sheshi-home .sheshi-nav-cta:focus-visible {
  border-color: #5b5956;
  color: #fff;
  background: var(--sheshi-surface-raised);
}

.sheshi-nav-cta .sheshi-nav-plus,
.sheshi-mobile-action svg { color: var(--sheshi-accent-text); stroke: currentColor; }

body.sheshi-shell .sheshi-search-submit,
body.sheshi-home .sheshi-search-submit,
body.single-listing .sheshi-profile-primary-link--cta,
body.single-listing .sheshi-profile-mobile-primary,
body.single-listing .sheshi-profile-mobile-callbar a {
  border-color: var(--sheshi-accent-fill);
  color: #fff;
  background: var(--sheshi-accent-fill);
}

.sheshi-skip-link,
.sheshi-skip-link:focus {
  z-index: 11000;
  border: 2px solid var(--sheshi-accent-text);
  color: var(--sheshi-text-primary) !important;
  background: #121212 !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.sheshi-site-footer .sheshi-brand,
.sheshi-site-footer .sheshi-wordmark { color: var(--sheshi-text-primary) !important; }
.sheshi-site-footer p { color: var(--sheshi-text-secondary); }
.sheshi-site-footer .sheshi-copyright { color: var(--sheshi-text-meta); }

/* Shared category, location and status component. */
.sheshi-meta-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sheshi-meta-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--sheshi-border);
  border-radius: 999px;
  color: var(--sheshi-text-secondary);
  background: var(--sheshi-surface-raised);
  font-size: clamp(12px, .82vw, 12.5px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

.sheshi-meta-chip--location { color: var(--sheshi-text-meta); }
.sheshi-meta-chip--status-official {
  border-color: var(--sheshi-status-official-border);
  color: var(--sheshi-status-official);
  background: var(--sheshi-status-official-bg);
}
.sheshi-meta-chip--status-editorial,
.sheshi-meta-chip--status-demo { color: var(--sheshi-text-meta); background: #292927; }

body.single-listing .sheshi-profile-state {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}
body.single-listing .sheshi-profile-state a { color: var(--sheshi-accent-text); }

/* Category icons are neutral navigation, not alarm states. */
body.sheshi-home .sheshi-index-row .sheshi-category-icon,
body.sheshi-home .sheshi-quick-categories a .sheshi-category-icon,
body.sheshi-home .sheshi-discovery-meta .sheshi-category-icon,
body.sheshi-shell .sheshi-directory-index a > .sheshi-category-icon,
body.search .sheshi-result-card--search .sheshi-category-icon,
body.archive.sheshi-shell .sheshi-result-card--search .sheshi-category-icon {
  border: 1px solid var(--sheshi-border);
  color: var(--sheshi-text-secondary);
  background: var(--sheshi-surface-raised);
}

body.sheshi-home .sheshi-index-arrow,
body.sheshi-shell .sheshi-directory-index b { color: var(--sheshi-accent-text); }
body.sheshi-home .sheshi-index-row p { color: var(--sheshi-text-secondary); }
body.sheshi-home .sheshi-index-count { color: var(--sheshi-text-meta); font-size: 12px; }
body.sheshi-home .sheshi-index-row h3 { margin-top: 0 !important; }
body.sheshi-home .sheshi-discovery-actions .sheshi-meta-chip { font-size: 12px !important; }

/* Staging notice is information, not a competing card. */
body.sheshi-shell .sheshi-note {
  padding: 11px 14px;
  border: 0;
  border-left: 2px solid var(--sheshi-accent-fill);
  border-radius: 0 8px 8px 0;
  color: var(--sheshi-text-secondary);
  background: var(--sheshi-surface);
  font-size: 13px;
  line-height: 1.5;
}
body.sheshi-shell .sheshi-note strong { color: var(--sheshi-text-primary); }
body.sheshi-shell .sheshi-directory-section .sheshi-section-head h2 { font-size: clamp(21px, 2vw, 24px); }

/* Search: facets, dense rows, active state and real ordering. */
body.search .sheshi-results-layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}
body.search.search .sheshi-results-facets { padding-top: 52px; }
body.search.search .sheshi-facet-option {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 9px;
  color: var(--sheshi-text-secondary);
  font-size: 12.5px;
}
body.search.search .sheshi-facet-option small {
  color: var(--sheshi-text-meta);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
body.search.search .sheshi-facet-option.is-disabled {
  color: var(--sheshi-text-disabled);
  cursor: not-allowed;
  opacity: .65;
}
body.search.search .sheshi-facet-option.is-disabled small { color: var(--sheshi-text-disabled); }
body.search.search .sheshi-facet-option.is-active .sheshi-facet-box {
  border-color: var(--sheshi-accent-fill);
  background: var(--sheshi-accent-fill);
}

body.search .sheshi-results-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 0;
  padding: 0 0 12px;
  border-bottom: 1px solid #30302f;
}
body.search .sheshi-results-toolbar p { margin: 0; color: var(--sheshi-text-secondary); font-size: 14px; }
body.search .sheshi-results-toolbar p strong { color: var(--sheshi-text-primary); font-size: 18px; }
.sheshi-sort-form { display: flex; align-items: center; gap: 9px; }
.sheshi-sort-form label { color: var(--sheshi-text-meta); font-size: 12px; }
.sheshi-sort-form select {
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--sheshi-border);
  border-radius: 9px;
  color: var(--sheshi-text-primary);
  background-color: var(--sheshi-surface-raised);
  font-size: 12.5px;
}

body.search .sheshi-active-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 7px;
  margin: 12px 0 14px;
}
.sheshi-active-filters-label {
  align-self: center;
  margin-right: 3px;
  color: var(--sheshi-text-meta);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
body.search .sheshi-filter-chip {
  border-color: var(--sheshi-border);
  color: var(--sheshi-text-secondary);
  background: var(--sheshi-surface-raised);
}
body.search .sheshi-filter-chip span { color: var(--sheshi-accent-text); }
body.search .sheshi-filter-reset {
  align-self: center;
  margin-left: 3px;
  color: var(--sheshi-accent-text);
  font-size: 12px;
  text-decoration: none;
}

body.search .sheshi-results-page .sheshi-results-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--sheshi-border);
  border-radius: 14px;
  overflow: hidden;
}
body.search .sheshi-results-page .sheshi-result-card--search {
  display: grid;
  min-height: 142px;
  grid-template-columns: 42px minmax(0, 1fr) 190px;
  gap: 14px 18px;
  align-items: center;
  padding: 20px 22px;
  border: 0;
  border-bottom: 1px solid #30302f;
  border-radius: 0;
  color: var(--sheshi-text-primary);
  background: var(--sheshi-surface);
}
body.search .sheshi-results-page .sheshi-result-card--search:last-child { border-bottom: 0; }
body.search .sheshi-results-page .sheshi-result-card--search:hover { border-color: #30302f; background: #202020; }
body.search .sheshi-result-card--search .sheshi-result-body { min-width: 0; }
body.search .sheshi-result-card--search .sheshi-result-meta { margin: 0 0 8px; }
body.search .sheshi-result-card--search .sheshi-result-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
body.search .sheshi-result-card--search h2 {
  margin: 0;
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 1.18;
}
body.search .sheshi-result-card--search h2 a,
body.search .sheshi-result-title-name { color: var(--sheshi-text-primary) !important; }
body.search .sheshi-result-title-place { color: var(--sheshi-text-secondary) !important; font-weight: 620; }
body.search .sheshi-result-card--search .sheshi-result-description {
  margin-top: 5px;
  color: var(--sheshi-text-secondary);
  font-size: 13px;
}
body.search .sheshi-result-card--search .sheshi-result-facts {
  margin-top: 7px;
  color: var(--sheshi-text-meta);
  font-size: 11.5px;
}
body.search .sheshi-result-card--search .sheshi-result-foot {
  grid-column: 3;
  align-self: center;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 1px solid #343432;
}
body.search .sheshi-result-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}
body.search .sheshi-result-links .sheshi-result-details {
  min-height: 32px;
  padding: 4px;
  border: 0;
  border-color: transparent !important;
  color: var(--sheshi-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.search .sheshi-result-links .sheshi-result-website {
  min-height: 40px;
  border: 1px solid #66514f;
  color: var(--sheshi-accent-text);
  background: transparent;
}
body.search .sheshi-result-links .sheshi-result-website:hover,
body.search .sheshi-result-links .sheshi-result-website:focus-visible {
  border-color: var(--sheshi-accent-text);
  color: #ffd0cb;
  background: #2b2020;
}

/* Profile contact remains useful; desktop phone is selectable and copyable. */
body.single-listing .sheshi-profile-contact {
  position: sticky;
  top: 88px;
  align-self: start;
}
.sheshi-profile-phone-copy {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--sheshi-border);
  border-radius: 8px;
  color: var(--sheshi-text-primary);
  background: #272726;
}
.sheshi-profile-phone-copy .sheshi-profile-phone-number {
  user-select: text;
  color: var(--sheshi-text-primary);
  font-size: 13px;
  font-weight: 650;
}
.sheshi-profile-phone-copy button {
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--sheshi-accent-text);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.sheshi-profile-phone-copy button:hover,
.sheshi-profile-phone-copy button:focus-visible { color: #ffd0cb; background: #332323; }
body.single-listing .sheshi-profile-phone-link {
  border-color: var(--sheshi-border) !important;
  color: #ede9e1 !important;
}

@media (max-width: 900px) {
  body.search .sheshi-results-layout { grid-template-columns: 1fr; gap: 0; }
  body.search.search .sheshi-results-facets { display: none; }
  body.single-listing .sheshi-profile-contact { position: static; }
}

@media (max-width: 767px) {
  body.sheshi-home .sheshi-quick-categories > div {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 22px 8px 0;
    scroll-padding-inline: 0 22px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  body.sheshi-home .sheshi-quick-categories > div::-webkit-scrollbar { display: none; }
  body.sheshi-home .sheshi-quick-categories a { flex: 0 0 auto; scroll-snap-align: start; }

  body.single-listing .sheshi-profile-mobile-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }
  body.single-listing .sheshi-profile-mobile-actions a { width: 100%; min-height: 46px; }
  body.single-listing .sheshi-profile-desktop-actions { display: none; }
  body.single-listing .sheshi-profile-page.has-mobile-callbar {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  body.single-listing .sheshi-profile-mobile-callbar {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top-color: var(--sheshi-border);
    color: var(--sheshi-text-primary);
    background: var(--sheshi-surface);
    transform: translateY(110%);
    transition: transform 150ms ease, visibility 150ms linear;
  }
  body.single-listing .sheshi-profile-mobile-callbar.is-visible {
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  body.single-listing .sheshi-profile-mobile-callbar small {
    color: var(--sheshi-text-meta);
    font-size: 12px;
  }
  body.single-listing .sheshi-profile-mobile-callbar strong {
    color: var(--sheshi-text-primary);
    font-size: 13px;
  }
  body.single-listing .sheshi-profile-state {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }
  body.single-listing .sheshi-profile-state .sheshi-meta-chip {
    max-width: calc(100% - 92px);
    white-space: normal;
  }
}

@media (min-width: 768px) {
  body.single-listing .sheshi-profile-mobile-actions,
  body.single-listing .sheshi-profile-mobile-callbar { display: none !important; }
}

@media (max-width: 620px) {
  body.search.search .sheshi-results-content {
    display: flex !important;
    flex-direction: column;
  }
  body.sheshi-shell .sheshi-brand,
  body.sheshi-home .sheshi-brand,
  body.search .sheshi-brand { font-size: 20px !important; }
  body.search .sheshi-results-breadcrumb,
  body.search .sheshi-results-head { order: 0; }
  body.search .sheshi-active-filters {
    order: 1;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 20px;
    overflow-x: auto;
    border-top: 1px solid #30302f;
    border-bottom: 1px solid #30302f;
    scrollbar-width: none;
  }
  body.search .sheshi-active-filters::-webkit-scrollbar { display: none; }
  body.search .sheshi-active-filters > * { flex: 0 0 auto; white-space: nowrap; }
  body.search .sheshi-active-filters-label {
    display: inline-flex;
    min-height: 38px;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid #494844;
    border-radius: 999px;
    color: var(--sheshi-text-primary);
    background: #121212;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
  }
  body.search .sheshi-filter-chip { min-height: 38px; padding: 9px 13px; }
  body.search .sheshi-filter-reset { padding: 8px 2px; }
  .sheshi-meta-chip { min-height: 25px; padding: 4px 8px; font-size: 12px; }
  body.search .sheshi-results-toolbar {
    order: 2;
    min-height: 58px;
    flex-direction: row;
    padding: 8px 20px;
  }
  body.search .sheshi-results-toolbar p { order: 0; }
  body.search .sheshi-results-toolbar .sheshi-sort-form { order: 1; }
  body.search .sheshi-results-list,
  body.search .sheshi-empty-state { order: 3; }
  body.search .navigation.pagination { order: 4; }
  .sheshi-sort-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .sheshi-sort-form select { max-width: 148px; min-height: 40px; }
  body.search .sheshi-results-page .sheshi-results-list {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  body.search .sheshi-results-page .sheshi-result-card--search {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px 13px;
    padding: 18px 20px;
  }
  body.search .sheshi-result-card--search .sheshi-result-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  body.search .sheshi-result-card--search .sheshi-result-foot {
    grid-column: 1 / -1;
    padding: 10px 0 0;
    border: 0;
  }
  body.search .sheshi-result-links {
    display: grid;
    grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
    gap: 9px;
  }
  body.search .sheshi-result-links .sheshi-result-details,
  body.search .sheshi-result-links .sheshi-result-website { min-height: 44px; }
  body.search .sheshi-result-card--search .sheshi-result-meta { margin-bottom: 6px; }
}
