/* Social Media (#/socials, socials.js). */

.soc { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.soc > .panel, .soc-two > .panel, .soc-accounts > .panel { margin: 0; }
.soc .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.soc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.soc-updated { color: var(--muted); font-size: 13px; }

/* ---------- accounts ---------- */
.soc-accounts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.soc-account { display: flex; flex-direction: column; gap: 8px; padding: 14px; min-width: 0; }
.soc-head { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; min-width: 0; }
.soc-head:hover strong, .soc-head:focus-visible strong { color: var(--gold-bright); }
.soc-icon { font-size: 22px; line-height: 1; flex: none; }
.soc-name { display: flex; flex-direction: column; min-width: 0; }
.soc-name strong { font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--white); line-height: 1.15; }
.soc-handle { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-followers { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.soc-big { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--white); font-variant-numeric: tabular-nums; }
.soc-unit { color: var(--muted); font-size: 13px; }
.soc-followers.none .soc-unit { color: var(--faint); font-size: 13px; line-height: 1.35; }

.soc-delta { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.soc-delta.up .soc-arrow { color: var(--green); }
.soc-delta.down .soc-arrow { color: var(--red); }
.soc-delta.flat .soc-arrow { color: var(--faint); }

.soc-spark { display: flex; flex-direction: column; gap: 2px; }
.soc-spark-svg { width: 100%; height: 40px; display: block; touch-action: pan-y; cursor: crosshair; overflow: visible; }
.soc-spark-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.soc-spark-dot { fill: var(--gold-bright); stroke: var(--navy-800); stroke-width: 2; vector-effect: non-scaling-stroke; }
.soc-spark-read { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; min-height: 1.2em; }

.soc-mini { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.soc-mini div { display: flex; flex-direction: column; }
.soc-mini dt { color: var(--gold); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.soc-mini dd { margin: 0; color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.soc-checked { color: var(--faint); font-size: 12px; margin-top: auto; }
.soc-checked.warn { color: var(--amber); }

/* ---------- headline figures ---------- */
.soc .soc-stats { margin: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.soc-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.soc-stat .value { font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ---------- top posts + weeks ---------- */
.soc-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.soc-two .panel { min-width: 0; }
.soc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.soc-chips::-webkit-scrollbar { display: none; }
.soc-chips .chip-btn { flex: none; white-space: nowrap; min-height: 34px; }
.soc-chip-n { opacity: 0.7; font-variant-numeric: tabular-nums; }
.soc-caption { margin: 8px 0 12px; }

/* ---------- an upload ---------- */
.soc-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.soc-item {
    display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center;
    padding: 10px 0; border-top: 1px solid var(--line);
}
.soc-items > .soc-item:first-child { border-top: 0; padding-top: 0; }
.soc-items.ranked { counter-reset: soc-rank; }
.soc-items.ranked .soc-item { grid-template-columns: 22px 88px minmax(0, 1fr) auto; counter-increment: soc-rank; }
.soc-items.ranked .soc-item::before {
    content: counter(soc-rank); color: var(--gold); font-family: var(--serif); font-size: 18px; text-align: center;
}
.soc-thumb {
    position: relative; width: 88px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden;
    background: var(--navy-900); border: 1px solid var(--line); display: grid; place-items: center;
}
.soc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soc-thumb-icon { font-size: 18px; opacity: 0.6; }
.soc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.soc-title {
    color: var(--white); text-decoration: none; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.soc-title:hover, .soc-title:focus-visible { color: var(--gold-bright); text-decoration: underline; }
.soc-meta { color: var(--faint); font-size: 13px; line-height: 1.35; }
.soc-sender { color: var(--muted); }
a.soc-sender:hover { color: var(--gold-bright); }
.soc-figs { display: flex; gap: 12px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.soc-fig.lead { color: var(--white); font-weight: 600; }
.soc-figs.none { color: var(--faint); }

/* ---------- every upload ---------- */
.soc-tools { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.soc-tools .soc-chips { flex: 1 1 320px; min-width: 0; }
.soc-search {
    flex: 0 1 240px; min-width: 0; padding: 8px 12px; font: inherit; font-size: 14px; color: var(--cream);
    background: var(--navy-900); border: 1px solid var(--line-strong); border-radius: 999px;
}
.soc-search:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.soc-more { justify-content: center; }

@media (max-width: 1100px) {
    .soc-accounts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .soc .soc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .soc-two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .soc { gap: 14px; }
    .soc-accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .soc-account { padding: 12px; gap: 6px; }
    .soc-big { font-size: 26px; }
    .soc .soc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .soc .soc-stats .stat-card { padding: 12px; }
    .soc .soc-stats .stat-card .value { font-size: 24px; }
    .soc .soc-stats .stat-card:last-child { grid-column: 1 / -1; }
    .soc-search { flex: 1 1 100%; }
    .soc-tools .soc-chips { flex-basis: 100%; }
    /* thumbnail | title and meta, the figures under them */
    .soc-item { grid-template-columns: 72px minmax(0, 1fr); gap: 4px 10px; align-items: start; }
    .soc-thumb { width: 72px; grid-row: span 2; }
    .soc-figs { grid-column: 2; gap: 10px; }
    .soc-items.ranked .soc-item { grid-template-columns: 18px 72px minmax(0, 1fr); }
    .soc-items.ranked .soc-item::before { grid-row: span 2; align-self: center; font-size: 16px; }
    .soc-items.ranked .soc-figs { grid-column: 3; }
}

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

/* How we compare on YouTube (social_rivals.py) */
.soc-compare { margin-top: 18px; }
.soc-compare .hint { margin-top: -6px; }
table.soc-rivals td { vertical-align: middle; }
table.soc-rivals .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.soc-rank { width: 2.2em; color: var(--muted); }
.soc-rival { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; min-width: 0; }
.soc-rival img, .soc-rival-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--navy-700); border: 1px solid var(--line); }
.soc-rival span { display: flex; flex-direction: column; min-width: 0; }
.soc-rival strong { color: var(--white); font-weight: 600; }
.soc-rival small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.soc-rival:hover strong { color: var(--gold-bright); }
tr.soc-ours td { background: rgba(201, 168, 76, 0.09); }
tr.soc-ours .soc-rank { color: var(--gold); font-weight: 700; }
.soc-bar-mini { display: block; height: 3px; margin: 3px 0 0 auto; width: 90px; border-radius: 2px; background: var(--line); overflow: hidden; }
.soc-bar-mini i { display: block; height: 100%; margin-left: auto; background: var(--gold); }
.soc-change { display: block; font-size: 11.5px; }
.soc-change.up { color: var(--green); }
.soc-change.down { color: var(--red); }
.soc-rival-form { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.soc-rival-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; }
.soc-rival-form .hint { margin: 0; }
@media (max-width: 640px) { .soc-rival-fields { grid-template-columns: minmax(0, 1fr); } }
.soc-compare { min-width: 0; }
.soc-compare .table-wrap { position: relative; max-width: 100%; }
