/* Three-Act Stage — Performance Chooser */

.three-act-stage {
    --cj-bg: #FCF5E9;
    --cj-surface: #FFFFFF;
    --cj-text: #2C2321;
    --cj-muted: #8C7E76;
    --cj-border: #E8E0D8;
    --cj-accent: #A89080;

    --cj-songs: #B5646A;
    --cj-songs-tint: #F5E3E4;
    --cj-songs-dk: #9A5258;

    --cj-truth: #8FA68A;
    --cj-truth-tint: #E5ECE3;
    --cj-truth-dk: #7A9175;

    --cj-plays: #A89080;
    --cj-plays-tint: #EFE8E1;
    --cj-plays-dk: #968070;

    background: var(--cj-bg);
    border-radius: 10px;
    padding: 40px 36px 44px;
    font-family: var(--font-body, 'Nunito', system-ui, sans-serif);
}

/* ─── Header ─── */

.tas-header {
    text-align: center;
    margin-bottom: 12px;
}

.tas-header__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cj-muted);
    margin: 0 0 10px;
}

.tas-header__headline {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 36px;
    font-weight: 600;
    color: var(--cj-text);
    margin: 0 0 10px;
    line-height: 1.15;
}

.tas-header__lede {
    color: var(--cj-muted);
    font-size: 15px;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── Stage container ─── */

.tas-stage {
    position: relative;
    margin-top: 28px;
}

/* ─── Panels (tablist) ─── */

.tas-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--cj-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--cj-surface);
    box-shadow: 0 4px 24px rgba(44, 35, 33, 0.06);
}

.tas-panel {
    position: relative;
    border: none;
    background: var(--cj-surface);
    padding: 32px 22px 28px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    transition: background 0.25s, opacity 0.25s;
}

.tas-panel:not(:first-child) {
    border-left: 1px solid var(--cj-border);
}

.tas-panel:hover,
.tas-panel:focus-visible {
    background: var(--cj-surface);
}

.tas-panel[data-category="songs"]:hover,
.tas-panel[data-category="songs"]:focus-visible,
.tas-panel[data-category="songs"][aria-selected="true"] {
    background: var(--cj-songs-tint);
}

.tas-panel[data-category="truth"]:hover,
.tas-panel[data-category="truth"]:focus-visible,
.tas-panel[data-category="truth"][aria-selected="true"] {
    background: var(--cj-truth-tint);
}

.tas-panel[data-category="plays"]:hover,
.tas-panel[data-category="plays"]:focus-visible,
.tas-panel[data-category="plays"][aria-selected="true"] {
    background: var(--cj-plays-tint);
}

/* Dim inactive panels when one is active */
.tas-panels.has-active .tas-panel:not([aria-selected="true"]) {
    opacity: 0.55;
}

.tas-panel:focus-visible {
    outline: 2px solid var(--cj-accent);
    outline-offset: -2px;
    z-index: 1;
}

/* ─── Panel image ─── */

.tas-panel__image {
    height: 140px;
    margin: 0 -4px 18px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--cj-border);
}

.tas-panel__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tas-panel[data-category="songs"] .tas-panel__image img { object-position: 50% 40%; }
.tas-panel[data-category="truth"] .tas-panel__image img { object-position: 60% 35%; }
.tas-panel[data-category="plays"] .tas-panel__image img { object-position: 50% 40%; }

/* ─── Panel text ─── */

.tas-panel__title {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--cj-text);
    margin: 0 0 6px;
    line-height: 1.15;
}

.tas-panel__desc {
    font-size: 13.5px;
    color: var(--cj-muted);
    margin: 0 0 14px;
    font-style: italic;
    line-height: 1.5;
}

/* ─── Panel CTA affordance ─── */

.tas-panel__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.tas-panel[data-category="songs"] .tas-panel__cta { color: var(--cj-songs); }
.tas-panel[data-category="truth"] .tas-panel__cta { color: var(--cj-truth); }
.tas-panel[data-category="plays"] .tas-panel__cta { color: var(--cj-plays); }

.tas-panel__cta-text {
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 2px;
    transition: letter-spacing 0.2s;
    letter-spacing: 0.4px;
}

.tas-panel:hover .tas-panel__cta-text,
.tas-panel[aria-selected="true"] .tas-panel__cta-text {
    letter-spacing: 1.2px;
}

.tas-panel[aria-selected="true"] .tas-panel__cta-text::after {
    content: none;
}

.tas-panel__cta-arrow {
    display: inline-block;
    transition: transform 0.2s;
    transform: translateX(0);
}

.tas-panel:hover .tas-panel__cta-arrow,
.tas-panel[aria-selected="true"] .tas-panel__cta-arrow {
    transform: translateX(4px);
}

/* ─── Panel stats ─── */

.tas-panel__stats {
    display: flex;
    gap: 18px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px dashed var(--cj-border);
}

.tas-panel__stat-num {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    display: block;
}

.tas-panel[data-category="songs"] .tas-panel__stat-num { color: var(--cj-songs); }
.tas-panel[data-category="truth"] .tas-panel__stat-num { color: var(--cj-truth); }
.tas-panel[data-category="plays"] .tas-panel__stat-num { color: var(--cj-plays); }

.tas-panel__stat-label {
    font-size: 10px;
    color: var(--cj-muted);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 3px;
    display: block;
}

/* ─── Stage floor ─── */

.tas-floor {
    margin: 0 20px;
}

.tas-floor__bar {
    height: 4px;
    background: linear-gradient(to right, var(--cj-songs), var(--cj-truth), var(--cj-plays));
    border-radius: 2px;
    opacity: 0.85;
}

.tas-floor__shadow {
    height: 14px;
    background: linear-gradient(to bottom, rgba(168, 144, 128, 0.13), transparent);
    margin: 0 20px;
}

/* ─── Drill-in tray ─── */

.tas-tray {
    margin-top: 8px;
    background: var(--cj-surface);
    border-radius: 12px;
    border: 1px solid var(--cj-border);
    padding: 24px 32px 26px;
    animation: tas-tray-in 0.3s ease;
}

.tas-tray[hidden] {
    display: none;
}

.tas-tray[data-category="songs"] { border-top: 3px solid var(--cj-songs); }
.tas-tray[data-category="truth"] { border-top: 3px solid var(--cj-truth); }
.tas-tray[data-category="plays"] { border-top: 3px solid var(--cj-plays); }

@keyframes tas-tray-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Tray header ─── */

.tas-tray__head {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.tas-tray__head-text {
    flex: 1;
}

.tas-tray__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.tas-tray[data-category="songs"] .tas-tray__eyebrow { color: var(--cj-songs); }
.tas-tray[data-category="truth"] .tas-tray__eyebrow { color: var(--cj-truth); }
.tas-tray[data-category="plays"] .tas-tray__eyebrow { color: var(--cj-plays); }

.tas-tray__blurb {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-style: italic;
    font-size: 17px;
    line-height: 1.55;
    color: var(--cj-text);
    margin: 0;
    max-width: 560px;
}

.tas-tray__close {
    border: none;
    background: transparent;
    color: var(--cj-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
    white-space: nowrap;
    border-radius: 4px;
    transition: background 0.15s;
}

.tas-tray__close:hover {
    background: var(--cj-border);
}

.tas-tray__close:focus-visible {
    outline: 2px solid var(--cj-accent);
    outline-offset: 2px;
}

/* ─── Tray grid (post cards) ─── */

.tas-tray__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
}

.tas-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--cj-border);
    text-decoration: none;
    color: var(--cj-text);
    font-size: 15px;
    transition: color 0.15s;
    gap: 16px;
}

.tas-card:hover {
    text-decoration: none;
}

.tas-tray[data-category="songs"] .tas-card:hover { color: var(--cj-songs); }
.tas-tray[data-category="truth"] .tas-card:hover { color: var(--cj-truth); }
.tas-tray[data-category="plays"] .tas-card:hover { color: var(--cj-plays); }

.tas-card__title {
    font-weight: 500;
}

.tas-card__tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tas-card__tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--cj-bg);
    color: var(--cj-muted);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* ─── Tray empty state ─── */

.tas-tray__empty {
    font-style: italic;
    color: var(--cj-muted);
    font-size: 15px;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

/* ─── Tray footer ─── */

.tas-tray__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 16px;
    flex-wrap: wrap;
}

.tas-tray__meta {
    font-size: 13px;
    color: var(--cj-muted);
    margin: 0;
}

.tas-tray__browse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
}

.tas-tray__browse svg {
    flex-shrink: 0;
}

.tas-tray[data-category="songs"] .tas-tray__browse {
    background: var(--cj-songs);
}
.tas-tray[data-category="songs"] .tas-tray__browse:hover {
    background: var(--cj-songs-dk);
}

.tas-tray[data-category="truth"] .tas-tray__browse {
    background: var(--cj-truth);
}
.tas-tray[data-category="truth"] .tas-tray__browse:hover {
    background: var(--cj-truth-dk);
}

.tas-tray[data-category="plays"] .tas-tray__browse {
    background: var(--cj-plays);
}
.tas-tray[data-category="plays"] .tas-tray__browse:hover {
    background: var(--cj-plays-dk);
}

.tas-tray__browse:focus-visible {
    outline: 2px solid var(--cj-accent);
    outline-offset: 2px;
}

/* ─── Responsive ─── */

@media (max-width: 720px) {
    .three-act-stage {
        padding: 24px 18px 32px;
    }

    .tas-header__headline {
        font-size: 26px;
    }

    .tas-header__lede {
        font-size: 14px;
    }

    .tas-panels {
        grid-template-columns: 1fr;
        border-radius: 12px;
    }

    .tas-panel {
        min-height: auto;
        padding: 24px 20px;
    }

    .tas-panel:not(:first-child) {
        border-left: none;
        border-top: 1px solid var(--cj-border);
    }

    .tas-panel__image {
        height: 100px;
    }

    .tas-panel__title {
        font-size: 22px;
    }

    .tas-floor {
        opacity: 0;
        height: 0;
        margin: 0;
    }

    .tas-tray {
        padding: 18px 18px 20px;
    }

    .tas-tray__head {
        flex-direction: column;
        gap: 12px;
    }

    .tas-tray__grid {
        grid-template-columns: 1fr;
    }

    .tas-tray__foot {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .tas-tray__browse {
        justify-content: center;
    }
}
