/* Components v2 (round 1, system leg): the class vocabulary every page and leg uses. Tokens from style.css only.
   The macros that print this markup: templates/_kit.html, _mapa.html, _trayectoria.html. Guide: docs/design.md. */

/* Type: labels say what a thing is (Geist caps, never mono); the serif is for what you read */
.label { margin: 0 0 var(--s2); font: 600 var(--t-label)/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--gris); }
.label-ink { color: var(--tinta); }
.label-red { color: var(--rojo); }
.h-display { margin: 0 0 var(--s5); font: 700 var(--t-display)/1.04 var(--serif); letter-spacing: -.022em; color: var(--titulo); text-wrap: balance; }
.h-big { margin: 0; font: 700 var(--t-h2)/1.12 var(--serif); letter-spacing: -.012em; color: var(--titulo); text-wrap: balance; }
.h-card { margin: 0; font: 700 var(--t-h3)/1.2 var(--serif); letter-spacing: -.01em; color: var(--titulo); }
:is(h1, h2, h3, .h-display, .h-big, .h-card) :is(em, i) { font-style: normal; }  /* no italic display headlines */
.section-lead, .lead { font-size: var(--t-lead); line-height: 1.5; color: var(--gris); max-width: 40rem; }
.caption { font-size: var(--t-caption); line-height: 1.5; color: var(--gris-2); }
.caption b { color: var(--grafito); font-weight: 600; }

/* Codes: Geist Mono only for claves (MI), GPC codes and lesson ids */
.clave { font: 500 .82em/1 var(--mono); letter-spacing: .02em; color: var(--gris); }

/* Section and card heads: title left, lead or meta right from 60rem */
.sec-head { display: grid; gap: var(--s4); margin: 0 0 var(--s6); }
.sec-head .label { margin: 0 0 var(--s3); }
.sec-head h2, .sec-head .lead { margin: 0; }
.card-head { display: grid; gap: var(--s2); margin: 0 0 var(--s4); }
.card-head .label { margin: 0 0 var(--s1); }
.card-meta { margin: 0; color: var(--gris); font-size: var(--t-caption); line-height: 1.45; }

/* Chips: small, square, quiet; ink for state, red only for what comes back */
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 1.625rem; padding: .2rem .625rem; border-radius: var(--rad-sm); background: var(--celeste); color: var(--tinta); font: 600 .78125rem/1.3 var(--sans); text-decoration: none; }
.chip-ink { background: var(--celeste); color: var(--tinta); }
.chip-red, .chip-coral { background: var(--rojo-suave); color: var(--rojo); }
.chip-quiet, .chip-sand { background: transparent; color: var(--gris); box-shadow: inset 0 0 0 1px var(--regla-2); }
a.chip:hover { color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }

/* A number with its sample: b is the value, small holds "±m · n = N" */
.stat-n { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; margin: 0; }
.stat-n b { font: 600 1.625rem/1.1 var(--sans); letter-spacing: -.01em; color: var(--titulo); font-variant-numeric: tabular-nums; }
.stat-n small { font-size: .78125rem; color: var(--gris); font-variant-numeric: tabular-nums; }

/* Data tables: right-aligned numbers, columns that hide on phones, a low row, a totals hairline */
.data-table .r { text-align: right; }
.data-table .hp { position: static; width: auto; height: auto; overflow: visible; display: none; }
.data-table tr.is-low b, .data-table tr.is-low .stat-n b { color: var(--rojo); }
.data-table tfoot th, .data-table tfoot td { border-top: 1px solid var(--titulo); border-bottom: 0; font-weight: 600; }

/* The night band: one per page at most; in dark it keeps an edge, since the page is dark too */
.band-night { background: var(--noche); color: var(--on-noche); }
.band-night :is(h1, h2, h3, .h-display, .h-big, .h-card, .brand) { color: var(--on-noche); }
.band-night :is(.label, .lead, .caption, .note) { color: var(--on-noche-2); }
.band-night a:not(.btn) { color: var(--on-noche); }
.band-night .brand-mark rect { fill: var(--on-noche); }
.band-night .brand-word small { color: var(--on-noche-2); }
.band-night :is(.chip-quiet, .chip-sand), .panel-night :is(.chip-quiet, .chip-sand) { color: var(--on-noche-2); box-shadow: inset 0 0 0 1px var(--on-noche-2); }
[data-theme="dark"] .band-night { border-top: 1px solid var(--regla); border-bottom: 1px solid var(--regla); }
@media (prefers-color-scheme: dark) { [data-theme="system"] .band-night { border-top: 1px solid var(--regla); border-bottom: 1px solid var(--regla); } }

/* Empty states say what is missing and how to get it */
.empty { padding: var(--s5); border: 1px dashed var(--regla-2); border-radius: var(--rad); color: var(--gris); background: var(--papel); }
.empty p { margin: 0 0 var(--s3); }
.empty p:last-child { margin: 0; }

/* Keycaps for keyboard shortcuts: phones have no keyboard */
.key { display: none; }

/* A sheet: details.sheet > summary + .sheet-body; a bottom sheet on phones, inline from 48rem */
details.sheet > summary { list-style: none; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--tinta); }
details.sheet > summary::-webkit-details-marker { display: none; }
.sheet-body { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 75vh; overflow-y: auto; padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); background: var(--papel); border-top: 1px solid var(--regla); border-radius: var(--rad-lg) var(--rad-lg) 0 0; box-shadow: var(--shadow-2); }

.textlink { font-weight: 600; color: var(--tinta); text-decoration: none; border-bottom: 1px solid var(--regla-2); padding-bottom: 2px; }
.textlink:hover { color: var(--tinta); border-bottom-color: var(--tinta); }

/* Two-letter codes on phones, full names from 48rem (the map switches by its own width, below) */
.full-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.abbr { display: inline; }

/* The mapa curricular (_mapa.html): a real table of areas x skills; numbers and words, never colour alone */
.mapa-frame { container: mapa / inline-size; margin: var(--s5) 0 0; }
.mapa { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; background: transparent; font-size: .9375rem; }
.mapa caption { caption-side: bottom; padding-top: var(--s3); text-align: left; }
.mapa th, .mapa td { padding: 0; border: 0; }
.mapa .col-area { width: 2.75rem; }
.mapa .col-tot { width: 0; }
.mapa thead th { padding: 0 1px .35rem; vertical-align: bottom; text-align: center; font: 600 .6875rem/1.2 var(--sans); letter-spacing: .02em; text-transform: none; color: var(--gris); }
.mapa thead .tot { display: none; }
.mapa tbody th { padding: 0 .35rem 0 0; vertical-align: middle; text-align: left; }
.mapa .area { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mapa .area-meta { display: flex; align-items: center; gap: .4rem; font: 500 .75rem/1 var(--sans); color: var(--gris); }
.mapa .area-meta .w, .mapa .weight-bar { display: none; }
.mapa .clave { font-size: .8125rem; font-weight: 600; color: var(--tinta); }
.mapa td { height: 2.25rem; border-radius: var(--rad-sm); text-align: center; vertical-align: middle; font: 600 .75rem/1 var(--sans); font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.mapa .pc { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* the % sign: read aloud, shown once there is room */
.mapa td.tot { display: none; text-align: right; font-weight: 500; color: var(--grafito); }
.mapa .c0 { color: var(--gris-2); box-shadow: inset 0 0 0 1px var(--regla); font-weight: 400; }
.mapa .c1 { background: var(--rampa-1); color: var(--on-rampa-lo); }
.mapa .c2 { background: var(--rampa-2); color: var(--on-rampa-lo); }
.mapa .c3 { background: var(--rampa-3); color: var(--on-rampa-hi); }
.mapa .c4 { background: var(--rampa-4); color: var(--on-rampa-hi); }
.mapa .c5 { background: var(--rampa-5); color: var(--on-rampa-hi); }
.mapa .st-dom { background: var(--tinta); color: var(--on-tinta); }
.mapa .st-pro { background: var(--celeste); color: var(--titulo); box-shadow: inset 0 0 0 1px var(--rampa-1); }
.mapa .st-med { background: var(--papel); color: var(--gris); border: 1px dashed var(--regla-2); font-weight: 500; }
.mapa .st-nil { color: var(--gris-2); font-weight: 400; }
.mapa .hot { outline: 2px solid var(--rojo); outline-offset: 1px; }
.mapa .here { outline: 2px solid var(--tinta); outline-offset: 1px; }
.mapa .full-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mapa .abbr { display: inline; }
.mapa-key { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: var(--s3) 0 0; font-size: .8125rem; color: var(--gris); }
.mapa-key .mk { display: inline-flex; align-items: center; gap: .4rem; }
.mapa-key .sw { display: inline-block; width: 1.125rem; height: .75rem; border-radius: 2px; }
.mapa-key .c0, .mapa-key .st-nil { box-shadow: inset 0 0 0 1px var(--regla); }
.mapa-key .c1 { background: var(--rampa-1); } .mapa-key .c2 { background: var(--rampa-2); } .mapa-key .c3 { background: var(--rampa-3); }
.mapa-key .c4 { background: var(--rampa-4); } .mapa-key .c5 { background: var(--rampa-5); }
.mapa-key .st-dom { background: var(--tinta); } .mapa-key .st-pro { background: var(--celeste); box-shadow: inset 0 0 0 1px var(--rampa-1); }
.mapa-key .st-med { border: 1px dashed var(--regla-2); } .mapa-key .hot { box-shadow: inset 0 0 0 2px var(--rojo); } .mapa-key .here { box-shadow: inset 0 0 0 2px var(--tinta); }
.mapa-tally, .mapa-abbr, .mapa-areas { margin: var(--s2) 0 0; }
.mapa-abbr .clave, .mapa-areas .clave { color: var(--tinta); margin-right: .2rem; }  /* the codes the rows and heads show */
.weight-bar .wb-track { fill: var(--celeste); }
.weight-bar .wb-fill { fill: var(--tinta); }
@container mapa (min-width: 30rem) {
  .mapa .col-area { width: 9rem; }
  .mapa .area { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; font: 700 .96875rem/1.15 var(--serif); color: var(--titulo); }
  .mapa .area-meta { margin-top: .3rem; }
  .mapa .area-meta .w, .mapa .weight-bar { display: inline-block; }
  .mapa td { height: 2.75rem; font-size: .875rem; }
  .mapa .pc { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: .8em; font-weight: 500; }
  .mapa-areas { display: none; }  /* the rows name their areas now */
}
@container mapa (min-width: 52rem) {
  .mapa { border-spacing: 4px; }
  .mapa .col-area { width: 12rem; }
  .mapa thead th { font-size: .75rem; font-weight: 500; }
  .mapa .full-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .mapa .abbr, .mapa-abbr { display: none; }
  .mapa td { height: 3.125rem; font-size: .9375rem; }
}
@container mapa (min-width: 60rem) {
  .mapa .col-tot { width: 6.5rem; }
  .mapa thead .tot, .mapa td.tot { display: table-cell; }
}

/* The trayectoria (_trayectoria.html): bars on a 0-1000 axis from 48rem; the same stages as a list. The key explains
   the drawing, so it shows only where the drawing does; its swatches are rects with the marks' own classes. */
svg.tray, .tray-key { display: none; }
svg.tray { width: 100%; height: 4.5rem; }
.tray-stage { fill: var(--celeste); }
.tray-stage.tray-done { fill: var(--tinta); }
.tray-stage.tray-now { fill: var(--rampa-3); }
.tray-stage.tray-next { fill: var(--rampa-1); }
.tray-mock { fill: var(--rampa-2); }
.tray-mock.tray-mock_done { fill: var(--tinta); }
.tray-mock.tray-mock_plan { fill: var(--rampa-1); }
.tray-today { fill: var(--rojo); }
.tray-exam { fill: var(--titulo); }
ol.etapas { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; }
.etapas li { position: relative; padding: 0 0 var(--s5) 1.75rem; }
.etapas li::before { content: ""; position: absolute; left: .3rem; top: .3rem; width: .5625rem; height: .5625rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rampa-2); background: var(--papel); }
.etapas li::after { content: ""; position: absolute; left: .55rem; top: 1.1rem; bottom: .2rem; width: 1px; background: var(--regla); }
.etapas li:last-child::after { display: none; }
.etapas .tray-done::before { background: var(--tinta); box-shadow: none; }
.etapas .tray-now::before { background: var(--rojo); box-shadow: none; }
.etapas .e-when { display: block; font: 600 .6875rem/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--tinta); }
.etapas .e-title { display: block; margin-top: .2rem; font: 700 1.0625rem/1.25 var(--serif); color: var(--titulo); }
.etapas .e-rule { display: block; margin-top: .2rem; font-size: .875rem; line-height: 1.45; color: var(--gris); }
.tray-key, .tray-count { margin: var(--s3) 0 0; }
ul.tray-key { flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; padding: 0; list-style: none; font-size: .8125rem; color: var(--gris); }
.tray-key li { display: inline-flex; align-items: center; gap: .45rem; }
svg.tray-sw { display: block; flex: none; width: .25rem; height: .875rem; }

@media (min-width: 48rem) {
  .data-table .hp { display: table-cell; }
  .key { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border: 1px solid var(--regla-2); border-bottom-width: 2px; border-radius: var(--rad-sm); background: var(--papel); color: var(--gris); font: 500 .75rem/1 var(--mono); }
  .sheet-body { position: static; max-height: none; overflow: visible; padding: var(--s4) 0 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  .full-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .abbr { display: none; }
  svg.tray, p.tray-key { display: block; }
  ul.tray-key { display: flex; }
  ol.etapas { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s5); }
  .etapas li { padding: var(--s4) 0 0; border-top: 1px solid var(--regla); }
  .etapas li::before, .etapas li::after { display: none; }
  .etapas .tray-now { border-top: 2px solid var(--rojo); }
  .etapas .tray-done { border-top-color: var(--tinta); }
}
@media (min-width: 60rem) {
  .sec-head { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: end; column-gap: var(--s8); }
  .card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); }
  .card-meta { max-width: 26em; text-align: right; }
}
@media (max-width: 30rem) {
  .card-meta, .mapa-key { font-size: 1rem; }
}
