/* Fire Prevention product page. Builds on site.css and the shared product page pieces in time.css.
   Colour roles: green is an inspection passed, amber is a deficiency that is open, and red is reserved
   for a failed answer itself. Blue marks the month being inspected now. */

/* The digital inspection tag */

.firetag {
    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;
}

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

/* Twelve month boxes, like the punch boxes on a paper extinguisher tag */
.ft-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4px;
    padding: 16px 22px 14px;
    border-bottom: 1px solid var(--line);
}

.ft-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0 5px;
    border-radius: 6px;
    border: 1.5px dashed var(--line);
    font-size: 0.7rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.ft-month b {
    font-weight: 700;
    color: var(--ink-soft);
}

.ft-month i {
    min-height: 1.2em;
    font-style: normal;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ft-month.is-done {
    border: 1.5px solid var(--verified);
    background: var(--verified-soft);
}

.ft-month.is-done i {
    color: var(--verified);
}

.ft-month.is-now:not(.is-done):not(.is-flagged) {
    border: 1.5px solid var(--signal);
    background: var(--signal-soft);
}

.ft-month.is-flagged {
    border: 1.5px solid var(--escalate);
    background: var(--escalate-soft);
}

.ft-month.is-flagged i {
    color: var(--escalate);
}

/* The checklist */

.ft-checks {
    padding: 6px 0;
}

.ft-check {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
    padding: 7px 22px;
    font-size: 0.88rem;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

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

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

.ft-val {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.ft-mark {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--verified);
}

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

.ft-check.is-fail.is-open {
    background: var(--stop-soft);
}

.ft-check.is-fail .ft-mark {
    background: var(--stop);
}

.ft-check.is-fail .ft-mark::after {
    content: "\00d7";
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border: 0;
    transform: none;
    color: var(--surface);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.ft-check.is-fail .ft-val {
    color: var(--stop);
}

.ft-issue .ft-mark,
.ft-alert .ft-mark {
    background: var(--escalate);
}

.ft-issue .ft-mark::after,
.ft-alert .ft-mark::after {
    content: "!";
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border: 0;
    transform: none;
    color: var(--surface);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.ft-issue.is-open {
    background: var(--escalate-soft);
}

.ft-issue.is-resolved .ft-mark {
    background: var(--verified);
}

.ft-issue.is-resolved .ft-mark::after {
    content: "";
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ft-check.is-pending {
    opacity: 0;
}

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

.ft-summary.is-live {
    color: var(--ink-soft);
}

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

/* Pass and fail: the two outcomes of every inspection, side by side */

.paths {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.path {
    padding: 26px 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    border-top: 4px solid var(--tone);
    background: var(--surface);
}

.path-pass { --tone: var(--verified); }
.path-fail { --tone: var(--stop); }

.path-kind {
    font-variation-settings: "wdth" 115;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--tone);
}

.path-text {
    margin-top: 6px;
    font-size: 1.05rem;
}

/* Lifecycle callout */

.drives {
    margin-top: 36px;
    padding: 18px 22px;
    border-radius: var(--radius-sm);
    background: var(--signal-soft);
    font-size: 1.1rem;
}

.drives strong {
    color: var(--signal);
}

/* Readings card */

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

.reading-rows li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 52px;
    column-gap: 14px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}

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

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

.r-val {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.r-ok {
    padding: 2px 0;
    border-radius: 999px;
    background: var(--verified-soft);
    color: var(--verified);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

.reading-rows li.is-fail {
    background: var(--stop-soft);
}

.reading-rows li.is-fail .r-val {
    color: var(--stop);
}

.reading-rows li.is-fail .r-ok {
    background: var(--stop);
    color: var(--surface);
}

.reading-note {
    padding: 14px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--escalate);
}

/* Inspection export: its own columns, since results and timestamps are wider than the time clock sheet's */

.fire-row,
.fire-sheet-head {
    grid-template-columns: 0.6fr 1.3fr 0.9fr 1fr 1.4fr 0.5fr;
    min-width: 680px;
}

.fire-row span:nth-child(5) {
    color: inherit;
    font-weight: 400;
}

.fire-row.is-fail {
    background: var(--stop-soft);
}

.fire-row.is-fail span:nth-child(5) {
    color: var(--stop);
    font-weight: 700;
}

.fire-row span:nth-child(6) {
    color: var(--signal);
    font-weight: 600;
}

/* Responsive */

@media (max-width: 640px) {
    .paths {
        grid-template-columns: minmax(0, 1fr);
    }

    .ft-months {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        padding: 14px 16px 12px;
    }

    .ft-check {
        padding: 7px 16px;
    }

    .ft-head,
    .ft-summary {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* In the better-state section the two paths stack beside the copy */
.better .paths {
    grid-template-columns: minmax(0, 1fr);
}
