/* ---------- Taller 3D (entrada «/») ----------
   La escena (Three.js, js/workshop/) ocupa todo el espacio bajo la cabecera. Encima solo hay HTML cuando hace
   falta: la tarjeta del objeto señalado, la pantalla de carga y la versión sencilla. Comparte tokens, cabecera,
   botones y paneles con css/styles.css. */


.workshop {
  position: relative; overflow: hidden;
  height: calc(100svh - 64px); min-height: 440px;
  background: #c9c6c0;
}
.ws-stage, .ws-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ws-canvas { touch-action: none; opacity: 0; transition: opacity .5s ease-out; outline: none; }
.workshop.is-ready .ws-canvas { opacity: 1; }

/* Salida hacia una práctica: fundido al fondo de la mesa técnica. */
.workshop::after { content: ""; position: absolute; inset: 0; z-index: 8; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .45s ease-in; }
.workshop.is-leaving::after { opacity: 1; }

/* Puntos de interés para teclado y lectores de pantalla: invisibles; con el foco se señala el objeto en la escena
   (halo y tarjeta), que hace de indicador de foco. */
.ws-points { position: absolute; left: 0; top: 0; margin: 0; padding: 0; list-style: none; }
.ws-points button {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.ws-package-controls[hidden]{display:none;}
.ws-package-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.ws-package-arrow{position:absolute;z-index:6;width:48px;height:48px;min-width:48px;padding:0;display:grid;place-items:center;transform:translate(-50%,-50%);border-radius:50%;border:1px solid rgb(255 255 255 / 80%);background:rgb(239 249 255 / 62%);color:#234962;backdrop-filter:blur(16px) saturate(125%);-webkit-backdrop-filter:blur(16px) saturate(125%);box-shadow:inset 0 1px 2px #fff,0 4px 16px rgb(19 48 70 / 16%);cursor:pointer;transition:background .15s,box-shadow .15s;}
.ws-package-arrow:hover{background:rgb(249 253 255 / 84%);box-shadow:inset 0 1px 2px #fff,0 4px 18px rgb(31 102 151 / 25%);}
.ws-package-arrow:focus-visible{outline:3px solid #278dc1;outline-offset:3px;}
.ws-package-arrow svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;}

/* Carga: el icono, una frase y un indicador discreto. */
.ws-loader {
  position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: #e4e9ed; color: var(--muted); font-size: 14.5px; transition: opacity .45s ease-out;
}
.ws-loader[hidden] { display: none; }
.workshop.is-ready .ws-loader { opacity: 0; pointer-events: none; }
.ws-loader__bar { position: relative; width: 120px; height: 3px; border-radius: 3px; background: rgb(var(--navy-rgb) / 12%); overflow: hidden; }
.ws-loader__bar::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform-origin: left; transform: scaleX(var(--load, .08)); transition: transform .25s; }

/* Versión sencilla (sin WebGL o si el 3D no arranca). */
.ws-fallback {
  position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: 8px;
  padding: 24px; text-align: center; background: linear-gradient(180deg, #e9edf0, #d6dde3); color: var(--ink);
}
.ws-fallback[hidden] { display: none; }
.ws-fallback__title { font-size: 19px; font-weight: 700; color: var(--navy); }
.ws-fallback__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.ws-fallback .btn { text-decoration: none; }
.ws-noscript { position: absolute; left: 24px; bottom: 24px; z-index: 9; padding: 10px 14px; border-radius: 10px; background: var(--surface); }

.practices--about { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; }
.practices--about[open] { display: flex; flex-direction: column; }   /* la cabecera fija; el texto se desplaza */
.practices__text { overflow-y: auto; padding: 4px 20px 20px; font-size: 15px; line-height: 1.55; }
.practices__text p { margin: 12px 0 0; }
.practices__text h3 { margin: 22px 0 0; font-size: 15.5px; color: var(--navy); }
.practices--about h4 { margin: 18px 0 0; font-size: 15px; color: var(--navy); }
.practices--about h4 a { color: var(--blue); text-underline-offset: 2px; }
.practices__text ul, .practices__text ol { margin: 8px 0 0; padding-left: 22px; }
.practices__text li + li { margin-top: 5px; }
.practices__text strong { color: var(--navy); }
.practices__text .practice-link { margin-top: 14px; }
.practices__text .practices__legal {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px;
  margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.practices__legal > a { color: inherit; }
.practices__credit a { color: var(--blue); font-weight: 700; }
.practices__legal a { text-underline-offset: 3px; }

.hub .tool .icon { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .ws-canvas, .ws-loader, .workshop::after { transition: none; }
}
@media (max-width: 700px) {
  .workshop { height: calc(100svh - 64px); min-height: 380px; }
  .hub .topbar { padding: 8px 12px; }
}

/* La marca conserva el blanco en todos los estados del enlace. */
.hub .brand__name a:any-link, .hub .brand__home:any-link{color:var(--on-dark,#fff);text-decoration:none}

.practices__text nav a,.practices__text strong a{color:var(--blue);text-underline-offset:2px}

/* La escena llega hasta arriba, detrás de la barra de cristal. */
.hub .topbar.topbar{position:absolute;top:0;left:0;right:0}
.hub .workshop{height:100vh;height:100dvh}


/* Light frosted header: brighten the scene sampled behind the navigation. */
.hub .topbar.topbar{background:rgb(255 255 255 / 88%);-webkit-backdrop-filter:blur(28px) saturate(110%) brightness(1.25);backdrop-filter:blur(28px) saturate(110%) brightness(1.25)}

/* Cambio de zona (mesa ⇄ vitrinas): abajo a la izquierda, sobre la escena. */
/* Se cambia de zona con las señales 3D (mesa → vitrinas y vuelta): este botón solo aparece con el foco del teclado,
   con aspecto de señal de museo (azul, borde claro), abajo a la izquierda. */
.ws-zone { position: absolute; left: 16px; bottom: 16px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 2px solid #49baff; border-radius: 12px; background: #17324d; color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgb(23 50 77 / 30%); cursor: pointer; }
.ws-zone .icon { width: 18px; height: 18px; flex: none; }
.ws-zone:hover { background: #1f4467; }
.ws-zone:not(:focus-visible) { clip-path: inset(50%); width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; white-space: nowrap; }
.ws-zone[hidden] { display: none; }
.workshop.is-leaving .ws-zone { opacity: 0; pointer-events: none; }
