/* ===== Fuentes ===== */
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

/* ===== Variables ===== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1f2330;
  --text-soft: #565d6d;
  --muted: #8a90a0;
  --border: #e6e8ee;
  --brand: #F26654;
  --brand-soft: #fdece8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 12px 32px rgba(20, 24, 40, .06);
  --maxw: 820px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; word-break: break-word; }
a:hover { text-decoration: underline; }

/* ===== Header + Tabs ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 246, 248, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  color: var(--text);
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* Segmented tabs */
.tabs {
  display: inline-flex;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  gap: 4px;
}
.tabs__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-soft);
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.tabs__link:hover { text-decoration: none; color: var(--text); }
.tabs__link.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(242, 102, 84, .32);
}

/* ===== Layout ===== */
.page {
  max-width: var(--maxw);
  margin: 36px auto 80px;
  padding: 0 24px;
}

.doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px clamp(24px, 5vw, 56px);
}

/* ===== Tipografía del documento ===== */
.doc__title {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 900;
  letter-spacing: -.025em;
  margin: 0 0 6px;
  line-height: 1.15;
}
.doc__updated {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 28px;
}

.doc h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 44px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 140px;
}
.doc h3 {
  font-size: 17px;
  font-weight: 800;
  margin: 28px 0 10px;
}

.doc p,
.doc li {
  color: var(--text-soft);
  font-size: 15.5px;
}
.doc p { margin: 0 0 16px; }

.doc strong { color: var(--text); font-weight: 800; }

.doc ul { margin: 0 0 16px; padding-left: 22px; }
.doc ul li { margin: 0 0 8px; }
.doc ul { list-style: none; }
.doc ul li { position: relative; }
.doc ul li::before {
  content: "";
  position: absolute;
  left: -16px;
  top: .7em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--brand);
  opacity: .55;
}

/* Bloque "In Short" / resumen */
.callout {
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--text-soft);
}
.callout strong { color: var(--brand); }

/* Tarjeta de resumen / TOC */
.intro-note {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 28px;
}

.toc {
  counter-reset: toc;
  list-style: none;
  padding-left: 0;
  margin: 0 0 8px;
}
.toc li { padding-left: 0; }
.toc li::before { display: none; }
.toc a {
  display: block;
  padding: 7px 0;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px dashed var(--border);
}

/* Tabla */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 520px;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  color: var(--text-soft);
}
th { background: #fafbff; color: var(--text); font-weight: 800; }
td.center { text-align: center; font-weight: 700; }

/* Estado vacío (placeholder términos) */
.empty {
  text-align: center;
  padding: 60px 20px;
}
.empty__icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--brand-soft);
  font-size: 30px;
}
.empty h2 { border: 0; padding: 0; margin: 0 0 8px; }
.empty p { max-width: 420px; margin: 0 auto; }

/* ===== Footer ===== */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 48px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Botón "volver arriba" */
.back-to-top {
  display: inline-block;
  margin-top: 22px;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 560px) {
  .tabs__link { padding: 9px 14px; font-size: 13.5px; }
  .doc { padding: 32px 20px; }
}
