/*
 * /specs/ and /specs/<id>/. The search panel, field and chips come from Verifier 26 (search.css, category.css);
 * this file lays out the page around them, in the same measures as /deals/.
 */

.tvd-specs { padding-bottom: 56px; }
.tvd-specs__h1 { margin: 0 !important; font-size: 28px; line-height: 1.15; font-weight: 700; color: var(--tv-text); }
.tvd-specs__sub { margin: 6px 0 0 !important; font-size: 15px; line-height: 1.5; color: var(--tv-muted); }
.tvd-specs__h2 { margin: 0 !important; font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--tv-text); }
.tvd-specs__filters { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Each control on its own row with a small label beside it (above it on phones); all of them chips */
.tvd-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tvd-filter__k { font-size: 12px; font-weight: 700; color: var(--tv-muted); letter-spacing: .02em; }
.tvd-filter--brands { padding-top: 14px; border-top: 1px solid var(--tv-line); }
@media (min-width: 1025px) {
  .tvd-filter { flex-direction: row; align-items: center; gap: 14px; }
  .tvd-filter__k { flex: 0 0 96px; }
}
.tvd-specs__body { padding: 20px 16px 0; display: flex; flex-direction: column; gap: 16px; }
.tvd-specs .tvsearch__count { margin: 0; }

/* Device tiles */
.tvd-specs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tvd-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 14px 16px;
  background: var(--tv-surface); border: 1px solid var(--tv-line); color: var(--tv-text); text-decoration: none !important;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--tv-cut-md, 10px) 100%, 0 calc(100% - var(--tv-cut-md, 10px)));
  transition: border-color .15s;
}
.tvd-tile:hover, .tvd-tile:focus-visible { border-color: var(--tv-text); }
.tvd-tile__img { align-self: center; width: 100% !important; height: 120px !important; object-fit: contain; margin: 0 0 10px !important; }
.tvd-tile__img--none { display: block; background: var(--tv-bg); }
.tvd-tile__brand { font-size: 12px; font-weight: 700; color: var(--tv-accent-text); }
.tvd-tile__model { font-size: 16px; font-weight: 800; line-height: 1.25; color: var(--tv-text); }
.tvd-tile__year { margin-top: 2px; font-size: 13px; color: var(--tv-muted); }

/* Device page */
.tvd-dev__in { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 22px; }
.tvd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--tv-muted); }
.tvd-crumbs a { color: var(--tv-link); font-weight: 700; text-decoration: none; }
.tvd-crumbs span[aria-current] { color: var(--tv-text); font-weight: 700; }

.tvd-dev__head { display: flex; flex-direction: column; gap: 16px; padding: 20px 16px; background: var(--tv-surface); border-top: 3px solid var(--tv-text); }
.tvd-dev__img { align-self: center; width: 100% !important; max-width: 280px !important; height: 220px !important; object-fit: contain; margin: 0 !important; }
.tvd-dev__title { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tvd-dev__brand { font-size: 14px; font-weight: 700; color: var(--tv-accent-text); }
.tvd-dev__h1 { margin: 0 !important; font-size: 30px !important; line-height: 1.15 !important; font-weight: 800; color: var(--tv-text); }

/* The summary, under the name: beside the picture on desktop, under it on phones */
.tvd-dev__intro { margin: 10px 0 0 !important; font-size: 17px; line-height: 1.65; color: var(--tv-body); }
.tvd-dev__note { margin: -8px 0 0 !important; padding: 10px 14px; font-size: 14px; color: var(--tv-body); background: var(--tv-chip-bg); border-inline-start: 3px solid var(--tv-caution); }
.tvd-dev__sec { display: flex; flex-direction: column; gap: 12px; }
.tvd-dev__sheet { margin: 0 !important; }

/* Articles about the device */
.tvd-posts { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; }
.tvd-posts li { margin: 0 !important; border-bottom: 1px solid var(--tv-line); }
.tvd-post { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 4px; padding: 12px 0; text-decoration: none !important; }
.tvd-post__img { grid-row: 1 / 3; width: 112px !important; height: 72px !important; object-fit: cover; margin: 0 !important; }
.tvd-post__t { font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--tv-text); }
.tvd-post__d { font-size: 13px; color: var(--tv-muted); }
.tvd-post:hover .tvd-post__t { color: var(--tv-link); }

@media (min-width: 768px) {
  .tvd-specs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .tvd-dev__head { flex-direction: row; align-items: center; gap: 32px; padding: 28px 32px; }
  .tvd-dev__img { flex: 0 0 auto; width: 42% !important; max-width: 320px !important; height: 280px !important; }
  .tvd-dev__title { flex: 1; }
}

@media (min-width: 1025px) {
  .tvd-specs__h1 { font-size: 40px; }
  .tvd-specs__sub { font-size: 17px; }
  .tvd-specs__body { width: min(1200px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 0; gap: 20px; }
  .tvd-specs__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .tvd-specs__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tvd-tile__img { height: 150px !important; }
  .tvd-tile__model { font-size: 18px; }
  .tvd-dev__in { width: min(900px, calc(100% - 64px)); margin: 0 auto; padding: 24px 0 0; gap: 28px; }
  .tvd-dev__h1 { font-size: 40px !important; }
  .tvd-dev__img { height: 320px !important; }
  .tvd-dev__intro { font-size: 18px; }
  .tvd-specs__h2 { font-size: 26px; }
  .tvd-post { grid-template-columns: 160px 1fr; }
  .tvd-post__img { width: 160px !important; height: 96px !important; }
  .tvd-post__t { font-size: 18px; }
}

/* Full spec sheet in groups (1.2): one card per group; two columns of cards on desktop */
.tvd-groups { display: flex; flex-direction: column; gap: 12px; }
.tvd-groups .tvd-group { margin: 0 !important; padding: 14px 18px 4px; }
.tvd-group__h { margin: 0 0 4px !important; padding-bottom: 10px; font-size: 17px !important; line-height: 1.25; font-weight: 800; color: var(--tv-text); border-bottom: 2px solid var(--tv-line); }
.tvd-groups .tvdev .tvspec dt { width: 96px; }
.tvd-dev__src { margin: 0 !important; font-size: 13px; color: var(--tv-muted); }
.tvd-dev__src a { color: var(--tv-link); }
@media (min-width: 1025px) {
  .tvd-groups { display: block; columns: 2; column-gap: 16px; }
  .tvd-groups .tvd-group { break-inside: avoid; margin: 0 0 16px !important; }
  /* inside a group card the rows stay one column: the two columns are the cards */
  .tvd-groups .tvdev dl.tvspec { display: flex; }
  .tvd-groups .tvdev .tvspec > div:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--tvd-line); }
  .tvd-groups .tvdev .tvspec > div:last-child { border-bottom: 0; }
  .tvd-groups .tvdev .tvspec dt { width: 104px; font-size: 14px; }
  .tvd-groups .tvdev .tvspec dd { font-size: 15px; }
}
