/*
 * Compass theme for the provider DETAIL page.
 *
 */

.compass-detail {
  padding-bottom: 48px;
}

.cd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cmp-teal);
  text-decoration: none;
}

.cd-back:hover {
  text-decoration: underline;
}

/* ---------- two-column body ---------- */
.cd-body {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 18px;
}

.cd-main {
  flex: 1;
  min-width: 0;
}

.cd-sidebar {
  width: 330px;
  flex: none;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- hero ---------- */
.cd-hero {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(56, 46, 32, 0.04);
}

.cd-hero__banner {
  position: relative;
  height: 120px;
  background-image: repeating-linear-gradient(
      135deg,
      #22443f 0,
      #22443f 1px,
      transparent 1px,
      transparent 11px
    ),
    linear-gradient(120deg, #1f6e68, #2c5751);
}

.cd-hero__flag {
  position: absolute;
  top: 14px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.92);
  color: var(--cmp-teal-deep);
}

.cd-hero__flag i {
  color: var(--cmp-teal);
  font-size: 11px;
}

.cd-hero__body {
  position: relative;
  padding: 0 24px 22px;
}

.cd-hero__avatar {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  box-shadow: 0 4px 14px rgba(56, 46, 32, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -40px;
}

.cd-hero__avatar-inner {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  background: #e7f1ee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cmp-teal);
  font-size: 24px;
}

.cd-hero__row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.cd-hero__identity {
  flex: 1;
  min-width: 240px;
}

.cd-hero__tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cd-hero__license {
  font-size: 13px;
  color: var(--cmp-text-faint);
}

.cd-hero__name {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--cmp-teal-deep);
  margin: 10px 0 0;
}

.cd-hero__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 14px;
  color: var(--cmp-text-muted);
}

.cd-hero__meta .sep {
  color: var(--cmp-dot);
}

.cd-hero__meta i {
  color: var(--cmp-teal);
  font-size: 13px;
  margin-right: 4px;
}

.cd-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* hero quality chip (right) */
.cd-qchip {
  flex: none;
  text-align: right;
}

.cd-qchip__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  background: #e7f1ee;
  color: #1b6e5f;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  font-size: 22px;
}

.cd-qchip__value i {
  color: #e0a12e;
  font-size: 18px;
}

.cd-qchip__label {
  font-size: 12.5px;
  color: #8a8175;
  margin-top: 5px;
}

/* ---------- at a glance ---------- */
.cd-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.cd-stat {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(56, 46, 32, 0.04);
}

.cd-stat__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cmp-text-faint);
}

.cd-stat__label i {
  color: var(--cmp-teal);
  font-size: 13px;
}

.cd-stat__value {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--cmp-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cd-stat__sub {
  margin-top: 3px;
  font-size: 12px;
  color: #8a8175;
}

/* ---------- tabs ---------- */
.cd-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 24px;
  border-bottom: 1px solid var(--cmp-border);
}

.cd-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #8a8175;
  cursor: pointer;
}

.cd-tab i {
  font-size: 14px;
}

.cd-tab.is-active {
  color: var(--cmp-teal);
}

.cd-tab__underline {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: transparent;
}

.cd-tab.is-active .cd-tab__underline {
  background: var(--cmp-teal);
}

.cd-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  background: #e6decf;
  color: var(--cmp-text-muted);
}

.cd-tab.is-active .cd-tab__badge {
  background: var(--cmp-teal);
  color: #fff;
}

.cd-panel {
  margin-top: 22px;
}

.cd-panel[hidden] {
  display: none;
}

/* ---------- shared section bits ---------- */
.cd-heading {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--cmp-teal-deep);
  margin: 0;
}

.cd-section {
  margin-top: 24px;
}

.cd-section__title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cmp-text-faint);
  margin-bottom: 11px;
}

.cd-prose {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: #4a443c;
  max-width: 64ch;
}

/* ---------- overview: ages ---------- */
.cd-ages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

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

.cd-age--served {
  background: #f4faf8;
  border-color: #cfe7df;
}

.cd-age__icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: #f1ece3;
  color: #a89e91;
}

.cd-age--served .cd-age__icon {
  background: #e7f1ee;
  color: var(--cmp-teal);
}

.cd-age__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--cmp-text);
}

.cd-age__range {
  margin-top: 1px;
  font-size: 12.5px;
  color: #8a8175;
}

.cd-age__status {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: #a89e91;
}

.cd-age--served .cd-age__status {
  color: #1b6e5f;
}

/* ---------- chips (program features) ---------- */
.cd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cd-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #e6decf;
  background: var(--cmp-surface);
  color: #3a352f;
}

.cd-chip i {
  font-size: 13px;
  color: var(--cmp-teal);
}

/* ---------- compliance ---------- */
.cd-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  margin-bottom: 18px;
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  background: #f4efe7;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cmp-text-soft);
}

.cd-note i {
  color: var(--cmp-teal);
  font-size: 15px;
  margin-top: 1px;
}

.cd-cstat {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: 0 1px 2px rgba(56, 46, 32, 0.04);
}

.cd-cstat__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cmp-text-faint);
}

.cd-cstat__value {
  margin-top: 8px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--cmp-text);
}

.cd-cstat__value--warn {
  color: #a2412c;
}

/* inspection cards */
.cd-insp {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(56, 46, 32, 0.04);
  margin-bottom: 11px;
}

.cd-insp.is-open {
  border-color: #c9bfae;
}

.cd-insp__head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  text-align: left;
  font-family: inherit;
  border: none;
  background: none;
}

button.cd-insp__head {
  cursor: pointer;
}

.cd-insp__icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.cd-insp__icon--clean {
  background: #e4f0ec;
  color: #2e9a7e;
}

.cd-insp__icon--warn {
  background: #fbf0da;
  color: #dda033;
}

.cd-insp__icon--alert {
  background: #f7e4dd;
  color: #cc6b4f;
}

.cd-insp__main {
  flex: 1;
  min-width: 0;
}

.cd-insp__title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.cd-insp__type {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cmp-text);
}

.cd-insp__date {
  font-size: 12px;
  color: var(--cmp-text-faint);
}

.cd-insp__summary {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cmp-text-muted);
}

.cd-insp__summary--clean {
  color: #1b6e5f;
}

.cd-insp__summary--warn {
  color: #9a6b12;
}

.cd-insp__aside {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cmp-text-muted);
}

.cd-insp__chev {
  font-size: 12px;
  color: #a89e91;
  transition: transform 0.2s;
}

.cd-insp.is-open .cd-insp__chev {
  transform: rotate(180deg);
}

.cd-insp__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.cd-insp.is-open .cd-insp__body {
  max-height: 2400px;
}

.cd-insp__findings {
  padding: 2px 17px 14px;
  border-top: 1px solid #f0eadf;
}

.cd-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.cd-flag--ok {
  color: #1b6e5f;
}

.cd-flag--warn {
  color: #a2412c;
}

/* findings */
.cd-finding {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid #f4efe7;
}

.cd-finding:last-child {
  border-bottom: none;
}

.cd-finding__tags {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.cd-tag {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cmp-text);
}

.cd-sev {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 5px;
}

.cd-sev--high {
  background: #f7e4dd;
  color: #a2412c;
}

.cd-sev--medium {
  background: #fbf0da;
  color: #9a6b12;
}

.cd-sev--low,
.cd-sev--unrated {
  background: #eeeae3;
  color: #7a7269;
}

.cd-finding__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.cd-finding__status--resolved {
  color: #1b6e5f;
}

.cd-finding__status--open {
  color: #9a6b12;
}

.cd-finding__note {
  font-size: 12px;
  color: #8a8175;
}

/* ---------- quality ---------- */
.cd-quality {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(56, 46, 32, 0.04);
}

.cd-quality__badge {
  flex: none;
  text-align: center;
}

.cd-quality__grade {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: var(--cmp-teal-deep);
}

.cd-quality__tier {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: #e7f1ee;
  color: #1b6e5f;
  font-weight: 700;
  font-size: 16px;
}

.cd-quality__divider {
  width: 1px;
  align-self: stretch;
  background: #ebe4d8;
}

.cd-quality__body {
  flex: 1;
}

.cd-quality__system {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--cmp-teal-deep);
}

.cd-quality__blurb {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cmp-text-muted);
  max-width: 54ch;
}

.cd-domain {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 13px;
  padding: 14px 16px;
  margin-bottom: 11px;
}

.cd-domain__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cd-domain__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--cmp-text);
}

.cd-domain__score {
  font-size: 12.5px;
  font-weight: 600;
  color: #1b6e5f;
}

.cd-bar {
  height: 7px;
  margin-top: 10px;
  border-radius: 4px;
  background: #f1ece3;
  overflow: hidden;
}

.cd-bar__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--cmp-teal);
}

.cd-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--cmp-card-border);
  border-radius: 10px;
  background: var(--cmp-surface);
  font-size: 13.5px;
  color: var(--cmp-text-muted);
}

.cd-history__rating {
  font-weight: 700;
  color: var(--cmp-teal-deep);
}

/* empty states (no rating, etc.) */
.cd-empty {
  text-align: center;
  padding: 46px 20px;
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 16px;
}

.cd-empty i {
  font-size: 30px;
  color: #c9bfae;
}

.cd-empty__title {
  margin-top: 12px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  color: var(--cmp-text-soft);
}

.cd-empty__hint {
  margin: 5px auto 0;
  max-width: 44ch;
  font-size: 13.5px;
  color: #8a8175;
}

/* ---------- details facts grid ---------- */
.cd-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid #ebe4d8;
  border-radius: 14px;
  background: #ebe4d8;
  overflow: hidden;
}

.cd-fact {
  background: var(--cmp-surface);
  padding: 13px 16px;
}

.cd-fact__label {
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--cmp-text-faint);
}

.cd-fact__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--cmp-text);
  word-break: break-word;
}

/* ---------- sidebar cards ---------- */
.cd-side-card {
  background: var(--cmp-surface);
  border: 1px solid var(--cmp-card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(56, 46, 32, 0.04);
}

.cd-side-card--flush {
  padding: 0;
  overflow: hidden;
}

.cd-side-title {
  margin-bottom: 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cmp-text-faint);
}

.cd-side-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #8a8175;
}

.cd-map {
  height: 160px;
  width: 100%;
  background: #ede7dd;
}

.cd-side-body {
  padding: 15px 18px;
}

.cd-address {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--cmp-text);
}

.cd-contacts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.cd-contact {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
}

.cd-contact i {
  width: 16px;
  font-size: 14px;
  color: var(--cmp-teal);
}

.cd-contact a {
  color: #3a352f;
  text-decoration: none;
  word-break: break-all;
}

.cd-contact a:hover {
  color: var(--cmp-teal);
}

.cd-licrows {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.cd-licrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cd-licrow__label {
  font-size: 13px;
  color: #8a8175;
}

.cd-licrow__value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  color: var(--cmp-text);
}

/* ---------- utilities ---------- */
.cd-w100 {
  width: 100%;
  margin-top: 14px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cd-body {
    flex-direction: column;
  }

  .cd-sidebar {
    width: 100%;
    position: static;
  }
}

@media (max-width: 560px) {
  .cd-facts {
    grid-template-columns: 1fr;
  }
}
