/* ==========================================================================
   QuórumPH — estilos de las guías (se carga después de styles.css)
   ========================================================================== */

/* --- Cabecera de la guía ------------------------------------------------- */

.guide-head {
  background: var(--tint);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(1.75rem, 5vw, 3.25rem);
}

.guide-head h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  max-width: 24ch;
  margin-top: 1.1rem;
}

.guide-head__lead {
  font-size: clamp(1.08rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
  margin: 1.2rem 0 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: #8aa3b0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy); }
.crumbs [aria-current] { color: var(--ink); }
/* en pantallas pequeñas el título de la guía ya está justo debajo */
@media (max-width: 639px) { .crumbs li:last-child:not(:first-child):not(:nth-child(2)) { display: none; } }

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-nav a[aria-current="page"] {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.35em;
}

/* --- Maquetación: índice + texto ---------------------------------------- */

.guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-block: clamp(2rem, 5vw, 3.75rem) clamp(3rem, 7vw, 5rem);
}

@media (min-width: 960px) {
  .guide { grid-template-columns: 250px minmax(0, 1fr); gap: 4rem; align-items: start; }
  .toc { position: sticky; top: 6.5rem; }
}

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.96rem;
}
.toc summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
}
.toc[open] summary { margin-bottom: 0.7rem; }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin-bottom: 0.4rem; line-height: 1.4; }
.toc li::marker { color: var(--muted); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--teal-ink); text-decoration: underline; }

/* --- Texto --------------------------------------------------------------- */

.prose > p,
.prose > ul,
.prose > ol,
.prose > h2,
.prose > h3 { max-width: 68ch; }

.prose h2 {
  font-size: clamp(1.5rem, 2.7vw, 1.95rem);
  line-height: 1.18;
  margin: 3rem 0 1rem;
}
.prose h3 {
  font-size: 1.2rem;
  margin: 1.9rem 0 0.5rem;
}
.prose > h2:first-child { margin-top: 0; }

.prose a { overflow-wrap: anywhere; }

.prose ul.list,
.prose ol.list { margin: 1rem 0 1.25rem; padding-left: 1.4rem; }
.prose ul.list li,
.prose ol.list li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.prose ul.list li::marker { color: var(--teal); }
.prose ol.list li::marker { color: var(--navy); font-weight: 600; }

.prose .ticks { margin-bottom: 1.25rem; }
.prose .steps { margin: 1.5rem 0 1rem; max-width: 68ch; }
.prose .steps h3 { margin: 0.25rem 0 0.35rem; font-size: 1.2rem; }

/* --- Resumen y avisos ---------------------------------------------------- */

.summary {
  background: var(--tint);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.4rem 0.9rem;
  margin: 0 0 2.5rem;
}
.prose .summary__title {
  font-size: 1.25rem;
  margin: 0 0 0.2rem;
}
.summary .ticks { margin-top: 0.8rem; }

.callout {
  border-left: 4px solid #b7791f;
  background: #fff8eb;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem 0.2rem;
  margin: 1.5rem 0;
}

/* --- Tablas -------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.table-wrap:focus-visible { outline-offset: 2px; }

table.data {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
}
table.data.wide { min-width: 640px; }

table.data caption {
  caption-side: top;
  text-align: left;
  padding: 0.8rem 0.95rem;
  color: var(--muted);
  font-size: 0.92rem;
}
table.data th,
table.data td {
  padding: 0.6rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
}
table.data thead th {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  border-top: 0;
  vertical-align: bottom;
}
table.data tbody th,
table.data tfoot th { font-weight: 600; color: var(--navy); }
table.data .num { text-align: right; white-space: nowrap; }
table.data tbody tr:nth-child(even) { background: #f7fbfc; }
table.data tfoot th,
table.data tfoot td { background: var(--tint); font-weight: 600; border-top: 2px solid var(--line); }
table.data .yes { color: var(--teal-ink); font-weight: 600; }
table.data .no { color: var(--muted); }

@media (max-width: 599px) {
  table.data { font-size: 0.9rem; }
  table.data th, table.data td, table.data caption { padding-inline: 0.6rem; }
}

@media (max-width: 479px) {
  table.data { font-size: 0.88rem; }
  table.data th, table.data td, table.data caption { padding-inline: 0.42rem; }
  table.data th:first-child, table.data td:first-child, table.data caption { padding-left: 0.65rem; }
}

.table-hint { display: none; margin: 1.5rem 0 0; font-size: 0.88rem; color: var(--muted); }
.table-hint + .table-wrap { margin-top: 0.5rem; }
.table-hint.show { display: block; }

/* --- Fuentes y relacionadas --------------------------------------------- */

.sources { list-style: none; margin: 1rem 0 1.5rem; padding: 0; max-width: 68ch; }
.sources li { margin-bottom: 0.65rem; font-size: 0.97rem; line-height: 1.5; }

.related {
  margin-top: 3.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}
.prose .related__title { font-size: 1.4rem; margin: 0 0 1.5rem; }
.related .services { gap: 1.75rem 2.5rem; }
.related .service h3 { font-size: 1.12rem; }

.guide-list { margin-bottom: 0.5rem; }
.guide-list .service .guide-meta { margin-top: 0.6rem; }

/* --- Modelos para copiar ------------------------------------------------ */

.template {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  background: var(--white);
}
.template__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.8rem 1.1rem;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}
.prose .template__title { margin: 0; font-family: var(--font-display); font-weight: 800; color: var(--navy); }
.template__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.template__body { padding: 1.4rem clamp(1rem, 3vw, 1.75rem); font-size: 0.98rem; line-height: 1.6; }
.prose .template__body p,
.prose .template__body li { max-width: none; }
.template__body p { margin: 0 0 0.9rem; }
.template__body ol,
.template__body ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.template__body li { margin-bottom: 0.3rem; }
.template__h { font-weight: 600; text-align: center; color: var(--navy); font-size: 1.05rem; }
.template__label { font-weight: 600; color: var(--navy); margin-top: 1.3rem !important; }
.template__sign { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 640px) { .template__sign { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.template__sign p { color: var(--muted); }
.blank { background: #fff3c4; border-radius: 3px; padding: 0 0.15em; color: var(--ink); }

.notfound { margin-top: 1.25rem; }

@media print {
  .toc, .related { display: none; }
  .guide { display: block; }
}
