/* HoodWRX — one stylesheet for the public site, maintenance page and admin. */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dm-serif-display-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #ffffff; --text: #111111; --muted: #6b6258; --line: #e7dfd3; --surface: #f8f4ee;
  --tan: #b89a6a; --tan-soft: #f1e8da; --gold: #8f6300; --gold-bright: #c8961e; --on-gold: #111;
  --danger: #a3261b; --ok: #2f6b2f; --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 20px rgba(40, 30, 10, .06);
  --radius: 14px; --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --text: #ffffff; --muted: #b3a998; --line: #2b2620; --surface: #100e0c;
    --tan: #d7bf95; --tan-soft: #1d1813; --gold: #f5c542; --gold-bright: #ffd45e; --on-gold: #111;
    --danger: #ff7b6b; --ok: #8fd18f; --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --text: #ffffff; --muted: #b3a998; --line: #2b2620; --surface: #100e0c;
  --tan: #d7bf95; --tan-soft: #1d1813; --gold: #f5c542; --gold-bright: #ffd45e; --on-gold: #111;
  --danger: #ff7b6b; --ok: #8fd18f; --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--on-gold); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5;
  backdrop-filter: saturate(1.2) blur(8px); }
.bar { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--text); letter-spacing: .2px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--gold-bright); font-weight: 400; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--tan-soft); text-decoration: none; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-form { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 4px 2px 12px; }
.search-form input, .search-form input[type=search] { border: 0; border-radius: 0; outline: none; background: transparent; color: var(--text); font: inherit; width: 180px; padding: 7px 4px; outline: none; }
.search-form button, .icon-btn { border: 0; background: transparent; color: var(--text); cursor: pointer; width: 38px; height: 38px;
  border-radius: 999px; display: grid; place-items: center; }
.icon-btn { border: 1px solid var(--line); }
.icon-btn:hover, .search-form button:hover { background: var(--tan-soft); }
.icon-btn svg, .search-form svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.dateline { font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.dateline .wrap { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; padding: 10px 0 6px; gap: 8px; }
  .brand { font-size: 26px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
  .tools { flex: 1; margin-left: 0; }
  .search-form { flex: 1; }
  .search-form input, .search-form input[type=search] { width: 100%; }
  .site-header { position: static; }
}

/* ---------- sections ---------- */
main { padding: 22px 0 48px; }
.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 3px solid var(--text); padding-top: 10px; margin-bottom: 16px; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; line-height: 1.1; }
.section-head h2::after { content: ""; display: inline-block; width: 9px; height: 9px; background: var(--gold-bright);
  border-radius: 2px; margin-left: 8px; vertical-align: middle; }
.section-head a { font-weight: 600; font-size: 14px; }
.page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 48px); margin: 6px 0 4px; line-height: 1.05; }
.lede { color: var(--muted); margin: 0 0 18px; }

/* ---------- cards ---------- */
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.kicker a { color: inherit; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meta .dot::before { content: "•"; }
.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.2; margin: 0; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--gold); text-decoration: none; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.thumb { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--tan-soft); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.thumb.placeholder { display: grid; place-items: center; font-family: var(--serif); font-size: 40px; color: var(--tan); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--gold-bright); color: var(--on-gold); padding: 2px 8px; border-radius: 999px; }

.top-grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
.lead h3 { font-size: clamp(28px, 4vw, 40px); line-height: 1.08; }
.lead p { font-size: 17px; }
.top-list { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.top-list .card h3 { font-size: 19px; }
@media (min-width: 900px) {
  .top-grid { grid-template-columns: 1.6fr 1fr; }
  .top-list { grid-template-columns: 1fr 1fr; align-content: start; }
}
@media (max-width: 520px) { .top-list { grid-template-columns: 1fr; } }

.grid { display: grid; gap: 26px 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rows { display: grid; gap: 0; }
.row { display: grid; grid-template-columns: 1fr 120px; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.row h3 { font-size: 19px; }
.row .thumb { aspect-ratio: 4 / 3; border-radius: 10px; }
@media (min-width: 700px) { .row { grid-template-columns: 1fr 180px; } }
.row:first-child { padding-top: 0; }

.posts-strip { background: var(--tan-soft); border-radius: calc(var(--radius) + 6px); padding: 20px; }
.posts-strip .section-head { border-top-color: var(--gold-bright); }

/* videos */
.video { display: flex; flex-direction: column; gap: 8px; }
.video .frame { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; position: relative; }
.video button.play { all: unset; cursor: pointer; position: absolute; inset: 0; display: block; }
.video button.play img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.video button.play::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: var(--gold-bright) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23111'/%3E%3C/svg%3E") center/28px no-repeat;
  box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: transform .2s; }
.video button.play:hover::after, .video button.play:focus-visible::after { transform: scale(1.08); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video h3 { font-size: 17px; font-family: var(--sans); font-weight: 650; line-height: 1.3; margin: 0; }
.video h3 a { color: var(--text); }

/* products */
.product { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.product .thumb { aspect-ratio: 1 / 1; background: #fff; border-radius: 10px; }
.product .thumb img { object-fit: contain; padding: 10px; }
.product h3 { font-family: var(--sans); font-size: 16px; font-weight: 650; line-height: 1.3; margin: 0; }
.product h3 a { color: var(--text); }
.price { font-weight: 700; color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--gold-bright); background: var(--gold-bright);
  color: var(--on-gold); font: 600 14px/1 var(--sans); padding: 10px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--tan-soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: currentColor; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.note { font-size: 12px; color: var(--muted); }

/* sources & pager */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--text); background: var(--bg); }
.chip:hover { border-color: var(--gold-bright); text-decoration: none; }
.pager { display: flex; justify-content: space-between; margin-top: 26px; }

/* article page */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 6vw, 54px); line-height: 1.05; margin: 10px 0; }
.article .hero { border-radius: var(--radius); overflow: hidden; margin: 18px 0; }
.prose { font-size: 18px; line-height: 1.7; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
.prose blockquote { margin: 1.2em 0; padding: .2em 1em; border-left: 4px solid var(--gold-bright); color: var(--muted); }
.prose img { border-radius: 10px; margin: 1em 0; }
.prose pre { background: var(--surface); padding: 12px; border-radius: 10px; overflow: auto; }
.prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 30px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .brand { font-size: 24px; }
.footer-grid { display: grid; gap: 20px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- maintenance ---------- */
.maint { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center;
  background: radial-gradient(1200px 500px at 50% -10%, var(--tan-soft), var(--bg)); }
.maint .box { max-width: 560px; }
.maint .brand { font-size: clamp(48px, 10vw, 84px); display: block; margin-bottom: 18px; }
.maint h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 5vw, 40px); margin: 0 0 10px; }
.maint p { color: var(--muted); font-size: 18px; margin: 0 0 22px; }
.maint .bar-anim { height: 4px; width: 160px; margin: 0 auto 26px; border-radius: 4px; background: linear-gradient(90deg, var(--tan), var(--gold-bright), var(--tan)); background-size: 200% 100%; animation: slide 2.4s linear infinite; }
@keyframes slide { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .maint .bar-anim { animation: none; } .thumb img { transition: none; } }

/* ---------- admin ---------- */
.admin-bar { background: var(--surface); }
.admin-badge { font-size: 12px; font-weight: 700; color: var(--on-gold); background: var(--gold-bright); padding: 3px 8px; border-radius: 6px; margin-left: 8px; font-family: var(--sans); vertical-align: middle; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; border: 1px solid var(--line); background: var(--surface); }
.alert.ok { border-color: var(--ok); }
.alert.error { border-color: var(--danger); color: var(--danger); }
.alert.warn { border-color: var(--gold-bright); background: var(--tan-soft); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0 0 12px; }
.panels { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 26px; font-family: var(--serif); font-weight: 400; }
.stat span { font-size: 13px; color: var(--muted); }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input[type=text], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-bright); border-color: transparent; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-row.two { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: 2fr 1fr 1fr; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.min { width: 1%; white-space: nowrap; }
.table .t { font-weight: 600; }
.inline { display: inline; margin: 0; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.status.on { color: var(--ok); border-color: var(--ok); } .status.off { color: var(--muted); }
.status.hidden { color: var(--danger); border-color: var(--danger); }
.switch-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.big-state { font-size: 20px; font-weight: 700; }
.big-state.on { color: var(--danger); } .big-state.off { color: var(--ok); }
.mini-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--tan-soft); }
.editor-grid { display: grid; gap: 20px; }
.muted { color: var(--muted); }
.scroll-x { overflow-x: auto; }

/* EasyMDE theming */
.EasyMDEContainer .CodeMirror { background: var(--bg); color: var(--text); border-color: var(--line); border-radius: 0 0 10px 10px; font: 16px/1.6 var(--sans); }
.EasyMDEContainer .CodeMirror-cursor { border-color: var(--text); }
.editor-toolbar { border-color: var(--line); border-radius: 10px 10px 0 0; background: var(--surface); opacity: 1; }
.editor-toolbar button { color: var(--text) !important; font: 700 13px/1 var(--sans); min-width: 34px; width: auto; padding: 0 8px; }
.editor-toolbar button:hover, .editor-toolbar button.active { background: var(--tan-soft); border-color: var(--line); }
.editor-toolbar i.separator { border-color: var(--line); }
.editor-preview, .editor-preview-side { background: var(--bg); color: var(--text); border-color: var(--line); }
.editor-preview-side { font-size: 17px; line-height: 1.65; }
.editor-statusbar { color: var(--muted); }
.CodeMirror-selected { background: var(--tan-soft) !important; }
.cm-s-easymde .cm-link, .cm-s-easymde .cm-url { color: var(--gold); }
.maint .theme-toggle { margin: 0 auto; }
.table select { width: auto; min-width: 110px; padding: 6px 8px; }
