

.lesson-card { border-color: var(--mod-secuencia); }
.lesson-card h2 { margin: 0; }
.lesson-visual { display: flex; flex-direction: column; align-items: center; width: 100%; }
.lesson-rule { margin: 0; font-weight: 700; }
.btn-reference { align-self: center; }
.real-card { align-items: center; border-color: var(--mod-razonamiento-suave); }
.real-visual { display: flex; min-height: 170px; align-items: center; justify-content: center; width: 100%; }
.real-caption { max-width: 560px; margin: 0; padding-inline-start: 1.6rem; text-align: left; }
.real-caption li { padding-inline-start: 0.2rem; line-height: 1.45; }
.real-caption li + li { margin-top: 0.35rem; }
.real-caption li::marker { color: var(--mod-secuencia, var(--color-texto)); font-weight: 700; }
.real-life-svg { width: min(100%, 360px); height: auto; overflow: visible; }
.real-ladder-svg { width: min(100%, 230px); }
.real-wall,
.real-ground { stroke: var(--color-texto); stroke-width: 5; stroke-linecap: round; }
.real-ladder-rail { stroke: var(--mod-secuencia, var(--color-texto)); stroke-width: 7; stroke-linecap: round; }
.real-ladder-rung { fill: none; stroke: var(--color-texto); stroke-width: 4; stroke-linecap: round; }
.real-house { fill: var(--color-superficie); stroke: var(--color-texto); stroke-width: 4; stroke-linejoin: round; }
.real-roof { fill: var(--mod-secuencia-suave, var(--color-superficie)); stroke: var(--mod-secuencia, var(--color-texto)); stroke-width: 5; stroke-linejoin: round; }
.real-window { fill: var(--mod-razonamiento-suave, var(--color-superficie)); stroke: var(--color-texto); stroke-width: 3; }
.real-detail { stroke: var(--color-texto); stroke-width: 2; }
.real-door { fill: var(--mod-razonamiento-suave, var(--color-superficie)); stroke: var(--color-texto); stroke-width: 3; }
.real-knob { fill: var(--color-texto); }
.real-ramp { fill: var(--mod-secuencia-suave, var(--color-superficie)); stroke: none; }
.real-slope { fill: none; stroke: var(--mod-secuencia, var(--color-texto)); stroke-width: 6; stroke-linecap: round; }
.real-car-body { fill: var(--mod-razonamiento); stroke: var(--color-texto); stroke-width: 2; stroke-linejoin: round; }
.real-car-window { fill: var(--color-superficie); stroke: var(--color-texto); stroke-width: 1.5; stroke-linejoin: round; }
.real-car-wheel { fill: var(--color-texto); }
.real-wheel-hub { fill: var(--color-superficie); }
.real-label { fill: var(--color-texto); font-size: 12px; font-weight: 700; text-anchor: middle; }
.real-guide { fill: none; stroke: var(--color-borde); stroke-width: 3; stroke-dasharray: 6 5; }
.real-angle-mark { fill: none; stroke: var(--mod-razonamiento, var(--color-texto)); stroke-width: 4; stroke-linecap: round; }


/* ---- The stage ----
   Both drawings (the triangle and the ladder) sit on the same centred
   stage, so a question that changes activity keeps its place on the
   page and the person does not have to find the picture again. */
.tri-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 130px;
}
/* Two triangles side by side for the "same ratio?" question. They must
   read as two separate drawings, not as one broken one, so the gap is
   generous and each keeps its own box. */
.pair-stage { gap: 1.5rem; }
.reason-compare-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  gap: 0.5rem;
  width: 100%;
}
.reason-example { display: flex; min-width: 0; flex-direction: column; align-items: center; text-align: center; }
.reason-reference { grid-column: 1 / -1; }
.reason-example-label { margin-bottom: 0.35rem; font-weight: 700; }

.tri-svg { overflow: visible; }

/* ---- The right triangle ----
   The grid under the triangle is what makes a leg countable, so it is
   faint and never competes with the sides. */
.tri-cell {
  fill: var(--color-superficie);
  stroke: var(--color-borde);
  stroke-width: 1.5;
}
/* The corner guide: the sheet of paper held against the angle. Dashed,
   so it reads as a guide and not as a fourth side. */
.tri-corner {
  fill: none;
  stroke: var(--color-borde);
  stroke-width: 3;
  stroke-linecap: round;
}
/* The marked angle: thicker than the guide and solid, so it is the only
   arc on screen. */
.tri-angle {
  fill: none;
  stroke: var(--color-texto);
  stroke-width: 4;
  stroke-linecap: round;
}
/* All three sides are drawn the same by default. The one a question is
   about is heavier AND in a second colour, so the three answer options
   are still three different pictures with no colour at all (WCAG 1.4.1). */
.tri-side {
  stroke: var(--color-texto);
  stroke-width: 3;
  stroke-linecap: round;
}
.tri-side.is-marked {
  stroke: var(--mod-secuencia, var(--color-texto));
  stroke-width: 8;
}
.tri-vertex { fill: var(--color-texto); }

/* ---- A ladder against a wall ----
   The wall and the floor are the two sides that never lean, so they are
   the heaviest strokes in the drawing. The wall is deliberately thinner
   than a ladder: the most upright ladder of the last level stands flat
   against it, and if the two were the same weight that ladder would be
   invisible — the very answer the question is asking about. */
.lad-svg { overflow: visible; }
.lad-wall,
.lad-floor {
  stroke: var(--color-texto);
  stroke-width: 5;
  stroke-linecap: round;
}
/* The ladder itself: slanted, and in the accent colour so it is the
   side the eye goes to. */
.lad-ladder {
  stroke: var(--mod-secuencia, var(--color-texto));
  stroke-width: 8;
  stroke-linecap: round;
}
.lad-ladder.is-marked {
  stroke: var(--mod-razonamiento, var(--color-texto));
  stroke-width: 11;
}
.lad-tip { fill: var(--color-texto); }
/* The height line the tops reach, dashed so it reads as a guide and not
   as another side of the triangle. */
.lad-guide {
  stroke: var(--color-borde);
  stroke-width: 3;
  stroke-dasharray: 7 5;
}
.lad-label {
  fill: var(--color-texto);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

/* ---- Options ----
   The name of a side and the reason a triangle rises are shown the same
   way: the real name on top, its plain-words gloss underneath. */
.reason-name,
.kind-name {
  display: block;
  font-weight: 700;
}
.reason-gloss,
.kind-gloss {
  display: block;
  font-size: 0.9em;
}
/* A picture option has to keep its own shape: without this the SVG would
   be squeezed by the button's padding. */
.options.options-row .option-btn .tri-svg { display: block; margin: 0 auto; }

/* ---- Small screens ----
   At 320px the two triangles of the "same ratio?" question no longer fit
   side by side, so they stack instead of being scaled down to nothing. */
@media (max-width: 420px) {
  .pair-stage { flex-direction: column; gap: 0.5rem; }
  .options.options-row .option-btn { min-width: 0; width: 100%; }
}
