/* =============================================================
   Building walkthroughs — every case study with a 360° tour, one viewer
   templates/page-walkthroughs.php   Prefix: wt
   ============================================================= */

.wt {
    --wt-max: 1320px;
    --wt-gutter: clamp(1.25rem, 5vw, 3.5rem);
    --wt-overlap: clamp(4.5rem, 10vw, 8.5rem);
    --wt-ink: #171717;
    --wt-muted: #5c6055;
    --wt-line: rgba(23, 23, 23, 0.1);
    --wt-green: var(--sd-color-primary, #36452f);
    --wt-cta: var(--sd-color-cta, #5f7d3a);
    --wt-radius: 6px;
    --wt-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Hero (flat green, matches the nav + other heroes) ─────── */
/* Extra depth at the foot so the viewer can sit half on the green. */
.wt-hero {
    background: var(--wt-green);
    padding: clamp(6.5rem, 11vw, 9rem) var(--wt-gutter) calc(var(--wt-overlap) + clamp(2rem, 4vw, 3rem));
}

.wt-hero__inner {
    max-width: var(--wt-max);
    margin-inline: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem 3rem;
    flex-wrap: wrap;
}

.wt-hero__copy {
    flex: 1 1 36rem;
    max-width: 46rem;
}

.wt-hero__overline {
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--sd-color-cta-hover, #8db35a);
    margin-bottom: 1rem;
}

.wt-hero__title {
    font-size: clamp(2.25rem, 5vw, 4rem); /* unified hero title scale */
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

.wt-hero__intro {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 640px;
}

.wt-hero__intro p:last-child {
    margin-bottom: 0;
}

.wt-hero__count {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.3;
    max-width: 12rem;
}

.wt-hero__count-num {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--sd-color-cta-hover, #8db35a);
    font-variant-numeric: tabular-nums;
}

/* ── Stage ─────────────────────────────────────────────────── */
.wt-stage {
    max-width: calc(var(--wt-max) + 2 * var(--wt-gutter));
    margin: calc(-1 * var(--wt-overlap)) auto 0;
    padding-inline: var(--wt-gutter);
    position: relative;
    scroll-margin-top: calc(var(--sd-header-height-desktop, 88px) + 3.5rem); /* + the utility bar */
}

@media (max-width: 767px) {
    .wt-stage {
        scroll-margin-top: calc(var(--sd-header-height-mobile, 72px) + 0.75rem);
    }
}

.wt-slide + .wt-slide {
    margin-top: 3.5rem; /* no-JS: every walkthrough listed in turn */
}

.wt--js .wt-slide:not(.is-active) {
    display: none;
}

.wt--js .wt-slide + .wt-slide {
    margin-top: 0;
}

.wt--js .wt-slide.is-active {
    animation: wt-in 0.35s ease both;
}

@keyframes wt-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.wt-slide__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--wt-radius);
    background: #1e2619;
    box-shadow: 0 2.5rem 4rem -2.5rem rgba(20, 28, 16, 0.55), 0 0 0 1px rgba(23, 23, 23, 0.06);
    isolation: isolate;
}

.wt-slide__frame iframe {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 0;
}

.wt-slide__poster {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.001);
    transition: opacity 0.6s ease, visibility 0s linear 0.6s, transform 1.2s var(--wt-ease);
}

/* A soft floor of shade so the white controls read on any photo. */
.wt-slide__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, rgba(15, 20, 12, 0.28) 0%, rgba(15, 20, 12, 0) 60%),
        linear-gradient(to top, rgba(15, 20, 12, 0.35), rgba(15, 20, 12, 0) 45%);
    transition: opacity 0.4s ease;
}

.wt-slide__play {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.wt-slide__frame:hover .wt-slide__poster {
    transform: scale(1.025);
}

.wt-slide__play-disc {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(4.25rem, 8vw, 5.75rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    color: var(--wt-green);
    box-shadow: 0 0.75rem 2rem rgba(10, 14, 8, 0.35);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.3s var(--wt-ease);
}

.wt-slide__play-disc svg {
    width: 38%;
    height: auto;
    margin-left: 7%; /* optical centre of the triangle */
}

/* One slow ring outward, then a long rest: noticed, not nagging. */
.wt-slide__play-disc::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    animation: wt-ring 3.2s ease-out 1s infinite;
}

@keyframes wt-ring {
    0%       { transform: scale(1);   opacity: 0.9; }
    45%, 100% { transform: scale(1.6); opacity: 0; }
}

.wt-slide__play:hover .wt-slide__play-disc,
.wt-slide__play:focus-visible .wt-slide__play-disc {
    background: var(--wt-green);
    color: #fff;
    transform: scale(1.06);
}

.wt-slide__play:focus-visible {
    outline: none;
}

.wt-slide__play:focus-visible .wt-slide__play-disc {
    outline: 3px solid #fff;
    outline-offset: 5px;
}

.wt-slide__play-label {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: rgba(18, 24, 15, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.005em;
}

/* Loading: the photo stays up behind a spinner until the tour has drawn. */
.wt-slide__status {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.5rem;
    text-align: center;
    color: #fff;
    font-weight: 600;
    background: rgba(15, 20, 12, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.wt-slide__spinner {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: wt-spin 0.9s linear infinite;
}

@keyframes wt-spin {
    to { transform: rotate(360deg); }
}

.wt-slide__status-slow {
    display: none;
    max-width: 26rem;
    font-weight: 400;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.88);
}

.wt-slide__status-slow a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wt-slide.is-slow .wt-slide__status-slow {
    display: block;
}

.wt-slide.is-loading .wt-slide__play,
.wt-slide.is-live .wt-slide__play {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wt-slide.is-loading .wt-slide__status {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

.wt-slide.is-live .wt-slide__poster,
.wt-slide.is-live .wt-slide__frame::after {
    opacity: 0;
    visibility: hidden;
}

/* ── Caption bar under the viewer ──────────────────────────── */
.wt-slide__bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2.5rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
}

.wt-slide__info {
    flex: 1 1 28rem;
    min-width: 0;
}

.wt-slide__eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wt-cta);
}

.wt-slide__title {
    margin: 0;
    font-size: clamp(1.375rem, 2.4vw, 1.875rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--wt-ink);
    max-width: 44ch;
    text-wrap: balance;
}

.wt-slide__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
    color: var(--wt-muted);
    font-variant-numeric: tabular-nums;
}

.wt-slide__facts li + li::before {
    content: "·";
    margin: 0 0.6rem;
    color: rgba(23, 23, 23, 0.3);
}

.wt-slide__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem 1.5rem;
    flex-wrap: wrap;
}

.wt-slide__open {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--wt-green);
    text-decoration: underline;
    text-decoration-color: rgba(54, 69, 47, 0.35);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s ease;
}

.wt-slide__open:hover {
    color: var(--wt-green);
    text-decoration-color: currentColor;
}

.wt-slide__case {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.3rem;
    border-radius: 4px;
    background: var(--wt-green);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.wt-slide__case:hover {
    background: var(--sd-color-primary-dark, #2a3624);
    color: #fff;
}

.wt-slide__case svg {
    flex: none;
    transition: transform 0.28s var(--wt-ease);
}

.wt-slide__case:hover svg {
    transform: translateX(3px);
}

/* ── How to get around ─────────────────────────────────────── */
.wt-tips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 2rem;
    margin: 2rem 0 0;
    padding: 1.4rem 0 0;
    list-style: none;
    border-top: 1px solid var(--wt-line);
}

.wt-tips li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--wt-muted);
}

.wt-tips svg {
    flex: none;
    margin-top: 0.1rem;
    color: var(--wt-cta);
}

.wt-tips strong {
    display: block;
    color: var(--wt-ink);
    font-weight: 600;
}

/* ── Choose a building ─────────────────────────────────────── */
.wt-pick {
    max-width: calc(var(--wt-max) + 2 * var(--wt-gutter));
    margin: clamp(3.5rem, 7vw, 5.5rem) auto 0;
    padding-inline: var(--wt-gutter);
}

.wt-pick__head {
    margin-bottom: 1.75rem;
}

.wt-pick__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--wt-ink);
}

.wt-pick__lede {
    margin: 0;
    color: var(--wt-muted);
    font-size: 1.02rem;
}

.wt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
    gap: 2rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.wt-card__media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--wt-radius);
    background: #e9ece4;
    outline: 3px solid transparent;
    outline-offset: 3px;
    transition: outline-color 0.2s ease;
}

.wt-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--wt-ease);
}

.wt-card:hover .wt-card__img {
    transform: scale(1.04);
}

.wt-card__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
}

.wt-card__badge > span {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
}

.wt-card__badge-off {
    display: inline-block;
    background: rgba(18, 24, 15, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.wt-card__badge-on {
    display: none;
    background: var(--wt-cta);
}

.wt-card.is-active .wt-card__badge-on { display: inline-block; }
.wt-card.is-active .wt-card__badge-off { display: none; }

.wt-card.is-active .wt-card__media,
.wt-card:focus-visible .wt-card__media {
    outline-color: var(--wt-cta);
}

.wt-card:focus-visible {
    outline: none;
}

.wt-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-top: 0.95rem;
}

.wt-card__eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--wt-cta);
}

.wt-card__title {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--wt-ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wt-card:hover .wt-card__title {
    text-decoration: underline;
    text-decoration-color: rgba(23, 23, 23, 0.3);
    text-underline-offset: 3px;
}

.wt-card__facts {
    font-size: 0.875rem;
    color: var(--wt-muted);
    font-variant-numeric: tabular-nums;
}

.wt-body {
    max-width: calc(var(--wt-max) + 2 * var(--wt-gutter));
    margin: 3rem auto 0;
    padding-inline: var(--wt-gutter);
}

.wt-empty a {
    color: var(--wt-cta);
    text-decoration: underline;
}

.wt .sd-endcta {
    margin-top: clamp(3.5rem, 7vw, 6rem);
}

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 780px) {
    .wt-tips {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }
}

@media (max-width: 640px) {
    .wt {
        --wt-overlap: 3.5rem;
    }

    /* Taller than 16:9 so a phone shows more room, short enough to scroll past. */
    .wt-slide__frame {
        aspect-ratio: 4 / 3;
    }

    .wt-hero__count {
        max-width: none;
    }

    .wt-slide__actions {
        width: 100%;
    }

    .wt-slide__case {
        flex: 1 1 auto;
        justify-content: space-between;
    }

    /* The picker as compact rows: six full-width photos is a lot of thumb. */
    .wt-grid {
        gap: 1rem;
    }

    .wt-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .wt-card__media {
        flex: 0 0 40%;
        aspect-ratio: 4 / 3;
    }

    .wt-card__badge {
        top: 0.4rem;
        left: 0.4rem;
        font-size: 0.6875rem;
    }

    .wt-card__badge > span {
        padding: 0.3rem 0.5rem;
    }

    .wt-card__badge-off {
        display: none;
    }

    .wt-card__body {
        padding-top: 0;
        min-width: 0;
    }

    .wt-card__title {
        font-size: 0.98rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wt--js .wt-slide.is-active,
    .wt-slide__play-disc::before {
        animation: none;
    }

    .wt-slide__poster,
    .wt-card__img {
        transition: opacity 0.2s ease, visibility 0s linear 0.2s;
        transform: none !important;
    }
}
