/*
Theme Name: The Spec Report
Theme URI: https://thespecreport.com
Author: The Spec Report
Description: Editorial block theme for The Spec Report: consensus scores built from high-trust reviews. Archivo headlines, Georgia body.
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-spec-report
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(h1, h2, h3, h4) { text-wrap: balance; }
.wp-site-blocks { min-height: 100vh; }
.skip-link:focus { background: #fff; color: var(--wp--preset--color--navy); }
:where(.wp-block-post-content) a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
:where(.wp-block-post-content) a:hover { text-decoration-thickness: 2px; }
img { height: auto; }
.has-tabular-nums, table { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Wordmark (masthead and footer) ---------- */
.tsr-wordmark { display: inline-block; position: relative; text-decoration: none !important; line-height: 0; }
.tsr-wordmark svg { display: block; height: 56px; width: auto; }
.site-footer .tsr-wordmark svg { height: 40px; }
@media (max-width: 600px) {
	.tsr-wordmark svg { height: 36px; }
	.site-header .tsr-util { font-size: 0.875rem; white-space: nowrap; margin: 0; }
	.site-header { padding-top: 1.1rem !important; }
	.site-header .tsr-nav-row { margin-top: 0.9rem !important; padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
	/* Categories scroll sideways on phones instead of hiding behind a menu button. */
	.site-header .tsr-nav-row .wp-block-navigation, .site-header .tsr-nav-row .wp-block-navigation__container { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
	.site-header .tsr-nav-row .wp-block-navigation__container::-webkit-scrollbar { display: none; }
	.site-header .tsr-nav-row .wp-block-navigation-item { white-space: nowrap; flex: none; }
	.site-header .tsr-nav-row .wp-block-navigation-item__content { display: inline-block; padding: 0.5rem 0; }
}

/* ---------- Header ---------- */
.site-header .tsr-nav-row { border-top: 3px solid var(--wp--preset--color--navy); }
.site-header .wp-block-navigation__container { gap: 0.4rem 1.6rem; }
.site-header .wp-block-navigation a { color: var(--wp--preset--color--ink); text-decoration: none; }
.site-header .wp-block-navigation a:hover { color: var(--wp--preset--color--navy); text-decoration: underline; text-underline-offset: 4px; }
.site-header .tsr-util a { color: var(--wp--preset--color--navy); text-decoration: none; font-family: var(--wp--preset--font-family--headline); font-size: 0.9375rem; }

/* ---------- Byline line ---------- */
.tsr-byline { font-family: var(--wp--preset--font-family--headline); font-size: var(--wp--preset--font-size--meta); color: var(--wp--preset--color--meta); }
.tsr-byline > * { margin: 0; }
.tsr-byline .wp-block-post-author-name a { color: var(--wp--preset--color--ink); text-decoration: none; }

/* ---------- Story cards (no borders, no shadows) ---------- */
.tsr-story .wp-block-post-title a, .tsr-list .wp-block-post-title a { color: var(--wp--preset--color--navy); text-decoration: none; }
.tsr-story .wp-block-post-title a:hover, .tsr-list .wp-block-post-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tsr-list .wp-block-post-title a { color: var(--wp--preset--color--ink); }
.tsr-story .wp-block-post-featured-image img, .tsr-hero .wp-block-post-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.tsr-story .wp-block-post-featured-image:not(:has(img)), .tsr-hero .wp-block-post-featured-image:not(:has(img)) { background: var(--wp--preset--color--photo); aspect-ratio: 16 / 9; }

/* Category tiles on the homepage */
.tsr-cat-tile { text-decoration: none; }
.tsr-cat-tile .tsr-cat-photo { aspect-ratio: 1 / 1; background: var(--wp--preset--color--photo); }
.tsr-cat-tile h3 a { color: var(--wp--preset--color--ink); text-decoration: none; }
.tsr-cat-tile h3 a:hover { text-decoration: underline; }

/* ---------- Disclosure line (plain sentence, body type, never a tinted box) ---------- */
.is-style-tsr-disclosure { font-size: var(--wp--preset--font-size--meta); color: var(--wp--preset--color--dek); }

/* ---------- Quick answer ---------- */
.is-style-tsr-quick-answer { background: var(--wp--preset--color--panel); padding: 1.25rem 1.5rem; }
.is-style-tsr-quick-answer > :first-child { margin-top: 0; }
.is-style-tsr-quick-answer .tsr-label { font-family: var(--wp--preset--font-family--headline); font-weight: 700; color: var(--wp--preset--color--navy); font-size: 1.0625rem; margin-bottom: 0.25rem; }

/* ---------- Consensus box ---------- */
.is-style-tsr-consensus { background: var(--wp--preset--color--panel); padding: 1.5rem 1.75rem 1.75rem; }
.is-style-tsr-consensus > :first-child { margin-top: 0; }
.tsr-score { font-family: var(--wp--preset--font-family--headline); font-weight: 800; font-size: var(--wp--preset--font-size--score); line-height: 1; letter-spacing: -0.03em; color: var(--wp--preset--color--navy); margin: 0; }
.tsr-score-sub { font-family: var(--wp--preset--font-family--headline); font-size: var(--wp--preset--font-size--meta); color: var(--wp--preset--color--dek); margin: 0.25rem 0 0; }
.tsr-tally { font-family: var(--wp--preset--font-family--headline); font-size: var(--wp--preset--font-size--meta); color: var(--wp--preset--color--navy); }
.is-style-tsr-consensus h3 { margin-top: 1.5rem; font-size: 1.1875rem; }
.is-style-tsr-consensus ul { margin-top: 0.5rem; padding-left: 1.2em; }
.is-style-tsr-consensus li { margin-bottom: 0.35rem; }

/* Spread strip, rendered server-side by tsr-core's [tsr_spread] shortcode */
.tsr-spread { margin: 1rem 0 0.25rem; max-width: 520px; }
.tsr-spread svg { display: block; width: 100%; height: auto; overflow: visible; }
.tsr-spread figcaption { font-family: var(--wp--preset--font-family--headline); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--meta); margin-top: 0.4rem; }

/* ---------- Tables: zebra fill, bold header, no cell borders ---------- */
.wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table th, .wp-block-table td { border: 0; padding: 0.7rem 0.85rem; text-align: left; vertical-align: top; }
.wp-block-table thead { border: 0; }
.wp-block-table thead th { font-weight: 700; color: var(--wp--preset--color--navy); background: var(--wp--preset--color--panel); }
.wp-block-table tbody tr:nth-child(odd) { background: var(--wp--preset--color--fill); }
.wp-block-table tbody tr:nth-child(even) { background: var(--wp--preset--color--panel); }
.wp-block-table figcaption { text-align: left; }
.is-style-tsr-specs td:first-child, .is-style-tsr-specs th:first-child { font-weight: 600; width: 42%; }
/* Comparison: sticky first column on small screens */
@media (max-width: 720px) {
	.is-style-tsr-compare table { min-width: 560px; }
	.is-style-tsr-compare th:first-child, .is-style-tsr-compare td:first-child { position: sticky; left: 0; z-index: 1; background: inherit; box-shadow: 1px 0 0 var(--wp--preset--color--photo); }
	.is-style-tsr-picks table { min-width: 620px; }
	.is-style-tsr-specs td:first-child, .is-style-tsr-specs th:first-child { width: 48%; }
}
.wp-block-table.is-style-tsr-compare::after, .wp-block-table.is-style-tsr-picks::after { content: ""; }

/* ---------- Pick cards (roundups) ---------- */
.is-style-tsr-pick { background: var(--wp--preset--color--panel); padding: 1.5rem 1.75rem; }
.is-style-tsr-pick > :first-child { margin-top: 0; }
.tsr-award { font-family: var(--wp--preset--font-family--headline); font-weight: 700; color: var(--wp--preset--color--navy); font-size: 1rem; margin: 0; }

/* ---------- Promo code ---------- */
.is-style-tsr-promo { background: var(--wp--preset--color--navy); color: #fff; padding: 1.25rem 1.5rem; }
.is-style-tsr-promo > :first-child { margin-top: 0; }
.is-style-tsr-promo a { color: #fff; }
.tsr-code { font-family: var(--wp--preset--font-family--headline); font-weight: 800; font-size: 1.75rem; letter-spacing: 0.02em; margin: 0.25rem 0; }
.tsr-copy { font: 600 0.9375rem var(--wp--preset--font-family--headline); background: #fff; color: var(--wp--preset--color--navy); border: 0; border-radius: 2px; min-height: 44px; padding: 0 1rem; cursor: pointer; margin-left: 0.75rem; vertical-align: middle; }
.tsr-copy:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.is-style-tsr-promo .tsr-promo-note { font-style: italic; font-size: var(--wp--preset--font-size--small); color: #D5DCE6; }

/* ---------- Plain panels: how we evaluated, worth it, who it's for ---------- */
.is-style-tsr-panel { background: var(--wp--preset--color--panel); padding: 1.25rem 1.5rem; }
.is-style-tsr-panel > :first-child { margin-top: 0; }

/* ---------- Retailer buttons ---------- */
.is-style-tsr-retailer .wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; }

/* ---------- Status banner ---------- */
.is-style-tsr-banner { background: #FFF4E5; color: #3A2400; padding: 0.9rem 1.25rem; font-family: var(--wp--preset--font-family--headline); font-size: 1rem; }
.is-style-tsr-banner a { color: #3A2400; }

/* ---------- FAQ (native details, server-rendered) ---------- */
.wp-block-details { background: var(--wp--preset--color--panel); padding: 0.9rem 1.25rem; margin-top: 0.5rem !important; }
.wp-block-details summary { font-family: var(--wp--preset--font-family--headline); font-weight: 700; color: var(--wp--preset--color--navy); cursor: pointer; min-height: 32px; }
.wp-block-details[open] summary { margin-bottom: 0.5rem; }

/* ---------- Update history and sources ---------- */
.is-style-tsr-history, .is-style-tsr-sources { font-family: var(--wp--preset--font-family--headline); font-size: var(--wp--preset--font-size--meta); color: var(--wp--preset--color--dek); padding-left: 1.2em; }
.is-style-tsr-history li, .is-style-tsr-sources li { margin-bottom: 0.4rem; }

/* ---------- Author box ---------- */
.tsr-author-box { background: var(--wp--preset--color--panel); padding: 1.5rem 1.75rem; }
.tsr-author-box .wp-block-post-author-biography { font-size: 1rem; }
.tsr-author-box .tsr-links a { font-family: var(--wp--preset--font-family--headline); font-size: var(--wp--preset--font-size--meta); }

/* ---------- Newsletter ---------- */
.tsr-newsletter { background: var(--wp--preset--color--panel); }
.tsr-newsletter .wp-block-jetpack-subscriptions__form input[type="email"] { border: 2px solid var(--wp--preset--color--navy) !important; border-radius: 2px !important; min-height: 48px; font-family: var(--wp--preset--font-family--body); }
.tsr-newsletter .wp-block-jetpack-subscriptions__form button { border-radius: 2px !important; min-height: 48px; background: var(--wp--preset--color--navy) !important; font-family: var(--wp--preset--font-family--headline); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer .tsr-foot-note { color: #D5DCE6; }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { font-family: var(--wp--preset--font-family--headline); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
