/*
Theme Name: Sheshi Live Audit Corrections
Version: 0.25.1
Description: Terminal corrections for search layout, density, alignment and profile details.
*/

/* Accessible hiding must survive ListingPro's label rules. */
.sr-only,
.screen-reader-text,
.sheshi-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  max-width: 1px !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sheshi-skip-link:focus-visible {
  position: fixed !important;
  top: 8px !important;
  left: 8px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  border: 1px solid var(--text-primary) !important;
  border-radius: 8px !important;
  color: var(--surface-card) !important;
  background: var(--text-primary) !important;
}

/* One content edge for header, main and footer. */
.sheshi-wrap {
  width: 100% !important;
  max-width: 1240px !important;
  margin-inline: auto !important;
  padding-inline: 40px !important;
}

body.sheshi-shell h2,
body.sheshi-home h2 {
  font-size: 22px !important;
  line-height: 1.25 !important;
  letter-spacing: -.4px !important;
}

/* Hero search sits on the same center axis as the rest of the hero. */
.sheshi-portal { text-align: center !important; }
.sheshi-portal h1,
.sheshi-hero-copy { margin-inline: auto !important; }
.sheshi-search-hero {
  width: 100% !important;
  max-width: 680px !important;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto !important;
  gap: 8px !important;
  margin: 24px auto 20px !important;
}
.sheshi-search-hero > * { min-width: 0 !important; }
.sheshi-quick-categories { margin-inline: auto !important; }
.sheshi-quick-categories > div { justify-content: center !important; }
.sheshi-hero-tools {
  margin-top: 20px !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  text-align: center !important;
}
.sheshi-hero-tools > span { display: block !important; }

/* Search head: four desktop columns down to the audited 900px breakpoint. */
body.search .sheshi-results-search-strip { padding: 14px 0 !important; }
body.search form.sheshi-search-results {
  display: grid !important;
  width: 100% !important;
  max-width: 1160px !important;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto !important;
  grid-template-rows: 44px !important;
  gap: 8px !important;
  align-items: stretch !important;
  margin-inline: auto !important;
  padding: 0 !important;
}
body.search form.sheshi-search-results > * { min-width: 0 !important; }
body.search form.sheshi-search-results > input[type="search"] { grid-column: 1 !important; grid-row: 1 !important; }
body.search form.sheshi-search-results > .sheshi-search-filter-toggle { display: none !important; }
body.search form.sheshi-search-results > .sheshi-search-mobile-filter-fields { display: contents !important; }
body.search.sheshi-shell form.sheshi-search-results .sheshi-search-mobile-filter-fields > select:first-of-type { grid-column: 2 !important; grid-row: 1 !important; }
body.search.sheshi-shell form.sheshi-search-results .sheshi-search-mobile-filter-fields > select:last-of-type { grid-column: 3 !important; grid-row: 1 !important; }
body.search form.sheshi-search-results > .sheshi-search-submit { grid-column: 4 !important; grid-row: 1 !important; min-width: 116px !important; }
body.search form.sheshi-search-results input,
body.search form.sheshi-search-results select,
body.search form.sheshi-search-results button { width: 100% !important; height: 44px !important; min-height: 44px !important; border-radius: 8px !important; }

/* Dense, predictable directory rows. */
.sheshi-result-card--search,
.sheshi-discovery-grid .sheshi-result-card--search {
  height: 112px !important;
  min-height: 112px !important;
  grid-template-columns: 42px minmax(0, 1fr) 200px !important;
  gap: 16px !important;
  align-items: center !important;
  overflow: hidden !important;
  padding: 8px 18px !important;
}
.sheshi-result-card--search > .sheshi-category-icon { align-self: center !important; }
.sheshi-result-title-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: baseline !important;
  gap: 8px !important;
}
body.sheshi-shell .sheshi-result-title-row h2,
body.sheshi-home .sheshi-result-title-row h2 {
  order: 1;
  min-width: 0;
  margin: 0 !important;
  font-size: 17px !important;
  line-height: 1.3 !important;
  letter-spacing: -.2px !important;
}
body.sheshi-shell .sheshi-result-title-row h2 a,
body.sheshi-home .sheshi-result-title-row h2 a {
  display: -webkit-box !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sheshi-result-title-row .sheshi-meta-chip {
  order: 2;
  flex: 0 0 auto;
  margin: 0 !important;
  white-space: nowrap !important;
  vertical-align: 2px;
}
.sheshi-result-description {
  display: -webkit-box !important;
  margin: 3px 0 6px !important;
  overflow: hidden !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.sheshi-result-facts {
  flex-wrap: nowrap !important;
  margin: 0 !important;
  overflow: hidden !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}
.sheshi-result-facts > span { display: inline-flex !important; flex: 0 0 auto !important; }
body.sheshi-shell .sheshi-result-facts > span + span::before,
body.sheshi-home .sheshi-result-facts > span + span::before {
  display: inline-block !important;
  content: "·" !important;
  margin-inline: 8px !important;
  color: var(--text-muted) !important;
}
.sheshi-result-links { display: grid !important; gap: 4px !important; justify-items: stretch !important; }
.sheshi-result-details {
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
}
.sheshi-result-details:hover { text-decoration: underline !important; }

/* Category tiles: fixed reading depth and no isolated arrow. */
.sheshi-index-row,
.sheshi-directory-index > a {
  position: relative !important;
  height: 128px !important;
  min-height: 112px !important;
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  grid-template-rows: auto 1fr !important;
  gap: 4px 14px !important;
  padding: 16px 18px !important;
}
.sheshi-index-row .sheshi-category-icon,
.sheshi-directory-index > a .sheshi-category-icon { grid-row: 1 / 3 !important; }
.sheshi-index-row h3,
.sheshi-directory-index > a strong { grid-column: 2 !important; align-self: start !important; }
.sheshi-index-row p {
  display: -webkit-box !important;
  grid-column: 2 / -1 !important;
  margin: 4px 0 0 !important;
  overflow: hidden !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sheshi-index-count,
.sheshi-directory-index > a small { grid-column: 3 !important; grid-row: 1 !important; white-space: nowrap !important; font-size: 13px !important; }
.sheshi-index-arrow,
.sheshi-directory-index > a b { display: none !important; }

/* Profile axes, separators and sticky contact. */
.sheshi-profile-state {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin: 0 0 14px !important;
}
.sheshi-profile-state .sheshi-meta-chip { margin: 0 !important; }
.sheshi-profile-state > a { display: inline-flex !important; min-height: 44px !important; align-items: center !important; font-size: 13px !important; line-height: 1 !important; }
.sheshi-profile-meta-line {
  display: flex !important;
  width: 100% !important;
  flex-wrap: wrap !important;
  gap: 4px 12px !important;
  margin-inline: 0 !important;
}
.sheshi-profile-meta-line span { display: inline-flex !important; align-items: baseline !important; }
.sheshi-profile-meta-line span + span::before { content: "·" !important; margin-right: 12px !important; color: var(--text-muted) !important; }
.sheshi-profile-identity,
.sheshi-profile-section,
.sheshi-profile-contact,
.sheshi-profile-contact dl,
.sheshi-profile-contact dl > div,
.sheshi-contact-source,
.sheshi-profile-socials { width: 100% !important; margin-inline: 0 !important; }
.sheshi-profile-contact {
  position: sticky !important;
  top: 88px !important;
  align-self: start !important;
  padding: 18px !important;
}
.sheshi-profile-contact dl > div,
.sheshi-contact-source,
.sheshi-profile-socials { margin-inline: 0 !important; }

/* Header controls share one geometry. */
.sheshi-theme-toggle,
.sheshi-nav-cta { height: 44px !important; min-height: 44px !important; border-radius: 8px !important; }
.sheshi-theme-toggle { width: 44px !important; }

@media (max-width: 1023px) and (min-width: 901px) {
  body.search.sheshi-shell .sheshi-results-search form.sheshi-search-results > .sheshi-search-filter-toggle { display: none !important; }
  body.search.sheshi-shell .sheshi-results-search form.sheshi-search-results > .sheshi-search-mobile-filter-fields { display: contents !important; }
  body.search.sheshi-shell .sheshi-results-search form.sheshi-search-results > .sheshi-search-mobile-filter-fields > select:first-of-type { grid-column: 2 !important; grid-row: 1 !important; }
  body.search.sheshi-shell .sheshi-results-search form.sheshi-search-results > .sheshi-search-mobile-filter-fields > select:last-of-type { grid-column: 3 !important; grid-row: 1 !important; }
  body.search .sheshi-results-layout { grid-template-columns: 1fr !important; }
  body.search .sheshi-results-facets { display: none !important; }
  .sheshi-profile-layout { grid-template-columns: minmax(0, 1fr) 300px !important; }
}

@media (max-width: 900px) {
  .sheshi-wrap { padding-inline: 24px !important; }
  body.search form.sheshi-search-results {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
  }
  body.search form.sheshi-search-results > input[type="search"],
  body.search form.sheshi-search-results > .sheshi-search-filter-toggle,
  body.search form.sheshi-search-results > .sheshi-search-mobile-filter-fields,
  body.search form.sheshi-search-results > .sheshi-search-submit { grid-column: 1 !important; grid-row: auto !important; }
  body.search form.sheshi-search-results > .sheshi-search-filter-toggle { display: flex !important; width: 100% !important; min-height: 44px !important; align-items: center !important; gap: 8px !important; padding: 0 12px !important; border: 1px solid var(--border-strong) !important; color: var(--text-secondary) !important; background: var(--surface-card) !important; }
  body.search form.sheshi-search-results > .sheshi-search-filter-toggle svg { width: 18px !important; height: 18px !important; fill: none; stroke: currentColor; stroke-width: 1.75; }
  body.search form.sheshi-search-results > .sheshi-search-mobile-filter-fields { display: none !important; }
  body.search form.sheshi-search-results.is-filter-open > .sheshi-search-mobile-filter-fields { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  body.search.sheshi-shell form.sheshi-search-results .sheshi-search-mobile-filter-fields > select:first-of-type,
  body.search.sheshi-shell form.sheshi-search-results .sheshi-search-mobile-filter-fields > select:last-of-type { grid-column: 1 !important; grid-row: auto !important; }
  body.search form.sheshi-search-results > .sheshi-search-submit { width: 100% !important; }
  .sheshi-profile-contact { position: static !important; }
}

@media (max-width: 767px) {
  .sheshi-wrap { padding-inline: 16px !important; }
  body.sheshi-shell h2,
  body.sheshi-home h2 { font-size: 20px !important; }
  .sheshi-search-hero { grid-template-columns: 1fr !important; }
  .sheshi-quick-categories > div { justify-content: flex-start !important; }
  .sheshi-result-card--search,
  .sheshi-discovery-grid .sheshi-result-card--search {
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    padding: 16px !important;
  }
  .sheshi-result-title-row { flex-direction: column !important; align-items: flex-start !important; gap: 6px !important; }
  .sheshi-result-title-row .sheshi-meta-chip { order: 1; }
  body.sheshi-shell .sheshi-result-title-row h2,
  body.sheshi-home .sheshi-result-title-row h2 { order: 2; }
  .sheshi-result-foot { grid-column: 1 / -1 !important; }
  .sheshi-result-links { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .sheshi-result-details { min-height: 44px !important; border: 1px solid var(--border-strong) !important; color: var(--text-primary) !important; }
  body.search form.sheshi-search-results.is-filter-open > .sheshi-search-mobile-filter-fields { grid-template-columns: 1fr !important; }
  .sheshi-profile-state > a { min-height: 32px !important; }
  .sheshi-profile-meta-line span + span::before { display: none !important; content: none !important; }
}

@media (max-width: 640px) {
  .sheshi-search-hero { grid-template-columns: 1fr !important; }
}
