/* TechSifted v2 site-specific overrides */

/* ==========================================================================
   Markdown tables                                          [review R1 + R2]
   v2 loads system/components/homepage/site only -- never style.css, where
   every table/th/td rule lived. 231 pages rendered borderless and unpadded,
   and an unconstrained table pushed the document 108px past a 390px viewport.
   Markup comes from layouts/_default/_markup/render-table.html.
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 32px 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}
.table-wrap:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
.table-wrap th,
.table-wrap td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-2);
}
.table-wrap thead th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}
.table-wrap tbody td:first-child {
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.table-wrap tbody tr:hover { background: var(--bg-2); }
.table-wrap td a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.table-wrap code { font-family: var(--font-mono); font-size: 0.9em; }

/* A grid/flex item defaults to min-width:auto, so it refuses to shrink below its
   content min-content width. Without this, the 480px table min-width forces the
   .article-shell column -- and the whole document -- wider than the viewport, and
   .table-wrap never gets narrow enough to scroll. This is the actual overflow fix;
   the wrapper alone is not enough. */
.article-shell { min-width: 0; }
.article-shell > * { min-width: 0; }
.article-body { min-width: 0; }
.table-wrap { max-width: 100%; }

/* Any table that slips past the render hook still gets contained. */
.article-body table:not(.table-wrap table) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
}

/* Long unbreakable strings -- inline <code>, bare URLs, long slugs -- were the
   other source of mobile horizontal overflow once tables were contained. */
.article-body { overflow-wrap: break-word; }
.article-body code,
.faq__answer code,
.table-wrap code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article-body pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body pre code { overflow-wrap: normal; word-break: normal; }
.article-body img,
.article-body iframe,
.article-body video { max-width: 100%; }

/* ==========================================================================
   FAQ accordions                                                 [review R3]
   .faq / .faq__item / .faq__question / .faq__answer are emitted on 409 pages
   and had zero CSS in v2, so they rendered as raw <details> triangles.
   ========================================================================== */
.faq {
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
}
.faq__title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 32px 0 4px;
}
.faq__item {
  border-bottom: 1px solid var(--line);
}
.faq__question {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 44px 18px 0;
  position: relative;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink);
  list-style: none;
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::marker { content: ""; }
.faq__question::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
  transition: transform 0.18s ease;
}
.faq__item[open] > .faq__question::after {
  content: "\2013"; /* en dash */
}
.faq__question:hover { color: var(--brand); }
.faq__question:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.faq__answer {
  padding: 0 44px 22px 0;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-3);
}
.faq__answer > p { margin: 0 0 14px; }
.faq__answer > p:last-child { margin: 0; }
.faq__answer a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .faq__question::after { transition: none; }
}

/* ==========================================================================
   Table-of-contents rail                                         [review R5]
   components.css styles `.toc-rail ol`, but Hugo's .TableOfContents emits
   <nav id="TableOfContents"><ul>. The selector never matched, so 363 pages
   fell back to default bullets. Match the markup that actually ships.
   ========================================================================== */
.toc-rail ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.toc-rail ul ul {
  border-left: 0;
  padding-left: 14px;
  margin-top: 10px;
  gap: 8px;
}
.toc-rail li { margin: 0; }
.toc-rail li a {
  color: var(--ink-3);
  line-height: 1.35;
  display: block;
}
.toc-rail li a:hover { color: var(--brand); }
.toc-rail ul ul li a { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   Taxonomy term lists                                            [review R8]
   _default/terms.html emits .section-header / .taxonomy-list / .count with no
   CSS in v2, so /tags/, /categories/ and /authors/ rendered as bare bullets.
   ========================================================================== */
.section-header {
  padding: 56px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.section-header h1 {
  font-family: var(--font-body);
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.03;
  color: var(--ink);
  margin: 0;
}
.taxonomy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
/* Borders on the items, not a 1px-gap-over-a-coloured-background trick: with
   the trick, a part-filled last row painted the empty grid cells solid grey. */
.taxonomy-list li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.taxonomy-list li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.taxonomy-list li a:hover { background: var(--bg-2); color: var(--brand); }
.taxonomy-list .count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  flex: none;
}

@media (max-width: 980px) {
  .table-wrap { margin: 24px 0; border-radius: 0; border-left: 0; border-right: 0; }
  .table-wrap table { min-width: 480px; font-size: 13px; }
  .table-wrap th, .table-wrap td { padding: 10px 12px; }
  .faq__question { font-size: 16px; padding-right: 36px; }
  .faq__answer { font-size: 16px; padding-right: 0; }
  .section-header { padding: 32px 0 20px; }
}

/* ==========================================================================
   Newsletter hero                                         [mobile overflow]
   The hero was a hardcoded inline 2-column grid with a 56px gutter and no
   breakpoint, so the dark subscribe card could not shrink and pushed the page
   175px past a 390px viewport. Inline styles moved to classes so they can be
   overridden at all.
   ========================================================================== */
.nl-hero {
  border-bottom: 1px solid var(--line);
  padding: 64px var(--gutter) 40px;
}
.nl-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
  min-width: 0;
}
.nl-hero-grid > * { min-width: 0; }
.nl-subscribe {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 40px;
}
@media (max-width: 980px) {
  .nl-hero { padding: 40px var(--gutter-mobile) 32px; }
  .nl-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .nl-hero-grid .h1 { font-size: 40px; }
  .nl-subscribe { padding: 28px 24px; }
}

/* ==========================================================================
   Header nav, tablet range                                [mobile overflow]
   system.css only ever adapts .site-nav below 720px, but the desktop nav --
   logo + 6 links + a fixed 220px search pill + Subscribe -- does not fit until
   about 1000px. .site-nav is a non-wrapping flex row, so between 721px and
   980px .nav-right overflowed and pushed EVERY page 237px wider than the
   viewport. Measured at 768px on staging; production does not do this.
   ========================================================================== */
@media (max-width: 980px) {
  .site-nav { padding: 16px 24px; gap: 16px; }
  .nav-search { display: none; }
  .nav-links { gap: 20px; font-size: 13px; min-width: 0; }
  .nav-right { gap: 12px; flex: none; }
}

/* Below 720px system.css turns .nav-links into a scrollable full-width row.
   Keep that, and make sure nothing in the bar can force the page wider. */
@media (max-width: 720px) {
  .site-nav { padding: 14px var(--gutter-mobile); }
  .nav-links { width: 100%; }
}

/* ==========================================================================
   Review verdict card CTA                          [Ed, 2026-08-08: "the Try
   <product> button doesn't look like it fits correctly"]

   .verdict-cta is an <a> given width:100%, padding:16px and margin-top:16px --
   but components.css never sets a display, and <a> is inline by default. On an
   inline box width is ignored and vertical padding does not displace adjacent
   lines, so the button rendered shrink-wrapped and overlapped the price row
   above it by 13px and the disclosure note below it by 2px. 74 review pages
   (every review carrying a product_url).

   The price row is a separate issue on the same card: space-between with a long
   product_price string pushed the value hard against the card padding with no
   room to wrap.
   ========================================================================== */
.verdict-cta {
  display: block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}
.verdict-cta:hover { background: var(--brand-2); }

.verdict-pricing {
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: baseline;
}
.verdict-pricing strong {
  text-align: right;
  overflow-wrap: anywhere;
  margin-left: auto;
}
