/* =========================================================
   Fairness Warps Geometry — project.css
   Inherits variables from ../styles.css
   ========================================================= */


/* ---------------- Sidebar ---------------- */

.sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    align-self: flex-start;
}


/* ---------------- Main Project Layout ---------------- */

.project-container {
    position: relative;
    max-width: 1200px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;

    align-items: flex-start;
}


/* ---------------- Visualization Container ---------------- */

#vis-container {
    position: sticky;
    top: 2rem;

    height: 520px;
    /* CRITICAL: explicit height */
    max-height: 80vh;

    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;

    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}


/* ---------------- Controls ---------------- */

#controls {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;

    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

#controls label {
    font-size: 0.85rem;
    color: var(--text);
}

#fairness-slider {
    width: 100%;
    cursor: pointer;
}


/* ---------------- Canvas / SVG ---------------- */

#canvas-container {
    width: 100%;
    height: 360px;
    /* CRITICAL: explicit height */
    position: relative;
    overflow: hidden;
}

#canvas-container svg {
    width: 100%;
    height: 100%;
    display: block;
}


/* ---------------- Legend ---------------- */

#legend {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;

    display: flex;
    gap: 1rem;
    align-items: center;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.group-a {
    background-color: #4a90e2;
    /* blue */
}

.group-b {
    background-color: #f5a623;
    /* orange */
}


/* ---------------- Scrollytelling Sections ---------------- */

.scroll-sections {
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.step {
    min-height: 40vh;
    /* Reduced from 80vh */
    padding: 1rem 0;
    margin: 3rem 0;

    background: transparent;
    border: none;
    box-shadow: none;

    max-width: 100%;
    pointer-events: auto;

    opacity: 1;
    transition: opacity 0.3s;
}

/* Act 1 needs more breathing room per user request */
#act-1 {
    min-height: 80vh;
}

.step h1,
.step h2 {
    margin-top: 0;
}

.spacer {
    height: 20px;
}


/* ---------------- Mobile Layout ---------------- */

@media (max-width: 900px) {

    .project-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        /* Sidebar is handled by global styles now (top bar) */
        position: relative;
        max-height: none;
        overflow-y: visible;
    }

    #vis-container {
        position: relative;
        /* Not sticky on mobile to allow scrolling past it */
        top: 0;

        /* Reduce height for mobile */
        height: auto;
        min-height: 350px;
        max-height: none;
        margin-bottom: 2rem;

        display: flex;
        flex-direction: column;
    }

    #canvas-container {
        height: 280px;
        /* Reduced specific height */
        flex-shrink: 0;
    }

    .step {
        min-height: auto;
        margin-bottom: 3rem;
        padding: 1.5rem;

        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    /* Ensure last step has space */
    .step:last-child {
        margin-bottom: 5rem;
    }

    /* Footer link shouldn't look like a card */
    .step-footer {
        padding: 1.5rem;
        margin-bottom: 5rem;
        background: transparent;
        border: none;
        box-shadow: none;
    }
}