/* ================================================
   Protocolos de rehabilitación (extiende styles.css)
   ================================================ */

.proto-section { padding: clamp(3rem, 6vw, 5rem) 0; scroll-margin-top: 4.5rem; }
.proto-section--tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.proto-content { max-width: 860px; margin: 0 auto; }

.proto-head { margin-bottom: 2rem; }
.proto-head h2 {
  margin: 0;
  font-family: 'Merriweather', serif;
  font-size: clamp(1.75rem, 2.4vw, 2.4rem);
  line-height: 1.1;
}
.proto-head p:not(.section-label) { margin: 1.1rem 0 0; color: var(--muted); }

.proto-content h3 {
  margin: 2.25rem 0 0.5rem;
  font-family: 'Merriweather', serif;
  font-size: 1.25rem;
  line-height: 1.25;
}
.proto-content > h3:first-child,
.proto-head + h3 { margin-top: 0; }
.proto-content p,
.proto-content li { color: var(--text); }
.proto-content p { margin: 0 0 1rem; }
.proto-content ul { margin: 0 0 1.25rem; padding-left: 1.3em; }
.proto-content li { margin-bottom: 0.4rem; }
.proto-note { color: var(--muted) !important; font-size: 0.92rem; }

/* ── Índice ─────────────────────────────────── */
.proto-toc {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.proto-toc .container { padding-top: 0.6rem; padding-bottom: 0.6rem; width: max-content; min-width: 100%; }
.proto-toc a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  margin-right: 0.25rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.proto-toc a:hover,
.proto-toc a:focus-visible { background: var(--surface-soft); color: var(--text); }

/* ── Tarjetas ───────────────────────────────── */
.proto-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.proto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.1rem 1.25rem;
}
.proto-card h4 { margin: 0 0 0.35rem; font-size: 1rem; line-height: 1.3; }
.proto-card p { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.6; }

/* ── Avisos ─────────────────────────────────── */
.proto-callout {
  border-radius: 20px;
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.proto-callout h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proto-callout p { margin: 0; font-size: 0.97rem; }
.proto-callout.danger { background: #fbe9e6; border-color: #e9c1ba; }
.proto-callout.danger h4 { color: #a23a30; }
.proto-callout.warning { background: #faefd9; border-color: #ecd6a6; }
.proto-callout.warning h4 { color: #85571a; }
.proto-callout.note h4 { color: var(--muted); }

/* ── Fases ──────────────────────────────────── */
.phase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.phase > summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  list-style: none;
}
.phase > summary::-webkit-details-marker { display: none; }
.phase > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.phase-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.phase-summary-text { flex: 1; min-width: 0; }
.phase-summary-text h3 { margin: 0; font-size: 1.15rem; }
.phase-sub { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }
.chev { flex: none; width: 1.2rem; height: 1.2rem; color: var(--muted); transition: transform 0.18s ease; }
.phase[open] .chev { transform: rotate(180deg); }
.phase-body { padding: 0.25rem 1.4rem 1.5rem; border-top: 1px solid var(--border); }
.phase-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin: 1.1rem 0; }
.phase-row p { margin: 0; }
.field-label {
  margin: 0 0 0.3rem !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.exercise-list { list-style: none; padding: 0 !important; margin: 0.4rem 0 1rem !important; }
.exercise-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  margin: 0 !important;
  border-bottom: 1px dashed var(--border);
  font-size: 0.97rem;
}
.exercise-list li:last-child { border-bottom: none; }
.exercise-list a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.exercise-list a:hover { border-bottom-color: var(--accent); }
.exercise-list .dose { flex: none; color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.vid-icon {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  line-height: 1.05rem;
  margin-left: 0.3rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.55rem;
  text-align: center;
  vertical-align: 0.1em;
}

.criteria {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  background: #e8f1ea;
}
.criteria .field-label { color: #2c6a47; }
.criteria ul { list-style: none; padding: 0 !important; margin: 0.4rem 0 0 !important; }
.criteria li { position: relative; padding-left: 1.5rem; margin: 0 0 0.2rem; font-size: 0.97rem; }
.criteria li::before { content: "✓"; position: absolute; left: 0; color: #2c6a47; font-weight: 700; }

/* ── Tablas ─────────────────────────────────── */
.proto-table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.proto-table-wrap table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 0.93rem; }
.proto-table-wrap th,
.proto-table-wrap td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.proto-table-wrap th { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--surface-soft); }
.proto-table-wrap tr:last-child td { border-bottom: none; }
.proto-table-wrap td.num { font-variant-numeric: tabular-nums; }

/* ── FAQ ────────────────────────────────────── */
.proto-faq { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.proto-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.proto-faq summary::-webkit-details-marker { display: none; }
.proto-faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.proto-faq[open] summary::after { content: "–"; }
.proto-faq p { margin: 0.7rem 0 0; color: var(--muted); }

.proto-cta h2 { margin: 0; font-family: 'Merriweather', serif; font-size: clamp(1.6rem, 2.2vw, 2.1rem); }
.proto-cta > p { margin-top: 1rem; }
.proto-cta .hero-actions { margin: 1.5rem 0; }

@media (max-width: 720px) {
  .phase-row { grid-template-columns: 1fr; }
  .exercise-list li { flex-direction: column; gap: 0.1rem; }
}
.proto-more { margin-top: 2rem; color: var(--muted); }
