/* ICD browser
   Layout: breadcrumb → [search + child-code table as one card] → page title → details.
   Colours are inherited from the theme; only structure is set here. */

/* The theme prints its own title above the content; the in-content title below
   the browse card replaces it, so hide the duplicate. */
.single-icd10 .entry-title,
.single-icd10 .page-title,
.single-icd10 .elementor-heading-title.elementor-size-default:first-of-type {
  display: none;
}

/* ecgwaves.com has no theme H1 — its Elementor single template repeats the
   code, the chapter and the section as four headings above the content.
   The breadcrumb and the detail block now carry all four, so hide them. */
.single-icd-code .entry-title,
.single-icd-code .page-title,
.single-icd-code .elementor-location-single .elementor-widget-heading {
  display: none;
}

.icd-breadcrumb {
  margin: 0 0 1rem;
  font-size: .9em;
  line-height: 1.6;
}
.icd-breadcrumb a { text-decoration: none; }
.icd-breadcrumb a:hover { text-decoration: underline; }

/* ---------- browse card: search + child codes ---------- */
.icd-browse {
  margin: 0 0 2rem;
  border: 1px solid rgba(128, 128, 128, .3);
  border-radius: 10px;
  overflow: hidden;
}

.icd-search-wrap {
  position: relative;
  display: block;
  margin: 0;
  border-bottom: 1px solid rgba(128, 128, 128, .3);
}
.icd-browse > .icd-search-wrap:only-child { border-bottom: 0; }

.icd-search {
  width: 100%;
  padding: .85rem 2.4rem .85rem 1rem;
  font-size: 1em;
  line-height: 1.4;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}
.icd-search:focus { outline: 2px solid currentColor; outline-offset: -2px; }

.icd-search-clear {
  position: absolute;
  top: 50%;
  right: .6rem;
  transform: translateY(-50%);
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  font-size: 1.2em;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .5;
  cursor: pointer;
}
.icd-search-clear:hover { opacity: .9; }

.icd-search-status {
  padding: .5rem 1rem;
  font-size: .82em;
  opacity: .65;
}
.icd-search-status:empty { display: none; }

/* child codes + search results share one row style */
.icd-children,
.icd-result-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.icd-children li,
.icd-result-list li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: 0;
  padding-right: .5rem;
  border-top: 1px solid rgba(128, 128, 128, .22);
}
.icd-children li:first-child,
.icd-result-list li:first-child { border-top: 0; }

.icd-children a,
.icd-result-list a {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: .85rem;
  padding: .7rem 1rem;
  text-decoration: none;
}
.icd-children a:hover,
.icd-result-list a:hover { background: rgba(128, 128, 128, .08); }

.icd-result-code {
  flex: 0 0 auto;
  min-width: 5.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.icd-result-title { flex: 1 1 auto; }
.icd-result-more {
  margin: 0;
  padding: .6rem 1rem;
  font-size: .82em;
  opacity: .6;
  border-top: 1px solid rgba(128, 128, 128, .22);
}

/* ---------- detail block ---------- */
.icd-title {
  margin: 0 0 1rem;
  line-height: 1.25;
}
.icd-detail h3 {
  margin: 1.5rem 0 .4rem;
  font-size: 1.05em;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.icd-detail ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.icd-detail p { margin: 0 0 1rem; }
.icd-facts { font-size: .9em; opacity: .75; }

/* copy button */
.icd-copy {
  flex: 0 0 auto;
  padding: 0 .35rem;
  font-size: .85em;
  line-height: 1.3;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  opacity: .3;
  cursor: pointer;
  transition: opacity .12s ease;
}
.icd-copy:hover,
.icd-copy:focus-visible { opacity: .9; }
.icd-copy.is-copied { opacity: 1; }
li:hover > .icd-copy { opacity: .6; }

.icd-loading { opacity: .55; transition: opacity .1s ease; }

@media (max-width: 640px) {
  .icd-result-code { min-width: 4.2rem; }
  .icd-children a,
  .icd-result-list a { gap: .5rem; padding: .65rem .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .icd-copy, .icd-loading { transition: none; }
}
