/* ================================================
   TOUR CHAPTERS - the scroll tours on phones
   ================================================
   The dots and the caption that tour-chapters.js adds inside the pinned stage.
   Each page's own tour.css pins the stage and turns its captions into spacers. */

.tc-dots, .tc-cap { display: none; }

@media (max-width: 960px) {
    /* Proximity snapping settles each chapter in place without fighting a flick. */
    html:has(.tc-cap) { scroll-snap-type: y proximity; }

    .tc-dots { display: flex; justify-content: center; gap: 6px; margin: 0 auto 14px; flex: none; }
    .tc-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.22); cursor: pointer; transition: width 0.3s ease, background 0.3s ease; }
    .tc-dots button.on { width: 22px; background: #00d4ff; }

    /* The screen keeps its size; a long caption gives way instead. */
    .tc-dots + * { flex: none; }
    .tc-cap { display: block; width: 100%; max-width: 34rem; margin: 18px auto 0; padding: 0 4px; flex: 0 1 auto; min-height: 0; overflow: hidden; text-align: center;
        transition: opacity 0.2s ease, transform 0.2s ease; }
    .tc-cap > div, .tc-cap .st-cta { justify-content: center; }
    .tc-cap h3, .tc-cap p { margin-left: auto; margin-right: auto; }
    /* The tour fills the screen on phones; the scroll-to-top button would sit on its buttons. */
    html:has(.tc-cap) .scroll-top { display: none; }
    .tc-cap.out { opacity: 0; transform: translateY(8px); }
    .tc-group { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #00d4ff; margin-bottom: 0.55rem; }
    .tc-cap h3 { font-size: 1.32rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.5rem; }
    .tc-cap p { font-size: 0.95rem; line-height: 1.55; color: var(--color-text-secondary); }
    .tc-cap p + p { margin-top: 0.45rem; }
    .tc-hint { text-align: center; color: var(--color-text-muted); font-size: 0.9rem; }
}

/* Shorter phones: keep the screen and the gist, drop the small print. */
@media (max-width: 960px) and (max-height: 820px) {
    .tc-cap .st-fine { display: none; }
    .tc-cap p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
}
@media (max-width: 960px) and (max-height: 700px) {
    .tc-cap p { -webkit-line-clamp: 3; }
    .tc-cap h3 { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tc-cap, .tc-dots button { transition: none; }
}
