/* Portada «Etiqueta de cuaderno» de cursos y tests sin foto (21-10-2026). Plantilla:
   components/_portada.html. Llena su caja (position:absolute) y escala con ella (unidades cq).
   Colores: SOLO en este bloque de tokens, con su versión de noche. */
.portada {
  --pt-hoja: #FFFDF8; --pt-pauta: #DCE4EC; --pt-pauta-f: #C9D6E2; --pt-margen: #E9A79C;
  --pt-tx-2: #46525C; --pt-sombra: rgba(30, 42, 50, .5);
  --pt-pri: #B23E0A; --pt-eso: #2546A6; --pt-bach: #0D5C6A; --pt-otro: #3D7A64;
  --pt-f-tit: "Zilla Slab", Rockwell, Georgia, serif;
  --pt-f-nino: "Andika", "Atkinson Hyperlegible Next", "Trebuchet MS", system-ui, sans-serif;
  --pt-f-tx: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
}
[data-theme="dark"] .portada {
  --pt-hoja: #1B2423; --pt-pauta: rgba(205, 230, 222, .08); --pt-pauta-f: rgba(205, 230, 222, .14);
  --pt-margen: rgba(255, 148, 136, .45); --pt-tx-2: #C6CEC9; --pt-sombra: rgba(0, 0, 0, .7);
  --pt-pri: #FFA470; --pt-eso: #A3B9FF; --pt-bach: #6FCFDB; --pt-otro: #8ED1B5;
}
.portada {
  position: absolute; inset: 0; overflow: hidden; container-type: size;
  background-color: var(--pt-hoja); font-family: var(--pt-f-tx); --pt-tinta: var(--pt-otro);
}
.portada--pri { --pt-tinta: var(--pt-pri); background-image: linear-gradient(var(--pt-pauta-f) 1px, transparent 1px), linear-gradient(90deg, var(--pt-pauta-f) 1px, transparent 1px); background-size: 26px 26px; }
.portada--eso { --pt-tinta: var(--pt-eso); background-image: linear-gradient(transparent 19px, var(--pt-pauta-f) 19px, var(--pt-pauta-f) 20px); background-size: 100% 20px; }
.portada--bach, .portada--otro { background-image: linear-gradient(var(--pt-pauta) 1px, transparent 1px), linear-gradient(90deg, var(--pt-pauta) 1px, transparent 1px), linear-gradient(var(--pt-pauta-f) 1px, transparent 1px), linear-gradient(90deg, var(--pt-pauta-f) 1px, transparent 1px); background-size: 8px 8px, 8px 8px, 40px 40px, 40px 40px; }
.portada--bach { --pt-tinta: var(--pt-bach); }
.portada__margen { position: absolute; top: 0; bottom: 0; left: 14%; width: 2px; background: var(--pt-margen); }
/* Tamaño del icono en variables: la etiqueta descuenta su sitio y deja 10 px de aire (nunca se montan).
   La letra crece con la caja (cqh = alto, cqw = ancho; manda la menor), con mínimo legible y techo
   (dueño, 26-10-2026: «se ve súper pequeño y tiene espacio de sobra»). */
.portada { --pt-ic-h: 56cqh; --pt-ic-w: 25cqw; --pt-etq-x: 20cqw; }
.portada:has(.bandera) { --pt-etq-x: calc(2.5cqw + clamp(26px, 14cqw, 48px) + 4px + 14px); }   /* + su borde blanco; 14 px porque al ondear se ensancha */
.portada__etq {
  position: absolute; box-sizing: border-box; left: var(--pt-etq-x); top: 50%; display: grid; gap: clamp(1px, 1.5cqh, 4px);
  max-width: calc(100cqw - var(--pt-etq-x) - 7cqw - min(var(--pt-ic-h), var(--pt-ic-w)) - 10px);
  max-height: calc(100cqh - 12px); overflow: hidden;
  transform: translateY(-50%) rotate(var(--pt-giro, 0deg));
  background: var(--pt-hoja); border: 2px solid var(--pt-tinta); border-radius: 8px;
  padding: clamp(5px, 6cqh, 14px) clamp(8px, 4cqw, 18px); box-shadow: 0 6px 14px -10px var(--pt-sombra);
  text-align: left; line-height: 1.15; overflow-wrap: break-word;
}
.portada__etq small { font-size: clamp(11px, min(11cqh, 4.2cqw), 17px); color: var(--pt-tx-2); }
.portada__etq strong { font: 700 clamp(14px, min(19cqh, 7.2cqw), 32px)/1.1 var(--pt-f-tit); color: var(--pt-tinta); }
.portada__etq b { font-size: clamp(10px, min(9.5cqh, 3.6cqw), 15px); font-weight: 700; color: var(--pt-tx-2); }
.portada--pri .portada__etq { --pt-giro: -3deg; border-radius: 14px; font-family: var(--pt-f-nino); }
.portada--pri .portada__etq strong { font-family: var(--pt-f-nino); }
.portada__ic { position: absolute; right: 7%; top: 50%; height: var(--pt-ic-h); aspect-ratio: 1; max-width: var(--pt-ic-w); transform: translateY(-50%) rotate(var(--pt-giro-ic, 0deg)); color: var(--pt-tinta); }
.portada__ic .cole-icon { width: 100%; height: 100%; display: block; }
.portada--pri { --pt-ic-h: 62cqh; --pt-ic-w: 28cqw; }
.portada--pri .portada__ic { --pt-giro-ic: 8deg; }
.portada--bach { --pt-ic-h: 48cqh; --pt-ic-w: 21cqw; }
.portada__hoja { position: absolute; right: 6%; bottom: 8%; display: grid; gap: 5px; opacity: .55; }
.portada__hoja i { display: block; position: relative; width: 56px; height: 10px; border-bottom: 1.5px solid var(--pt-tinta); }
.portada__hoja i::before { content: ""; position: absolute; left: -16px; top: 0; width: 9px; height: 9px; border: 1.5px solid var(--pt-tinta); border-radius: 2px; }
.portada--test .portada__ic { top: 30%; }
.portada--test { --pt-ic-h: 34cqh; }
@container (max-height: 90px) { .portada__hoja { display: none; } .portada--test .portada__ic { top: 50%; } .portada--test :is(.portada__ic, .portada__etq) { --pt-ic-h: 56cqh; } }
/* Cajas estrechas (buscador, biblioteca): el icono cede sitio para que la palabra larga quepa entera */
@container (max-width: 300px) {
  .portada :is(.portada__ic, .portada__etq) { --pt-ic-w: 18cqw; }
  .portada__etq { padding-inline: 7px; }
}
/* Caja muy pequeña de un idioma: la bandera ya hace de dibujo; el icono se va y su sitio es para el texto */
@container (max-width: 240px) and (max-height: 110px) {
  .portada:has(.bandera) .portada__ic { display: none; }
  .portada:has(.bandera) .portada__etq { --pt-ic-w: 0px; }
}
