/* Blog posts as "stories": a cover, then scenes with different layouts (split, fan, film strip, collage, comic reader, note). */
.st { overflow: clip; }
.st a.pic { display: block; cursor: zoom-in; }
.st a.pic img { width: 100%; height: auto; display: block; }

/* ----- cover ----- */
.st__cover { padding: clamp(36px, 5vw, 70px) 0 clamp(30px, 4vw, 56px); background: radial-gradient(ellipse 50% 70% at 82% 40%, rgba(186,108,0,.16), transparent 70%), radial-gradient(ellipse 40% 60% at 5% 100%, rgba(59,78,0,.12), transparent 70%); }
.st__coverin { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.st__cover--plain .st__coverin { grid-template-columns: 1fr; max-width: 820px; }
.st__head h1 { font-size: clamp(2rem, 3vw + 1rem, 3.4rem); }
.st__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.st__meta span { background: rgba(255,255,255,.8); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 13px; font: 600 .86rem var(--body); color: var(--ink-soft); }
.st__cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.st__cats span { background: var(--wash-sage); color: var(--olive); border-radius: 999px; padding: 3px 11px; font: 600 .78rem var(--body); }
.st__coverimg { margin: 0; position: relative; }
.st__coverimg img { width: 100%; max-height: 68vh; object-fit: contain; border-radius: 10px; background: #fff; border: 7px solid #fff; box-shadow: var(--sh-lift); transform: rotate(2deg); }
.st__coverimg::after { content: ''; position: absolute; inset: -16px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(186,108,0,.25), transparent); filter: blur(12px); }

/* ----- chapter rail: one paint blob per scene, the current one is filled ----- */
.st__rail { position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 40; display: grid; gap: 7px; max-height: 76vh; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .4s; }
.st__rail.is-on { opacity: 1; pointer-events: auto; }
.st__rail a { width: 26px; height: 26px; display: grid; place-items: center; text-decoration: none; }
.st__rail span { width: 12px; height: 12px; border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%; background: rgba(59,78,0,.22); color: transparent; font: 700 0px var(--body); display: grid; place-items: center; transition: all .3s cubic-bezier(.2,.8,.3,1.4); }
.st__rail a:hover span, .st__rail a.is-on span { width: 24px; height: 24px; background: var(--orange); color: #fff; font-size: 11px; }
.st__rail a.is-done span { background: var(--olive); }
@media (max-width: 1320px) { .st__rail { display: none; } }

/* ----- scenes ----- */
.sc { padding: clamp(34px, 5vw, 70px) 0; scroll-margin-top: 80px; }
.sc:nth-of-type(even) { background: linear-gradient(180deg, transparent, rgba(246,227,207,.55) 18%, rgba(246,227,207,.55) 82%, transparent); }
.sc h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem); }
.sc p, .sc li { font-size: 1.08rem; }
.sc__two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.sc--flip .sc__media { order: 2; }
.sc--notext .sc__two { grid-template-columns: minmax(0, 760px); justify-content: center; }
.sc__text > p:first-of-type::first-letter, .sc__note > p:first-of-type::first-letter { font: 600 3.1em/.82 var(--display); color: var(--orange); float: left; padding: .06em .1em 0 0; }
.sc__lead { max-width: 760px; margin-bottom: 22px; }
.sc__note { max-width: 700px; text-align: center; }
.sc__note p { font: 500 1.3rem/1.55 var(--display); color: var(--olive); }
.sc__note > p:first-of-type::first-letter { float: none; font-size: inherit; color: inherit; padding: 0; }
.sc__note::before { content: ''; display: block; width: 46px; height: 32px; margin: 0 auto 14px; background: var(--orange); -webkit-mask: url('../img/brand/jww-mark-white.png') center / contain no-repeat; mask: url('../img/brand/jww-mark-white.png') center / contain no-repeat; }
.sc__video { max-width: 900px; margin-top: 24px; }
.sc__video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-img); box-shadow: var(--sh-lift); }

/* one picture: a sheet of paper lying beside the text */
.pic--sheet img { border-radius: 8px; background: #fff; box-shadow: 0 2px 0 #fff, var(--sh-lift); transform: rotate(-2deg); transition: transform .45s cubic-bezier(.2,.8,.3,1.2), box-shadow .3s; max-height: 78vh; object-fit: contain; }
.sc--flip .pic--sheet img { transform: rotate(2deg); }
.pic--sheet:hover img { transform: rotate(0) scale(1.02); }

/* 2-3 pictures: a fanned stack that spreads when the mouse comes near */
.fan { display: grid; place-items: center; padding: 8% 0 12%; }
.fan__card { grid-area: 1 / 1; width: 60%; transition: transform .55s cubic-bezier(.2,.8,.3,1.25), z-index 0s; }
.fan__card img { border-radius: 8px; background: #fff; border: 6px solid #fff; box-shadow: var(--sh-lift); aspect-ratio: 4 / 5; object-fit: cover; }
.fan__card--1 { transform: translate(-17%, 2%) rotate(-8deg); z-index: 1; }
.fan__card--2 { transform: translate(17%, -3%) rotate(6deg); z-index: 2; }
.fan__card--3 { transform: translate(0, 13%) rotate(-1deg); z-index: 3; }
.fan--2 .fan__card--2 { transform: translate(18%, 8%) rotate(6deg); }
.fan:hover .fan__card--1 { transform: translate(-36%, -4%) rotate(-11deg); }
.fan:hover .fan__card--2 { transform: translate(36%, -6%) rotate(9deg); }
.fan:hover .fan__card--3 { transform: translate(0, 24%) rotate(0); }
.fan--2:hover .fan__card--2 { transform: translate(36%, 10%) rotate(9deg); }
.fan__card:hover, .fan__card:focus-visible { z-index: 5; }
.fan__card:hover img { box-shadow: 0 0 0 3px var(--orange), var(--sh-lift); }

/* 4+ pictures: film strip */
.filmstrip { position: relative; }
.filmstrip__track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding: 14px max(20px, calc((100vw - 1200px) / 2)) 22px; scrollbar-width: none; cursor: grab; }
.filmstrip__track::-webkit-scrollbar { display: none; }
.filmstrip__track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.filmstrip__item { flex: 0 0 auto; scroll-snap-align: center; }
.st a.filmstrip__item img { height: clamp(240px, 46vh, 460px); width: auto; border-radius: 10px; background: #fff; border: 5px solid #fff; box-shadow: var(--sh-card); transition: transform .35s, box-shadow .35s; -webkit-user-drag: none; user-select: none; }
.filmstrip__item:nth-child(odd) img { transform: rotate(-1.2deg); } .filmstrip__item:nth-child(even) img { transform: rotate(1.2deg) translateY(8px); }
.filmstrip__item:hover img { transform: rotate(0) translateY(-6px) scale(1.02); box-shadow: var(--sh-lift); }
.filmstrip__arrow { position: absolute; top: 46%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--olive); font: 600 30px/1 var(--display); cursor: pointer; box-shadow: var(--sh-card); transition: background .2s, color .2s, opacity .2s; }
.filmstrip__arrow:hover { background: var(--olive); color: #fff; }
.filmstrip__arrow[data-dir="-1"] { left: 14px; } .filmstrip__arrow[data-dir="1"] { right: 14px; }
.filmstrip__arrow:disabled { opacity: 0; pointer-events: none; }
.filmstrip__count { text-align: center; margin: 0; font: 600 .9rem var(--body); color: var(--ink-soft); }
.filmstrip__count b { color: var(--orange-dark); font-size: 1.1rem; }

/* collage */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(120px, 15vw, 210px); gap: 12px; }
.mosaic__item { border-radius: 12px; overflow: hidden; box-shadow: var(--sh-card); background: var(--paper-2); }
.st a.mosaic__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.mosaic__item:hover img { transform: scale(1.06); }
.mosaic__item:first-child { grid-column: span 2; grid-row: span 2; }
.mosaic--4 .mosaic__item:last-child { grid-column: span 2; }
.mosaic--6 { grid-template-columns: repeat(3, 1fr); } .mosaic--6 .mosaic__item:first-child { grid-column: auto; grid-row: auto; }
.mosaic--7 .mosaic__item:nth-last-child(-n+2) { grid-column: span 2; }

/* comic reader */
.comic { display: grid; gap: 26px; justify-items: center; padding: 0 16px; }
.comic__page { margin: 0; width: min(780px, 100%); background: #fff; padding: 10px 10px 4px; border-radius: 12px; box-shadow: var(--sh-lift); }
.comic__page img { border-radius: 6px; }
.comic__page figcaption { text-align: center; font: 600 .8rem var(--body); color: var(--ink-soft); padding: 6px 0 4px; letter-spacing: .08em; text-transform: uppercase; }

/* ----- the end: neighbouring stories ----- */
.st__next { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 30px 0 60px; }
.st__nextcard { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: var(--r-card); padding: 12px; box-shadow: var(--sh-card); text-decoration: none; color: var(--ink); transition: transform .3s, box-shadow .3s; }
.st__nextcard:hover { transform: translateY(-5px); box-shadow: var(--sh-lift); }
.st__nextcard img { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; flex: none; }
.st__nextcard small { display: block; color: var(--orange-dark); font-weight: 600; }
.st__nextcard b { font: 600 1.1rem/1.3 var(--display); color: var(--olive); }
.st__nextcard--right { justify-content: flex-end; text-align: right; }

@media (max-width: 820px) {
  .st__coverin, .sc__two { grid-template-columns: 1fr; }
  .st__coverimg { order: -1; max-width: 420px; margin: 0 auto; }
  .sc--flip .sc__media { order: 0; }
  .fan__card { width: 56%; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 42vw; }
  .mosaic--6 { grid-template-columns: repeat(2, 1fr); }
  .mosaic--7 .mosaic__item:nth-last-child(-n+2), .mosaic--4 .mosaic__item:last-child { grid-column: auto; }
  .filmstrip__arrow { display: none; }
  .st__next { grid-template-columns: 1fr; }
  .st__nextcard--right { flex-direction: row-reverse; text-align: left; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .fan__card, .pic--sheet img, .filmstrip__item img { transition: none; } }

/* ----- after the story: tags, share buttons, "written by" box ----- */
.st__after { max-width: 880px; padding-top: clamp(24px, 4vw, 44px); padding-bottom: clamp(28px, 5vw, 56px); }
.st__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.st__tags a { font: 600 .88rem var(--body); color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.st__tags a:hover { border-color: var(--orange); color: var(--orange-dark); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: clamp(28px, 5vw, 48px); }
.share__label { font: 700 .78rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-right: 6px; }
.share__btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; padding: 0; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.share__btn:hover, .share__btn:focus-visible { transform: translateY(-2px); color: #fff; border-color: transparent; }
.share__btn--fb:hover, .share__btn--fb:focus-visible { background: #1877F2; }
.share__btn--pin:hover, .share__btn--pin:focus-visible { background: #E60023; }
.share__btn--x:hover, .share__btn--x:focus-visible { background: #111; }
.share__btn--wa:hover, .share__btn--wa:focus-visible { background: #128C4A; }
.share__btn--mail:hover, .share__btn--mail:focus-visible, .share__btn--copy:hover, .share__btn--copy:focus-visible { background: var(--olive); }
.share__done { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff; font: 400 .75rem var(--body); padding: 3px 8px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.share__btn.is-copied .share__done { opacity: 1; }
.author { position: relative; display: grid; grid-template-columns: 140px 1fr; gap: clamp(16px, 4vw, 44px); align-items: center; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--orange); border-radius: 18px; padding: clamp(18px, 3.5vw, 34px); box-shadow: 0 10px 30px -18px rgba(59,78,0,.45); overflow: hidden; }
.author::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 200px; height: 200px; background: url('../img/brand/jww-mark-white.png') center / contain no-repeat; filter: invert(1); opacity: .05; pointer-events: none; }
.author__photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; }
.author__kicker { margin: 0; font: 700 .78rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--orange-dark); }
.author__name { margin: 2px 0 6px; font-size: 1.5rem; }
.author__bio { margin: 0 0 14px; color: var(--ink-soft); line-height: 1.6; }
.author__btns { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.author .btn:first-child { background: var(--orange); }
@media (max-width: 640px) { .author { grid-template-columns: 1fr; text-align: center; justify-items: center; } .author__btns { justify-content: center; } }
@media print { .share, .author__btns { display: none; } }

/* ----- flip book (comic diary) ----- */
.flip { padding: 0 16px; }
.flip__book { display: grid; gap: 26px; justify-items: center; outline: none; }
.flip__p { margin: 0; width: min(780px, 100%); background: #fff; padding: 10px 10px 4px; border-radius: 12px; box-shadow: var(--sh-lift); position: relative; }
.flip__p img { border-radius: 6px; display: block; width: 100%; height: auto; }
.flip__p figcaption { text-align: center; font: 600 .8rem var(--body); color: var(--ink-soft); padding: 6px 0 4px; letter-spacing: .08em; text-transform: uppercase; }
.flip__zoom { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(42,36,24,.72); color: #fff; text-decoration: none; font-size: 1.15rem; opacity: 0; transition: opacity .2s, background .2s; z-index: 3; }
.flip__p:hover .flip__zoom, .flip__zoom:focus-visible { opacity: 1; }
.flip__zoom:hover { background: var(--orange); }
.flip__bar, .flip__hint { display: none; }

.flip.is-ready .flip__bar { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; }
.flip.is-ready .flip__hint { display: block; text-align: center; color: var(--ink-soft); font-size: .92rem; margin: 10px 0 0; }
.flip:not(.is-ready) .flip__hint { display: block; text-align: center; margin-top: 18px; }
.flip:not(.is-ready) .flip__hint span, .flip:not(.is-ready) [data-flip-first] { display: none; }
.flip__btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--olive); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; transition: background .2s, transform .15s; }
.flip__btn:hover:not(:disabled) { background: var(--orange); transform: scale(1.06); }
.flip__btn:disabled { opacity: .3; cursor: default; }
.flip__count { font: 600 1rem var(--body); color: var(--olive); min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.flip__link { border: 0; background: none; color: var(--orange-dark); font: inherit; text-decoration: underline; cursor: pointer; padding: 4px 6px; }
.flip__hint--swipe { display: none; }

/* the open book (wide screens) */
.flip[data-mode="book"] .flip__book { display: block; position: relative; width: min(1120px, 100%, calc(84vh * var(--ratio, .69) * 2)); aspect-ratio: calc(var(--ratio, .69) * 2) / 1; margin: 0 auto; perspective: 2600px; transition: transform .6s ease; }
.flip[data-mode="book"] .flip__book:focus-visible { outline: 3px solid var(--focus, #1F5FBF); outline-offset: 10px; border-radius: 8px; }
.flip[data-mode="book"] .flip__book.is-closed { transform: translateX(-25%); }   /* the single first page sits in the middle */
.flip[data-mode="book"] .flip__book.is-ended { transform: translateX(25%); }
.flip__leaf { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.35,.1,.25,1); }
.flip__leaf.is-flipped { transform: rotateY(-180deg); }
.flip__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; overflow: hidden; cursor: pointer; box-shadow: 0 18px 40px -22px rgba(42,36,24,.6); }
.flip__face--front { border-radius: 2px 10px 10px 2px; }
.flip__face--back { transform: rotateY(180deg); border-radius: 10px 2px 2px 10px; }
.flip__face--front::after, .flip__face--back::after { content: ''; position: absolute; top: 0; bottom: 0; width: 5%; pointer-events: none; }
.flip__face--front::after { left: 0; background: linear-gradient(90deg, rgba(42,36,24,.12), rgba(42,36,24,0)); }
.flip__face--back::after { right: 0; background: linear-gradient(270deg, rgba(42,36,24,.12), rgba(42,36,24,0)); }
.flip__face.is-blank { background: var(--paper-2); cursor: default; display: grid; place-items: center; }
.flip__end { font: italic 600 1.4rem var(--display); color: var(--ink-soft); }
.flip[data-mode="book"] .flip__p { position: absolute; inset: 0; width: auto; height: auto; padding: 0; border-radius: 0; box-shadow: none; background: #fff; display: block; }
/* the whole picture always fits inside its page: nothing is cut off */
.flip[data-mode="book"] .flip__p img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; object-position: center; border-radius: 0; }
.flip[data-mode="book"] .flip__p figcaption { display: none; }

/* one page with swipe (phones) */
.flip[data-mode="swipe"] { padding: 0; }
.flip[data-mode="swipe"] .flip__book { display: block; }
.flip__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.flip__track::-webkit-scrollbar { display: none; }
.flip[data-mode="swipe"] .flip__p { flex: 0 0 100%; scroll-snap-align: center; width: 100%; padding: 0 12px; background: none; box-shadow: none; border-radius: 0; }
.flip[data-mode="swipe"] .flip__p img { max-height: 78vh; width: auto; height: auto; max-width: 100%; object-fit: contain; margin: 0 auto; border-radius: 8px; box-shadow: var(--sh-card); background: #fff; }
.flip[data-mode="swipe"] .flip__p figcaption { display: none; }
.flip[data-mode="swipe"] .flip__zoom { opacity: 1; right: 22px; top: 10px; }
.flip[data-mode="swipe"] .flip__hint--book { display: none; }
.flip[data-mode="swipe"] .flip__hint--swipe { display: inline; }
@media (prefers-reduced-motion: reduce) { .flip__leaf, .flip[data-mode="book"] .flip__book { transition: none; } }
@media print { .flip__bar, .flip__hint, .flip__zoom { display: none !important; } }
/* phones: the whole page always fits the screen width and height */
.flip[data-mode="swipe"] .flip__p { min-width: 0; box-sizing: border-box; display: grid; place-items: center; }
.flip[data-mode="swipe"] .flip__p img { max-width: min(100%, calc(100vw - 24px)); max-height: 78vh; }
