/* Operational Equipment Readiness product page. Builds on site.css and the shared product page pieces in time.css.
   Colour roles: green with a tick is a check that passed, amber with an exclamation mark is a unit that needs
   attention, and a hollow ring is a unit still outstanding. */

.hero-motto {
    margin-top: 14px;
    font-variation-settings: "wdth" 110;
    font-weight: 650;
    font-size: 1.1rem;
}

/* Hero: coverage grid of the 142 units in the seasonal check */

.cv-grid {
    display: grid;
    grid-template-columns: repeat(18, minmax(0, 1fr));
    gap: 4px;
    padding: 20px 22px 14px;
}

.u {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1.5px var(--lapsed);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.u.is-pass {
    background: var(--verified);
    box-shadow: none;
}

/* The tick on a passed unit */
.u.is-pass::after {
    content: "";
    position: absolute;
    left: 37%;
    top: 20%;
    width: 24%;
    height: 44%;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.u.is-flag {
    background: var(--escalate);
    box-shadow: none;
}

/* The exclamation mark on a unit that needs attention */
.u.is-flag::after {
    content: "!";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    color: var(--surface);
}

.u.is-new {
    box-shadow: 0 0 0 3px var(--escalate-soft);
}

.cv-key {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 0 22px 14px;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.cv-key li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cv-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1.5px var(--lapsed);
}

.cv-dot.is-pass {
    background: var(--verified);
    box-shadow: none;
}

.cv-dot.is-flag {
    background: var(--escalate);
    box-shadow: none;
}

.cv-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}

.cv-totals div {
    padding: 14px 22px;
}

.cv-totals div + div {
    border-left: 1px solid var(--line);
}

.cv-totals dt {
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.cv-totals dd {
    font-variation-settings: "wdth" 112;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.35rem;
}

.cv-total-pass dd {
    color: var(--verified);
}

.cv-total-flag {
    background: var(--escalate-soft);
}

.cv-total-flag dd {
    color: var(--escalate);
}

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

.cv-status.is-live {
    color: var(--signal);
}

.cv-status.is-flag {
    color: var(--escalate);
}

/* Better state: only the exceptions reach the manager */

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

.attention-passed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--verified-soft);
    color: var(--verified);
    font-weight: 650;
}

.attention-tick {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--verified);
}

.attention-tick::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 4px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.attention-label {
    padding: 14px 20px 4px;
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--ink-soft);
}

.attention-rows li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.attention-rows li:last-child {
    border-bottom: 0;
}

.attention-mark {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--escalate);
    color: var(--surface);
    font-size: 0.75rem;
    font-weight: 800;
}

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

.attention-what small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* The solution: coverage board by building */

.coverage-board ul {
    display: grid;
}

.cb-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 84px 72px;
    column-gap: 14px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.coverage-board li:last-child {
    border-bottom: 0;
}

.cb-head {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--ink-soft);
}

.cb-head span:nth-child(n+3) {
    text-align: right;
}

.cb-name {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.cb-name small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* Completion bar: the share of units done in the building */
.cb-bar {
    position: relative;
    height: 22px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    overflow: hidden;
}

.cb-bar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--done);
    background: var(--verified-soft);
    box-shadow: inset 0 0 0 1px var(--verified);
    border-radius: 999px;
}

.cb-bar b {
    position: relative;
    display: block;
    padding-left: 10px;
    line-height: 22px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--verified);
}

.cb-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.cb-num.is-zero {
    color: var(--ink-soft);
    font-weight: 400;
}

.cb-num.is-flag {
    color: var(--escalate);
}

.cb-num.is-flag::before {
    content: "! ";
}

@media (max-width: 640px) {
    .cv-grid {
        gap: 3px;
        padding: 16px 16px 12px;
    }

    .u.is-flag::after {
        font-size: 0.55rem;
    }

    .u.is-pass::after {
        border-width: 0 1.5px 1.5px 0;
    }

    .cv-key,
    .cv-status {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cv-totals div {
        padding: 12px 14px;
    }

    .cv-totals dd {
        font-size: 1.1rem;
    }

    .cb-row {
        grid-template-columns: minmax(0, 1fr) 70px 56px;
        padding: 12px 16px;
    }

    .cb-bar,
    .cb-head span:nth-child(2) {
        display: none;
    }

    .attention-rows li {
        grid-template-columns: 22px minmax(0, 1fr);
        row-gap: 6px;
        padding: 10px 16px;
    }

    .attention-rows .state {
        grid-column: 2;
        justify-self: start;
    }
}
