/*
 * tools-v4-invisible-character.css: extra rules for /tools/invisible-character only.
 * The shared .ic-* card rules live in tools-v4.css; this file adds the list text, the hidden
 * character finder and the facts table details. Every rule is scoped under .tv4.
 * Linked from the view's `block extrahead`, outside the usemin build blocks, with ?v=<date>.
 */

/* Quantity row inside the dark card: Foundation styles every label, so reset it here. */
.tv4 .ic-qty label {
    display: inline;
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: 500;
    line-height: 1.3;
    cursor: default;
}

.tv4 .ic-qty span {
    color: rgba(255, 255, 255, 0.6);
}

.tv4 .ic-qty input:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

/* Blocks inside the tool card: the character list and the finder */
.tv4 .ic-block {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--pn-line);
}

.tv4 .ic-h {
    color: var(--pn-ink);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.tv4 .ic-sub {
    margin-top: 6px;
    color: var(--pn-ink-2);
    font-size: 15px;
    line-height: 1.5;
}

.tv4 .ic-block .ic-list {
    margin-top: 20px;
}

.tv4 .ic-row__name {
    color: var(--pn-ink);
}

.tv4 .ic-row__use {
    margin-top: 4px;
    color: var(--pn-ink-2);
    font-size: 13px;
    line-height: 1.45;
}

/* Hidden character finder */
.tv4 .ic-finder .tv4-label {
    margin-top: 20px;
}

.tv4 .ic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.tv4 .ic-result {
    margin-top: 20px;
}

.tv4 .ic-summary {
    color: var(--pn-ink);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.tv4 .ic-found {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.tv4 .ic-found__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--pn-line);
    border-radius: 14px;
    background: #ffffff;
}

.tv4 .ic-found__row .ic-chip {
    margin: 2px 0 0;
}

.tv4 .ic-found__name {
    color: var(--pn-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
}

.tv4 .ic-found__name b {
    color: var(--pn-ink-3);
    font-weight: 500;
    white-space: nowrap;
}

.tv4 .ic-found__meta {
    margin-top: 2px;
    color: var(--pn-ink-3);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* One hidden character, drawn as a dashed box with its code (the same look as .ic-row__box). */
.tv4 .ic-chip {
    display: inline-block;
    margin: 0 1px;
    padding: 0 4px;
    border: 1px dashed #c8c8cd;
    border-radius: 6px;
    background: #fafafa;
    color: var(--pn-ink-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
    vertical-align: 1px;
}

.tv4 .ic-chip.is-remove {
    border-color: #e0a59d;
    background: #fdf1ef;
    color: var(--tv4-bad);
}

.tv4 .ic-chip.is-space,
.tv4 .ic-chip.is-line {
    border-color: #e2c18c;
    background: #fdf6e9;
    color: var(--tv4-warn);
}

.tv4 .ic-chip.is-keep {
    border-color: #9fd3b8;
    background: #ecf8f1;
    color: var(--tv4-ok);
}

.tv4 #ic-marked-wrap {
    margin-top: 16px;
}

.tv4 .ic-marked {
    max-height: 320px;
    overflow: auto;
    padding: 14px 16px;
    border: 1px solid var(--tv4-field);
    border-radius: 14px;
    background: #ffffff;
    color: var(--pn-ink);
    font-size: 16px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Facts table */
.tv4 .ic-facts table.tv4-table td:first-child {
    font-weight: 500;
}

.tv4 .ic-facts table.tv4-table code {
    padding: 1px 6px;
    border-radius: 5px;
    background: #f1f1f3;
    color: var(--pn-ink-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 400;
}

.tv4 .ic-facts .tv4-checked a {
    color: var(--pns-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 900px) {
    .tv4 .ic-found {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .tv4 .ic-main {
        padding: 22px;
    }

    .tv4 .ic-main .tv4-btn {
        align-self: stretch;
        width: 100%;
    }

    .tv4 .ic-test {
        padding: 18px;
    }

    .tv4 .ic-block {
        margin-top: 32px;
        padding-top: 28px;
    }

    .tv4 .ic-h {
        font-size: 21px;
    }

    .tv4 .ic-actions .tv4-btn {
        flex: 1 1 auto;
    }

    .tv4 .ic-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 12px;
    }

    .tv4 .ic-row__box {
        width: 40px;
        height: 40px;
        font-size: 10px;
    }

    /* Four columns do not fit a phone: each row becomes a small card (name, code and width,
     * then the use line), so nothing hides behind a sideways scroll. */
    .tv4 .ic-facts table.tv4-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .tv4 .ic-facts table.tv4-table,
    .tv4 .ic-facts table.tv4-table tbody,
    .tv4 .ic-facts table.tv4-table tr,
    .tv4 .ic-facts table.tv4-table td {
        display: block;
    }

    .tv4 .ic-facts table.tv4-table tr {
        padding: 14px 16px;
        border-bottom: 1px solid var(--pn-line);
    }

    .tv4 .ic-facts table.tv4-table tbody tr:last-child {
        border-bottom: 0;
    }

    .tv4 .ic-facts table.tv4-table td {
        padding: 0;
        border: 0;
    }

    .tv4 .ic-facts table.tv4-table td:nth-child(2),
    .tv4 .ic-facts table.tv4-table td:nth-child(3) {
        display: inline-block;
        margin: 6px 8px 0 0;
        color: var(--pn-ink-3);
        font-size: 14px;
    }

    .tv4 .ic-facts table.tv4-table td:nth-child(4) {
        margin-top: 6px;
        color: var(--pn-ink-2);
        font-size: 14px;
    }
}
