.factory-gallery figcaption { margin-top: .5rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.factory-viewport { position: relative; background: #25282a; }
.factory-view { display: block; cursor: zoom-in; touch-action: pan-y pinch-zoom; }
.factory-gallery .factory-view img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 0; }
.factory-gallery-controls {
  position: absolute;
  right: clamp(.6rem, 2%, 1.4rem);
  bottom: clamp(.6rem, 3%, 1.4rem);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid #ffffff54;
  background: #202327ed;
  color: #fff;
}
.factory-gallery-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: inherit;
  border: 0;
}
.factory-gallery-controls button:hover { background: #ffffff29; }
.factory-gallery-controls svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.factory-view-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  background: #f2f2f2;
}
.factory-view-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  padding: .6rem clamp(.6rem, 1.4vw, 1.5rem);
  border-block-end: 3px solid transparent;
  font: 600 clamp(.81rem, 1.08vw, 1rem)/1.27 var(--sans);
}
.factory-view-link span { overflow-wrap: anywhere; }
.factory-gallery .factory-view-link img {
  width: clamp(40px, 4vw, 64px);
  height: auto;
  aspect-ratio: 16 / 9;
  flex: none;
  border: 0;
}
.factory-view-link[aria-current] { border-block-end-color: var(--accent); background: #e5e5e6; }
.factory-view-link:hover { background: #e5e5e6; }
.factory-gallery :is(a, button):focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.factory-gallery-controls button:focus-visible { outline-color: white; }
@media (max-width: 620px) {
  .factory-view-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .factory-view-link { min-height: 52px; padding: .45rem; gap: .45rem; }
  .factory-gallery-controls button { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: no-preference) {
  .factory-gallery-enhanced .factory-view:not([hidden]) { animation: factory-appear .24s ease-out; }
  @keyframes factory-appear { from { opacity: .5; } to { opacity: 1; } }
}
