/* =========================================================
   The Gadget Index — inner-page layout.
   Loaded after tgi.css on every public route except the homepage. Components (cards, scores,
   badges, buttons, sections, versus, ledger) come from tgi.css unchanged; this file only lays
   them out for archive and detail pages and styles long-form content, using tgi.css tokens.
   ========================================================= */

/* Product photos fill the art frame without cropping (the frame's height comes from its aspect ratio). */
.art-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4%; object-fit: contain; }
.product-card__foot .price { font-size: 1rem; white-space: nowrap; }

/* ---------- Page intro: the homepage hero field, compact ---------- */
.page-intro__inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: end;
  padding-block: clamp(36px, 5vw, 72px) clamp(40px, 5vw, 72px);
}
@media (min-width: 1024px) { .page-intro--split .page-intro__inner { grid-template-columns: minmax(0, 1fr) 300px; } }
.page-intro__copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 820px; min-width: 0; }
.page-intro__title { font-size: var(--text-h1); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; }
.page-intro .meta { color: var(--color-on-dark-muted); }
.page-intro .meta span { white-space: normal; }
.page-intro .hero-search { margin-top: 8px; }
.page-intro .hero__actions { margin-top: 8px; }
.intro-score { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--color-line-dark); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .03); }
.intro-score .big-score span { color: var(--color-on-dark-muted); }

/* Breadcrumbs: mono label scale, like the homepage meta line */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; color: var(--color-on-dark-muted); min-width: 0; }
.crumbs a { color: var(--color-on-dark-muted); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.crumbs--light { color: var(--color-text-muted); margin-bottom: var(--space-5); }
.crumbs--light a { color: var(--color-text-muted); }
.crumbs--light a:hover { color: var(--color-navy); }
.crumbs--light [aria-current] { color: var(--color-navy); }
.index-page .crumbs { margin-bottom: var(--space-5); }

/* ---------- Detail layouts ---------- */
.detail-top { padding-top: clamp(24px, 3vw, 40px); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 4vw, 56px); align-items: start; }
@media (min-width: 1024px) { .detail-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.detail-layout--single { max-width: var(--container-text); }
@media (min-width: 1024px) { .detail-layout--single { grid-template-columns: minmax(0, 1fr); } }
.detail-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); min-width: 0; }
.detail-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* Long affiliate button labels must wrap rather than set the minimum width on small screens. */
.detail-side .btn, .product-feature__buy .btn { white-space: normal; text-align: center; }
.product-feature__body { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .detail-side { position: sticky; top: calc(var(--header-h) + 24px); } }
.detail-side .contender__best:first-of-type { border-top: 0; padding-top: 0; }
.detail-side__product { display: grid; gap: 10px; }
.detail-side__product .art-frame { border-radius: var(--radius-md); }
.detail-side__name { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.detail-side__name a { color: var(--color-navy); text-decoration: none; }
.detail-side__name a:hover { color: var(--color-blue-strong); }
.detail-side .disclosure--inline { margin-top: -6px; }
.detail-hero-image .art-frame { border-radius: var(--radius-lg); aspect-ratio: 16 / 9; }
.detail-block { display: grid; gap: 14px; }
.detail-block__title { font-size: var(--text-h3); }
.pick-section .disclosure { margin-bottom: var(--space-5); }
.section > .container > .disclosure { margin-bottom: var(--space-6); }

.verdict-note { display: grid; gap: 8px; padding: 20px 24px; border-left: var(--rule-accent); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--color-surface-blue); }
.verdict-note p:last-child { font-size: var(--text-body-lg); color: var(--color-navy); }

.gallery-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.gallery-strip .art-frame { width: 88px; border-radius: var(--radius-md); border: var(--border-hairline); }

/* ---------- Long-form content ---------- */
.prose { font-size: var(--text-body-lg); line-height: 1.7; color: var(--color-text); max-width: var(--container-text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--text-h2); line-height: 1.15; margin-top: 1.8em; }
.prose h3 { font-size: var(--text-h3); margin-top: 1.6em; }
.prose h4 { font-size: var(--text-h4); margin-top: 1.4em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose ul { list-style: disc; padding-left: 1.3em; }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--color-blue); }
.prose a { color: var(--color-blue-strong); text-decoration: underline; }
.prose img { border-radius: var(--radius-lg); }
.prose blockquote { padding-left: 20px; border-left: var(--rule-accent); color: var(--color-slate); font-family: var(--font-display); font-size: 1.25rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: var(--border-hairline); }
.prose th { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 500; }
.prose code { font-family: var(--font-mono); font-size: .875em; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--color-paper); }

.spec-table { border: var(--border-hairline); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
.spec-table > div { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 16px; padding: 12px 16px; border-bottom: var(--border-hairline); }
.spec-table > div:last-child { border-bottom: 0; }
.spec-table dt { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.spec-table dd { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-navy); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Related editorial links (product page) ---------- */
.link-columns { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.link-column { display: grid; gap: 8px; align-content: start; padding: 20px; background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-lg); }
.link-column ul { display: grid; }
.link-column a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: var(--border-hairline); color: var(--color-navy); text-decoration: none; font-weight: 500; }
.link-column li:last-child a { border-bottom: 0; }
.link-column a:hover { color: var(--color-blue-strong); }

/* ---------- Archive layouts built from homepage cards ---------- */
.guide-layout--single { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .guide-layout--single .guide-card--featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; } .guide-layout--single .guide-card--featured .art-frame { height: 100%; aspect-ratio: auto; min-height: 320px; } }
.article-grid-list { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin-top: var(--space-6); }
.comparison-card .guide-card__stack { width: 84%; gap: 6%; align-items: center; }
.comparison-card .guide-card__stack img { width: 30%; aspect-ratio: 1; object-fit: contain; }
.comparison-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* Comparison detail */
.versus__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 767px) { .versus__grid--2 { grid-template-columns: none; } }
.contender__badge { position: absolute; top: 26px; left: 26px; z-index: 1; }
.contender__name a { color: var(--color-navy); text-decoration: none; }
.contender__name a:hover { color: var(--color-blue-strong); }
.contender__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buying-guide picks */
.pick-list { display: grid; counter-reset: pick; }
.pick-list li { counter-increment: pick; }
.pick-list a { display: grid; grid-template-columns: 2ch minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: var(--border-hairline); color: var(--color-navy); text-decoration: none; font-size: .9375rem; }
.pick-list a::before { content: counter(pick); font-family: var(--font-mono); font-size: .75rem; color: var(--color-blue); }
.pick-list b { font-family: var(--font-mono); font-weight: 600; font-size: .875rem; }
.pick-list li:last-child a { border-bottom: 0; }
.pick-list a:hover { color: var(--color-blue-strong); }
.pick-anchor { display: grid; scroll-margin-top: calc(var(--header-h) + 24px); }
.product-grid + .disclosure--inline { margin-top: 16px; }

/* FAQ */
.faq-list { display: grid; max-width: var(--container-text); border-top: var(--border-hairline); }
.faq { border-bottom: var(--border-hairline); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; color: var(--color-navy); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform var(--dur-base); flex: none; }
.faq[open] summary .icon { transform: rotate(180deg); }
.faq p { padding-bottom: 18px; color: var(--color-text-muted); max-width: 64ch; }

/* Empty state */
.empty-state { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; overflow: hidden; background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); }
@media (min-width: 768px) { .empty-state { grid-template-columns: 280px minmax(0, 1fr); } }
.empty-state .art-frame { aspect-ratio: 16 / 10; }
.empty-state .art { width: 30%; }
.empty-state__body { display: grid; gap: 10px; align-content: center; justify-items: start; padding: clamp(24px, 4vw, 40px); }
.empty-state__body h3 { font-size: var(--text-h3); }
.empty-state__body p:not(.label) { color: var(--color-text-muted); max-width: 52ch; }

/* Pagination in the homepage tab style */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--space-7); }
.pagination a { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-navy); font-family: var(--font-mono); font-size: .875rem; text-decoration: none; transition: border-color var(--dur-fast); }
.pagination a:hover { border-color: var(--color-navy); }
.pagination a[aria-current] { background: var(--color-navy); border-color: var(--color-navy); color: #fff; }
.index-page .pagination a { background: transparent; border-color: var(--color-line-dark); color: #fff; }
.index-page .pagination a[aria-current] { background: #fff; color: var(--color-navy); }

/* ---------- The Index page ---------- */
.index__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.index__selects { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 1024px) { .index__selects { grid-template-columns: 1fr; } }
.chip--check { cursor: pointer; }
.chip--check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip--check:has(input:checked) { background: var(--color-blue); border-color: var(--color-blue); color: #fff; }
.chip--check:has(input:focus-visible) { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.index-results-shell { transition: opacity var(--dur-fast); }
.index-results-shell[aria-busy="true"] { opacity: .55; pointer-events: none; }
.ledger__empty[hidden] { display: none; }

/* ---------- Brands ---------- */
.brand-grid .category-card__icon img { width: 32px; height: 32px; object-fit: contain; }
.brand-initial { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.category-card[aria-current] { border-color: var(--color-navy); box-shadow: inset 0 0 0 1px var(--color-navy); }

/* ---------- Forms (contact) ---------- */
.form-card { display: grid; gap: 18px; padding: clamp(20px, 4vw, 36px); background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); }
.form-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-field { display: grid; gap: 6px; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted); }
.form-field input, .form-field textarea { font-family: var(--font-body); font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--color-navy); width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); }
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field textarea:focus { outline: 2px solid var(--color-blue); outline-offset: 0; border-color: var(--color-blue); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-status { font-size: .875rem; color: var(--color-text-muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Search results page ---------- */
.search-page-panel { max-width: 820px; padding: 8px; background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); }
.search-result__icon img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-md); }
