/* Sitio legal de billetudo.
 *
 * Los colores salen de las variables del sistema de diseno
 * (design-system/billetudo/MASTER.md). No inventar hex nuevos aca: si hace
 * falta un color, sale de esa tabla o no va.
 *
 * Soporta tema claro y oscuro segun la preferencia del sistema, igual que la app.
 */

:root {
  --primary: #6c5ce7;
  --primary-deep: #5648c8;
  --primary-soft: #eeecfb;
  --on-primary: #ffffff;
  --background: #f4f3fa;
  --surface: #ffffff;
  --border: #ecebf3;
  --text-primary: #1c1b29;
  --text-secondary: #6b6980;
  --expense-text: #b91c1c;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #6d4fe0;
    --primary-deep: #a78bfa;
    --primary-soft: #26243b;
    --background: #14141f;
    --surface: #1e1e2e;
    --border: #2a2a3d;
    --text-primary: #f4f3fa;
    --text-secondary: #9a98b5;
    --expense-text: #f87171;
  }
}

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabecera ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.site-header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-header__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.site-header__name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--primary-deep);
}

/* ---------- Contenido ---------- */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin: 28px 0 8px;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

a {
  color: var(--primary-deep);
}

strong {
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

code {
  background: var(--primary-soft);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-word;
}

/* El indice y los bloques destacados que el Markdown emite como blockquote. */
blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--primary-soft);
  border-radius: 12px;
  border-left: 3px solid var(--primary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

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

.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.92rem;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--primary-soft);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

/* ---------- Pendientes visibles ---------- */

/* Marca los [VERIFICAR] que siguen sin resolver. Deliberadamente llamativo:
 * este sitio no deberia publicarse mientras quede uno visible. */
.pendiente {
  background: var(--expense-text);
  color: #ffffff;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.82em;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Pie ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 60px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.site-footer a {
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  main {
    padding: 28px 20px 60px;
  }

  .site-nav {
    margin-left: 0;
    width: 100%;
  }
}
