/* Article pages (/articulos). Same tokens as the legal pages. */
h1, h2, h3, h4 { letter-spacing: -0.02em; }
:root {
  color-scheme: light;
  --primary: #0f7a3d;
  --primary-hover: #0b6532;
  --primary-soft: #e3f1e7;
  --ink: #0c110b;
  --muted: #5a6457;
  --line: rgb(18 21 16 / 0.12);
  --surface: #ffffff;
  --canvas: #f7f7f7;
  --page: 82rem;
  --measure: 44rem;
  --radius: 1.25rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 6rem; overflow-x: clip; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.shell { width: min(calc(100% - 2rem), var(--page)); margin-inline: auto; }
.shell-narrow { width: min(calc(100% - 2rem), var(--measure)); margin-inline: auto; }

/* Header */
.prose a.cta, .calc button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.25rem;
  border: 0; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-size: 0.95rem; font-weight: 640;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.prose a.cta:hover, .calc button:hover { background: var(--primary-hover); }
.prose a.cta:active, .calc button:active { transform: scale(0.97); }

/* Article */
.article { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem); }
.article-head { margin-bottom: 2rem; }
.article-head h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 520; line-height: 1.06; text-wrap: balance; }
.article-head .updated { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.9rem; }
.article-head .lead { margin: 1rem 0 0; color: var(--muted); font-size: 1.15rem; }

.prose > * { margin-block: 0 1.1rem; }
.prose h2 { margin: 2.75rem 0 0.8rem; font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 560; line-height: 1.2; text-wrap: balance; }
.prose h3 { margin: 1.9rem 0 0.5rem; font-size: 1.15rem; font-weight: 620; line-height: 1.3; }
.prose p { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a:not(.cta) { color: var(--primary-hover); text-underline-offset: 0.18em; }
.prose strong { font-weight: 650; }
.prose code { font-size: 0.9em; }
.prose blockquote { margin-inline: 0; padding: 1rem 1.15rem; border-radius: 0.9rem; background: var(--surface); border: 1px solid var(--line); }
.prose blockquote p:last-child { margin-bottom: 0; }
/* Quotes are text to reuse (prompts, message templates). The text and its
   copy button share one frame; a click on the text selects all of it, so
   copying by hand also takes the whole prompt. */
.prose .copy-block { display: flex; flex-direction: column; margin-block: 1.25rem; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--surface); transition: border-color 160ms ease; }
.prose .copy-block:hover, .prose .copy-block:focus-within { border-color: rgb(15 122 61 / 0.45); }
.prose .copy-block blockquote { margin: 0; padding: 1rem 1.15rem 0.5rem; border: 0; border-radius: 0; background: none; cursor: text; -webkit-user-select: all; user-select: all; }
.prose .copy-block:has(.copy-button[hidden]) blockquote { padding-bottom: 1rem; }
.prose .copy-block blockquote > :first-child { margin-top: 0; }
.prose .copy-block blockquote::selection, .prose .copy-block blockquote *::selection { background: var(--primary-soft); }
.copy-button { align-self: flex-end; display: inline-flex; align-items: center; margin: 0 0.75rem 0.75rem; padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--primary-hover); font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background-color 160ms ease, transform 120ms ease; }
.copy-button[hidden] { display: none; }
.copy-button > span { display: inline-flex; align-items: center; gap: 0.4rem; }
.copy-button svg { flex: none; }
.copy-button .copy-done, .copy-button[data-state="done"] .copy-idle { display: none; }
.copy-button[data-state="done"] .copy-done { display: inline-flex; }
.copy-button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .copy-button:hover { background: var(--primary-soft); } }
@media (prefers-reduced-motion: reduce) { .prose .copy-block, .copy-button { transition: none; } .copy-button:active { transform: none; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.prose .table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 0.9rem; }
.prose .table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { padding: 0.6rem 0.85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 620; background: var(--primary-soft); }
.prose tr:last-child td { border-bottom: 0; }
.prose p:has(> a.cta:only-child) { margin-top: 1.25rem; }

/* Chatrabajo promo, right after the opening answer */
.prose .promo { margin: 1.5rem 0 2rem; padding: 1.25rem 1.35rem; border-radius: var(--radius); background: var(--primary-soft); border: 1px solid rgb(15 122 61 / 0.18); }
.promo p { margin: 0 0 0.9rem; font-size: 1.02rem; line-height: 1.5; }

/* Calculators */
.calc { margin: 2rem 0 2.5rem; padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(12 17 11 / 0.04); }
.calc h2 { margin: 0 0 1rem; font-size: 1.3rem; }
.calc-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.95rem; font-weight: 600; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0.6rem 0.85rem; border: 1px solid rgb(18 21 16 / 0.22); border-radius: 0.75rem;
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem;
}
.field input[aria-invalid="true"] { border-color: #b3261e; }
.field-error { margin: 0; color: #b3261e; font-size: 0.9rem; }
.calc button { justify-self: start; }
.calc-result { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.calc-result table { width: 100%; border-collapse: collapse; font-size: 0.98rem; font-variant-numeric: tabular-nums; }
.calc-result td { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.prose .calc-result td { padding: 0.45rem 0; }
.calc-result td:last-child { padding-left: 1rem; text-align: right; white-space: nowrap; }
.calc-result tr.total td { border-bottom: 0; padding-top: 0.75rem; font-size: 1.15rem; font-weight: 680; }
.calc-result .calc-steps { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.92rem; }
.calc-result .calc-warning { margin: 0.9rem 0 0; padding: 0.75rem 0.9rem; border-radius: 0.75rem; background: #fff6e0; font-size: 0.93rem; }
.calc-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.88rem; }

/* Index */
.article-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.article-list a { display: grid; gap: 0.3rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color 160ms var(--ease-out); }
.article-list a:hover { border-color: var(--primary); }
.article-list strong { font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.article-list span { color: var(--muted); font-size: 0.95rem; }


@media (prefers-reduced-motion: reduce) {
  .prose a.cta, .calc button, .article-list a { transition: none; }
}
