/* SWDS project story pages + render/reality slider. Uses theme tokens with fallbacks. */
.swds-story,
.swds-rr {
	--s-accent: var(--swds-accent, #CA8A04);
	--s-black: var(--swds-black, #171717);
	--s-surface: var(--swds-surface, #F2F0EC);
	--s-line: rgba(23, 23, 23, 0.1);
	--s-ease: cubic-bezier(.2, .7, .2, 1);
}
.swds-story__wrap { box-sizing: border-box; width: 100%; max-width: calc(var(--wp--style--global--content-size, 1180px) + 2 * var(--wp--style--root--padding-left, 1.25rem)); margin-inline: auto; padding-inline: var(--wp--style--root--padding-left, 1.25rem); }
.swds-story h2 { margin: 0 0 0.5em; }
.swds-story mark,
.swds-rr mark { background: none; color: inherit !important; font-style: normal; font-weight: inherit; }
.swds-story-hero mark,
.swds-story-compare mark,
.swds-story-cta mark,
.swds-rr mark { color: var(--s-accent) !important; }

/* Hero */
.swds-story-hero { position: relative; display: flex; align-items: flex-end; min-height: min(88vh, 860px); padding: 140px 0 clamp(3rem, 7vw, 5rem); overflow: hidden; background: var(--s-black); color: #fff; }
.swds-story-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.swds-story-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(23, 23, 23, 0.9) 0%, rgba(23, 23, 23, 0.35) 55%, rgba(23, 23, 23, 0.2) 100%); }
.swds-story-hero__inner { position: relative; z-index: 1; }
.swds-story-hero h1 { max-width: 14ch; margin: 0.4rem 0 0.6rem; color: #fff; font-size: clamp(2.8rem, 7vw, 5.75rem); }
.swds-story-hero .swds-lead { color: rgba(255, 255, 255, 0.82) !important; font-size: 1.125rem; }
.swds-story-hero .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.wp-site-blocks .swds-story-hero .swds-story-hero__img { animation: swds-zoomout 2.2s var(--s-ease) both; }

/* Facts strip */
.swds-story-facts { border-bottom: 1px solid var(--s-line); background: var(--swds-paper, #FAFAF9); }
.swds-story-facts dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-block: 0; padding-block: 1.6rem; }
.swds-story-facts dl > div { padding: 0.4rem 1.25rem; border-left: 1px solid var(--s-line); }
.swds-story-facts dl > div:first-child { padding-left: 0; border-left: 0; }
.swds-story-facts dt { color: var(--muted, #57534E); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.swds-story-facts dd { margin: 0.35rem 0 0; color: var(--s-black); font-family: var(--wp--preset--font-family--display, inherit); font-size: 1.25rem; font-weight: 500; }

/* Intro */
.swds-story-intro { padding-bottom: 0 !important; }
.swds-story-intro__text { max-width: 46rem; margin: 0; color: var(--s-black) !important; font-size: clamp(1.25rem, 2.2vw, 1.65rem); font-weight: 500; line-height: 1.5; }

/* Journey: sticky rail + stages */
.swds-journey { display: grid; grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.swds-journey__rail { position: sticky; top: 110px; }
.swds-journey__steps { position: relative; margin: 1.75rem 0 0; padding: 0 0 0 1.5rem; list-style: none; }
.swds-journey__steps::before,
.swds-journey__steps::after { content: ""; position: absolute; top: 0.35rem; bottom: 0.35rem; left: 0.3rem; width: 2px; border-radius: 2px; background: var(--s-line); }
.swds-journey__steps::after { bottom: auto; height: calc((100% - 0.7rem) * var(--progress, 0)); background: var(--s-accent); transition: height .25s linear; }
.swds-journey__steps li { margin: 0 0 0.35rem; }
.swds-journey__steps a { position: relative; display: flex; gap: 0.75rem; align-items: baseline; padding: 0.55rem 0.75rem; border-radius: 12px; color: rgba(23, 23, 23, 0.5); font-weight: 700; transition: color .3s, background-color .3s; }
.swds-journey__steps a::before { content: ""; position: absolute; top: 50%; left: -1.42rem; width: 12px; height: 12px; border: 2px solid var(--s-line); border-radius: 50%; background: #fff; transform: translateY(-50%); transition: border-color .3s, background-color .3s, transform .3s var(--s-ease); }
.swds-journey__steps a span { color: rgba(23, 23, 23, 0.35); font-size: 0.75rem; }
.swds-journey__steps a:hover { color: var(--s-black); }
.swds-journey__steps a.is-done::before { border-color: var(--s-accent); background: var(--s-accent); }
.swds-journey__steps a.is-active { background: #fff; color: var(--s-black); box-shadow: 0 10px 30px -18px rgba(23, 23, 23, 0.35); }
.swds-journey__steps a.is-active::before { border-color: var(--s-accent); background: var(--s-black); transform: translateY(-50%) scale(1.3); }
.swds-journey__steps a.is-active span { color: var(--swds-accent-ink); }
.swds-story-journey { background: var(--s-surface); }
.swds-journey__stages { display: grid; gap: clamp(4rem, 9vw, 7rem); }
.swds-stage { scroll-margin-top: 110px; }
.swds-stage__n { margin: 0 !important; color: var(--s-accent) !important; font-family: var(--wp--preset--font-family--display, inherit); font-size: 2.5rem; font-weight: 500; line-height: 1; }
.swds-stage h3 { margin: 0.35rem 0 0.4rem; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.swds-stage__note { max-width: 34rem; margin: 0 0 1.5rem !important; }
.swds-stage__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.swds-stage__grid.count-1 { grid-template-columns: 1fr; }
.swds-stage__grid > :first-child { grid-column: 1 / -1; }
.swds-stage__grid.count-2 > :first-child { grid-column: auto; }
.swds-shot-btn { position: relative; display: block; width: 100%; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 20px; background: #ddd; cursor: zoom-in; }
.swds-shot-btn img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .9s var(--s-ease); }
.swds-stage__grid > :first-child img { aspect-ratio: 16 / 9; }
.swds-stage__grid.count-2 > :first-child img { aspect-ratio: 4 / 3; }
.swds-shot-btn:hover img { transform: scale(1.04); }
.swds-shot-btn:focus-visible { outline: 3px solid var(--s-accent); outline-offset: 3px; }

/* Stage reveal: photos open like a curtain; floor plans get a blueprint sweep. */
.swds-story.is-motion .swds-stage .swds-shot-btn img { clip-path: inset(0 0 100% 0); transform: scale(1.15); transition: clip-path 1.3s cubic-bezier(.7, 0, .2, 1), transform 1.7s var(--s-ease); }
.swds-story.is-motion .swds-stage.is-in .swds-shot-btn img { clip-path: inset(0 0 0 0); transform: none; }
.swds-story.is-motion .swds-stage.is-in .swds-shot-btn:nth-child(2) img { transition-delay: .12s; }
.swds-story.is-motion .swds-stage.is-in .swds-shot-btn:nth-child(3) img { transition-delay: .24s; }
.swds-story.is-motion .swds-stage .swds-shot-btn.is-plan img { clip-path: inset(0 100% 0 0); transform: none; }
.swds-story.is-motion .swds-stage.is-in .swds-shot-btn.is-plan img { clip-path: inset(0 0 0 0); transition: clip-path 1.8s cubic-bezier(.65, 0, .25, 1); }
.swds-shot-btn.is-plan { background: #10263c linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 22px 22px, #10263c linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 22px 22px; }
.swds-shot-btn.is-plan::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--s-accent); box-shadow: 0 0 18px 4px rgba(202, 138, 4, 0.6); opacity: 0; pointer-events: none; }
.swds-story.is-motion .swds-stage.is-in .swds-shot-btn.is-plan::after { animation: swds-scan 1.8s cubic-bezier(.65, 0, .25, 1) both; }
@keyframes swds-scan { 0% { left: 0; opacity: 1; } 92% { opacity: 1; } 100% { left: calc(100% - 3px); opacity: 0; } }

/* Single-stage gallery */
.swds-story-gallery .swds-stage__grid { padding-block: 0; }

/* Render vs reality */
.swds-story-compare,
.swds-rr { background: var(--s-black); color: #fff; }
.swds-story-compare h2,
.swds-rr h2 { color: #fff; }
.swds-rr__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 3rem; margin-bottom: 2.5rem; }
.swds-rr__head p { max-width: 26rem; margin: 0; color: rgba(255, 255, 255, 0.65); }
.swds-rr__link { margin: 1.5rem 0 0; }
.swds-compare { position: relative; margin: 2rem 0 0; overflow: hidden; border-radius: var(--swds-radius, 6px); background: #222; aspect-ratio: 16 / 9; touch-action: pan-y; user-select: none; }
.swds-compare__layer { position: absolute; inset: 0; }
.swds-compare__layer img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.swds-compare__layer.is-photo { clip-path: inset(0 0 0 var(--pos)); }
.swds-compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: var(--s-accent); pointer-events: none; }
.swds-compare__handle::after {
	content: "‹ ›";
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--s-accent);
	color: var(--s-black);
	font-weight: 900;
	letter-spacing: 0.2em;
	box-shadow: 0 0 0 8px rgba(202, 138, 4, 0.25), 0 10px 30px rgba(0, 0, 0, 0.4);
	transform: translate(-50%, -50%);
}
.swds-compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.swds-compare__range:focus-visible ~ .swds-compare__handle::after,
.swds-compare:has(.swds-compare__range:focus-visible) .swds-compare__handle::after { outline: 3px solid #fff; outline-offset: 3px; }
.swds-compare__tag { position: absolute; top: 1rem; z-index: 1; padding: 0.4em 0.9em; border-radius: 999px; background: rgba(23, 23, 23, 0.7); color: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; pointer-events: none; }
.swds-compare__tag.is-render { left: 1rem; }
.swds-compare__tag.is-photo { right: 1rem; background: var(--s-accent); color: var(--s-black); }

/* Related */
.swds-story-related__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.swds-story-related__head h2 { margin: 0; }
.swds-story-link { color: var(--s-black); font-weight: 700; text-decoration: underline; text-decoration-color: var(--s-accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.swds-rr .swds-story-link,
.swds-story-compare .swds-story-link { color: #fff; }
.swds-story-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.swds-proj.is-linked { display: block; aspect-ratio: 4 / 3; }
.swds-proj.is-linked img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.swds-proj.is-linked .swds-proj__meta { display: grid; }
.swds-proj__title { color: #fff; font-family: var(--wp--preset--font-family--display, inherit); font-size: 1.25rem; font-weight: 500; }

/* CTA */
.swds-story-cta { background: var(--s-black); color: #fff; text-align: center; }
.swds-story-cta h2 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.75rem); }
.swds-story-cta p { max-width: 34rem; margin: 0 auto; color: rgba(255, 255, 255, 0.65) !important; }
.swds-story-cta .wp-block-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }

/* Next project: the whole banner is the link */
.swds-next { position: relative; display: flex; align-items: flex-end; min-height: clamp(320px, 52vh, 560px); padding-block: clamp(2.5rem, 5vw, 4rem); overflow: hidden; background: var(--s-black); color: #fff; text-decoration: none; }
.swds-next__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; transform: scale(1.04); transition: transform 1.2s var(--s-ease), opacity .6s; }
.swds-next:hover .swds-next__img,
.swds-next:focus-visible .swds-next__img { opacity: 0.7; transform: none; }
.swds-next__inner { position: relative; z-index: 1; display: grid; gap: 0.5rem; }
.swds-next__label { display: flex; align-items: center; gap: 0.85em; color: rgba(255, 255, 255, 0.82); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.swds-next__label::before { content: ""; width: 28px; height: 1px; background: var(--s-accent); }
.swds-next__title { font-family: var(--wp--preset--font-family--display, serif); font-size: clamp(2.5rem, 7vw, 6rem); line-height: 1; letter-spacing: -0.03em; }
.swds-next__title::after { content: " \2197"; color: var(--s-accent); font-size: 0.5em; vertical-align: 0.4em; transition: margin .4s var(--s-ease); }
.swds-next:hover .swds-next__title::after { margin-left: 0.25em; }
.swds-next__meta { color: rgba(255, 255, 255, 0.72); font-size: 0.9375rem; }
.swds-next:focus-visible { outline: 2px solid var(--s-accent); outline-offset: -6px; }

/* Lightbox */
.swds-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 4rem 4.5rem; background: rgba(8, 9, 7, 0.94); animation: swds-lb-in .3s ease both; }
.swds-lightbox[hidden] { display: none; }
.swds-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: swds-lb-img .45s var(--s-ease, ease) both; }
.swds-lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer; transition: background-color .2s, color .2s; }
.swds-lightbox button:hover,
.swds-lightbox button:focus-visible { background: #CA8A04; color: #171717; }
.swds-lightbox__close { top: 1.25rem; right: 1.25rem; }
.swds-lightbox__prev { top: 50%; left: 1rem; transform: translateY(-50%); }
.swds-lightbox__next { top: 50%; right: 1rem; transform: translateY(-50%); }
.swds-lightbox__count { position: absolute; bottom: 1.25rem; left: 50%; margin: 0; color: rgba(255, 255, 255, 0.7); font-size: 0.875rem; transform: translateX(-50%); }
@keyframes swds-lb-in { from { opacity: 0; } }
@keyframes swds-lb-img { from { opacity: 0; transform: scale(.96); } }

@media (max-width: 900px) {
	.swds-journey { grid-template-columns: 1fr; }
	.swds-journey__rail { position: static; }
	.swds-journey__steps { display: none; }
	.swds-story-related__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.swds-stage__grid,
	.swds-stage__grid.count-2 { grid-template-columns: 1fr; }
	.swds-story-related__grid { grid-template-columns: 1fr; }
	.swds-story-facts dl > div { padding-left: 0; border-left: 0; }
	.swds-compare { aspect-ratio: 4 / 3; }
	.swds-lightbox { padding: 4rem 0.75rem; }
	.swds-lightbox__prev,
	.swds-lightbox__next { top: auto; bottom: 1rem; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.swds-story *,
	.swds-rr *,
	.swds-lightbox,
	.swds-lightbox img { animation: none !important; transition: none !important; }
}

/* Link from a project to the service it used. */
.swds-story-service { margin-block: 1.5rem 0; font-family: var(--wp--preset--font-family--mono); font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; }
.swds-story-service a { color: inherit; text-decoration-color: var(--wp--preset--color--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
