/* ============================================================
   InjuryLog — condition library, injuries hub, and tools.
   Extends styles.css (same tokens). Loaded after it.
   ============================================================ */

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: 0.82rem; color: var(--muted); padding: 118px 0 0; }
.crumbs .wrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); transition: color .2s; }
.crumbs a:hover { color: var(--cyan); }
.crumbs span[aria-hidden] { opacity: .5; }
.crumbs .here { color: var(--text); }

/* ---------- Draft / review-pending banner ---------- */
.draft-banner {
  background: rgba(248, 81, 73, 0.08); border: 1px solid rgba(248, 81, 73, 0.35);
  border-radius: var(--radius-sm); padding: 12px 18px; margin: 20px auto 0;
  width: min(var(--maxw), 92%); font-size: 0.86rem; color: #f7b0ac;
  display: flex; gap: 10px; align-items: center;
}
.draft-banner svg { flex-shrink: 0; color: var(--danger); }

/* ---------- Condition page shell ---------- */
.condition { width: min(820px, 92%); margin: 0 auto; padding: 30px 0 40px; }
.condition-head { padding-top: 20px; }
.condition-head .region-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 14px;
}
.condition-head h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.08; margin-bottom: 14px;
}
.condition-head .aka { color: var(--muted); font-size: 0.98rem; }
.condition-head .aka strong { color: var(--text); font-weight: 600; }

/* ---------- Answer box (featured-snippet target) ---------- */
.answer-box {
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(0, 205, 255, 0.10), transparent 55%),
    var(--surface);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--cyan);
  border-radius: var(--radius); padding: 26px 28px; margin: 30px 0;
}
.answer-box p { font-family: "Sora", sans-serif; font-size: 1.24rem; line-height: 1.5; font-weight: 500; color: var(--text); }
@media (max-width: 560px) { .answer-box p { font-size: 1.1rem; } }

/* ---------- Section blocks within a condition ---------- */
.c-block { margin: 46px 0; }
.c-block > h2 {
  font-size: clamp(1.4rem, 3.4vw, 1.9rem); font-weight: 700; line-height: 1.2;
  margin-bottom: 16px; scroll-margin-top: 90px;
}
.c-block > h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.c-block p, .c-block li { color: var(--text); opacity: .92; }
.c-block p { margin-bottom: 14px; }
.c-block ul, .c-block ol { padding-left: 22px; margin-bottom: 16px; }
.c-block li { margin-bottom: 8px; }
.c-block .clinical { color: var(--muted); font-style: italic; }

/* ---------- Grade cards ---------- */
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.grade {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px;
}
.grade .g-label {
  font-family: "Sora", sans-serif; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 8px;
}
.grade .g-weeks { font-family: "Sora", sans-serif; font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.grade .g-weeks span { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.grade p { font-size: 0.92rem; margin: 0; color: var(--muted); opacity: 1; }
@media (max-width: 640px) { .grades { grid-template-columns: 1fr; } }

/* ---------- Timeline ---------- */
.timeline { display: grid; gap: 2px; margin: 20px 0; border-radius: var(--radius-sm); overflow: hidden; }
.tl-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 18px; background: var(--card);
  border: 1px solid var(--line); padding: 16px 18px; align-items: start;
}
.tl-row .tl-when { font-family: "Sora", sans-serif; font-weight: 700; color: var(--cyan); font-size: 0.92rem; }
.tl-row .tl-what { color: var(--text); opacity: .92; font-size: 0.96rem; }
@media (max-width: 560px) { .tl-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Red flags ---------- */
.red-flags {
  background: rgba(248, 81, 73, 0.06); border: 1px solid rgba(248, 81, 73, 0.28);
  border-radius: var(--radius); padding: 24px 26px; margin: 24px 0;
}
.red-flags h2 { color: #f7b0ac; }
.red-flags ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.red-flags li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); }
.red-flags li::before {
  content: ""; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%;
  background: var(--danger); flex-shrink: 0;
}
.red-flags .rf-foot { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }

/* ---------- In-context app CTA (the hinge) ---------- */
.hinge {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(0, 205, 255, 0.12), transparent 55%),
    var(--surface);
  border: 1px solid rgba(0, 205, 255, 0.30); border-radius: var(--radius); padding: 30px 30px;
  margin: 28px 0; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.hinge h3 { font-size: 1.3rem; margin-bottom: 8px; }
.hinge p { color: var(--muted); max-width: 46ch; margin: 0; }
.hinge .btn { white-space: nowrap; }
@media (max-width: 640px) { .hinge { grid-template-columns: 1fr; } }

/* track-list (what to record) */
.track-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.track-list li { display: flex; gap: 12px; align-items: flex-start; }
.track-list li svg { color: var(--cyan); flex-shrink: 0; margin-top: 3px; }

/* ---------- Real questions (FAQ) ---------- */
.questions .q { border-top: 1px solid var(--line); padding: 24px 0; }
.questions .q:last-child { border-bottom: 1px solid var(--line); }
.questions .q h2 {
  font-family: "Sora", sans-serif; font-size: 1.18rem; font-weight: 600; margin-bottom: 10px;
  color: var(--text); scroll-margin-top: 90px;
}
.questions .q p { color: var(--muted); margin: 0; }

/* ---------- Reviewer block ---------- */
.reviewer {
  display: flex; gap: 18px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 30px 0;
}
.reviewer .avatar {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: rgba(0, 205, 255, 0.08); border: 1px solid rgba(0, 205, 255, 0.28);
  display: grid; place-items: center; color: var(--cyan);
}
.reviewer .avatar img { width: 100%; height: 100%; object-fit: cover; }
.reviewer .r-meta .r-role { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 4px; }
.reviewer .r-meta .r-name { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.05rem; }
.reviewer .r-meta .r-cred { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.reviewer.pending { border-style: dashed; }
.reviewer.pending .r-name { color: var(--muted); }

/* ---------- Sources ---------- */
.sources { margin: 30px 0; }
.sources h2 { font-size: 1.2rem; margin-bottom: 12px; }
.sources ol { padding-left: 20px; }
.sources li { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.sources a { color: var(--cyan); word-break: break-word; }
.sources a:hover { text-decoration: underline; }
.reviewed-meta { font-size: 0.84rem; color: var(--muted); margin-top: 14px; }

/* ---------- Related conditions ---------- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.related-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; transition: border-color .2s, transform .2s;
}
.related-card:hover { border-color: rgba(0, 205, 255, 0.4); transform: translateY(-2px); }
.related-card .rc-name { font-family: "Sora", sans-serif; font-weight: 600; color: var(--text); }
.related-card .rc-region { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   Injuries hub — body map
   ============================================================ */
.hub-hero { padding: 128px 0 20px; text-align: center; }
.hub-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 14px; }
.hub-hero p { color: var(--muted); max-width: 54ch; margin: 0 auto; font-size: 1.06rem; }

/* Body map sits on its own, centred; the injuries for the chosen area render
   underneath it rather than alongside, so nothing crowds the figure. */
.bodymap-wrap { margin: 40px 0 20px; }

.bodymap { position: static; }
.bodymap-figure { position: relative; width: 100%; max-width: 290px; margin: 0 auto; }
.bodymap-holo {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 0 26px rgba(0, 205, 255, 0.16));
}
.bodymap-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bodymap .region {
  fill: rgba(0, 205, 255, 0); stroke: rgba(0, 205, 255, 0.16); stroke-width: 1.5;
  cursor: pointer; transition: fill .2s, stroke .2s, filter .2s;
}
.bodymap .region:hover, .bodymap .region:focus-visible { fill: rgba(0, 205, 255, 0.22); stroke: var(--cyan); stroke-width: 2.5; outline: none; }
.bodymap .region.active {
  fill: rgba(0, 205, 255, 0.32); stroke: #7ce8ff; stroke-width: 2.5;
  filter: drop-shadow(0 0 14px rgba(0, 205, 255, 0.85));
}
.bodymap-hint { text-align: center; color: var(--muted); font-size: 0.84rem; margin-top: 14px; }

.region-panel { max-width: 720px; margin: 36px auto 0; }
.region-panel .rp-title { font-family: "Sora", sans-serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.region-panel .rp-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }
.cond-list { display: grid; gap: 12px; }
.cond-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 20px; transition: border-color .2s, transform .2s;
}
.cond-item:hover { border-color: rgba(0, 205, 255, 0.4); transform: translateX(3px); }
.cond-item .ci-name { font-family: "Sora", sans-serif; font-weight: 600; color: var(--text); }
.cond-item .ci-aka { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.cond-item .ci-arrow { color: var(--cyan); flex-shrink: 0; }
.cond-item .ci-pending { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }

/* All-conditions fallback list (SEO: real links in source, no JS needed) */
.all-conditions { margin-top: 56px; }
.all-conditions h2 { font-size: 1.3rem; margin-bottom: 18px; }
.region-group { margin-bottom: 26px; }
.region-group h3 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 12px; }
.region-group ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.region-group a {
  display: inline-block; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; font-size: 0.92rem; color: var(--text);
  transition: border-color .2s, color .2s;
}
.region-group a:hover { border-color: var(--cyan); color: var(--cyan); }

/* ============================================================
   Recovery timeline estimator (tool)
   ============================================================ */
.tool-hero { padding: 128px 0 10px; text-align: center; }
.tool-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-bottom: 14px; }
.tool-hero p { color: var(--muted); max-width: 52ch; margin: 0 auto; font-size: 1.05rem; }

.estimator { width: min(880px, 92%); margin: 30px auto 0; }
.est-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
@media (max-width: 720px) { .est-controls { grid-template-columns: 1fr; } }
.est-field label {
  display: block; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; font-weight: 600;
}
.est-field select {
  width: 100%; background: rgba(13,17,23,0.6); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 14px 16px; font-family: inherit; font-size: 1rem; color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300CDFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.est-field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 205, 255, 0.14); }

.est-result { margin-top: 34px; }
.est-summary {
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(0, 205, 255, 0.10), transparent 55%),
    var(--surface);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--cyan);
  border-radius: var(--radius); padding: 24px 26px; margin-bottom: 22px;
}
.est-summary .es-range { font-family: "Sora", sans-serif; font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
.est-summary .es-range span { color: var(--cyan); }
.est-summary p { color: var(--muted); margin: 0; }
.est-phases { display: grid; gap: 2px; border-radius: var(--radius-sm); overflow: hidden; }
.est-phase {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px; background: var(--card);
  border: 1px solid var(--line); padding: 18px 20px; align-items: start;
}
.est-phase .ep-when { font-family: "Sora", sans-serif; font-weight: 700; color: var(--cyan); font-size: 0.92rem; }
.est-phase .ep-title { font-family: "Sora", sans-serif; font-weight: 600; margin-bottom: 4px; }
.est-phase .ep-body { color: var(--muted); font-size: 0.94rem; }
@media (max-width: 560px) { .est-phase { grid-template-columns: 1fr; gap: 4px; } }

.est-disclaimer {
  margin-top: 22px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 0.9rem; display: flex; gap: 12px; align-items: flex-start;
}
.est-disclaimer svg { color: var(--cyan); flex-shrink: 0; margin-top: 2px; }
.est-empty { text-align: center; color: var(--muted); padding: 40px 0; }
.est-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
