/* ==========================================================================
   Solución Salud — Legal pages stylesheet
   Self-contained: no external fonts, no CDN, no JavaScript.
   ========================================================================== */

:root {
  /* Brand */
  --brand:         #0d7268;
  --brand-dark:    #08514a;
  --brand-light:   #e6f4f1;
  --accent:        #b45309;
  --accent-light:  #fef3e2;

  /* Neutrals */
  --ink:           #10201d;
  --body:          #3d4d4a;
  --muted:         #6b7c79;
  --rule:          #dde5e3;
  --surface:       #ffffff;
  --canvas:        #f6f8f7;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --measure: 68ch;

  /* Space */
  --gap: 1.5rem;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------- Skip link */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ Header */

.masthead {
  background: var(--brand);
  color: #fff;
  padding: 1.1rem 0;
}

.masthead__inner {
  max-width: 76ch;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
}
.brand__mark svg { width: 17px; height: 17px; display: block; }

.masthead__nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
}
.masthead__nav a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.masthead__nav a:hover,
.masthead__nav a:focus-visible { color: #fff; border-bottom-color: rgba(255,255,255,.6); }
.masthead__nav a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }

/* ------------------------------------------------------------------- Shell */

.wrap {
  max-width: 76ch;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  background: var(--surface);
  max-width: 76ch;
  margin: 2.5rem auto;
  padding: 3rem 3rem 3.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { margin: 0; padding: 2rem 1.25rem 2.5rem; border-radius: 0; border-left: 0; border-right: 0; }
}

/* -------------------------------------------------------------- Page intro */

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.lede {
  font-size: 1.06rem;
  color: var(--body);
  margin: 0 0 1.25rem;
  max-width: var(--measure);
}

.stamp {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

/* ---------------------------------------------------------------- Headings */

h2 {
  font-size: 1.28rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 700;
  margin: 2.75rem 0 0.85rem;
  scroll-margin-top: 1.5rem;
}

h2 .num {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  margin-right: 0.45rem;
}

h3 {
  font-size: 1.02rem;
  color: var(--ink);
  font-weight: 700;
  margin: 1.9rem 0 0.6rem;
}

/* ------------------------------------------------------------------- Text */

p, li { max-width: var(--measure); }
p { margin: 0 0 1.05rem; }

ul, ol { margin: 0 0 1.05rem; padding-left: 1.35rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--brand); }

strong { color: var(--ink); font-weight: 650; }

a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand); }

abbr[title] { text-decoration: underline dotted; cursor: help; }

/* ------------------------------------------------------------------- ToC */

.toc {
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem 1.1rem;
  margin: 2rem 0 0;
}
.toc h2 {
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.92rem;
}
.toc li { margin-bottom: 0.4rem; break-inside: avoid; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* ------------------------------------------------------------------ Callout */

.note {
  border-left: 3px solid var(--brand);
  background: var(--brand-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}
.note > :last-child { margin-bottom: 0; }
.note p, .note li { max-width: none; }

.note--warn {
  border-left-color: var(--accent);
  background: var(--accent-light);
}

.note__title {
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

/* -------------------------------------------------------------------- Steps */

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0; }

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.4rem 3.25rem;
  margin: 0;
  max-width: none;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.07rem;
  top: 2.4rem;
  bottom: 0.35rem;
  width: 1px;
  background: var(--rule);
}
.steps h3 { margin-top: 0; }

/* -------------------------------------------------------------------- Table */

.table-scroll { overflow-x: auto; margin: 1.5rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 32rem;
}
caption {
  text-align: left;
  color: var(--muted);
  font-size: 0.86rem;
  padding-bottom: 0.6rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
thead th {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom-width: 2px;
}

/* ------------------------------------------------------------------ Contact */

.contact {
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  margin: 1.5rem 0;
}
.contact dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.25rem; }
.contact dt { font-weight: 700; color: var(--ink); font-size: 0.9rem; }
.contact dd { margin: 0; font-size: 0.95rem; }
@media (max-width: 520px) {
  .contact dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .contact dd { margin-bottom: 0.7rem; }
}

/* --------------------------------------------------------------- Index cards */

.cards {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1rem;
}
.cards li { margin: 0; max-width: none; }

.card {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover,
.card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 2px 14px rgba(13, 114, 104, 0.1);
  transform: translateY(-1px);
}
.card__title {
  font-weight: 700;
  color: var(--ink);
  font-size: 1.06rem;
  margin: 0 0 0.3rem;
}
.card__desc { margin: 0; font-size: 0.93rem; color: var(--muted); max-width: none; }

/* ------------------------------------------------------------------- Footer */

.foot {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 2rem 0 3rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.foot .wrap > :last-child { margin-bottom: 0; }
.foot p { max-width: none; margin-bottom: 0.5rem; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--brand-dark); }

.foot__links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.9rem; }

/* -------------------------------------------------------------------- Focus */

a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------- Print */

@media print {
  body { background: #fff; font-size: 11pt; }
  .masthead, .toc, .skip { display: none; }
  main { margin: 0; padding: 0; border: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  h2 { page-break-after: avoid; }
}
