/* The magazines page opens on one magazine (owner, 2026-11-29: "make an experience when you enter the magazine category with one
   example ... on scroll it unfolds"). Matthew in the KJV: the closed magazine, then four of its spreads turning page by page while
   the scroll moves through a tall track, each with one line on what makes the magazines what they are; below it, the wall of all
   magazines. Script: js/magazines-experience-20261129.js (adds .mx-live to <html> when it runs and motion is allowed).
   Without the script, or with reduced motion: the captions as a list beside one open spread, nothing moves. */

.mx { margin: -40px -16px 0; position: relative; }
.mx * { box-sizing: border-box; }

/* ---------- still version (no script, or reduced motion) ---------- */
.mx-track { position: relative; }
.mx-stage { display: grid; gap: 28px; padding: 48px 16px 56px; max-width: 1360px; margin: 0 auto; align-items: center; }
.mx-copy { position: relative; display: grid; gap: 26px; max-width: 520px; }
.mx-step h2, .mx-step h3 { margin: 0 0 10px; font-weight: 400; line-height: 1.02; letter-spacing: -0.01em; }
.mx-step h2 { font-size: clamp(38px, 6.4vw, 76px); }
.mx-step h3 { font-size: clamp(26px, 3.4vw, 40px); }
.mx-step p { margin: 0; max-width: 42ch; font-size: 16px; line-height: 1.55; color: var(--tb-muted, inherit); }
.mx-eyebrow { margin: 0 0 14px !important; font: 600 12px/1 var(--tb-ui, system-ui, sans-serif) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--tb-muted, inherit); }
.mx-cta { display: inline-flex; align-items: center; min-height: 48px; margin-top: 22px; padding: 0 24px; border-radius: 999px; background: var(--tb-fg, #f4f1ea); color: var(--tb-bg, #111); font: 600 14px/1 var(--tb-ui, system-ui, sans-serif); letter-spacing: .02em; text-decoration: none; transition: transform .2s ease, opacity .2s ease; }
.mag-page a.mx-cta, .mag-page a.mx-cta:visited { color: var(--tb-bg, #fff); }   /* the shop's link colour would win otherwise */
.mx-cta:hover { transform: translateY(-1px); }
.mx-cta:focus-visible { outline: 2px solid var(--tb-fg, currentColor); outline-offset: 3px; }
.mx-hint { display: none; }

.mx-scene { --pw: min(40vw, 300px); position: relative; display: flex; justify-content: center; perspective: 2600px; }
.mx-book { position: relative; width: calc(var(--pw) * 2); height: calc(var(--pw) * 1.4129); transform-style: preserve-3d; }
.mx-book::after { /* the shadow on the table */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -5%; height: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); filter: blur(10px); transform: translateZ(-2px); z-index: 0; }
.mx-base, .mx-leaf { position: absolute; top: 0; width: 50%; height: 100%; }
.mx-base { right: 0; }
.mx-base-left { left: 0; right: auto; }
.mx-leaf { left: 50%; transform-origin: 0 50%; transform-style: preserve-3d; will-change: transform; }
.mx-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #191917; }
.mx-back { transform: rotateY(180deg); }
.mx-face img, .mx-base img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the fold: a little shade at the spine on every page, more while a leaf is in the air */
.mx-face::after, .mx-base::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.mx-front::after, .mx-base-right::after { background: linear-gradient(90deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 7%); }
.mx-back::after, .mx-base-left::after { background: linear-gradient(270deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 7%); }
.mx-shade { position: absolute; inset: 0; pointer-events: none; background: #000; opacity: 0; }
.mx-cover .mx-front::after { background: linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 4%); }

/* still version: the magazine lies open on the Sermon on the Mount (the second leaf turned) */
/* (a hair of depth for each leaf: in a 3D scene the browser sorts flat leaves by depth, not z-index) */
html:not(.mx-live) .mx-leaf[data-leaf="0"] { z-index: 2; transform: translateZ(.6px) rotateY(-180deg); }
html:not(.mx-live) .mx-leaf[data-leaf="1"] { z-index: 3; transform: translateZ(1.2px) rotateY(-180deg); }
html:not(.mx-live) .mx-leaf[data-leaf="2"] { z-index: 2; transform: translateZ(1.2px); }
html:not(.mx-live) .mx-leaf[data-leaf="3"] { z-index: 1; transform: translateZ(.6px); }

@media (min-width: 1000px) {
  .mx-stage { grid-template-columns: minmax(300px, 34%) 1fr; padding: 64px 32px 80px; }
  .mx-step h2 { font-size: clamp(40px, 4.2vw, 62px); }
  .mx-scene { --pw: min(28vw, 380px); }
}

/* ---------- moving version ---------- */
/* the shop keeps the page from sliding sideways with overflow-x: hidden on body, which makes body a scroll box of its own and stops a
   sticky stage; clip keeps the page from sliding and lets the stage stay (the script checks it and falls back to the still version) */
html.mx-live body { overflow: visible; overflow-x: clip; }
html.mx-live .mx-track { height: 640vh; }
html.mx-live .mx-stage { position: sticky; top: 0; height: 100vh; height: 100svh; padding-top: 72px; padding-bottom: 28px; grid-template-rows: auto 1fr; overflow: hidden; }
html.mx-live .mx-copy { display: block; min-height: 190px; }
html.mx-live .mx-step { position: absolute; left: 0; right: 0; top: 0; opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; visibility: hidden; }
html.mx-live .mx-step.is-on { opacity: 1; transform: none; visibility: visible; }
html.mx-live .mx-scene { --pw: min(45vw, calc((100svh - 330px) * .7078), 360px); align-self: center; }
html.mx-live .mx-book { transform-origin: 50% 60%; }
html.mx-live .mx-hint { display: flex; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); align-items: center; gap: 8px; font: 600 11px/1 var(--tb-ui, system-ui, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--tb-muted, inherit); transition: opacity .3s ease; }
html.mx-live .mx-hint::after { content: ""; width: 1px; height: 22px; background: currentColor; animation: mx-hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes mx-hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }
html.mx-live .mx-dots { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
html.mx-live .mx-dots li { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .25; transition: opacity .3s ease, transform .3s ease; }
html.mx-live .mx-dots li.is-on { opacity: .9; transform: scale(1.35); }
.mx-dots { display: none; }
html.mx-live .mx-dots { display: grid; }

@media (min-width: 1000px) {
  html.mx-live .mx-stage { grid-template-rows: 1fr; padding-top: 64px; }
  html.mx-live .mx-copy { min-height: 320px; align-self: center; }
  html.mx-live .mx-scene { --pw: min(27vw, calc((100svh - 180px) * .7078), 430px); }
}
@media (max-width: 999px) {
  html.mx-live .mx-dots { display: none; }   /* on a phone the open magazine fills the width */
  html.mx-live .mx-step p { font-size: 15px; }
  html.mx-live .mx-step h2 { font-size: clamp(34px, 9vw, 52px); }
  html.mx-live .mx-step h3 { font-size: clamp(24px, 6.6vw, 34px); }
}

/* the wall below arrives as it scrolls in */
html.mx-live .mag-card.mx-wait { opacity: 0; transform: translateY(22px); }
html.mx-live .mag-card.mx-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }

/* every magazine opens its own page */
.mag-page a.mag-link { color: inherit; text-decoration: none; }
.mag-page a.mag-frame { display: block; }
.mag-page h3 a.mag-link:hover, .mag-page h3 a.mag-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.mag-page a.mag-frame img { transition: transform .35s ease; }
.mag-page a.mag-frame:hover img { transform: translateY(-3px); }
.mag-view { display: inline-block; margin: 2px 0 10px; font: 600 12px/1.4 var(--tb-ui, system-ui, sans-serif); letter-spacing: .04em; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .mx-cta, .mag-page a.mag-frame img { transition: none; }
  html.mx-live .mag-card.mx-wait { opacity: 1; transform: none; }
}
