/* Space Readiness & Changeovers product page. Builds on site.css and the shared product page pieces in time.css.
   Colour roles: blue is a team's work in progress, green is a stage done or a room ready, and amber is an
   exception the coordinator needs to see. A hollow ring is a stage still waiting for its turn. */

/* The changeover card */

.changeover {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 var(--line), 0 24px 48px -24px rgba(20, 33, 61, 0.28);
    overflow: hidden;
}

.co-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.co-steps {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.co-row {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: center;
    padding: 9px 22px;
    font-size: 0.9rem;
    transition: opacity 0.35s ease, background-color 0.35s ease;
}

.co-row.is-pending {
    opacity: 0.35;
}

/* A hand-off sits between two lanes, indented and quieter */
.co-handoff {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.co-handoff .co-what {
    font-weight: 500;
}

.co-handoff.is-pending {
    opacity: 0;
}

.co-what {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.co-team {
    font-variation-settings: "wdth" 112;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--signal);
}

.co-detail {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.co-val {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    font-size: 0.85rem;
    text-align: right;
}

.co-row.is-active .co-val {
    color: var(--signal);
}

/* Marks: a hollow ring waiting, a filled blue dot working, a green tick done, an amber "!" for the exception */
.co-mark {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--lapsed);
    justify-self: center;
}

.co-handoff .co-mark {
    width: 12px;
    height: 12px;
}

.co-row.is-active .co-mark {
    box-shadow: inset 0 0 0 2px var(--signal);
    background: radial-gradient(circle, var(--signal) 0 4px, transparent 4.5px);
}

.co-row.is-done .co-mark {
    background: var(--verified);
    box-shadow: none;
}

.co-row.is-done .co-mark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.co-handoff.is-done .co-mark::after {
    left: 4px;
    top: 1px;
    width: 3px;
    height: 6px;
    border-width: 0 1.5px 1.5px 0;
}

.co-exception.is-active {
    background: var(--escalate-soft);
}

.co-exception.is-active .co-mark {
    background: var(--escalate);
    box-shadow: none;
}

.co-exception.is-active .co-mark::after {
    content: "!";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--surface);
}

.co-exception.is-active .co-val {
    color: var(--escalate);
}

.co-summary {
    padding: 12px 22px;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--verified);
}

.co-summary.is-live {
    color: var(--signal);
}

.co-summary.is-open {
    color: var(--escalate);
}

.co-count {
    padding: 12px 22px 16px;
    border-top: 1px solid var(--line);
}

.co-count p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.co-count b {
    font-variation-settings: "wdth" 112;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.co-bar {
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--base);
    box-shadow: inset 0 0 0 1px var(--line);
    overflow: hidden;
}

.co-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--verified);
    transition: width 0.5s ease;
}

/* Workplan: sequential stages, with one stage running two teams in parallel */

.workplan {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--base);
    overflow: hidden;
}

.wp-stages {
    display: grid;
    gap: 0;
    padding: 18px 20px 20px;
}

.wp-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 0 0 22px 28px;
}

.wp-stage:last-child {
    padding-bottom: 0;
}

/* The stage marker and the line joining it to the next stage */
.wp-stage::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--signal);
}

.wp-stage::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 20px;
    bottom: 2px;
    width: 2px;
    background: var(--line);
}

.wp-stage:last-child::after {
    display: none;
}

.wp-restore::before {
    background: var(--surface);
    box-shadow: inset 0 0 0 2px var(--lapsed);
}

.wp-when {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.wp-parallel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wp-parallel .wp-when {
    grid-column: 1 / -1;
}

.wp-task {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--signal);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.9rem;
    font-weight: 600;
}

.wp-proof {
    border-left-color: var(--verified);
}

.wp-restore .wp-task {
    border-left-color: var(--lapsed);
}

.wp-team {
    font-variation-settings: "wdth" 112;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-soft);
}

/* Coordinator board */

.co-board .board-rows li.is-flagged {
    background: var(--escalate-soft);
}

.co-board-note {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--ink-soft);
}

@media (max-width: 640px) {
    .co-head,
    .co-summary,
    .co-count {
        padding-left: 16px;
        padding-right: 16px;
    }

    .co-row {
        padding-left: 16px;
        padding-right: 16px;
        column-gap: 10px;
    }

    .wp-parallel {
        grid-template-columns: minmax(0, 1fr);
    }
}
