/* Spacebahd Company Directory — page-scoped styles (v2c) */

.sb-company-directory {
  --sb-cd-black: #0b0c0f;
  --sb-cd-black-2: #111318;
  --sb-cd-red: #e41f31;
  --sb-cd-red-soft: #ffe6e9;
  --sb-cd-text: #111;
  --sb-cd-muted: #666;
  --sb-cd-border: #deded9;
  --sb-cd-surface: #fafaf8;
  --sb-cd-white: #fff;
  --sb-cd-radius: 18px;
  --sb-cd-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  color: var(--sb-cd-text);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 0;
  box-sizing: border-box;
}

.sb-company-directory *,
.sb-company-directory *::before,
.sb-company-directory *::after {
  box-sizing: border-box;
}

.sb-cd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hide theme page title when directory shortcode supplies the H1 */
body.sb-company-directory-page .entry-header,
body.sb-company-directory-page .jeg_post_title,
body.sb-company-directory-page .jeg_inner_content > .jeg_post_title,
body.sb-company-directory-page .jnews_page_container .entry-header,
body.sb-company-directory-page .breadcrumb,
body.sb-company-directory-page .jeg_breadcrumbs {
  display: none !important;
}

body.sb-company-directory-page .content-inner > p:empty,
body.sb-company-directory-page .entry-content > p:empty {
  display: none;
}

.sb-cd-hero {
  background: linear-gradient(165deg, var(--sb-cd-black) 0%, var(--sb-cd-black-2) 55%, #1a1c22 100%);
  color: var(--sb-cd-white);
  padding: 72px 24px 96px;
}

.sb-cd-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: end;
}

.sb-cd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 18px;
}

.sb-cd-eyebrow i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sb-cd-red);
  display: inline-block;
}

.sb-cd-hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.sb-cd-hero-summary p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.sb-cd-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.sb-cd-hero-meta strong {
  color: #fff;
  font-weight: 700;
}

.sb-cd-shell {
  max-width: 1100px;
  margin: -48px auto 64px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.sb-cd-panel {
  background: var(--sb-cd-white);
  border: 1px solid var(--sb-cd-border);
  border-radius: var(--sb-cd-radius);
  box-shadow: var(--sb-cd-shadow);
  padding: 32px 28px 24px;
}

.sb-cd-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
  margin-bottom: 28px;
}

.sb-cd-kicker {
  display: block;
  color: var(--sb-cd-red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sb-cd-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  color: var(--sb-cd-text);
}

.sb-cd-intro p {
  margin: 0 0 10px;
  color: var(--sb-cd-muted);
}

.sb-cd-missing {
  margin: 0 !important;
  color: var(--sb-cd-muted);
}

.sb-cd-missing a {
  color: var(--sb-cd-red);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sb-cd-missing a:hover,
.sb-cd-missing a:focus-visible {
  color: #b51524;
}

.sb-cd-controls {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.sb-cd-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--sb-cd-border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--sb-cd-surface);
}

.sb-cd-search svg {
  color: #888;
  flex-shrink: 0;
}

.sb-cd-search input {
  border: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  color: var(--sb-cd-text);
  outline: none;
}

.sb-cd-search:focus-within {
  border-color: #bbb;
  box-shadow: 0 0 0 3px rgba(228, 31, 49, 0.15);
}

.sb-cd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sb-cd-filter {
  appearance: none;
  border: 1px solid var(--sb-cd-border);
  background: #fff;
  color: #333;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sb-cd-filter:hover {
  border-color: #bbb;
}

.sb-cd-filter:focus-visible {
  outline: 2px solid var(--sb-cd-red);
  outline-offset: 2px;
}

.sb-cd-filter.is-active {
  background: var(--sb-cd-black);
  border-color: var(--sb-cd-black);
  color: #fff;
}

.sb-cd-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.sb-cd-roster,
.sb-company-directory ul.sb-cd-roster,
.jeg_inner_content .sb-cd-roster,
.entry-content .sb-cd-roster {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 1px solid var(--sb-cd-border);
  counter-reset: none;
}

.sb-cd-roster > li,
.sb-company-directory .sb-cd-row {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  border-bottom: 1px solid var(--sb-cd-border);
}

.sb-cd-roster > li::before,
.sb-cd-roster > li::marker,
.sb-cd-row::before {
  content: none !important;
  display: none !important;
}

.sb-cd-row[hidden] {
  display: none !important;
}

.sb-cd-row-inner {
  display: grid;
  grid-template-columns: 56px minmax(180px, 1.6fr) 110px minmax(140px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 4px;
}

.sb-cd-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--sb-cd-border);
  background: var(--sb-cd-surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sb-cd-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.sb-cd-logo span {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.02em;
}

.sb-cd-company {
  min-width: 0;
}

.sb-cd-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.sb-cd-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sb-cd-text);
}

.sb-cd-profile-link {
  color: var(--sb-cd-red);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.sb-cd-profile-link:hover,
.sb-cd-profile-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.sb-cd-specialty {
  display: block;
  color: var(--sb-cd-muted);
  font-size: 0.92rem;
}

.sb-cd-sector {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #f0f0ec;
  color: #444;
  width: fit-content;
}

.sb-cd-sector.sector-build {
  background: #e3f2ff;
  color: #176290;
}

.sb-cd-sector.sector-launch {
  background: var(--sb-cd-red-soft);
  color: #b51524;
}

.sb-cd-sector.sector-operate {
  background: #eef7ea;
  color: #2f6b2f;
}

.sb-cd-sector.sector-observe {
  background: #f4eefc;
  color: #5b3f8c;
}

.sb-cd-sector.sector-government {
  background: #f1efe8;
  color: #8b5608;
}

.sb-cd-sector-empty {
  visibility: hidden;
}

.sb-cd-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sb-cd-muted);
  font-size: 0.92rem;
  min-width: 0;
}

.sb-cd-location svg {
  flex-shrink: 0;
  color: #999;
}

.sb-cd-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--sb-cd-muted);
}

.sb-cd-empty[hidden] {
  display: none !important;
}

.sb-cd-empty-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sb-cd-text);
}

.sb-cd-clear {
  appearance: none;
  margin-top: 14px;
  border: 1px solid var(--sb-cd-border);
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}

.sb-cd-clear:focus-visible {
  outline: 2px solid var(--sb-cd-red);
  outline-offset: 2px;
}

.sb-cd-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--sb-cd-border);
  color: var(--sb-cd-muted);
  font-size: 0.92rem;
}

@media (max-width: 920px) {
  .sb-cd-hero-inner,
  .sb-cd-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sb-cd-row-inner {
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "logo company"
      "logo sector"
      "logo location";
    gap: 8px 14px;
    padding: 18px 2px;
  }

  .sb-cd-logo {
    grid-area: logo;
    width: 48px;
    height: 48px;
  }

  .sb-cd-logo img {
    width: 48px;
    height: 48px;
  }

  .sb-cd-company {
    grid-area: company;
  }

  .sb-cd-sector {
    grid-area: sector;
  }

  .sb-cd-location {
    grid-area: location;
  }
}

@media (max-width: 640px) {
  .sb-cd-hero {
    padding: 56px 18px 80px;
  }

  .sb-cd-shell {
    margin-top: -40px;
    padding: 0 14px;
  }

  .sb-cd-panel {
    padding: 24px 16px 18px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-cd-filter {
    transition: none;
  }
}
