/* =========================================================
   Loaded on journal notes only, after styles.css.
   The pieces every note can use: the frame around a toy, its
   caption and button, and the tap-to-load Instagram video.
   A note's own toy is styled in toy.css in that note's folder.
   ========================================================= */

/* ---------- small toys inside notes ----------
   Same rules as the rest of the site: only opacity and transform move.
   Anything marked .lp loops only while its .toy is on screen (script.js adds .play).
   A toy with its own rule for reduced motion needs the same rule for [data-motion="off"],
   which is what the "Pause motion" button in the footer sets. */
.prose .toy { position: relative; isolation: isolate; overflow: hidden; margin: 2em 0; padding: clamp(20px, 4vw, 32px); border-radius: 18px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; line-height: 1.5 }
.toy::before { content: ""; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; right: -30%; top: -60%; border-radius: 50%; background: radial-gradient(closest-side, var(--tint, var(--a3)), transparent); opacity: .22; pointer-events: none }
.ready .toy:not(.play) .lp { animation-play-state: paused }
.toy-cap { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; color: var(--muted); font-size: 14.5px }
.toy-btn { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .2s }
.toy-btn:hover { box-shadow: inset 0 0 0 1px var(--fg) }
/* without script a toy's button and the video preview do nothing, so they are not offered;
   the link under a video still opens it on Instagram */
html:not(.js) .toy-btn, html:not(.js) .reel-poster { display: none }

/* a video from Instagram: a light preview first, the real player only after a tap */
.prose .reel { margin: 1.6em 0; display: grid; justify-items: center; gap: 14px }
.reel-poster { position: relative; overflow: hidden; isolation: isolate; width: min(100%, 340px); aspect-ratio: 9 / 16; border-radius: 18px; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; background: radial-gradient(120% 80% at 50% 0%, #12304A, #0B0C10 70%); color: #F3F4F6; text-align: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 24px 60px -30px var(--a4); transition: transform .35s var(--ease) }
.reel-poster:hover { transform: translateY(-4px) }
.reel-planet { width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #7FE0C4, #1E9FC2 55%, #0B3A55); box-shadow: 0 0 60px -10px #1E9FC2 }
.reel-play { position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; margin: -78px 0 0 -32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #0B0C10; transition: transform .3s var(--ease) }
.reel-poster:hover .reel-play { transform: scale(1.08) }
.reel-play svg { width: 26px; height: 26px; margin-left: 3px }
.reel-t { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.15; max-width: 11em }
.reel-note { color: #A2A8B6; font-size: 10px }
.reel iframe { width: min(100%, 400px); height: 720px; border: 0; border-radius: 18px; background: #fff }
.reel figcaption { font-size: 15px; color: var(--muted) }

/* animations more than one toy uses: a soft pulse, and a shake of the head */
@keyframes pulse { 50% { opacity: .25; transform: scale(.7) } }
@keyframes nope { 20% { transform: translateX(-7px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }

/* the line at the top of a note that contains sponsor links */
.disclosure { margin-top: 18px; max-width: 46em; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; line-height: 1.5; color: var(--muted); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line) }
.disclosure a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px }
