/* Homepage hero slideshow (#hero-show, static/js/home-hero.js): the Equipment Builder examples as before /
   after slides in the hero's picture slot. A slide is the cutsheet drawing with, in its second half, the live
   3D model (or its still) over it; a tag names which is showing, the bar under the stage carries the
   equipment name, the dots (the current one fills over the slide) and the pause button. Light only. */

.hero-video.hero-show {
    aspect-ratio: auto;
    max-width: 580px;
    width: 100%;
    --hs-ink: #2a3d51;
    --hs-muted: #5f6b78;
    --hs-line: #e5e7eb;
    --hs-blue: var(--thermist-blue, #0a87ed);
    --hs-model-bg: linear-gradient(#f4f8fc, #e9eef3);   /* the tool's own 3D view background */
}

.hero-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--hs-line);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 700ms ease;
}

.hero-slide[hidden] { display: none; }
.hero-slide.is-on { opacity: 1; }
.hero-slide.is-off { opacity: 0; pointer-events: none; }

.hero-sheet,
.hero-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* a slow push in on the drawing while it is on */
.hero-sheet {
    transform: scale(1);
    transform-origin: 50% 50%;
    transition: transform 7400ms linear;
}

.hero-slide.is-on .hero-sheet { transform: scale(1.06); }

/* the model layer fades in over the drawing in the slide's second half */
.hero-gl,
.hero-still {
    opacity: 0;
    transition: opacity 650ms ease;
    pointer-events: none;
}

.hero-gl {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: var(--hs-model-bg);
    touch-action: pan-y;
    cursor: grab;
    outline: none;
}

.hero-gl:active { cursor: grabbing; }

.hero-still { background: var(--hs-model-bg); }
.hero-still[hidden] { display: block; }

.hero-slide.is-model .hero-gl { opacity: 1; pointer-events: auto; }
.hero-slide.is-model.is-still .hero-gl { opacity: 0; pointer-events: none; }
.hero-slide.is-model.is-still .hero-still { opacity: 1; }

.hero-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--hs-line);
    color: var(--hs-ink);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    pointer-events: none;
}

.hero-state {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--hs-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.hero-state[hidden] { display: none; }

.hero-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 10px 4px 0;
    color: var(--hs-ink);
}

.hero-show-label {
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-ctl {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.hero-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-dot {
    position: relative;
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cfd6dd;
    cursor: pointer;
    overflow: hidden;
    transition: width 300ms ease, background-color 300ms ease;
}

/* a bigger hit target than the dot */
.hero-dot::before { content: ''; position: absolute; inset: -8px; }

.hero-dot[aria-current="true"] { width: 26px; background: #cfd6dd; }

.hero-dot-fill {
    position: absolute;
    inset: 0;
    background: var(--hs-blue);
    transform-origin: 0 50%;
    transform: scaleX(0);
}

.hero-dot:not([aria-current="true"]) .hero-dot-fill { display: none; }
.hero-dot:focus-visible { outline: 3px solid var(--hs-blue); outline-offset: 2px; }

.hero-pause {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5dce4;
    border-radius: 8px;
    background: #fff;
    color: var(--hs-muted);
    cursor: pointer;
}

.hero-pause:hover { background: #f1f4f7; color: var(--hs-ink); }
.hero-pause:focus-visible { outline: 3px solid var(--hs-blue); outline-offset: 1px; }
.hero-pause .hero-ico-play { display: none; }
.hero-pause.is-paused .hero-ico-play { display: block; }
.hero-pause.is-paused .hero-ico-pause { display: none; }

@media (max-width: 900px) {
    .hero-video.hero-show { max-width: 560px; }
    .hero-bar { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-sheet { transition: none; }
    .hero-slide.is-on .hero-sheet { transform: none; }
    .hero-dot { transition: none; }
}
