/* Hallmark · extends app.css (same DESIGN.md tokens) · notes pages: a sticky topic index beside long-form reading, tables and code, one warning callout style
 * critique: reading comfort first (68ch measure, 1.65 line height); colour only on the topic number, the index marker and the callout edge */

.ap { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: var(--s-8); align-items: start; }
.ap-index { position: sticky; top: var(--s-6); display: grid; gap: var(--s-1); }
.ap-index a { display: block; padding: var(--s-2) var(--s-3); border-radius: var(--r-cover); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--t-sm); transition: background-color var(--dur-micro) var(--ease-out); }
.ap-index a:hover { background: var(--surface-2); color: var(--text); }
.ap-index a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ap-index a[aria-current="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
.ap-index small { display: block; font-weight: 500; color: var(--text-3); }
.ap-body { display: grid; gap: var(--s-6); min-width: 0; }
.ap-tema { display: grid; gap: var(--s-3); padding: var(--s-6); border-radius: var(--r-card); background: var(--surface); color: var(--text); scroll-margin-top: var(--s-6); min-width: 0; }
.ap-tema h2 { font-size: var(--t-2xl); }
.ap-tema h3 { font-size: var(--t-lg); margin-top: var(--s-4); }
.ap-tema p, .ap-tema li { max-width: 68ch; line-height: 1.65; color: var(--text-2); }
.ap-tema b { color: var(--text); }
.ap-tema ul, .ap-tema ol { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-1); }
.ap-tema p { margin: 0; }
.ap-tema code { font: 500 0.875em/1.4 var(--font-code); color: var(--code-ink); background: var(--code-bg); padding: 0 4px; border-radius: 4px; }
.ap-tema pre.code { padding-inline: var(--s-4); white-space: pre; }
.ap-tema pre.code code, .ap-tema td code { background: transparent; padding: 0; }
.ap-num { font-size: var(--t-sm); font-weight: 700; color: var(--c-java); }
.ap-num--bbdd { color: var(--c-bbdd); }
.ap-ojo { padding: var(--s-3) var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--warn); color: var(--text-2); max-width: 72ch; line-height: 1.6; }
.ap-tabla-wrap { overflow-x: auto; }
.ap-tabla { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.ap-tabla th, .ap-tabla td { padding: var(--s-2) var(--s-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ap-tabla thead th { color: var(--text-3); font-weight: 600; font-size: var(--t-xs); }
.ap-tabla td { color: var(--text-2); }
.ap-hecho { justify-self: start; }
.ap-chuleta { box-shadow: inset 0 0 0 2px var(--brand); }

@media (max-width: 60rem) {
  .ap { grid-template-columns: minmax(0, 1fr); }
  .ap-index { position: static; display: flex; overflow-x: auto; gap: var(--s-2); padding-bottom: var(--s-1); }
  .ap-index a { white-space: nowrap; background: var(--surface); }
  .ap-index small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ap-index a { transition: none; } html { scroll-behavior: auto; } }

/* Lecciones "Aprende fácil": lista a la izquierda, la lección a la derecha */
.l-wrap { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.l-side { position: sticky; top: var(--s-4); display: grid; gap: var(--s-2); max-height: calc(100vh - 2 * var(--s-4)); overflow-y: auto; }
.l-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.l-tema { margin-top: var(--s-3); font-size: var(--t-sm); font-weight: 700; color: var(--c-java); }
.l-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-cover); background: transparent; color: var(--text-2); font: 500 var(--t-sm)/1.3 var(--font-body); text-align: left; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.l-item:hover { background: var(--surface); color: var(--text); }
.l-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.l-item[aria-current="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
.l-item__n { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-tag); background: var(--surface-3); color: var(--text-2); font: 700 var(--t-xs)/1 var(--font-code); }
.l-item__n.is-done { background: var(--ok); color: var(--bg); }
.l-body { display: grid; gap: var(--s-4); min-width: 0; padding: var(--s-6); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.l-kick { margin: 0; font-size: var(--t-sm); font-weight: 700; color: var(--c-java); }
.l-h { font-size: var(--t-2xl); line-height: 1.15; }
.l-p { margin: 0; max-width: 68ch; line-height: 1.65; color: var(--text); }
.l-p code, .l-q__t code { font-family: var(--font-code); background: var(--code-bg); color: var(--code-ink); padding: 0 4px; border-radius: var(--r-tag); font-size: 0.9em; }
.l-code { display: grid; gap: var(--s-2); min-width: 0; }
.l-pre { margin: 0; overflow-x: auto; }
.l-datos { margin: 0; }
.l-datos code { font-family: var(--font-code); }
.l-run { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.l-out { margin: 0; min-height: 0; white-space: pre-wrap; }
.l-quiz { display: grid; gap: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.l-quiz h3 { font-size: var(--t-lg); }
.l-q { display: grid; gap: var(--s-2); }
.l-q__t { margin: 0; font-weight: 600; }
.l-q__e { margin: 0; max-width: 68ch; }
.l-opts { display: grid; gap: var(--s-2); max-width: 40rem; }
.l-opt { background: var(--surface-2); color: var(--text); text-align: left; font: 500 var(--t-md)/1.4 var(--font-body); }
.l-fin { margin: 0; font-weight: 700; color: var(--ok); }
.l-nav { display: flex; justify-content: space-between; gap: var(--s-3); }
@media (max-width: 56rem) {
  .l-wrap { grid-template-columns: minmax(0, 1fr); }
  .l-side { position: static; max-height: 16rem; }
  .l-body { padding: var(--s-4); }
}
@media (prefers-reduced-motion: reduce) { .l-item { transition: none; } }

/* v14 · Plano de taller: tarjetas de papel con borde de tinta */
.ap-num, .l-tema, .l-kick { color: var(--c-java-text); }
.ap-num--bbdd { color: var(--c-bbdd-text); }
.ap-tema, .l-body { border: 1.5px solid var(--edge); box-shadow: var(--hard); }
.ap-ojo { border: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--warn); }
.ap-index a, .l-item { border: 1px solid transparent; transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.ap-index a:hover, .l-item:hover { transform: translateX(3px); }
.ap-index a[aria-current="true"], .l-item[aria-current="true"] { background: var(--note); border-color: var(--edge); box-shadow: var(--hard-sm); transform: none; }
.l-item__n { border: 1.5px solid var(--edge); background: var(--surface); }
.l-opt { border: 1.5px solid var(--edge); background: var(--surface); box-shadow: var(--hard-sm); transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.l-opt:hover:not(:disabled) { background: var(--surface-2); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hard-c); }
.l-opt:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .ap-index a:hover, .l-item:hover, .l-opt:hover:not(:disabled) { transform: none; } }
.l-opt.is-right { background: color-mix(in oklab, var(--ok) 18%, var(--surface)); }
.l-opt.is-wrong { background: color-mix(in oklab, var(--bad) 14%, var(--surface)); }
