/*
 * Specialty pages for physicians (/especialidades/).
 *
 * Built on the editorial system (static_src/sass/editorial-system.scss) and its brand
 * tokens. This file only adds what those pages need: the breadcrumb, the table from
 * clinical finding to area, the order of choice of exams and the area sheets.
 *
 * The exam order is a visual hierarchy, not only a list: the genome is the filled card,
 * the exome the outlined card and the panels a plain row.
 */

.neo-specialty-page {
  --spec-line: var(--neo-pilot-line, rgba(16, 42, 60, 0.18));
  --spec-anchor-offset: 7.5rem;
}

.neo-specialty-page :is(.neo-spec-area, #achados, #areas, #fontes, [id^="fonte-"]) {
  scroll-margin-top: var(--spec-anchor-offset);
}

/* --- Breadcrumb and hero ---------------------------------------------------------------- */

.neo-spec-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
  color: var(--neo-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.neo-spec-breadcrumb a {
  color: var(--neo-teal-text);
}

.neo-spec-breadcrumb a:hover {
  text-decoration: underline;
}

.neo-spec-hero--hub {
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.neo-spec-hero--hub .neo-pilot-display {
  max-width: 16ch;
}

.neo-spec-hero .neo-pilot-display {
  font-size: clamp(2.4rem, 4.4vw, 4.4rem);
  line-height: 1;
}

.neo-spec-index h2 {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.neo-spec-index nav {
  margin-top: 1.5rem;
}

.neo-spec-index > p {
  margin-top: 1.75rem;
  color: #c4d6e0;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* --- From the clinical finding to the area ---------------------------------------------- */

.neo-spec-scenario-table {
  margin-top: clamp(1.75rem, 3vw, 3rem);
  border-bottom: 1px solid var(--spec-line);
}

.neo-spec-scenario-table ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.neo-spec-scenario-table__head,
.neo-spec-scenario {
  display: grid;
  align-items: start;
  gap: 1rem 2rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(11rem, 0.5fr);
}

.neo-spec-scenario-table__head {
  padding-bottom: 0.85rem;
  color: var(--neo-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.neo-spec-scenario {
  padding-block: 1.35rem;
  border-top: 1px solid var(--spec-line);
  transition: padding-left 180ms ease, color 180ms ease;
}

.neo-spec-scenario:hover {
  padding-left: 0.5rem;
  color: var(--neo-teal-text);
}

.neo-spec-scenario:focus-visible,
.neo-spec-exam__name a:focus-visible,
.neo-spec-how-links a:focus-visible,
.neo-spec-sources a:focus-visible,
.neo-spec-area__sources a:focus-visible {
  outline: 3px solid rgba(0, 152, 174, 0.35);
  outline-offset: 4px;
}

.neo-spec-scenario strong {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.4;
}

.neo-spec-scenario__think {
  color: var(--neo-muted);
  line-height: 1.5;
}

.neo-spec-scenario__area {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--neo-teal-text);
  font-size: 0.95rem;
  font-weight: 600;
}

/* --- Order of choice --------------------------------------------------------------------- */

.neo-spec-order {
  background: var(--neo-ice);
}

.neo-spec-rank {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.75rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--neo-teal-text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.neo-spec-order__list {
  display: grid;
  gap: 1rem;
  margin: clamp(1.75rem, 3vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
  grid-template-columns: 1.15fr 1fr 1fr;
}

.neo-spec-order__item {
  padding: clamp(1.5rem, 2.4vw, 2.25rem);
  border: 1px solid var(--neo-line);
  border-radius: var(--neo-radius-md);
  background: var(--neo-white);
}

.neo-spec-order__item h3 {
  margin-top: 1.5rem;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.neo-spec-order__item > p:last-child {
  margin-top: 0.9rem;
  color: var(--neo-muted);
  line-height: 1.6;
}

.neo-spec-order__item--first {
  border-color: var(--neo-navy-deep);
  background: var(--neo-navy-deep);
  color: var(--neo-white);
}

.neo-spec-order__item--first .neo-spec-rank {
  color: var(--neo-teal-bright);
}

.neo-spec-order__item--first > p:last-child {
  color: #dce7ed;
}

.neo-spec-order__note {
  margin-top: 1.5rem;
  color: var(--neo-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Area sheets ------------------------------------------------------------------------- */

.neo-spec-areas {
  padding-block: clamp(3rem, 5vw, 5rem);
}

.neo-spec-areas > .neo-shell > .neo-pilot-heading {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.neo-spec-area {
  display: grid;
  align-items: start;
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 4.5vw, 4.25rem);
  border-top: 1px solid var(--spec-line);
  grid-template-columns: minmax(14rem, 0.42fr) minmax(0, 1fr);
}

.neo-spec-area__header {
  position: sticky;
  top: var(--spec-anchor-offset);
}

.neo-spec-area__number {
  color: var(--neo-teal-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.neo-spec-area__header h3 {
  margin-top: 0.9rem;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-wrap: balance;
}

.neo-spec-area__header > p {
  margin-top: 1rem;
  color: var(--neo-muted);
  line-height: 1.55;
}

.neo-spec-area__sources {
  font-size: 0.82rem;
}

.neo-spec-area__sources span {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.neo-spec-area__sources a {
  margin-left: 0.3rem;
  color: var(--neo-teal-text);
  font-weight: 600;
}

.neo-spec-area__sources a:hover {
  text-decoration: underline;
}

.neo-spec-area__body {
  display: grid;
  gap: clamp(2rem, 3.5vw, 3rem);
  min-width: 0;
}

.neo-spec-block h4 {
  color: var(--neo-teal-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.105em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* When to order */

.neo-spec-when {
  display: grid;
  gap: 0.85rem;
  max-width: 48rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.neo-spec-when li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 1.06rem;
  line-height: 1.6;
}

.neo-spec-when li::before {
  position: absolute;
  top: 0.82em;
  left: 0;
  width: 0.85rem;
  height: 1px;
  background: var(--neo-teal);
  content: "";
}

/* What changes: diagnosis, management, family */

.neo-spec-why {
  margin: 1.1rem 0 0;
  border: 1px solid var(--neo-line);
  border-radius: var(--neo-radius-md);
  background: var(--neo-white);
}

.neo-spec-why > div {
  display: grid;
  gap: 0.5rem 1.5rem;
  padding: 1.35rem clamp(1.25rem, 2.2vw, 1.9rem);
  grid-template-columns: 7.5rem minmax(0, 1fr);
}

.neo-spec-why > div + div {
  border-top: 1px solid var(--neo-line);
}

.neo-spec-why dt {
  color: var(--neo-navy);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.6;
}

.neo-spec-why dd {
  margin: 0;
  line-height: 1.65;
}

/* Which exam to order */

.neo-spec-steps {
  display: grid;
  gap: 0.75rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.neo-spec-step {
  display: grid;
  align-items: start;
  gap: 0.9rem 1.5rem;
  padding: 1.35rem clamp(1.25rem, 2.2vw, 1.9rem);
  border: 1px solid var(--neo-line);
  border-radius: var(--neo-radius-md);
  background: var(--neo-white);
  grid-template-columns: 7.5rem minmax(0, 1fr);
}

.neo-spec-step--single {
  grid-template-columns: minmax(0, 1fr);
}

.neo-spec-step__exams {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.neo-spec-step__note {
  max-width: 44rem;
  margin: 0;
  line-height: 1.6;
}

.neo-spec-step__exams > .neo-spec-step__note {
  order: 2;
  color: var(--neo-muted);
  font-size: 0.95rem;
}

.neo-spec-exam__name {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
}

.neo-spec-exam__name a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 152, 174, 0.4);
  text-underline-offset: 0.22em;
}

.neo-spec-exam__name a:hover {
  color: var(--neo-teal-text);
}

.neo-spec-exam__facts {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.3rem;
  color: var(--neo-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.neo-spec-exam__turnaround > span:first-child,
.neo-spec-exam__genes > span:first-child {
  font-weight: 600;
}

.neo-spec-exam__turnaround,
.neo-spec-exam__genes {
  margin-top: 0.2rem;
  color: var(--neo-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* First choice: the filled card. */

.neo-spec-step--genome {
  border-color: var(--neo-navy-deep);
  background: var(--neo-navy-deep);
  color: var(--neo-white);
}

.neo-spec-step--genome .neo-spec-rank {
  color: var(--neo-teal-bright);
}

.neo-spec-step--genome .neo-spec-exam__name {
  font-size: 1.35rem;
}

/* The genome itself, then why it comes first, then its other versions (trio, rapid...). */
.neo-spec-step--genome .neo-spec-step__exams > .neo-spec-step__note {
  order: 1;
}

.neo-spec-step--genome .neo-spec-exam ~ .neo-spec-exam {
  order: 2;
}

.neo-spec-step--genome .neo-spec-exam ~ .neo-spec-exam .neo-spec-exam__name,
.neo-spec-step--exome .neo-spec-exam ~ .neo-spec-exam .neo-spec-exam__name {
  font-size: 1rem;
}

.neo-spec-step--genome .neo-spec-exam__name a {
  text-decoration-color: rgba(0, 213, 226, 0.6);
}

.neo-spec-step--genome .neo-spec-exam__name a:hover {
  color: var(--neo-teal-bright);
}

.neo-spec-step--genome .neo-spec-step__note,
.neo-spec-step--genome .neo-spec-exam__turnaround {
  color: #dce7ed;
}

/* Second choice: the outlined card. */

.neo-spec-step--exome {
  border-color: var(--neo-teal);
}

/* Third choice: a plain row. */

.neo-spec-step--panels {
  background: transparent;
}

.neo-spec-step--panels .neo-spec-step__exams {
  gap: 1.5rem 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.neo-spec-step--panels .neo-spec-step__note {
  grid-column: 1 / -1;
}

.neo-spec-step--panels .neo-spec-exam__name {
  font-size: 1rem;
}

/* --- How to order: links under the process ----------------------------------------------- */

.neo-spec-how-links {
  padding-bottom: clamp(3rem, 5vw, 4.5rem);
  background: var(--neo-paper-light, #f8fbfc);
}

.neo-spec-how-links > .neo-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.neo-spec-how-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--neo-line);
  border-radius: 999px;
  background: var(--neo-white);
  color: var(--neo-teal-text);
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 180ms ease;
}

.neo-spec-how-links a:hover {
  border-color: var(--neo-teal);
}

/* --- Sources ----------------------------------------------------------------------------- */

.neo-spec-sources h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  letter-spacing: -0.03em;
}

.neo-spec-sources > div > p {
  max-width: 46rem;
  margin-top: 0.9rem;
  color: var(--neo-muted);
  line-height: 1.6;
}

.neo-spec-sources ol {
  display: grid;
  gap: 0.8rem;
  margin: 1.75rem 0 0;
  padding-left: 1.5rem;
  color: var(--neo-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  list-style: decimal;
}

.neo-spec-sources li:target {
  color: var(--neo-ink);
}

.neo-spec-sources a:hover {
  color: var(--neo-teal-text);
  text-decoration: underline;
}

/* --- Small screens ----------------------------------------------------------------------- */

@media (max-width: 960px) {
  .neo-spec-area {
    grid-template-columns: minmax(0, 1fr);
  }

  .neo-spec-area__header {
    position: static;
  }

  .neo-spec-order__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .neo-spec-scenario-table__head {
    display: none;
  }

  .neo-spec-scenario {
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .neo-spec-scenario__area {
    justify-content: flex-start;
    margin-top: 0.3rem;
  }

  .neo-spec-why > div,
  .neo-spec-step,
  .neo-spec-step--panels .neo-spec-step__exams {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .neo-spec-scenario,
  .neo-spec-how-links a {
    transition: none;
  }
}
