/*
 * The appliance error code lookup (lane L9, site/pages/free-tools/codes.php, assets/js/ft/codes.js), after
 * ft-base.css, ft-calc.css and ft-lookup.css (the fields, the result card, the two columns and the tables it shares).
 * Tokens only; every target 44 px or more; colour is never the only signal.
 *
 *   .ft-codes__matches > .ft-codes__chips > .ft-codes__chip   codes that start like the typed one, as buttons
 *   .ft-codes__result                                         the result card, its height reserved (no jump)
 *   .ft-codes--answer-first                                   a code page: the answer before the search, right column on a desktop
 *   .ft-code (__title, __code, __for, __means, __label, __checks, __line, __call, __src, __more)  one answer
 *   .ft-codes__table (__also, __name, __tech)                 a brand's full list; rows stack on a phone
 *   .ft-codes__index, .ft-codes__inline, .ft-codes__count     the lists by appliance, the code page links
 */
.ft-codes__matches {
    display: grid;
    gap: var(--sp-2);
}

.ft-codes__matches-title {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-codes__chips,
.ft-codes__inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ft-codes__chip {
    min-height: 44px;
    font-family: var(--font-mono);
}

.ft-codes__result {
    min-height: 16rem;
}

/* A code page prints its answer before the search (the answer is what the visitor came for); on a desktop the answer
   keeps the right column. */
.ft-codes--answer-first .ft-codes__result {
    min-height: 0;
}

@media (min-width: 960px) {
    .ft-codes--answer-first > .ft-calc__inputs {
        grid-row: 1;
        grid-column: 1;
    }

    .ft-codes--answer-first > .ft-codes__result {
        grid-row: 1;
        grid-column: 2;
    }
}

.ft-codes__answer {
    display: grid;
    gap: var(--sp-5);
    margin-top: var(--sp-3);
}

.ft-codes__answer:empty {
    display: none;
}

.ft-code {
    display: grid;
    gap: var(--sp-2);
}

.ft-code + .ft-code {
    padding-top: var(--sp-5);
    border-top: 1px solid var(--c-line);
}

.ft-code p,
.ft-code ol,
.ft-code h3,
.ft-code h4 {
    margin: 0;
}

.ft-code__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-2);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
}

.ft-code__code {
    font-family: var(--font-mono);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: 0.02em;
}

.ft-code__for {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-code__label {
    margin-top: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.ft-code__checks {
    display: grid;
    gap: var(--sp-2);
    padding-left: 1.4em;
    list-style: decimal;
}

.ft-code__call {
    padding: var(--sp-3);
    border-left: 3px solid var(--c-line-strong);
    background: var(--c-surface);
    border-radius: var(--r-sm);
}

.ft-code__src,
.ft-code__more {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-code__more a {
    display: inline-block;
    min-height: 44px;
    padding: var(--sp-2) 0;
}

.ft-codes__list > * + * {
    margin-top: var(--sp-4);
}

.ft-codes__table th[scope="row"] {
    min-width: 6.5rem;
    vertical-align: top;
}

.ft-codes__table td {
    vertical-align: top;
}

.ft-codes__table td p {
    margin: 0 0 var(--sp-2);
}

.ft-codes__table .ft-code__checks {
    margin: 0 0 var(--sp-2);
}

.ft-codes__also {
    display: block;
    margin-top: var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    color: var(--c-text-2);
}

.ft-codes__name {
    font-weight: var(--fw-semibold);
}

.ft-codes__tech {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-codes__table tr:target th,
.ft-codes__table tr:target td {
    background: var(--c-brand-soft);
}

.ft-codes__inline a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.ft-codes__pages a {
    padding: 0 var(--sp-3);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    font-family: var(--font-mono);
    text-decoration: none;
}

.ft-codes__count {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

/* A phone: each code's row stacks (code, then what to check, then when to call) instead of a sideways scroll. */
@media (max-width: 639px) {
    .ft-codes__wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .ft-codes__table th[scope="row"] code {
        font-size: var(--fs-lg);
    }

    .ft-codes__table,
    .ft-codes__table tbody,
    .ft-codes__table tr,
    .ft-codes__table th,
    .ft-codes__table td {
        display: block;
        width: 100%;
    }

    .ft-codes__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .ft-codes__table tr {
        padding: var(--sp-3) 0;
        border-bottom: 1px solid var(--c-line);
    }

    .ft-codes__table th,
    .ft-codes__table td {
        padding: var(--sp-1) 0;
        border: 0;
    }

    .ft-codes__table td:last-child::before {
        content: "When to call: ";
        font-weight: var(--fw-semibold);
    }
}

@media print {
    .ft-codes__matches,
    .ft-lookup__save,
    .ft-lookup__actions,
    .ft-code__more {
        display: none;
    }
}
