/* Ad Hustler archive - static stylesheet. No build step, no framework. */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f2efe9;
  --surface: #ffffff;
  --border: #e2ddd3;
  --border-strong: #cec7b8;
  --text: #23211d;
  --text-soft: #5f5a51;
  --text-faint: #8a8378;
  --accent: #b4451f;
  --link: #9c3d1b;
  --mark: #ffe9a8;
  --radius: 8px;
  --maxw: 46rem;
  --wide: 72rem;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16150f;
    --bg-soft: #1e1d17;
    --surface: #1c1b15;
    --border: #333127;
    --border-strong: #4a4739;
    --text: #e8e4d9;
    --text-soft: #b0aa9b;
    --text-faint: #857f71;
    --accent: #e8814f;
    --link: #eb9265;
    --mark: #5c4a15;
  }
}

:root[data-theme="dark"] {
  --bg: #16150f;
  --bg-soft: #1e1d17;
  --surface: #1c1b15;
  --border: #333127;
  --border-strong: #4a4739;
  --text: #e8e4d9;
  --text-soft: #b0aa9b;
  --text-faint: #857f71;
  --accent: #e8814f;
  --link: #eb9265;
  --mark: #5c4a15;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

img, video, iframe { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

code, pre, kbd { font-family: var(--mono); font-size: .88em; }
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  overflow-x: auto;
}
code { background: var(--bg-soft); padding: .1em .35em; border-radius: 4px; }
pre code { background: none; padding: 0; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.1rem;
  flex: 1;
  flex-wrap: wrap;
  font-size: .92rem;
}
.nav a { color: var(--text-soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { font-weight: 600; }

.masthead form { display: flex; }
.masthead input[type="search"] {
  font: inherit;
  font-size: .88rem;
  padding: .35rem .6rem;
  width: 12rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.masthead input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.theme-toggle {
  font: inherit;
  font-size: .95rem;
  line-height: 1;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  border-radius: var(--radius);
  padding: .38rem .5rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- layout ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .6rem; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 2.2rem 0 .7rem; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 .6rem; }

.lede { color: var(--text-soft); font-size: 1.05rem; margin: 0 0 2rem; }

.section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-faint);
  font-weight: 700;
  margin: 0 0 .9rem;
}

/* ---------- home ---------- */

.hero { border-bottom: 1px solid var(--border); padding-bottom: 2rem; margin-bottom: 2rem; }
.hero h1 { font-size: 2.4rem; }
.hero p { color: var(--text-soft); margin: .4rem 0 0; }

.stats { display: flex; flex-wrap: wrap; gap: 1.75rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.stats div { font-size: .85rem; color: var(--text-faint); }
.stats b { display: block; font-size: 1.5rem; color: var(--text); font-weight: 700; line-height: 1.1; }

/* ---------- post lists ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: 0; }
.post-list h3 { margin: 0 0 .25rem; font-size: 1.08rem; line-height: 1.35; }
.post-list h3 a { color: var(--text); text-decoration: none; }
.post-list h3 a:hover { color: var(--accent); text-decoration: underline; }
.post-list p { margin: .3rem 0 0; color: var(--text-soft); font-size: .93rem; }

.meta { font-size: .82rem; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.meta a { color: var(--text-faint); }
.meta .dot { opacity: .5; }

/* compact year-grouped archive rows */
.year-head {
  display: flex; align-items: baseline; gap: .75rem;
  margin: 2.5rem 0 .5rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--border-strong);
}
.year-head h2 { margin: 0; font-size: 1.5rem; }
.year-head span { font-size: .8rem; color: var(--text-faint); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 1rem; padding: .42rem 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.rows li:last-child { border-bottom: 0; }
.rows time { flex: 0 0 4.2rem; font-size: .8rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.rows a { color: var(--text); text-decoration: none; }
.rows a:hover { color: var(--accent); text-decoration: underline; }
.rows .cats { margin-left: auto; font-size: .75rem; color: var(--text-faint); text-align: right; flex: 0 0 auto; padding-left: 1rem; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-block;
  font-size: .78rem;
  padding: .22rem .6rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  background: var(--surface);
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip b { font-weight: 600; color: var(--text-faint); }

/* ---------- article ---------- */

.article-head { margin-bottom: 2rem; }
.article-head h1 { font-size: 2.1rem; }
.article-head .meta { margin-top: .7rem; }

.prose { font-family: var(--serif); font-size: 1.075rem; line-height: 1.75; overflow-wrap: break-word; }
.prose p { margin: 0 0 1.25rem; }
.prose h2, .prose h3, .prose h4 { font-family: var(--sans); }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); display: block; margin: 1.5rem auto; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: .3rem 0 .3rem 1.15rem;
  border-left: 3px solid var(--border-strong);
  color: var(--text-soft);
}
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
.prose li { margin: .3rem 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--border); padding: .45rem .6rem; text-align: left; }
.prose iframe { border-radius: var(--radius); }

/* embeds we replaced */
.embed-card {
  display: flex; align-items: center; gap: .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
  font-family: var(--sans);
  font-size: .93rem;
  text-decoration: none;
  color: var(--text);
}
.embed-card:hover { border-color: var(--accent); }
.embed-card .play {
  flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .8rem;
}
.embed-card small { display: block; color: var(--text-faint); font-size: .8rem; }

.dead-media {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
  font-family: var(--sans);
  font-size: .87rem;
  color: var(--text-faint);
}

/* ---------- prev/next ---------- */

.pager { display: flex; gap: 1rem; margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.pager a {
  flex: 1; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem;
  font-size: .92rem; line-height: 1.4;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager small { display: block; color: var(--text-faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .2rem; }
.pager .next { text-align: right; }

/* ---------- comments ---------- */

.comments { margin-top: 3.5rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul { list-style: none; margin: .9rem 0 0 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--border); }
.comment { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment-meta { font-size: .84rem; color: var(--text-faint); margin-bottom: .3rem; }
.comment-meta b { color: var(--text); font-weight: 600; }
.comment-body { font-size: .95rem; }
.comment-body p { margin: 0 0 .6rem; }
.comment-body p:last-child { margin-bottom: 0; }

/* ---------- search ---------- */

.search-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.search-controls input[type="search"] {
  flex: 1 1 18rem; font: inherit; font-size: 1.05rem;
  padding: .6rem .8rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.search-controls select {
  font: inherit; font-size: .9rem; padding: .55rem .5rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.search-controls input:focus, .search-controls select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.result-count { color: var(--text-faint); font-size: .87rem; margin: 0 0 1rem; }

.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.results h3 { margin: 0 0 .25rem; font-size: 1.05rem; line-height: 1.35; }
.results h3 a { color: var(--text); text-decoration: none; }
.results h3 a:hover { color: var(--accent); text-decoration: underline; }
.results .snippet { margin: .35rem 0 0; color: var(--text-soft); font-size: .92rem; }

mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 .1em; }

.empty { color: var(--text-faint); padding: 2rem 0; }
.loading { color: var(--text-faint); padding: 2rem 0; }

/* ---------- category grid ---------- */

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .9rem; padding: 0; list-style: none; margin: 0; }
.cat-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; background: var(--surface); text-decoration: none; display: block;
}
.cat-card:hover { border-color: var(--accent); }
.cat-card b { display: block; color: var(--text); font-size: 1rem; margin-bottom: .15rem; }
.cat-card:hover b { color: var(--accent); }
.cat-card span { font-size: .82rem; color: var(--text-faint); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 2rem 1.25rem;
  font-size: .85rem;
  color: var(--text-faint);
}
.footer-inner { max-width: var(--wide); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.footer a { color: var(--text-soft); }
.footer p { margin: 0 0 .35rem; }

/* ---------- misc ---------- */

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

.notice {
  border: 1px solid var(--border-strong); background: var(--bg-soft);
  border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .9rem;
  color: var(--text-soft); margin: 0 0 2rem;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.85rem; }
  .article-head h1 { font-size: 1.6rem; }
  /* Stack the masthead into three tidy rows instead of letting the nav
     wrap around the wordmark. */
  .masthead-inner { gap: .55rem .9rem; }
  .brand { order: 1; flex: 1 1 auto; }
  .theme-toggle { order: 2; }
  .nav { order: 3; flex: 1 1 100%; gap: .9rem; }
  .masthead form { order: 4; flex: 1 1 100%; }
  .masthead input[type="search"] { width: 100%; }
  .rows li { flex-wrap: wrap; gap: .15rem 1rem; }
  .rows .cats { margin-left: 0; padding-left: 0; text-align: left; flex-basis: 100%; }
  .rows time { flex-basis: 3.6rem; }
}

@media print {
  .masthead, .footer, .pager, .comments, .theme-toggle { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; }
}
