/*
Theme Name: Gadget Daily
Theme URI: https://gadgetdailynews.com/
Description: Gadget Daily News, set as a newspaper personal-technology section: a category-colored section band, a boxed Q/A answer under every headline, a then-and-now year rail and a calm serif reading column.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: gadgetdaily
*/

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Libre Franklin"; src: url("assets/fonts/libre-franklin-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("assets/fonts/source-serif-4-latin-wght.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
	--ink: #111418;
	--ink-2: #2b3036;
	--ink-3: #4f5761;
	--paper: #ffffff;
	--tint: #e8ebee;
	--tint-2: #f3f5f7;
	--rule: #d5dadf;
	--brand: #ea580c;
	--brand-ink: #c2410c;
	--section: var(--ink);
	--head: "Libre Franklin", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
	--read: "Source Serif 4", Georgia, "Times New Roman", serif;
	--wrap: 1312px;
	--gutter: clamp(20px, 4.4vw, 64px);
	--measure: 66ch;
}
.sec-apple { --section: #1d4ed8; }
.sec-android-phones { --section: #15803d; }
.sec-apps-services { --section: #6d28d9; }
.sec-photography { --section: #b45309; }
.sec-laptops-tablets { --section: #0f766e; }
.sec-ai-security { --section: #b91c1c; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--read); font-size: 18px; line-height: 1.7; font-optical-sizing: auto; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--section); color: #fff; }
:focus-visible { outline: 3px solid var(--section); outline-offset: 3px; }
.sec-default :focus-visible, body:not([class*="sec-"]) :focus-visible { outline-color: var(--brand-ink); }
html { scrollbar-color: var(--ink-3) var(--tint-2); }
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); text-wrap: balance; margin: 0; }
p, ul, ol, dl, figure, table, blockquote { margin: 0; }
p, li, dd { text-wrap: pretty; }
.screen-reader-text, .skip { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed !important; top: 12px; left: 12px; width: auto; height: auto; clip: auto; z-index: 99; background: var(--ink); color: #fff; padding: 10px 16px; font-family: var(--head); font-weight: 700; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Masthead ---------- */
.mast { border-bottom: 1px solid var(--ink); }
.mast__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.word { font-family: var(--head); font-weight: 900; font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.03em; line-height: 1; text-decoration: none; margin: 0; }
.word span { color: var(--brand); }
.word a { text-decoration: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.nav a { font-family: var(--head); font-weight: 600; font-size: 15px; text-decoration: none; padding: 6px 0 5px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { border-bottom-color: var(--rule); }
.nav .is-current a, .nav a[aria-current="page"] { border-bottom-color: var(--section); }
.mast__search { font-family: var(--head); font-weight: 700; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.mast__search svg { width: 18px; height: 18px; }

/* ---------- Section band (the frame) ---------- */
.band { background: var(--section); color: #fff; }
.band__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; font-family: var(--head); font-weight: 800; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.band a { color: #fff; text-decoration: none; font-weight: 800; }
.band a:hover { text-decoration: underline; }
.band__sep { padding: 0 6px; }
.band__topic { font-weight: 600; }
.band__right { font-weight: 600; letter-spacing: 0.04em; }
.crumbs { font-family: var(--head); font-size: 14px; color: var(--ink-3); padding-top: 18px; }
.crumbs a { color: var(--ink-3); }
.crumbs .separator { padding: 0 6px; }

/* ---------- Article layout ---------- */
.story { display: grid; grid-template-columns: 232px minmax(0, 700px) 300px; grid-template-areas: "rail head side" "rail body side"; column-gap: 48px; padding-top: 40px; padding-bottom: 72px; justify-content: space-between; }
.story__head { grid-area: head; }
.story__rail { grid-area: rail; align-self: start; position: sticky; top: 24px; }
.story__side { grid-area: side; align-self: start; position: sticky; top: 24px; }
.story__body { grid-area: body; min-width: 0; }
.story--norail { grid-template-columns: minmax(0, 700px) 300px; grid-template-areas: "head side" "body side"; justify-content: start; column-gap: 96px; }

.headline { font-weight: 900; font-size: clamp(36px, 4.4vw, 58px); line-height: 1.03; letter-spacing: -0.03em; margin-bottom: 18px; }
.deck { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.42; color: var(--ink-2); margin-bottom: 18px; max-width: 34em; }
.byline { font-family: var(--head); font-size: 14px; color: var(--ink-3); margin-bottom: 26px; }
.byline strong { color: var(--ink); font-weight: 700; }

.qa { background: var(--tint); padding: 24px 28px; display: grid; grid-template-columns: 44px 1fr; row-gap: 14px; margin-bottom: 36px; }
.qa dt, .qa dd { margin: 0; }
.qa__mark { font-family: var(--head); font-weight: 900; font-size: 30px; line-height: 1; color: var(--section); }
.qa__q { font-family: var(--head); font-weight: 600; font-size: 18px; line-height: 1.45; }
.qa__a { font-size: 19px; line-height: 1.55; }

.rail { border-top: 4px solid var(--ink); padding-top: 14px; }
.rail h2, .side h2, .rail summary, .toc-box summary { font-family: var(--head); font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.rail summary, .toc-box summary { list-style: none; cursor: default; }
.rail summary::-webkit-details-marker, .toc-box summary::-webkit-details-marker { display: none; }
.rail ol { list-style: none; padding: 0; }
.rail li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 1.38; }
.rail li b { font-family: var(--head); font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }
.rail li:last-child b { color: var(--section); }

.side { border-top: 4px solid var(--ink); padding-top: 14px; font-family: var(--head); }
.toc { list-style: none; padding: 0; margin-bottom: 24px; }
.toc a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1.35; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.toc a::before { content: ""; flex: none; width: 8px; height: 8px; border: 1.5px solid var(--ink); transform: translateY(-1px); }
.toc a:hover::before, .toc a.is-here::before { background: var(--ink); }
.checked { background: var(--tint-2); padding: 18px; font-size: 15px; line-height: 1.5; }
.checked b { display: block; font-weight: 800; margin-bottom: 4px; }
.checked a { font-weight: 600; }

/* ---------- Reading column ---------- */
.prose > * { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose p { font-size: 18px; line-height: 1.7; }
.prose h2 { font-weight: 800; font-size: clamp(25px, 2.2vw, 30px); line-height: 1.15; letter-spacing: -0.02em; margin-top: 2.1em; padding-top: 14px; border-top: 4px solid var(--ink); }
.prose h3 { font-weight: 800; font-size: 21px; line-height: 1.25; margin-top: 1.7em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose > h2:first-child { margin-top: 0; }
.prose strong { font-weight: 650; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; background: var(--tint-2); padding: 0.1em 0.35em; }
.prose ul { padding-left: 1.2em; }
.prose ul li { padding-left: 0.2em; }
.prose ul li::marker { color: var(--ink-3); }
.prose li + li { margin-top: 0.45em; }
/* Numbered steps: a strict margin of numbers (raise from the fold sequence). */
.prose ol { list-style: none; padding: 0; counter-reset: step; }
.prose ol > li { counter-increment: step; position: relative; padding: 12px 0 12px 52px; border-bottom: 1px solid var(--rule); }
.prose ol > li + li { margin-top: 0; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: 12px; width: 44px; font-family: var(--head); font-weight: 900; font-size: 22px; line-height: 1.2; color: var(--section); font-variant-numeric: tabular-nums; }
.prose ol > li > p:first-child { margin-top: 0; }
.prose blockquote { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px 0; font-size: 20px; line-height: 1.5; }

/* Tables are set like a newspaper data box, followed by a deliberate gap (raise from the cloud quarry). */
.prose .wp-block-table { max-width: 100%; overflow-x: auto; border-top: 4px solid var(--ink); margin-top: 1.6em; margin-bottom: 2.2em; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--head); font-size: 15px; line-height: 1.4; font-variant-numeric: tabular-nums lining-nums; }
.prose .wp-block-table th, .prose .wp-block-table td { border: 0; }
.prose .wp-block-table thead th { text-align: left; font-weight: 800; font-size: 12.5px; letter-spacing: 0.05em; text-transform: uppercase; padding: 12px 12px 10px; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.prose .wp-block-table td { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose tbody tr:nth-child(even) td { background: var(--tint-2); }
.prose td:first-child { font-weight: 700; }
.prose .wp-block-table figcaption { font-size: 14px; color: var(--ink-3); padding-top: 8px; font-family: var(--head); }

/* Figures (charts): set in the world's type and palette, with the finding as the title and a sourced caption. */
.prose .gdn-figure { max-width: 100%; margin-top: 1.8em; margin-bottom: 2.2em; border-top: 4px solid var(--ink); padding-top: 14px; }
.prose .gdn-figure svg { display: block; width: 100%; height: auto; max-width: 760px; }
.prose .gdn-figure figcaption { font-family: var(--head); font-size: 14px; line-height: 1.45; color: var(--ink-3); padding-top: 10px; max-width: var(--measure); }

/* Sources: corrections-box setting. */
.prose h2#sources { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.prose h2#sources + ul { list-style: none; padding: 0; font-family: var(--head); font-size: 15px; line-height: 1.45; }
.prose h2#sources + ul li { padding: 8px 0; border-bottom: 1px solid var(--rule); margin: 0; }

/* Ad slots collapse to nothing until ads are switched on. */
.ad { display: none; }
.ads-on .ad { display: block; min-height: 280px; margin: 2.2em 0; background: var(--tint-2); }

/* ---------- Related and lists ---------- */
.more { border-top: 4px solid var(--ink); padding-top: 14px; margin-top: 56px; max-width: var(--measure); }
.more h2 { font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.list { list-style: none; padding: 0; }
.list li { border-bottom: 1px solid var(--rule); }
.list a { display: block; text-decoration: none; padding: 16px 0; }
.list__title { display: block; font-family: var(--head); font-weight: 800; font-size: 21px; line-height: 1.22; letter-spacing: -0.01em; }
.list a:hover .list__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.list__dek { display: block; font-size: 16px; line-height: 1.5; color: var(--ink-2); margin-top: 6px; }
.list__meta { display: block; font-family: var(--head); font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* ---------- Section front (category archive, search) ---------- */
.front { padding-top: 40px; padding-bottom: 80px; }
.front__head { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: end; padding-bottom: 22px; border-bottom: 1px solid var(--ink); margin-bottom: 8px; }
.front__title { font-weight: 900; font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -0.035em; }
.front__intro { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.front__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
.front__grid > .side { margin-top: 28px; }
.front .list__title { font-size: 24px; }

/* ---------- Home: the paper's front ---------- */
.home-top { padding-top: 32px; }
.home-lead { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; padding: 28px 0 44px; border-bottom: 1px solid var(--ink); }
.home-lead__title { font-weight: 900; font-size: clamp(34px, 3.8vw, 52px); line-height: 1.04; letter-spacing: -0.03em; }
.home-lead__title a { text-decoration: none; }
.home-lead__title a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.home-lead .qa { margin: 22px 0 0; }
.home-lead__img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.home-lead .rail { align-self: start; }
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 40px 48px; padding: 44px 0 80px; }
.section-box > a.section-box__band { display: flex; justify-content: space-between; align-items: center; background: var(--section); color: #fff; text-decoration: none; font-family: var(--head); font-weight: 800; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 14px; }
.section-box > a.section-box__band:hover span:last-child { text-decoration: underline; }
.section-box .list__title { font-size: 19px; }

/* ---------- Pages, 404, search form ---------- */
.page { padding-top: 40px; padding-bottom: 80px; max-width: calc(700px + 2 * var(--gutter)); }
.page .headline { margin-bottom: 26px; }
.searchform { display: flex; gap: 0; max-width: 560px; border: 2px solid var(--ink); }
.searchform input { flex: 1; min-width: 0; border: 0; padding: 12px 14px; font: 17px var(--read); color: var(--ink); background: #fff; }
.searchform input::placeholder { color: var(--ink-3); }
.searchform input:focus { outline: none; }
.searchform:focus-within { outline: 3px solid var(--section); outline-offset: 2px; }
.searchform button { border: 0; background: var(--ink); color: #fff; font: 700 15px var(--head); padding: 0 20px; cursor: pointer; }
.searchform button:hover { background: var(--section); }
.empty { padding: 24px 0; font-size: 18px; }

/* ---------- Footer ---------- */
.foot { border-top: 4px solid var(--ink); margin-top: 0; padding: 32px 0 48px; font-family: var(--head); font-size: 15px; }
.foot__in { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.foot .word { font-size: 24px; margin-bottom: 10px; display: inline-block; }
.foot p { color: var(--ink-2); line-height: 1.55; max-width: 34em; }
.foot h2 { font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.foot ul { list-style: none; padding: 0; }
.foot li a { display: inline-block; padding: 4px 0; text-decoration: none; }
.foot li a:hover { text-decoration: underline; }
.foot__small { margin-top: 28px; color: var(--ink-3); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.mast__in { flex-wrap: wrap; min-height: 0; padding-top: 16px; gap: 10px; }
	.nav { order: 3; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--rule); }
	.nav::-webkit-scrollbar { display: none; }
	.nav ul { gap: 22px; padding: 4px var(--gutter); }
	.nav a { display: inline-block; padding: 10px 0 8px; }
	.story { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "rail head" "rail body" "rail side"; }
	.story--norail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body" "side"; }
	.story__side { position: static; margin-top: 48px; max-width: var(--measure); }
	.front__head, .front__grid { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
}
@media (max-width: 860px) {
	.band__in { min-height: 44px; font-size: 12.5px; }
	.story, .story--norail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "rail" "side" "body"; padding-top: 28px; }
	.story__rail { position: static; margin: 28px 0 0; }
	.story__side { position: static; margin: 24px 0 36px; }
	.rail summary, .toc-box summary { cursor: pointer; display: flex; justify-content: space-between; margin: 0; }
	.rail summary::after, .toc-box summary::after { content: "Show"; font-weight: 700; letter-spacing: 0.02em; text-transform: none; color: var(--section); }
	.rail details[open] summary::after, .toc-box[open] summary::after { content: "Hide"; }
	.rail details[open] summary, .toc-box[open] summary { margin-bottom: 10px; }
	.toc { margin-bottom: 16px; }
	/* Tables stack into label/value rows on phones. */
	.prose .wp-block-table { overflow: visible; }
	.prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
	.prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.prose tr { border-bottom: 2px solid var(--ink); padding: 6px 0; }
	.prose tbody tr:nth-child(even) td { background: none; }
	.prose .wp-block-table td { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 12px; border: 0; border-bottom: 1px solid var(--rule); padding: 8px 4px; }
	.prose .wp-block-table td:last-child { border-bottom: 0; }
	.story__side .checked { margin-top: 20px; }
	.prose td::before { content: attr(data-label); font-weight: 800; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); padding-top: 2px; }
	.prose td:first-child { font-size: 16px; }
	.qa { grid-template-columns: 34px 1fr; padding: 18px 18px; margin-bottom: 0; }
	.qa__mark { font-size: 24px; }
	.qa__a { font-size: 18px; }
	.home-lead { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.home-lead__img { order: -1; }
	.foot__in { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.prose table { font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
	.list__title, .toc a::before { transition: background-color 160ms cubic-bezier(.16,1,.3,1); }
}
@media print {
	.mast, .band, .story__side, .story__rail, .foot, .ad { display: none !important; }
	.story { display: block; }
}
