/* ============================================================
   The tour of a product capture (assets/js/tour.js).

   First on Sample Kit Builder's page (Ben, 2026-11-22, after
   pluginhubapp.com), then on the plugin pages in place of "How it works".
   Numbered pins on a real capture of the product, a card beside the pin,
   never on it, and Take the tour, which walks the pins in order.

   Colours: a pin is a button, so it takes the site's orange, like every
   action, and is told apart by its number, never by a colour. The card's
   number and the progress bar are marks, not actions: on a product page
   (data-product on <html>, product-colour.css) they take the plugin's
   colour. The pins breathe twice when the capture comes into view, then
   stay still: nothing moves at rest.

   Without JavaScript, the steps show as a numbered list under the capture
   (.tour__steps); tour.js builds the pins from that list and hides it.
   ============================================================ */

.tour { max-width: 1040px; margin: 0 auto; }
.tour__tabs { display: flex; justify-content: center; gap: 0.25rem; margin-bottom: 0.9rem; }
.tour__tabs[hidden] { display: none; }
.tour__tab { min-height: 44px; padding: 0 1.1rem; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font: 600 0.85rem/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.tour__tab:hover { color: var(--text-bright); }
.tour__tab[aria-pressed="true"] { color: var(--text-bright); border-bottom-color: var(--accent); }
.tour__tab:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
/* The whole capture fits under the site's sticky header (64 px) with room
   around it: --tour-ratio is its width over its height, set by the page. */
.tour__stage { position: relative; margin-inline: auto; max-width: calc((100vh - 112px) * var(--tour-ratio, 1.6)); max-width: calc((100svh - 112px) * var(--tour-ratio, 1.6)); }
.tour__shot { position: relative; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: #131211; }
.tour__shot img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: var(--radius-lg); opacity: 0; transition: opacity 0.25s ease; }
.tour__shot img.is-on { opacity: 1; }
.tour__shot.is-video { aspect-ratio: 16 / 9; overflow: hidden; }
.tour__shot.is-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* The pins */
.tour-pin { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent, #FFFFFF); font: 700 13px/1 var(--font); cursor: pointer; box-shadow: 0 0 0 6px rgba(244, 58, 0, 0.28), 0 6px 18px rgba(0, 0, 0, 0.5); transition: transform 0.15s, background-color 0.15s, color 0.15s, box-shadow 0.15s; z-index: 2; }
.tour-pin[hidden] { display: none; }
.tour-pin::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; }
.tour-pin:hover { transform: scale(1.12); }
.tour-pin[aria-expanded="true"] { background: #FFFFFF; color: #1A1A1A; box-shadow: 0 0 0 6px rgba(244, 58, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.5); z-index: 3; }
.tour-pin:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 4px; }
.tour.is-arrived:not(.is-explored) .tour-pin::after { content: ''; position: absolute; inset: 0; border-radius: 50%; animation: tour-pin-breathe 1.2s ease-out 2 both; animation-delay: var(--breathe-after, 0s); }
@keyframes tour-pin-breathe { from { box-shadow: 0 0 0 0 rgba(244, 58, 0, 0.6); } to { box-shadow: 0 0 0 18px rgba(244, 58, 0, 0); } }

/* The card */
/* 280 px, narrower on a narrow capture so it finds room beside a panel. */
.tour-card { position: absolute; width: min(280px, 38%); z-index: 4; background: var(--bg-card); border: 1px solid #404040; border-radius: var(--radius-lg); padding: 14px 18px 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); text-align: left; animation: tour-card-in 0.18s ease-out; }
.tour-card[hidden] { display: none; }
.tour-card__notch { position: absolute; width: 12px; height: 12px; background: var(--bg-card); border: 1px solid #404040; transform: rotate(45deg); }
.tour-card.is-right .tour-card__notch { left: -7px; top: calc(var(--notch, 28px) - 6px); border-top: 0; border-right: 0; }
.tour-card.is-left .tour-card__notch { right: -7px; top: calc(var(--notch, 28px) - 6px); border-bottom: 0; border-left: 0; }
.tour-card.is-below .tour-card__notch { top: -7px; left: calc(var(--notch, 28px) - 6px); border-bottom: 0; border-right: 0; }
.tour-card.is-above .tour-card__notch { bottom: -7px; left: calc(var(--notch, 28px) - 6px); border-top: 0; border-left: 0; }
/* No side of the pin leaves it and its zone uncovered (tour.js): under the
   capture, as on a phone. */
.tour-card.is-under { position: relative; width: auto; max-width: 36rem; margin: 12px auto 0; }
.tour-card.is-under .tour-card__notch { display: none; }
.tour-card__top { display: flex; align-items: center; justify-content: space-between; }
.tour-card__num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(244, 58, 0, 0.18); color: var(--accent-text, #FF5F3B); font: 700 13px/1 var(--font); }
.tour-card__close { width: 32px; height: 32px; margin-right: -8px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 6px; color: var(--text-muted); cursor: pointer; }
.tour-card__close:hover { color: var(--text-bright); background: var(--bg-hover); }
.tour-card__title { margin: 8px 0 4px; color: var(--text-bright); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.tour-card__text { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--text); }
.tour-card__nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--border); }
.tour-card__step { min-width: 44px; height: 36px; background: none; border: 0; border-radius: 6px; color: var(--text-muted); font: inherit; font-size: 1rem; cursor: pointer; }
.tour-card__step:hover { color: var(--text-bright); background: var(--bg-hover); }
.tour-card__count { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.04em; }
.tour-card__progress { position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left center; opacity: 0; }
.tour.is-touring .tour-card__progress { opacity: 1; animation: tour-tick var(--tour-step, 4500ms) linear forwards; }
.tour.is-paused .tour-card__progress { animation-play-state: paused; }
@keyframes tour-tick { to { transform: scaleX(1); } }
@keyframes tour-card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* On a product page, the card's marks take the plugin's colour. */
html[data-product] .tour-card__num { background: color-mix(in srgb, var(--product) 18%, transparent); color: var(--product-text); }
html[data-product] .tour-card__progress { background: var(--product); }

/* The buttons under the capture */
.tour__actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }
.tour-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 20px; background: transparent; border: 1px solid #4A4A4A; border-radius: 999px; font: 600 0.95rem/1 var(--font); color: var(--text-bright); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.tour-btn:hover, .tour-btn:focus-visible, .tour-btn[aria-pressed="true"] { border-color: var(--accent); background: rgba(244, 58, 0, 0.1); outline: none; }
.tour-btn[hidden] { display: none; }
.tour-btn__dot { width: 16px; height: 6px; border-radius: 999px; background: var(--accent); }
.tour__actions[hidden] { display: none; }

/* Without JavaScript: the steps as a numbered list under the capture. */
.tour__steps { max-width: 44rem; margin: 1.5rem auto 0; padding-left: 1.4rem; color: var(--text); line-height: 1.6; }
.tour__steps li { margin-bottom: 0.6rem; }
.tour__steps strong { color: var(--text-bright); }
.tour.is-ready .tour__steps { display: none; }

@media (max-width: 640px) {
  .tour-pin { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 11px; box-shadow: 0 0 0 4px rgba(244, 58, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.5); }
  .tour-card { position: relative; width: auto; margin-top: 12px; left: auto !important; top: auto !important; }
  .tour-card__notch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tour .tour-pin::after { animation: none !important; }
  .tour__shot img { transition: none; }
  .tour-pin, .tour-card { transition: none; animation: none; }
  .tour-pin:hover { transform: none; }
  .tour.is-touring .tour-card__progress { animation: none; opacity: 0; }
}
