@import "./section-common.css";

/* "Who we serve" — a ledger-style directory rather than the equal-card grid
   used elsewhere on the page. A tappable/hoverable row list drives a single
   large visual stage, so the section reads as one focused statement at a
   time instead of four competing tiles. The stage sits visually on the left
   (via `order`) while the list stays first in the DOM for reading order. */

.wws-directory {
    display: grid;
    grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
    gap: var(--sec-gap);
    align-items: stretch;
    margin-top: clamp(24px, 3vw, 40px);
}

/* --- row list ------------------------------------------------------------ */

.wws-list {
    order: 2;
    display: flex;
    flex-direction: column;
    border-top: var(--rule);
}

.wws-row {
    all: unset;
    box-sizing: border-box;
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 18px;
    align-items: start;
    column-gap: 24px;
    width: 100%;
    padding: 22px 20px 22px 16px;
    border-bottom: var(--rule);
    cursor: pointer;
}

.wws-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--brand-bright);
    transform: scaleY(0);
    transform-origin: 50% 50%;
    transition: transform 0.3s ease;
}

.wws-row.is-active::before {
    transform: scaleY(1);
}

.wws-row.is-active {
    background: var(--surface);
}

.wws-row-num {
    font-family: DM Sans;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--text-4);
    padding-top: 4px;
    transition: color 0.25s ease;
}

.wws-row.is-active .wws-row-num {
    color: var(--brand-bright);
}

.wws-row-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wws-row-title {
    font-family: DM Sans;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.25em;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-3);
    transition: color 0.25s ease;
}

.wws-row.is-active .wws-row-title {
    color: var(--text);
}

/* Grid-rows 0fr → 1fr accordion: animates height without a fixed guess and
   without measuring in JS. */
.wws-row-desc-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.wws-row.is-active .wws-row-desc-wrap {
    grid-template-rows: 1fr;
}

.wws-row-desc-inner {
    overflow: hidden;
}

.wws-row-desc {
    display: block;
    font-family: DM Sans;
    font-size: 15px;
    line-height: 1.5em;
    font-weight: 300;
    color: var(--text-3);
    max-width: 54ch;
    padding-top: 10px;
}

.wws-row-tag {
    justify-self: end;
    font-family: DM Sans;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-4);
    text-align: right;
    max-width: 20ch;
    padding-top: 6px;
    transition: color 0.25s ease;
}

.wws-row.is-active .wws-row-tag {
    color: var(--brand-bright);
}

.wws-row-arrow {
    display: grid;
    place-items: center;
    padding-top: 4px;
    color: var(--text-4);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.wws-row.is-active .wws-row-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--brand-bright);
}

/* --- visual stage ---------------------------------------------------------- */

.wws-stage {
    order: 1;
    position: relative;
    min-height: 370px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    background: var(--surface-3);
}

/* Faint technical grid + brand glow stand in for photography — keeps the
   panel feeling like instrument data rather than stock imagery. */
.wws-stage-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(120% 60% at 100% 0%, var(--brand-tint) 0%, transparent 60%),
        linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 40px,
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 40px 100%;
    -webkit-mask-image: radial-gradient(80% 80% at 50% 42%, #000 30%, transparent 78%);
    mask-image: radial-gradient(80% 80% at 50% 42%, #000 30%, transparent 78%);
}

.wws-stage-frame {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    padding-bottom: 64px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.wws-stage-frame.is-active {
    opacity: 1;
    transform: scale(1);
}

.wws-stage-art {
    width: min(58%, 220px);
    aspect-ratio: 1 / 1;
    filter: drop-shadow(0 12px 30px #00000059);
}

.wws-stage-caption {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 26px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wws-stage-tag {
    font-family: DM Sans;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--brand-bright);
}

.wws-stage-title {
    font-family: DM Sans;
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text);
}

.wws-stage-dots {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    display: flex;
    gap: 6px;
}

.wws-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: background 0.25s ease, transform 0.25s ease;
}

.wws-dot.is-active {
    background: var(--brand-bright);
    transform: scale(1.35);
}

@media (max-width: 992px) {
    .wws-directory {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .wws-stage {
        order: -1;
        min-height: 260px;
    }

    .wws-row {
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 16px;
        padding: 18px 4px;
    }

    .wws-row-tag,
    .wws-row-arrow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wws-stage-frame {
        transition: opacity 0.3s ease;
    }
}
