/* The example videos at the top of the feature pages and their hub (subtitleai/seo/tool_page.py, static/hero-examples.js),
   as at AutoSubtitles: on a phone a strip of phones to swipe under the upload button, from 1024 px a fan of four
   beside the heading with the front one playing. Each phone is a 9:16 video in a 6 px frame; the dots pick one. */

.seo-body .tool-hero .seo-lede { margin-top: 32px; }
.seo-body .tool-hero .tool-hero-cta { margin-bottom: 48px; }
.seo-body .tool-examples { margin: 0 0 64px; }
/* 4 px above the phones keep a keyboard focus ring whole inside the strip, which clips what it does not scroll. */
.seo-body .tool-examples-track {
    position: relative;
    display: flex;
    gap: 16px;
    margin: 0 -20px;
    padding: 4px 20px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.seo-body .tool-examples-track::-webkit-scrollbar { display: none; }
.seo-body .tool-example {
    position: relative;
    display: block;
    flex: 0 0 62%;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--tool-line);
    border-radius: 16px;
    background: var(--tool-card);
    color: inherit;
    font: inherit;
    cursor: pointer;
    scroll-snap-align: center;
    touch-action: manipulation;
}
.seo-body .tool-example video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    background: #000;
    object-fit: cover;
    pointer-events: none;
}
html[data-theme="dark"] .seo-body .tool-example { box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95); }
/* The playing phone's sign: pause while it plays, play while it is paused. */
.seo-body .tool-example-state {
    position: absolute;
    top: 14px;
    right: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}
.seo-body .tool-example[data-state] .tool-example-state { display: flex; }
.seo-body .tool-example-state svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.seo-body .tool-example-play { fill: currentColor; }
.seo-body .tool-example[data-state="playing"] .tool-example-play,
.seo-body .tool-example[data-state="paused"] .tool-example-pause { display: none; }
.seo-body .tool-example-dots { display: flex; justify-content: center; margin-top: 8px; }
.seo-body .tool-examples-credit { margin: 4px 0 0; color: var(--tool-dim); font-size: 0.75rem; line-height: 1.5; text-align: center; }
.seo-body .tool-example-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    touch-action: manipulation;
}
.seo-body .tool-example-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--tool-dim);
    opacity: 0.45;
    transition: width 200ms ease, opacity 200ms ease;
}
.seo-body .tool-example-dot[aria-current="true"]::before { width: 24px; background: var(--accent); opacity: 1; }
.seo-body :is(.tool-example, .tool-example-dot):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Up to 1023 px the heading, its line and the button are centred above the strip, as at AutoSubtitles. */
@media (max-width: 1023px) {
    .seo-body .tool-hero .seo-header { margin-inline: auto; text-align: center; }
    .seo-body .tool-hero .tool-hero-cta { justify-content: center; }
}

@media (min-width: 640px) {
    .seo-body .tool-examples-track { margin: 0 -32px; padding: 4px 32px 8px; }
    .seo-body .tool-example { flex-basis: 36%; }
}

/* Side by side: the copy on the left, the phones stacked in one cell on the right. The front phone is up to 248 px
   wide; the next leans in on the right, the last on the left, the others wait hidden behind. */
@media (min-width: 1024px) {
    .seo-body .tool-hero {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        align-items: center;
        column-gap: 48px;
        margin: 0 0 96px;
    }
    .seo-body .tool-hero .tool-hero-cta,
    .seo-body .tool-examples { margin: 0; }
    .seo-body .tool-examples-track {
        display: grid;
        align-items: center;
        justify-items: center;
        margin: 0;
        padding: 24px 0;
        overflow: visible;
        scroll-snap-type: none;
    }
    .seo-body .tool-example {
        grid-area: 1 / 1;
        width: min(15.5rem, 48%);
        transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1), opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), visibility 800ms;
    }
    .seo-body .tool-example[data-place="front"] { z-index: 3; }
    .seo-body .tool-example[data-place="next"] { z-index: 2; opacity: 0.5; transform: translateX(64%) scale(0.8) rotate(7deg); }
    .seo-body .tool-example[data-place="prev"] { z-index: 2; opacity: 0.5; transform: translateX(-64%) scale(0.8) rotate(-7deg); }
    .seo-body .tool-example[data-place="back"] { z-index: 1; opacity: 0; visibility: hidden; transform: scale(0.62); }
    .seo-body .tool-example-dots { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .seo-body .tool-example,
    .seo-body .tool-example-dot::before { transition: none; }
}
