/*
Theme Name: Scott's Gear
Theme URI: https://scottsgear.com
Author: Scott's Gear
Description: A custom, accessible publishing theme for Scott's Gear, its gadget collection, stories, and videos.
Version: 0.1.0-alpha
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: scottsgear
*/

:root {
  --sg-orange: #f36b21;
  --sg-orange-dark: #c9470c;
  --sg-cream: #f5efe3;
  --sg-paper: #fffdf8;
  --sg-ink: #171714;
  --sg-muted: #68645d;
  --sg-line: #dcd3c4;
  --sg-panel: rgba(255, 253, 248, 0.88);
  --sg-shadow: 0 18px 45px rgba(43, 34, 23, 0.12);
  --sg-radius: 1.15rem;
  --sg-content: 1180px;
  color-scheme: light;
}

[data-theme="dark"] {
  --sg-cream: #111210;
  --sg-paper: #191a17;
  --sg-ink: #f7f0e5;
  --sg-muted: #b7b0a4;
  --sg-line: #34362f;
  --sg-panel: rgba(25, 26, 23, 0.9);
  --sg-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, rgba(243, 107, 33, .12), transparent 24rem),
    var(--sg-cream);
  color: var(--sg-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--sg-orange-dark); }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, .sg-button, input[type="submit"] {
  border: 0;
  border-radius: 999px;
  background: var(--sg-orange);
  color: #171714;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .7rem 1.15rem;
  font-weight: 800;
  text-decoration: none;
}
button:hover, .sg-button:hover, input[type="submit"]:hover { background: #ff7b30; color: #171714; }
.sg-button--ghost { background: transparent; border: 1px solid var(--sg-line); color: var(--sg-ink); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; z-index: 100000; top: 1rem; left: 1rem; width: auto; height: auto; padding: .75rem 1rem; clip: auto; background: var(--sg-paper); color: var(--sg-ink); }
.sg-shell { width: min(calc(100% - 2rem), var(--sg-content)); margin-inline: auto; }
.sg-narrow { width: min(calc(100% - 2rem), 780px); margin-inline: auto; }
.sg-section { padding: clamp(3rem, 7vw, 6rem) 0; }
.sg-eyebrow { margin: 0 0 .7rem; color: var(--sg-orange-dark); font-size: .76rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, h4 { margin: 0 0 .7em; font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif; line-height: .98; letter-spacing: -.025em; text-wrap: balance; }
h1 { font-size: clamp(3.2rem, 9vw, 7.4rem); }
h2 { font-size: clamp(2.1rem, 5vw, 4.2rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 2rem); }
p { margin: 0 0 1.2rem; }
.sg-lede { max-width: 730px; color: var(--sg-muted); font-size: clamp(1.08rem, 2.4vw, 1.4rem); }

.sg-site-header { position: sticky; z-index: 100; top: 0; border-bottom: 1px solid var(--sg-line); background: color-mix(in srgb, var(--sg-cream) 88%, transparent); backdrop-filter: blur(15px); }
.sg-header-inner { min-height: 76px; display: flex; align-items: center; gap: 1.25rem; }
.sg-brand { display: inline-flex; align-items: center; gap: .75rem; margin-right: auto; text-decoration: none; }
.sg-mark { width: 42px; aspect-ratio: 1; border: 3px solid currentColor; border-radius: 11px; display: grid; place-items: center; background: var(--sg-orange); color: #171714; font-weight: 950; letter-spacing: -.1em; }
.sg-brand-copy { display: grid; line-height: 1; }
.sg-brand-name { font-family: "Arial Narrow", Impact, sans-serif; font-size: 1.3rem; font-weight: 900; letter-spacing: -.03em; }
.sg-brand-tagline { margin-top: .25rem; color: var(--sg-muted); font-size: .68rem; font-weight: 700; }
.sg-nav ul { display: flex; align-items: center; gap: 1.15rem; margin: 0; padding: 0; list-style: none; }
.sg-nav a { font-size: .83rem; font-weight: 850; text-decoration: none; }
.sg-theme-switcher { display: flex; gap: .3rem; padding: .25rem; border: 1px solid var(--sg-line); border-radius: 999px; background: var(--sg-paper); }
.sg-theme-switcher button { width: 36px; min-height: 34px; padding: 0; background: transparent; color: var(--sg-muted); font-size: .72rem; }
.sg-theme-switcher button[aria-pressed="true"] { background: var(--sg-orange); color: #171714; }
.sg-menu-toggle { display: none; }

.sg-hero { padding: clamp(4rem, 9vw, 8rem) 0; overflow: hidden; }
.sg-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .75fr); align-items: center; gap: clamp(2rem, 7vw, 7rem); }
.sg-hero h1 span { color: var(--sg-orange); }
.sg-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.sg-device-stage { position: relative; min-height: 480px; display: grid; place-items: center; }
.sg-device-stage::before { content: ""; position: absolute; width: 92%; aspect-ratio: 1; border: 1px solid var(--sg-line); border-radius: 50%; box-shadow: 0 0 0 45px color-mix(in srgb, var(--sg-orange) 7%, transparent), 0 0 0 90px color-mix(in srgb, var(--sg-orange) 4%, transparent); }
.sg-device-placeholder { position: relative; width: min(62%, 260px); aspect-ratio: .62; border: 8px solid var(--sg-ink); border-radius: 2.4rem; background: linear-gradient(150deg, var(--sg-paper), color-mix(in srgb, var(--sg-orange) 14%, var(--sg-paper))); box-shadow: var(--sg-shadow); transform: rotate(7deg); }
.sg-device-placeholder::before { content: "DEVICE PHOTO"; position: absolute; inset: 14% 10% 38%; display: grid; place-items: center; border: 2px solid var(--sg-line); border-radius: .7rem; color: var(--sg-muted); font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.sg-device-placeholder::after { content: ""; position: absolute; left: 50%; bottom: 12%; width: 22%; aspect-ratio: 1; border: 3px solid var(--sg-line); border-radius: 50%; transform: translateX(-50%); }
.sg-fact { position: absolute; right: 0; bottom: 8%; max-width: 220px; padding: 1rem; border: 1px solid var(--sg-line); border-radius: 1rem; background: var(--sg-panel); box-shadow: var(--sg-shadow); font-size: .85rem; }
.sg-fact strong { display: block; color: var(--sg-orange-dark); }

.sg-stat-strip { border-block: 1px solid var(--sg-line); background: var(--sg-paper); }
.sg-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.sg-stat { padding: 1.7rem; border-right: 1px solid var(--sg-line); }
.sg-stat:last-child { border-right: 0; }
.sg-stat strong { display: block; font-family: "Arial Narrow", Impact, sans-serif; font-size: 2rem; line-height: 1; }
.sg-stat span { color: var(--sg-muted); font-size: .78rem; font-weight: 750; }

.sg-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2rem; }
.sg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.sg-card { overflow: hidden; border: 1px solid var(--sg-line); border-radius: var(--sg-radius); background: var(--sg-panel); box-shadow: 0 8px 22px rgba(43,34,23,.06); }
.sg-card a { text-decoration: none; }
.sg-card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--sg-orange) 9%, var(--sg-paper)); }
.sg-card-media img { width: 100%; height: 100%; object-fit: contain; padding: .8rem; transition: transform .25s ease; }
.sg-card:hover .sg-card-media img { transform: scale(1.03); }
.sg-card-placeholder { color: var(--sg-muted); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
.sg-card-body { padding: 1.2rem; }
.sg-card-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .7rem; color: var(--sg-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.sg-card h3 { margin-bottom: .45rem; }
.sg-card p { color: var(--sg-muted); font-size: .92rem; }
.sg-pill { display: inline-flex; padding: .22rem .55rem; border: 1px solid var(--sg-line); border-radius: 999px; font-size: .7rem; font-weight: 800; }

.sg-dark-band { background: #171714; color: #f7f0e5; }
.sg-dark-band .sg-eyebrow { color: #ff8a46; }
.sg-dark-band .sg-lede { color: #cfc7bb; }
.sg-story-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.sg-story-list { border-top: 1px solid #3b3a35; }
.sg-story-link { display: grid; grid-template-columns: 4rem 1fr auto; gap: 1rem; align-items: center; padding: 1.3rem 0; border-bottom: 1px solid #3b3a35; text-decoration: none; }
.sg-story-link time { color: #a7a096; font-size: .75rem; }
.sg-story-link strong { font-size: 1.08rem; }

.sg-archive-header { padding: 4rem 0 2rem; }
.sg-filter-bar { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.5rem 0 2.5rem; padding: 1rem; border: 1px solid var(--sg-line); border-radius: var(--sg-radius); background: var(--sg-paper); }
.sg-filter-bar input, .sg-filter-bar select, .sg-field input, .sg-field textarea {
  width: 100%; border: 1px solid var(--sg-line); border-radius: .7rem; background: var(--sg-cream); color: var(--sg-ink); padding: .75rem .85rem;
}
.sg-filter-bar input { flex: 1 1 250px; }
.sg-filter-bar select { width: auto; flex: 1 1 160px; }
.sg-pagination { margin-top: 2rem; }
.sg-pagination .nav-links { display: flex; gap: .5rem; }
.sg-pagination .page-numbers { padding: .45rem .75rem; border: 1px solid var(--sg-line); border-radius: .5rem; text-decoration: none; }
.sg-pagination .current { background: var(--sg-orange); color: #171714; border-color: var(--sg-orange); }

.sg-single-hero { padding: 4rem 0 2rem; }
.sg-single-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.sg-gallery-main { position: sticky; top: 100px; border: 1px solid var(--sg-line); border-radius: var(--sg-radius); background: var(--sg-paper); overflow: hidden; }
.sg-gallery-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 1.3rem; }
.sg-specs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 1px solid var(--sg-line); }
.sg-spec { padding: .95rem 0; border-bottom: 1px solid var(--sg-line); }
.sg-spec:nth-child(odd) { padding-right: 1rem; }
.sg-spec:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--sg-line); }
.sg-spec dt { color: var(--sg-muted); font-size: .7rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.sg-spec dd { margin: .2rem 0 0; font-weight: 700; }
.sg-prose { padding: 3rem 0; }
.sg-prose > * { max-width: 760px; margin-inline: auto; }
.sg-prose > .alignwide { max-width: var(--sg-content); }
.sg-prose blockquote { padding: 1rem 1.5rem; border-left: 5px solid var(--sg-orange); background: var(--sg-paper); font-size: 1.2rem; }
.sg-notice { margin: 1rem 0; padding: 1rem; border: 1px solid var(--sg-line); border-radius: .8rem; background: var(--sg-paper); }
.sg-notice--success { border-color: #2e8b57; }
.sg-notice--error { border-color: #c83d2f; }
.sg-form { display: grid; gap: 1rem; }
.sg-field label { display: block; margin-bottom: .3rem; font-weight: 800; }

.sg-site-footer { padding: 4rem 0 1.5rem; background: #11120f; color: #f7f0e5; }
.sg-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.sg-footer-grid h3 { font-size: 1rem; letter-spacing: .03em; }
.sg-footer-grid ul { margin: 0; padding: 0; list-style: none; }
.sg-footer-grid li { margin: .45rem 0; }
.sg-footer-grid a { color: #d9d1c4; text-decoration: none; }
.sg-footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid #34362f; color: #9d978d; font-size: .75rem; }

[data-theme="crt"] {
  --sg-cream: #020a04;
  --sg-paper: #061109;
  --sg-ink: #77ff88;
  --sg-muted: #4fc460;
  --sg-line: #1b6128;
  --sg-panel: #061109;
  --sg-orange: #77ff88;
  --sg-orange-dark: #9affaa;
  --sg-shadow: 0 0 20px rgba(72,255,99,.13);
  color-scheme: dark;
}
[data-theme="crt"] body { background: #020a04; font-family: "Courier New", monospace; text-shadow: 0 0 7px rgba(92,255,110,.38); }
[data-theme="crt"] body::after { content: ""; pointer-events: none; position: fixed; z-index: 9999; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0,0,0,.18) 3px, rgba(0,0,0,.18) 4px); mix-blend-mode: multiply; }
[data-theme="crt"] h1, [data-theme="crt"] h2, [data-theme="crt"] h3, [data-theme="crt"] h4, [data-theme="crt"] .sg-brand-name, [data-theme="crt"] .sg-stat strong { font-family: "Courier New", monospace; letter-spacing: 0; }
[data-theme="crt"] .sg-site-header { background: #020a04; backdrop-filter: none; }
[data-theme="crt"] img, [data-theme="crt"] video, [data-theme="crt"] iframe, [data-theme="crt"] .sg-device-stage, [data-theme="crt"] .wp-block-cover, [data-theme="crt"] .wp-block-image { display: none !important; }
[data-theme="crt"] .sg-card-media { aspect-ratio: auto; min-height: 3rem; border-bottom: 1px dashed var(--sg-line); background: transparent; }
[data-theme="crt"] .sg-card-media::after { content: "[MEDIA OMITTED IN TEXT MODE]"; color: var(--sg-muted); font-size: .68rem; }
[data-theme="crt"] .sg-hero-grid, [data-theme="crt"] .sg-single-grid, [data-theme="crt"] .sg-story-grid { grid-template-columns: 1fr; }
[data-theme="crt"] .sg-hero { padding-block: 3rem; }
[data-theme="crt"] .sg-card, [data-theme="crt"] .sg-filter-bar, [data-theme="crt"] .sg-gallery-main { border-radius: 0; box-shadow: none; }

@media (max-width: 900px) {
  .sg-menu-toggle { display: inline-flex; width: 42px; min-height: 38px; padding: 0; }
  .sg-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; padding: 1rem; border-bottom: 1px solid var(--sg-line); background: var(--sg-cream); }
  .sg-nav.is-open { display: block; }
  .sg-nav ul { align-items: stretch; flex-direction: column; }
  .sg-hero-grid, .sg-single-grid, .sg-story-grid { grid-template-columns: 1fr; }
  .sg-device-stage { min-height: 360px; }
  .sg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .sg-brand-tagline { display: none; }
  .sg-theme-switcher button { width: 31px; }
  .sg-stats, .sg-grid, .sg-footer-grid { grid-template-columns: 1fr; }
  .sg-stat { border-right: 0; border-bottom: 1px solid var(--sg-line); }
  .sg-heading-row, .sg-footer-bottom { align-items: start; flex-direction: column; }
  .sg-specs { grid-template-columns: 1fr; }
  .sg-spec:nth-child(odd), .sg-spec:nth-child(even) { padding-inline: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
