/**
 * Vendor discovery competency overview
 *
 * Mirrors the hierarchy and ordering of the "Was?" search control while
 * keeping the initial archive compact and easy to scan.
 */

body.wp-child-theme-marnamic.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 2px 0 0 !important;
  overflow: visible !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 15px;
  padding: 0 2px;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters-intro h2 {
  margin: 0;
  color: var(--marnamic-cream);
  font-family: var(--marnamic-font-display);
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters-intro p {
  margin: 0;
  color: var(--marnamic-text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(97, 165, 172, 0.09), transparent 48%),
    rgba(241, 233, 221, 0.035);
  border: 1px solid var(--marnamic-border-soft);
  border-radius: 13px;
  box-shadow: none;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link,
body.wp-child-theme-marnamic .marnamic-vendor-discovery__competency {
  min-width: 0;
  text-decoration: none !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link {
  display: grid;
  min-height: 60px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 12px 12px 11px;
  color: var(--marnamic-cream) !important;
  background: rgba(161, 192, 195, 0.08);
  border-bottom: 1px solid var(--marnamic-border-soft);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.24;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link span,
body.wp-child-theme-marnamic .marnamic-vendor-discovery__competency span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link small,
body.wp-child-theme-marnamic .marnamic-vendor-discovery__competency small {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center !important;
  justify-content: center !important;
  color: var(--marnamic-dark) !important;
  background: var(--marnamic-lime) !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link small {
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 7px !important;
  font-size: 0.7rem !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__children {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  padding: 7px;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic .marnamic-vendor-discovery__competency {
  display: grid !important;
  min-height: 38px !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 8px 7px 10px !important;
  color: var(--marnamic-text-muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  line-height: 1.28 !important;
  transition:
    color 160ms ease,
    background-color 160ms ease !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic .marnamic-vendor-discovery__competency small {
  min-width: 24px !important;
  height: 24px !important;
  padding: 0 6px !important;
  font-size: 0.66rem !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link:is(:hover, :focus-visible),
body.wp-child-theme-marnamic.wp-child-theme-marnamic .marnamic-vendor-discovery__competency:is(:hover, :focus-visible) {
  color: var(--marnamic-dark) !important;
  background: var(--marnamic-teal) !important;
  outline: 0 !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link:is(:hover, :focus-visible) small,
body.wp-child-theme-marnamic .marnamic-vendor-discovery__competency:is(:hover, :focus-visible) small {
  color: var(--marnamic-dark) !important;
  background: rgba(19, 33, 36, 0.12) !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link:focus-visible,
body.wp-child-theme-marnamic .marnamic-vendor-discovery__competency:focus-visible {
  box-shadow: inset 0 0 0 2px var(--marnamic-teal) !important;
}

body.wp-child-theme-marnamic .marnamic-vendor-discovery__group--singleton {
  min-height: 100%;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic .marnamic-vendor-discovery__competency--singleton {
  min-height: 100% !important;
  padding: 14px !important;
  color: var(--marnamic-cream) !important;
  background: rgba(161, 192, 195, 0.08) !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
}

@media (max-width: 1080px) {
  body.wp-child-theme-marnamic .marnamic-vendor-discovery__groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.wp-child-theme-marnamic.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters {
    overflow: visible !important;
    padding: 0 !important;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters-intro {
    display: block;
    margin-bottom: 12px;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__clusters-intro p {
    margin-top: 4px;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__groups {
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group {
    position: relative;
    width: 100%;
    min-width: 0;
    flex: none;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-link {
    min-height: 58px;
    padding-right: 62px;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    display: inline-grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    place-items: center;
    margin: 0;
    padding: 0;
    color: var(--marnamic-cream);
    background: rgba(15, 25, 27, 0.82);
    border: 1px solid var(--marnamic-border);
    border-radius: 10px;
    box-shadow: none;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-toggle span {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 160ms ease;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group.is-open .marnamic-vendor-discovery__group-toggle {
    color: var(--marnamic-dark);
    background: var(--marnamic-teal);
    border-color: var(--marnamic-teal);
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group.is-open .marnamic-vendor-discovery__group-toggle span {
    transform: rotate(225deg) translate(-1px, -1px);
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group:not(.is-open) .marnamic-vendor-discovery__children {
    display: none;
  }

  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group.is-open .marnamic-vendor-discovery__children {
    display: flex;
  }
}

@media (min-width: 761px) {
  body.wp-child-theme-marnamic .marnamic-vendor-discovery__group-toggle {
    display: none !important;
  }
}
