/* Tips, taller, redes y sellos de datos en wireframe y puntillismo. */

.tips, .taller { position: relative; z-index: 2; padding: var(--sala-pad) var(--margen) clamp(40px, 8vh, 96px); }

/* Sellos: figura de puntos que dibuja un dato de la sección ---------------------- */
.seccion-cab { position: relative; }
.sello {
  position: absolute; right: 0; top: -10px; width: clamp(150px, 17vw, 230px);
  color: var(--tinta); pointer-events: none;
}
.sello svg { width: 100%; height: auto; overflow: visible; fill: currentColor; }
.sello .w { fill: none; stroke: currentColor; stroke-width: 1; opacity: .5; vector-effect: non-scaling-stroke; }
.sello .punteada { stroke-dasharray: 2 5; }
.sello .fina { opacity: .18; }
.sello .gira { transform-origin: 100px 100px; animation: sello-gira 24s linear infinite; }
.sello .gira.lento { animation-duration: 40s; }
.sello-leyenda { display: block; margin-top: 6px; text-align: right; color: var(--gris-texto); font-size: .6875rem; }
@keyframes sello-gira { to { transform: rotate(360deg); } }
.seccion-cab .titulo, .seccion-cab .sala-intro { max-width: calc(100% - clamp(160px, 19vw, 250px)); }
.sello-contacto { position: absolute; top: clamp(40px, 8vh, 96px); right: var(--margen); }
#contacto { position: relative; }
@media (max-width: 760px) {
  .sello { position: relative; top: 0; width: 150px; margin: 0 0 12px auto; }
  .seccion-cab .titulo, .seccion-cab .sala-intro { max-width: none; }
  .sello-contacto { position: relative; top: 0; right: 0; }
}
html[data-movimiento="reducido"] .sello .gira { animation: none; }
@media (prefers-reduced-motion: reduce) { .sello .gira { animation: none; } }

/* Tips --------------------------------------------------------------------------- */
.tip-filtros { margin-bottom: 18px; }
.tips-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.tip {
  display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radio);
  background: var(--superficie); border: 1px solid var(--borde-suave);
}
.tip.con-imagen { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 28px; align-items: start; }
.tip.con-imagen .tip-imagen { grid-row: 1 / span 6; grid-column: 1; }
.tip.con-imagen > :not(.tip-imagen) { grid-column: 2; }
.tip-cat { margin: 0; color: var(--gris-texto); }
.tip-titulo { margin: 0; font-family: var(--f-display); font-weight: 800; letter-spacing: -0.03em; font-size: clamp(1.25rem, 1.8vw, 1.625rem); line-height: 1.05; }
.tip-texto { margin: 0; line-height: 1.55; }
.tip-imagen { margin: 0; border-radius: 14px; overflow: hidden; background: #f4f1ea; }
.tip-imagen img { width: 100%; height: auto; display: block; }
.tip-prompt { position: relative; border-radius: 12px; background: #0e0e0d; border: 1px solid var(--borde-suave); }
.tip-prompt pre { margin: 0; padding: 14px 14px 52px; white-space: pre-wrap; font: 400 .875rem/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; color: #d8d6cf; }
.tip-copiar {
  position: absolute; right: 10px; bottom: 10px; appearance: none; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 0; background: var(--tinta); color: var(--papel); font: 500 .8125rem/1 var(--f-titular);
}
.tip-copiar:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }
@media (max-width: 860px) {
  .tip.con-imagen { display: flex; }
}

/* Taller ------------------------------------------------------------------------- */
.taller-cuerpo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 3.5vw, 56px); align-items: start; }
.taller-texto { position: sticky; top: calc(var(--cab-alto) + 24px); }
.taller-texto p { margin: 0 0 14px; line-height: 1.6; max-width: 54ch; }
.taller-pregunta { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.5rem, 2.4vw, 2.125rem) !important; line-height: 1.15 !important; }
.taller-final { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.taller-pie { color: var(--gris-texto); }
.taller-pie a { color: var(--tinta); }
.taller-diapositivas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.taller-diapositivas figure { margin: 0; }
.taller-diapositivas img { width: 100%; height: auto; display: block; border-radius: 14px; background: #f4f1ea; aspect-ratio: 820 / 1025; object-fit: cover; }
.taller-diapositivas figcaption { margin-top: 6px; color: var(--gris-texto); }
.taller-diapositivas li:nth-child(even) { transform: translateY(36px); }
@media (max-width: 860px) {
  .taller-cuerpo { grid-template-columns: 1fr; }
  .taller-texto { position: static; }
  .taller-diapositivas li:nth-child(even) { transform: none; }
}

/* Redes en el contacto --------------------------------------------------------------- */
.redes-destacadas { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 28px; }
.red-boton {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 14px 20px; border-radius: 999px; text-decoration: none;
  background: var(--tinta); color: var(--papel); font-weight: 500;
}
.red-boton:hover { background: #fff; }
.red-nombre { font-family: var(--f-display); font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; }
.red-usuario { opacity: .7; }
.red-boton:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }
.ensenanza .seccion-cab, .laboratorio .seccion-cab, .tips .seccion-cab, .taller .seccion-cab { max-width: none; }
.seccion-cab .titulo, .seccion-cab .sala-intro { max-width: min(980px, calc(100% - clamp(160px, 19vw, 250px))); }

/* Sellos de arena ----------------------------------------------------------------- */
.sello-arena { display: block; width: 100%; aspect-ratio: 1; }
.libro-destacado { position: relative; }
.sello-libro { top: calc(var(--sala-pad) * .35); right: var(--margen); width: clamp(120px, 12vw, 170px); z-index: 3; }
#voz .sala-cab { position: relative; }
.sello-voz { top: 0; right: 0; }
@media (max-width: 760px) { .sello-libro { position: relative; top: 0; right: 0; margin: 0 0 12px auto; } }

/* Tip completo ------------------------------------------------------------------------ */
.tip { cursor: pointer; transition: border-color .25s, transform .25s var(--ease); }
.tip:hover { border-color: rgba(242, 240, 234, .3); transform: translateY(-2px); }
.tip-enlace { color: inherit; text-decoration: none; }
.tip-enlace:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.tip-dialogo {
  width: min(860px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: clamp(18px, 3vw, 36px);
  border: 1px solid var(--borde-suave); border-radius: var(--radio); background: #121211; color: var(--tinta);
}
.tip-dialogo::backdrop { background: rgba(5, 5, 6, .8); }
.tip-dialogo-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.tip-dialogo-barra .meta { margin: 0; color: var(--gris-texto); }
.tip-cerrar { color: var(--tinta); text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--borde-suave); }
.tip-dialogo-titulo { margin: 0 0 16px; font-family: var(--f-display); font-weight: 800; letter-spacing: -0.035em; font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1; }
.tip-dialogo-img { width: 100%; height: auto; border-radius: 14px; margin-bottom: 16px; background: #f4f1ea; }
.tip-dialogo-texto { font-size: 1.125rem; line-height: 1.6; margin: 0 0 18px; }
.tip-dialogo-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--borde-suave); }
.tip-nav { color: var(--gris-texto); text-decoration: none; max-width: 36ch; }
.tip-nav:hover { color: var(--tinta); }
.tip-compartir { appearance: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--borde-suave); background: transparent; color: var(--tinta); font: 500 .875rem/1 var(--f-titular); }
.red-boton.correo { background: transparent; color: var(--tinta); border: 1.5px solid var(--tinta); }
.red-boton.correo:hover { background: var(--tinta); color: var(--papel); }

/* Diagramas propios en wireframe y puntillismo de datos (js/diagramas.js) -------------- */
.tip-diagrama { background: #0e0e0d; border: 1px solid var(--borde-suave); padding: clamp(8px, 1.4vw, 16px); }
.dg { margin: 0; color: var(--tinta); }
.dg svg { display: block; width: 100%; height: auto; font-family: var(--f-titular); overflow: visible; }
.dg .alambre { fill: none; stroke: currentColor; stroke-width: 1; opacity: .2; vector-effect: non-scaling-stroke; }
.dg .puntos { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0 7; opacity: .9; }
.dg .rapido .puntos { stroke-width: 3; }
.dg .punta { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dg .marco { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 0 9; opacity: .38; }
.dg .marco.fuerte { opacity: .85; }
.dg .grano-dato { fill: currentColor; }
.dg text { fill: currentColor; }
.dg .t-titulo { font-family: var(--f-display); font-weight: 800; font-size: 40px; letter-spacing: -.02em; }
.dg .t-sub { font-size: 19px; fill: var(--gris-texto); }
.dg .t-paso { font-weight: 600; font-size: 21px; }
.dg .t-nota { font-size: 16.5px; fill: var(--gris-texto); }
.dg .t-vuelta { font-weight: 600; font-size: 19px; font-style: italic; }
.dg .t-puente { font-weight: 600; font-size: 18px; }
.dg .v .t-titulo { font-size: 30px; } .dg .v .t-sub { font-size: 14px; } .dg .v .t-paso { font-size: 16px; }
.dg .v .t-nota { font-size: 13px; } .dg .v .t-vuelta { font-size: 14px; } .dg .v .t-puente { font-size: 15px; }
.dg .gira { transform-box: fill-box; transform-origin: center; }
/* El ritmo de datos: los puntos corren por cada línea solo mientras el diagrama se ve. */
.dg.en-vista .puntos { animation: dg-flujo 1.4s linear infinite; }
.dg.en-vista .rapido .puntos { animation-duration: .7s; }
.dg.en-vista .gira { animation: dg-gira 7s linear infinite; }
@keyframes dg-flujo { to { stroke-dashoffset: -14; } }
@keyframes dg-gira { to { transform: rotate(360deg); } }
html[data-movimiento="reducido"] .dg .puntos, html[data-movimiento="reducido"] .dg .gira { animation: none; }
html[data-movimiento="reducido"] .dg .grano-dato { display: none; }
@media (prefers-reduced-motion: reduce) { .dg .puntos, .dg .gira { animation: none; } .dg .grano-dato { display: none; } }
.dg .ic .puntos { stroke-dasharray: 0 4.6667; stroke-width: 2; }

/* Quién escribe los tips ---------------------------------------------------------------- */
.tip-autor { display: grid; gap: 10px; max-width: 760px; margin: 0 0 28px; padding: 20px 22px; border-radius: 18px; border: 1px solid var(--borde-suave); background: rgba(20, 20, 19, .72); }
.tip-autor .meta { margin: 0; color: var(--gris-texto); }
.tip-autor-texto { margin: 0; font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.55; }
.tip-autor-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }

/* Insumos para descargar ---------------------------------------------------------------- */
.tip-insumos { grid-column: 2; margin-top: 4px; }
.tip.con-imagen .tip-insumos { grid-column: 2; }
.tip:not(.con-imagen) .tip-insumos { grid-column: auto; }
.tip-insumos .meta { margin: 0 0 8px; color: var(--gris-texto); }
.tip-insumos ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tip-descarga { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(242, 240, 234, .22); color: var(--tinta); text-decoration: none; }
.tip-descarga:hover { border-color: var(--tinta); background: rgba(242, 240, 234, .04); }
.tip-descarga:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
.tip-descarga-icono { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px dashed currentColor; font-weight: 700; }
.tip-descarga-nombre { font-weight: 500; overflow-wrap: anywhere; }
.tip-descarga-meta { color: var(--gris-texto); white-space: nowrap; }
.tip-dialogo .tip-insumos { margin: 18px 0; }
