/*
 * Verifier Devices: spec card (.tvdev) and comparison table (.tvcmp).
 * Colours come from the Verifier 26 tokens when that design is on, with neutral fallbacks otherwise.
 */

.tvdev, .tvcmp-wrap {
  --tvd-surface: var(--tv-surface, #fff);
  --tvd-line: var(--tv-line, #e2e4e7);
  --tvd-text: var(--tv-text, #1d2327);
  --tvd-muted: var(--tv-muted, #646970);
  --tvd-accent: var(--tv-accent-text, #2271b1);
}

.tvdev { margin: 24px 0; padding: 18px 20px 8px; background: var(--tvd-surface); border: 1px solid var(--tvd-line); }
.tvdev__top { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--tvd-line); }
.tvdev__img { width: 88px; height: 88px; object-fit: contain; flex-shrink: 0; margin: 0 !important; }
.tvdev__txt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.tvdev__k { font-size: 13px; font-weight: 700; color: var(--tvd-accent); }
.tvdev__t { font-size: 20px; font-weight: 800; line-height: 1.25; color: var(--tvd-text); }

.tvdev__more { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 12px; font-size: 15px; font-weight: 700; color: var(--tv-link, #2F44C8) !important; text-decoration: none !important; }
.tvdev__more:hover { text-decoration: underline !important; }
.tvcmp thead th a.tvcmp__model { text-decoration: none !important; }
.tvcmp thead th a.tvcmp__model:hover { color: var(--tv-link, #2F44C8) !important; }
.tvdev dl.tvspec { margin: 0 !important; padding: 0; display: flex; flex-direction: column; }
.tvdev .tvspec > div { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--tvd-line); }
.tvdev .tvspec > div:last-child { border-bottom: 0; }
.tvdev .tvspec dt { width: 72px; flex-shrink: 0; margin: 0; font-size: 14px; font-weight: 700; color: var(--tvd-muted); }
.tvdev .tvspec dd { margin: 0; font-size: 15px; line-height: 1.45; color: var(--tvd-text); overflow-wrap: anywhere; text-align: right; }
/* Desktop: two columns of specs, like the spec sheet in reviews (review.css) */
@media (min-width: 1025px) {
  .tvdev dl.tvspec { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .tvdev .tvspec > div { padding: 13px 0; }
  .tvdev .tvspec > div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .tvdev .tvspec dt { width: 80px; font-size: 15px; }
  .tvdev .tvspec dd { font-size: 16px; }
  .tvdev__img { width: 104px; height: 104px; }
}

/*
 * Comparison table.
 * In Verifier 26 articles the design wraps every table (.tvtbl--wide: sideways scroll, sticky first column),
 * and the comparison takes that look like any other table. The rules below apply only where nothing wrapped it
 * (the table is a direct child of .tvcmp-wrap): the editor, pages, or the site without Verifier 26.
 */
.tvcmp-wrap { margin: 24px 0; }
.tvcmp-wrap:has(> .tvtbl) { margin: 0; } /* the design wrapper brings its own spacing */
.tvcmp-wrap:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--tvd-line); background: var(--tvd-surface); }
.tvcmp-wrap > table.tvcmp { width: 100%; min-width: 520px; margin: 0 !important; border: 0 !important; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.tvcmp-wrap > .tvcmp th, .tvcmp-wrap > .tvcmp td { padding: 10px 12px !important; border: 0 !important; border-bottom: 1px solid var(--tvd-line) !important; text-align: right !important; vertical-align: top; color: var(--tvd-text); background: none; line-height: 1.45; white-space: normal !important; overflow-wrap: anywhere; }
.tvcmp-wrap > .tvcmp thead th { font-size: 15px !important; font-weight: 800; vertical-align: bottom; }
.tvcmp-wrap > .tvcmp tbody th { font-weight: 700; color: var(--tvd-muted); position: sticky; inset-inline-start: 0; background: var(--tvd-surface); }
.tvcmp-wrap > .tvcmp tbody tr:last-child > * { border-bottom: 0 !important; }
.tvcmp-wrap > .tvcmp thead th:first-child { width: 84px; }
.tvcmp-wrap > .tvcmp--2 thead th:not(:first-child) { width: calc((100% - 84px) / 2); }
.tvcmp-wrap > .tvcmp--3 thead th:not(:first-child) { width: calc((100% - 84px) / 3); }

/* Both ways: device pictures in the header, and the hidden label */
/*
 * Column headings: picture, brand (small, accent colour) and model (the title).
 * Phone, and three devices on desktop: picture on top, name under it, all on the right edge.
 * Two devices on desktop: picture and name side by side, the name bigger.
 */
.tvcmp thead th { text-align: right !important; vertical-align: bottom; }
.tvcmp thead th:not(:first-child) { padding-top: 18px !important; padding-bottom: 14px !important; }
.tvcmp__head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.tvcmp__img { display: block; width: 100% !important; max-width: 220px !important; height: 110px !important; object-fit: contain; object-position: right bottom; margin: 0 !important; }
.tvcmp__name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.tvcmp thead th .tvcmp__brand { font-size: 12px !important; font-weight: 700 !important; line-height: 1.2; color: var(--tv-accent-text, #2F44C8) !important; }
.tvcmp thead th .tvcmp__model { font-size: 16px !important; font-weight: 800 !important; line-height: 1.2; color: var(--tv-text, #0A1030) !important; overflow-wrap: anywhere; }

@media (min-width: 1025px) {
  .tvcmp thead th .tvcmp__model { font-size: 18px !important; }
  .tvcmp--3 .tvcmp__img { height: 150px !important; }
  .tvcmp--2 .tvcmp__head { flex-direction: row; align-items: center; gap: 16px; }
  .tvcmp--2 .tvcmp__img { width: 45% !important; max-width: 150px !important; height: 130px !important; object-position: center; flex-shrink: 0; }
  .tvcmp--2 thead th .tvcmp__brand { font-size: 13px !important; }
  .tvcmp--2 thead th .tvcmp__model { font-size: 21px !important; }
}

.tvcmp .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mixed Hebrew and English: each part keeps its own direction, even where the theme forces one on everything. */
.tvdev bdi, .tvcmp bdi { unicode-bidi: isolate !important; }
.tvdev [dir="ltr"], .tvcmp [dir="ltr"] { direction: ltr !important; }
.tvdev bdi[dir="rtl"], .tvcmp bdi[dir="rtl"] { direction: rtl !important; }
.tvdev, .tvcmp, .tvcmp td, .tvdev dd { direction: rtl !important; }
