/*
 * tools-v4-sizes.css: /tools/social-media-sizes (docs/tools-2026-11/PLAN-WAVE-D.md, section 3).
 * The network filter, one size table per network (cards on phones through tools-v4.css's stacked tables) and the
 * resizer heading. Tokens from pn-system.css; scoped under .tv4 like the rest of the family. Linked outside the
 * usemin build blocks with ?v=<date>. Muted text is #555 (tests/old-pages-text-contrast.test.js).
 * No scroll-margin on the jump targets: the site's html scroll-padding-top already clears the sticky bars.
 */

.tv4 .sz-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.tv4 .sz-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tv4 button.sz-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--pns-line);
    border-radius: var(--pns-r-btn);
    background: var(--pns-card);
    box-shadow: none;
    color: var(--pns-text);
    font-family: var(--pn-font);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tv4 button.sz-chip:hover {
    border-color: var(--pns-text);
}

.tv4 button.sz-chip[aria-pressed="true"] {
    border-color: var(--pns-ink);
    background: var(--pns-ink);
    color: var(--pns-on-ink);
}

.tv4 button.sz-chip:focus-visible {
    outline: 2px solid var(--pns-focus);
    outline-offset: 2px;
}

.tv4 button.sz-chip img {
    width: 18px;
    height: 18px;
    flex: none;
}

/* The X and Threads logos are black: on the ink chip they sit on a white disc. */
.tv4 button.sz-chip[aria-pressed="true"] img {
    padding: 1px;
    border-radius: 50%;
    background: #ffffff;
}

.tv4 .sz-checked {
    margin: 0;
    color: #555555;
    font-size: 14px;
}

/* ---- one block per network ---- */
.tv4 .sz-net {
    margin-top: 40px;
}

.tv4 .sz-bar + .sz-net {
    margin-top: 28px;
}

.tv4 h2.sz-net__h {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--pns-text);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: var(--pns-track-h3);
}

.tv4 h2.sz-net__h img {
    width: 24px;
    height: 24px;
    flex: none;
}

.tv4 .sz-table-wrap {
    margin-top: 14px;
}

.tv4 table.sz-table td {
    vertical-align: middle;
}

.tv4 table.sz-table td:first-child {
    width: 34%;
}

.tv4 .sz-use {
    display: block;
    font-weight: 500;
}

.tv4 .sz-note {
    display: block;
    max-width: 52ch;
    margin-top: 2px;
    color: #555555;
    font-size: 13px;
    line-height: 1.45;
}

.tv4 table.sz-table td.sz-px {
    font-weight: 500;
}

.tv4 table.sz-table td.sz-px--text {
    color: #555555;
    font-weight: 400;
}

.tv4 table.sz-table .sz-act {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

/* tools-v4.css sizes a.tv4-btn at 44px, above the --sm modifier: a row button stays small. */
.tv4 a.tv4-btn.tv4-btn--sm.sz-resize {
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
}

.tv4 .sz-foot {
    display: grid;
    gap: 4px;
    margin-top: 12px;
}

.tv4 .sz-foot p,
.tv4 .sz-foot .tv4-links {
    margin: 0;
    color: #555555;
    font-size: 14px;
    line-height: 1.5;
}

.tv4 .sz-foot .tv4-links {
    color: var(--pns-text);
}

.tv4 .sz-foot a {
    color: var(--pns-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- resizer ---- */
.tv4 .sz-rz {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--pns-line);
}

.tv4 .sz-rz .tv4-h2 {
    margin-bottom: 24px;
}

/* Fifteen sizes: two columns keep the list short, beside the crop area on wide screens and under it on phones. */
@media (min-width: 1200px) {
    .tv4 .sz-rz .rz {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    }
}

@media (min-width: 1200px), (max-width: 900px) {
    .tv4 .sz-rz .rz-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .tv4 .sz-rz .rz-preset {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .tv4 .sz-rz .rz-preset__shape {
        width: 30px;
    }

    .tv4 .sz-rz .rz-preset__name {
        font-size: 14px;
    }

    .tv4 .sz-rz .rz-preset__size {
        font-size: 12px;
    }
}

/* ---- sources ---- */
.tv4 table.sz-sources td {
    vertical-align: middle;
}

.tv4 table.sz-sources td:last-child {
    color: #555555;
}

.tv4 .sz-facts > .tv4-wrap > .tv4-links {
    max-width: 72ch;
    margin-top: 24px;
    color: var(--pns-text-2);
    font-size: 16px;
    line-height: 1.6;
}

.tv4 .sz-facts > .tv4-wrap > .tv4-links a {
    color: var(--pns-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- per-network resizer pages (network_resizer.pug): the resizer opens the page, the facts table follows ---- */
.tv4 h2.tv4-h2.sz-net__title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tv4 h2.tv4-h2.sz-net__title img {
    width: 32px;
    height: 32px;
    flex: none;
}

.tv4 .sz-checked--facts {
    margin-top: 12px;
}

.tv4 .sz-facts .sz-table-wrap {
    margin-top: 24px;
}

/* ---- phones: each table row is a card (tools-v4.css), the Resize button sits under the values ---- */
@media (max-width: 640px) {
    .tv4 .sz-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .tv4 button.sz-chip {
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }

    .tv4 h2.sz-net__h {
        font-size: 19px;
    }

    .tv4 table.sz-table td:first-child {
        width: auto;
    }

    .tv4 table.sz-table.tv4-table--stack td.sz-act {
        width: auto;
        margin-top: 10px;
        padding-left: 0;
        text-align: left;
    }

    .tv4 table.sz-table.tv4-table--stack td.sz-act::before {
        content: none;
    }

    .tv4 a.tv4-btn.tv4-btn--sm.sz-resize {
        height: 40px;
    }

    .tv4 table.sz-table.tv4-table--stack td.sz-act--none {
        display: none;
    }

    .tv4 table.sz-table.tv4-table--stack td.sz-px--text {
        color: #555555;
    }

    .tv4 .sz-rz {
        margin-top: 40px;
        padding-top: 32px;
    }
}
