/* Studio Stour: story pages (includes/story.php). Tokens and devices in site.css; strip and links in inner.css. */

/* ---------- opener: the title on the drafting sheet, the cover opening to full width below it ---------- */
.story-open { position: relative; padding: calc(var(--header-h) + clamp(28px, 5vh, 56px)) 0 clamp(36px, 5.5vh, 64px); overflow: clip; }
.story-open__grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 21vw, 300px); gap: clamp(28px, 5vw, 88px); align-items: end; }
.story-open__back { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: .95rem; }
.story-open__back span { color: var(--ochre-ink); }
.story-open__back .text-link { font-weight: 600; }
.story-open__title { font-size: clamp(2.3rem, 4.4vw, 4.4rem); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 .32em; }
.story-open__lede { font-size: clamp(1.08rem, 1.3vw, 1.22rem); line-height: 1.6; color: var(--ink-2); margin: 0; }
.story-open__tb { margin: 0; border: 1px solid var(--stour); border-radius: var(--r); background: var(--white); color: var(--stour); font-size: .95rem; line-height: 1.3; box-shadow: 0 30px 50px -40px rgba(19, 36, 31, .55); }
.story-open__tb > div { padding: 10px 16px; border-top: 1px solid var(--rule); }
.story-open__tb > div:first-child { border-top: 0; }
.story-open__tb dt { font-weight: 650; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.story-open__tb dd { margin: 0; font-weight: 600; color: var(--ink); }
.story-open__tb-firm { background: var(--stour); }
.story-open__tb-firm dt { font-family: var(--display); font-size: 1.12rem; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--on-dark); }
.story-open__tb-firm dd { color: var(--ochre-soft); font-weight: 650; font-variant-numeric: tabular-nums; }

/* the cover: a full-bleed figure clipped to the container, opened to the screen edges by the scroll */
.story-cover { --inset: max(var(--gut), calc((100vw - var(--max)) / 2)); margin: 0 0 clamp(48px, 6vw, 88px); position: relative;
  clip-path: inset(0 var(--inset) 0 var(--inset) round var(--r)); }
.story-cover__media { position: relative; height: min(calc(100vw * .5), 78vh, 820px); min-height: 300px; overflow: hidden; background: var(--paper); cursor: crosshair; }
.story-cover__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-cover__photo { --bloom: 160%; -webkit-mask-image: radial-gradient(circle at 42% 58%, #000 var(--bloom), transparent calc(var(--bloom) + 14%)); mask-image: radial-gradient(circle at 42% 58%, #000 var(--bloom), transparent calc(var(--bloom) + 14%)); }
.story-cover__lens { z-index: 1; pointer-events: none; -webkit-mask-image: radial-gradient(circle at var(--x, 50%) var(--y, 50%), #000 var(--lr, 0px), transparent calc(var(--lr, 0px) + 1.5px)); mask-image: radial-gradient(circle at var(--x, 50%) var(--y, 50%), #000 var(--lr, 0px), transparent calc(var(--lr, 0px) + 1.5px)); }
.story-cover .corner-marks { inset: 14px calc(var(--inset) + 14px); }
.story-cover__media > img { animation: kb-drift 16s ease-in-out infinite alternate; }
.js:not(.reduced):not(.no-anim) .story-cover__photo { --bloom: 0%; }
.js:not(.reduced):not(.no-anim) .story-open__tb > div { opacity: 0; }
.no-js .story-cover__lens, .no-anim .story-cover__lens, .reduced .story-cover__lens { display: none; }
.reduced .story-cover__media > img { animation: none; }
@media (prefers-reduced-motion: reduce) { .story-cover__media > img { animation: none; } }
@media (max-width: 900px) {
  .story-open__grid { grid-template-columns: 1fr; gap: 22px; }
  .story-open__tb { display: grid; grid-template-columns: 1fr 1fr; }
  .story-open__tb > div:nth-child(2) { border-top: 0; }
  .story-open__tb-firm { grid-column: 1 / -1; }
  .story-open__tb > div:nth-child(2n+1):not(:first-child) { border-left: 1px solid var(--rule); }
  .story-cover__media { height: min(68vw, 56vh); }
}

/* ---------- body: a sticky rail beside the long-form text ---------- */
.story-body { padding-top: 0; }
.story-body__grid { display: grid; grid-template-columns: clamp(250px, 23vw, 320px) minmax(0, 1fr); gap: clamp(36px, 5.5vw, 96px); align-items: start; }
/* the rail itself sticks (its grid area is the text's row), so it stays as short as its content */
.story-rail { position: sticky; top: 104px; }
.story-rail__inner { display: grid; gap: 24px; padding-top: 6px; }
.story-rail__k { margin: 0 0 10px; font-weight: 700; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ochre-ink); }
.story-rail__sheet { display: grid; gap: 12px; padding: 8px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 26px 44px -36px rgba(19, 36, 31, .6); }
.story-rail__thumb { aspect-ratio: 2 / 1; position: relative; border-radius: 2px; background: var(--paper); }
.story-rail__thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kb-drift 12s ease-in-out infinite alternate; }
.story-rail__photo { -webkit-mask-image: radial-gradient(circle at 30% 70%, #000 calc(var(--p, 1) * 125%), transparent calc(var(--p, 1) * 125% + 12%)); mask-image: radial-gradient(circle at 30% 70%, #000 calc(var(--p, 1) * 125%), transparent calc(var(--p, 1) * 125% + 12%)); }
.js:not(.reduced):not(.no-anim) .story-rail__photo { --p: 0; }
.reduced .story-rail__thumb > img { animation: none; }
.story-rail__thumb .corner-marks { inset: 6px; }
.story-rail__meter { display: flex; align-items: center; gap: 12px; padding: 0 6px 4px; }
.story-rail__meter .story-rail__k { margin: 0; }
.story-rail__bar { flex: 1; height: 13px; position: relative; color: var(--ochre); background: linear-gradient(var(--rule), var(--rule)) 0 6px / 100% 1px no-repeat; }
.story-rail__bar::before, .story-rail__bar::after { content: ''; position: absolute; top: 0; width: 1px; height: 13px; background: currentColor; }
.story-rail__bar::before { left: 0; } .story-rail__bar::after { right: 0; opacity: .45; }
.story-rail__bar i { position: absolute; left: 0; right: 0; top: 5px; height: 3px; background: currentColor; transform-origin: left; transform: scaleX(var(--p, 0)); }
.story-rail__meter b { font-weight: 650; font-size: .92rem; font-variant-numeric: tabular-nums; color: var(--stour); min-width: 3.2em; text-align: right; }
.story-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.story-toc li { border-bottom: 1px solid var(--rule); }
.story-toc a { display: grid; grid-template-columns: 2.2em 1fr; gap: 6px; padding: 11px 0; min-height: 44px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .96rem; line-height: 1.35; transition: color .35s var(--ease), transform .45s var(--ease); }
.story-toc a span { font-family: var(--display); font-style: italic; color: var(--ochre-ink); font-weight: 500; }
.story-toc a:hover, .story-toc a.is-on { color: var(--stour); transform: translateX(6px); }
.story-toc a.is-on span { color: var(--stour); }
.story-rail__card { padding: 20px 20px 22px; border-radius: var(--r); background: var(--meadow) url('../img/river-ink-faint.svg'); background-size: 320px 96px; border-left: 2px solid var(--stour); }
.story-rail__card-t { font-family: var(--display); font-size: 1.3rem; line-height: 1.2; color: var(--stour); margin: 0 0 8px; font-weight: 560; }
.story-rail__card p { font-size: .98rem; color: var(--ink-2); }
.story-rail__card .btn { margin-top: 14px; min-height: 48px; padding: 0 18px; font-size: .92rem; }

.story-text { min-width: 0; font-size: 1.14rem; line-height: 1.75; color: var(--ink); }
.story-text > p, .story-text > .story-list, .story-text > h2, .story-text > h3, .story-text > .story-sign { max-width: 120ch; }
.story-text > p { margin: 0 0 1.15em; }
.story-text > p:first-child::first-letter { font-family: var(--display); float: left; font-size: 3.6em; line-height: .84; padding: .06em .1em 0 0; color: var(--stour); font-weight: 560; }
.story-link { color: var(--stour); font-weight: 600; text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 1px; text-underline-offset: .22em; transition: color .3s, text-decoration-color .3s; }
.story-link:hover { color: var(--ochre-ink); text-decoration-color: currentColor; }
.story-h2 { font-size: clamp(1.75rem, 2.5vw, 2.45rem); line-height: 1.12; margin: 1.6em 0 0; scroll-margin-top: 120px; }
.story-text > .story-h2:first-child { margin-top: 0; }
.story-text .dim { max-width: 220px; margin: 14px 0 26px; }
.story-h3 { font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.2; margin: 1.5em 0 .5em; }
.story-quote { position: relative; margin: 1.6em 0 1.8em; padding: 6px 0 6px clamp(28px, 3vw, 48px); }
.story-quote p { font-family: var(--display); font-style: italic; font-weight: 480; font-size: clamp(1.55rem, 2.5vw, 2.35rem); line-height: 1.24; color: var(--stour); margin: 0; text-wrap: balance; }
.story-quote__by { margin-top: .9em; font-size: 1rem; font-weight: 600; color: var(--ink, inherit); }
.story-quote__stroke { position: absolute; left: 0; top: 0; width: 18px; height: 100%; overflow: visible; }
.story-quote__stroke path { fill: none; stroke: var(--ochre); stroke-width: 2.4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.story-quote .qw { transition: none; }
.story-list { margin: 0 0 1.4em; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.story-list li { position: relative; padding: 12px 0 12px 34px; border-bottom: 1px solid var(--rule); line-height: 1.55; }
.story-list li::before { content: ''; position: absolute; left: 4px; top: 1.32em; width: 16px; height: 1px; background: var(--ochre); transform-origin: left; transform: scaleX(var(--t, 1)); }
.story-list li::after { content: ''; position: absolute; left: 20px; top: calc(1.32em - 4px); width: 1px; height: 9px; background: var(--ochre); opacity: var(--t, 1); }

/* photos: framed, sized from the screen height, pairs side by side */
.story-fig { margin: 2em 0 2.2em; width: min(100%, calc(var(--media-cap) * var(--r, 1.5))); }
.story-fig__frame { aspect-ratio: var(--r, 1.5); width: 100%; }
.story-fig figcaption { margin-top: 12px; font-size: .95rem; color: var(--ink-2); line-height: 1.45; padding-left: 14px; border-left: 1px solid var(--ochre); }
.story-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); margin: 2em 0 2.2em; align-items: start; }
.story-pair .story-fig { margin: 0; width: 100%; }
.story-pair .story-fig__frame { max-height: var(--media-cap); }
.story-pair .story-fig:nth-child(2) { margin-top: clamp(24px, 5vw, 72px); }
.story-card-link { display: grid; gap: 2px; margin: 1.4em 0 1.8em; padding: 18px 64px 18px 22px; border: 1px solid var(--stour); border-radius: var(--r); text-decoration: none; color: var(--stour); position: relative; background: var(--paper); max-width: 640px; transition: background .4s var(--ease), color .4s var(--ease); }
.story-card-link::after { content: ''; position: absolute; right: 22px; top: 50%; width: 20px; height: 12px; margin-top: -6px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .45s var(--ease); }
.story-card-link:hover { background: var(--stour); color: var(--on-dark); }
.story-card-link:hover::after { transform: translateX(5px); }
.story-card-link__label { font-family: var(--display); font-size: 1.25rem; line-height: 1.25; font-weight: 560; }
.story-card-link__host { font-size: .92rem; font-weight: 600; opacity: .75; }
.story-sign { font-family: var(--display); font-style: italic; font-size: 1.5rem; line-height: 1.3; color: var(--stour); margin: 1.2em 0 0; }
.story-end { display: flex; align-items: center; gap: 16px; margin-top: 2.6em; padding-top: 22px; border-top: 1px solid var(--stour); font-size: .98rem; color: var(--ink-2); }
.story-end p { margin: 0; }
@media (max-width: 980px) {
  .story-body__grid { grid-template-columns: 1fr; }
  .story-rail { order: 2; position: static; }
  .story-rail { display: none; }
}
@media (max-width: 640px) {
  .story-open__tb-firm, .story-open__tb > div:last-child { display: none; }
  .story-open__tb > div:nth-child(2), .story-open__tb > div:nth-child(3) { border-top: 0; }
  .story-open__tb > div:nth-child(4) { border-left: 0; }
  .story-open__tb > div:nth-child(4) { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
  .story-open__title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .story-open__back { margin-bottom: 12px; }
  .story-text { font-size: 1.08rem; }
  .story-pair { grid-template-columns: 1fr; }
  .story-pair .story-fig:nth-child(2) { margin-top: 0; }
}

/* ---------- reading line under the header: a dimension line that fills ---------- */
.read-line { position: fixed; left: 0; right: 0; top: 78px; height: 13px; z-index: 89; pointer-events: none; color: var(--ochre); opacity: 0; transition: opacity .4s var(--ease); }
.read-line.is-on { opacity: 1; }
.read-line span { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: currentColor; transform-origin: left; transform: scaleX(var(--p, 0)); }
.read-line i { position: absolute; top: 0; width: 1px; height: 9px; background: currentColor; }
.read-line i:first-child { left: 0; }
.read-line i:nth-child(2) { left: calc(var(--p, 0) * 100% - 1px); }
@media (max-width: 640px) { .read-line { top: 68px; } }
.no-js .read-line, .reduced .read-line { display: none; }

/* ---------- photo strip ---------- */
.story-strip { position: relative; padding: clamp(64px, 7vw, 104px) 0 clamp(48px, 5vw, 72px); overflow: clip; }
.story-strip__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 40px); }
.story-strip__head h2 { margin: 0; }

/* ---------- more stories ---------- */
.more-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 36px); }
.more-card { display: grid; gap: 10px; text-decoration: none; color: var(--ink); }
.more-card__img { display: block; aspect-ratio: 3 / 2; position: relative; margin-bottom: 8px; box-shadow: 0 26px 40px -34px rgba(19, 36, 31, .7); }
.more-card__img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.more-card__photo { clip-path: inset(0 0 0 0); transition: clip-path .9s var(--ease), scale 1.2s var(--ease); }
.more-card:hover .more-card__photo, .more-card:focus-visible .more-card__photo { clip-path: inset(0 0 0 100%); }
.more-card:hover .more-card__drawing, .more-card:focus-visible .more-card__drawing { scale: 1.04; }
.more-card__drawing { transition: scale 1.2s var(--ease); }
.more-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 650; font-size: .86rem; color: var(--ochre-ink); }
.more-card__meta span::before { content: ''; display: inline-block; width: 10px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 10px; }
.more-card__title { font-family: var(--display); font-size: clamp(1.3rem, 1.6vw, 1.6rem); line-height: 1.2; font-weight: 560; color: var(--stour); transition: color .3s; }
.more-card:hover .more-card__title { color: var(--ochre-ink); }
.more-card__ex { font-size: 1rem; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 900px) { .more-cards { grid-template-columns: 1fr; } .more-card__img { aspect-ratio: 2 / 1; } }

/* ---------- call to action on a photo band ---------- */
.story-cta { overflow: clip; }
.story-cta .photo-band img { animation: band-breathe 20s ease-in-out infinite alternate; }
.reduced .story-cta .photo-band img { animation: none; }
@media (prefers-reduced-motion: reduce) { .story-cta .photo-band img { animation: none; } }
.story-cta .photo-band::after { background: linear-gradient(90deg, rgba(19, 36, 31, .9), rgba(19, 36, 31, .7) 55%, rgba(19, 36, 31, .84)); }
.story-cta__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.story-cta__copy .btns { margin-top: 26px; }
.story-cta__nav { display: grid; border-top: 1px solid var(--rule-dark); }
.story-step { display: grid; gap: 4px; padding: 18px 46px 18px 0; border-bottom: 1px solid var(--rule-dark); text-decoration: none; color: var(--on-dark); position: relative; }
.story-step::after { content: ''; position: absolute; right: 4px; top: 50%; width: 20px; height: 12px; margin-top: -6px; background: var(--ochre);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .45s var(--ease); }
.story-step:hover::after, .story-step:focus-visible::after { transform: translateX(6px); }
.story-step__k { font-weight: 700; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ochre); }
.story-step__t { font-family: var(--display); font-size: clamp(1.15rem, 1.4vw, 1.35rem); line-height: 1.25; transition: color .3s; }
.story-step:hover .story-step__t { color: var(--ochre-soft); }
@media (max-width: 900px) { .story-cta__grid { grid-template-columns: 1fr; } }
