/*
 * Viewer pages (2026-11-08), loaded by inc/viewer-pages.php on /instagram-story-viewer/.
 * Same tokens as the v2 pages. Everything sits under .gsv. Phone first: the form is above the fold
 * at 360 px, and the one colour moment is the Instagram story ring around the account.
 */
body.gis-viewer-page main.wp-block-group { margin-block-start: 0 !important; }
body.gis-viewer-page main.wp-block-group > .wp-block-group { padding-top: 0 !important; padding-bottom: 0 !important; }
.wp-block-post-content:has(> .gsv) { padding-left: 0 !important; padding-right: 0 !important; }
.wp-block-post-content > .gsv { max-width: none !important; width: 100%; margin: 0 !important; }

.gsv {
    --gsv-ink: #16142b;
    --gsv-body: #4b4866;
    --gsv-muted: #6b6886;
    --gsv-line: #e7e4f3;
    --gsv-tint: #f7f6fd;
    --gsv-link: #4f3fc9;
    --gsv-brand-a: #667eea;
    --gsv-brand-b: #764ba2;
    --gsv-ring: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
    --gsv-radius: 18px;
    color: var(--gsv-body);
    background: #ffffff;
    font-family: var(--wp--preset--font-family--manrope, Manrope), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
.gsv *, .gsv *::before, .gsv *::after { box-sizing: border-box; }
.gsv :where(h1, h2, p, ol, ul) { margin: 0; padding: 0; }
.gsv :where(h1, h2) { font-family: inherit; color: var(--gsv-ink); }
.gsv a { color: var(--gsv-link); text-underline-offset: 3px; }
.gsv :focus-visible { outline: 3px solid var(--gsv-brand-a); outline-offset: 2px; border-radius: 10px; }
/* The block theme outlines every focused element; a tap on a button should not leave a dark box. */
.gsv button:focus:not(:focus-visible) { outline: none; }

.gsv-hero {
    padding: 28px 16px 22px;
    background: radial-gradient(520px 240px at 50% 0%, rgba(118, 75, 162, .10), transparent 70%), var(--gsv-tint);
    border-bottom: 1px solid var(--gsv-line);
    text-align: center;
}
.gsv-hero h1 { font-size: clamp(28px, 7.4vw, 44px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.gsv-lead { max-width: 34em; margin: 10px auto 0; font-size: 16.5px; }

.gsv-form { max-width: 620px; margin: 20px auto 0; text-align: start; }
.gsv-label { display: block; margin-bottom: 6px; color: var(--gsv-ink); font-size: 14px; font-weight: 700; }
.gsv-field {
    display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 16px;
    background: #ffffff; border: 1.5px solid var(--gsv-line); box-shadow: 0 10px 30px -18px rgba(22, 20, 43, .45);
}
.gsv-field:focus-within { border-color: var(--gsv-brand-a); }
.gsv-at { padding-inline-start: 8px; color: var(--gsv-muted); font-weight: 800; }
.gsv-field input {
    flex: 1 1 auto; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent;
    color: var(--gsv-ink); font: inherit; font-size: 16px;
}
.gsv-go {
    flex: 0 0 auto; height: 46px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer;
    color: #ffffff; font: inherit; font-weight: 800; font-size: 15px;
    background: linear-gradient(135deg, var(--gsv-brand-a), var(--gsv-brand-b));
}
.gsv-go[disabled] { opacity: .6; cursor: progress; }
.gsv-note { margin-top: 8px; color: var(--gsv-muted); font-size: 13.5px; text-align: center; }

.gsv-status { max-width: 620px; margin: 12px auto 0; font-size: 15px; text-align: center; }
.gsv-status:empty { display: none; }
.gsv-status.is-error { padding: 10px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.gsv-status.is-info { color: var(--gsv-muted); }
.gsv-status.is-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gsv-stage > .gsv-status { margin-top: 0; }
.gsv-retry { margin-inline-start: 8px; padding: 4px 10px; border-radius: 10px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }

.gsv-result { max-width: 680px; margin: 0 auto; padding: 20px 16px 8px; }
.gsv-profile { display: flex; align-items: center; gap: 14px; }
/* The signature: the account sits inside an Instagram story ring, which turns while stories load. */
.gsv-ring {
    position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 68px; height: 68px;
    border-radius: 50%; background: var(--gsv-ring); padding: 3px;
}
.gsv-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #ffffff; }
.gsv-initial {
    position: relative; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    background: var(--gsv-tint); color: var(--gsv-ink); font-weight: 800; font-size: 24px; text-transform: uppercase;
}
/* While loading, the ring becomes a coloured arc with a fading tail, so the turn is plain to see. */
.gsv-ring.is-loading {
    background: conic-gradient(from 0deg, rgba(79, 91, 213, 0) 0deg 60deg, #feda75 140deg, #fa7e1e 200deg, #d62976 270deg, #962fbf 330deg, #4f5bd5 360deg);
    animation: gsv-spin .9s linear infinite;
}
.gsv-ring.is-loading .gsv-initial { animation: gsv-spin .9s linear infinite reverse; }
.gsv-ring.is-empty { background: var(--gsv-line); }
@keyframes gsv-spin { to { transform: rotate(360deg); } }
.gsv-who { min-width: 0; display: grid; gap: 2px; }
.gsv-user { color: var(--gsv-ink) !important; font-weight: 800; font-size: 19px; text-decoration: none; overflow-wrap: anywhere; }
.gsv-meta { color: var(--gsv-muted); font-size: 14px; }

.gsv-sub { margin: 18px 0 8px; font-size: 15px; font-weight: 800; color: var(--gsv-ink); }
.gsv-hl-row { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.gsv-hl {
    flex: 0 0 auto; width: 72px; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0;
    background: transparent; cursor: pointer; scroll-snap-align: start; color: var(--gsv-body); font: inherit;
}
.gsv-hl-cover {
    display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
    border: 2px solid #ffffff; box-shadow: 0 0 0 2px var(--gsv-line); background: var(--gsv-tint);
    color: var(--gsv-ink); font-weight: 800;
}
.gsv-hl-cover { position: relative; }
.gsv-hl-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Below the fixed site header when the page scrolls to the result or the player. */
.gsv-result, .gsv-stage { scroll-margin-top: 96px; }
.gsv-hl[aria-pressed="true"] .gsv-hl-cover { box-shadow: 0 0 0 2px var(--gsv-brand-a); }
.gsv-hl-title { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.gsv-hl[disabled] { opacity: .55; cursor: progress; }
.gsv-hl.is-busy { opacity: 1; }
.gsv-hl.is-busy .gsv-hl-cover { box-shadow: 0 0 0 2px var(--gsv-brand-a); animation: gsv-breathe .8s ease-in-out infinite alternate; }
.gsv-stage { margin-top: 16px; }
.gsv-stage:empty { display: none; }

/* Busy states (11-08): the button, the ring and a story-shaped wait panel all say the request is alive. */
.gsv-go.is-busy { display: inline-flex; align-items: center; gap: 8px; opacity: 1; }
.gsv-go.is-busy::before {
    content: ""; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #ffffff; animation: gsv-spin .8s linear infinite;
}
.gsv-wait { padding: 16px; border: 1px solid var(--gsv-line); border-radius: var(--gsv-radius); background: var(--gsv-tint); }
.gsv-wait-frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 340px; margin: 0 auto; }
.gsv-wait-frames span {
    aspect-ratio: 9 / 16; border-radius: 12px;
    background: linear-gradient(100deg, #e9e6f5 35%, #fbfaff 50%, #e9e6f5 65%) 0 0 / 300% 100%;
    animation: gsv-shimmer 1.5s ease-in-out infinite;
}
.gsv-wait-frames span:nth-child(2) { animation-delay: .15s; }
.gsv-wait-frames span:nth-child(3) { animation-delay: .3s; }
.gsv-wait-bar { height: 6px; margin-top: 16px; border-radius: 99px; background: var(--gsv-line); overflow: hidden; }
.gsv-wait-bar span {
    display: block; height: 100%; border-radius: inherit; transform-origin: left center; transform: scaleX(.03);
    background: linear-gradient(90deg, var(--gsv-brand-a), var(--gsv-brand-b)); transition: transform .25s linear;
}
.gsv-wait-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; color: var(--gsv-ink); font-weight: 800; }
.gsv-wait-text { min-width: 0; overflow-wrap: anywhere; }
.gsv-wait-time { flex: 0 0 auto; color: var(--gsv-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.gsv-wait-sub { margin-top: 2px; color: var(--gsv-muted); font-size: 14px; }
@keyframes gsv-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes gsv-breathe { to { opacity: .55; } }

.gsv-section { max-width: 760px; margin: 0 auto; padding: 28px 16px; border-top: 1px solid var(--gsv-line); }
.gsv-section h2 { font-size: clamp(21px, 5vw, 26px); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.gsv-section > p { margin-top: 10px; }
.gsv-honest { background: var(--gsv-tint); border-radius: var(--gsv-radius); border-top: 0; margin-top: 24px; }
.gsv-steps { counter-reset: gsv; display: grid; gap: 12px; margin-top: 14px; list-style: none; }
.gsv-steps li { counter-increment: gsv; position: relative; padding-inline-start: 44px; }
.gsv-steps li::before {
    content: counter(gsv); position: absolute; inset-inline-start: 0; top: 0; display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 50%; background: var(--gsv-ink); color: #ffffff; font-weight: 800; font-size: 14px;
}
.gsv-steps strong { color: var(--gsv-ink); }
.gsv-faq { margin-top: 14px; display: grid; gap: 8px; }
.gsv-faq details { border: 1px solid var(--gsv-line); border-radius: 14px; background: #ffffff; }
.gsv-faq summary { padding: 14px 16px; cursor: pointer; color: var(--gsv-ink); font-weight: 700; list-style: none; }
.gsv-faq summary::-webkit-details-marker { display: none; }
.gsv-faq summary::after { content: "+"; float: inline-end; color: var(--gsv-muted); font-weight: 800; }
.gsv-faq details[open] summary::after { content: "\2212"; }
.gsv-faq details p { padding: 0 16px 14px; }
.gsv-tools { display: grid; gap: 10px; margin-top: 14px; list-style: none; }
.gsv-tools a {
    display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--gsv-line);
    text-decoration: none; background: #ffffff;
}
.gsv-tools strong { color: var(--gsv-ink); }
.gsv-tools span { color: var(--gsv-muted); font-size: 14px; }

@media (min-width: 720px) {
    .gsv-hero { padding: 48px 24px 34px; }
    .gsv-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
    .gsv-go { padding: 0 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .gsv-ring.is-loading, .gsv-ring.is-loading .gsv-initial, .gsv-go.is-busy::before,
    .gsv-wait-frames span, .gsv-hl.is-busy .gsv-hl-cover { animation: none; }
    .gsv-wait-bar span { transition: none; }
}
