/* TechSmash — editorial rebuild. Oswald (self-hosted) + Charter/Georgia. */
@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/oswald-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #e01b22;
  --red-dark: #b31217;
  --ink: #17181a;
  --ink-soft: #4a4d52;
  --paper: #faf9f7;
  --paper-raised: #ffffff;
  --rule: #e4e1db;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --measure: 42rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10;
}
.skip:focus { left: .5rem; top: .5rem; }
.visuallyhidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- masthead ---------- */
.masthead { border-top: 4px solid var(--red); }
.masthead-inner { display: flex; justify-content: center; padding: 1.5rem 1.25rem; }
.brand img { display: block; height: 48px; width: auto; }

.topnav { background: var(--ink); position: sticky; top: 0; z-index: 5; }
.topnav .wrap { display: flex; align-items: center; position: relative; }
.topnav ul {
  list-style: none; display: flex; gap: .25rem;
  margin: 0; padding: 0; flex-wrap: wrap;
}
.topnav a {
  display: block; color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 500;
  font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .8rem 1rem;
}
.topnav a:hover { background: var(--red); }
.navtoggle { display: none; border: 0; background: none; }

/* ---------- cards / grid ---------- */
.grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  margin: 2rem 0;
}
.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(23,24,26,.08); }
.card-media { display: block; aspect-ratio: 16/9; overflow: hidden; background: #fff; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .4rem; }
.kicker { margin: 0; font-family: var(--display); font-weight: 500; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.kicker a { color: var(--red); text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.card-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.2; text-transform: uppercase; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--red); }
.card-excerpt { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* lead story */
.home-lead { margin-top: 2rem; }
.card-lead { flex-direction: row; border-left: 4px solid var(--red); }
.card-lead .card-media { flex: 1 1 58%; aspect-ratio: auto; min-height: 20rem; }
.card-lead .card-body { flex: 1 1 42%; justify-content: center; padding: 2rem; }
.card-lead .card-title { font-size: 2.1rem; line-height: 1.1; }
.card-lead .card-excerpt { font-size: 1.05rem; }

.section-head {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.1rem; letter-spacing: .1em;
  border-bottom: 3px solid var(--ink); padding-bottom: .4rem;
  margin: 3rem 0 1.25rem;
}
.home-cats { margin-bottom: 3rem; }
.catgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.catcard {
  background: var(--ink); color: #fff; text-decoration: none;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .3rem;
  border-bottom: 4px solid var(--red);
}
.catcard:hover { background: var(--red); }
.catcard strong { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.15rem; letter-spacing: .04em; }
.catcard span { font-size: .85rem; opacity: .75; }

/* ---------- archive ---------- */
.arch-header { margin: 2.5rem 0 0; border-bottom: 3px solid var(--ink); padding-bottom: 1rem; }
.arch-header h1 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 2.2rem; margin: 0 0 .25rem; line-height: 1.1; }
.arch-header p { margin: 0; color: var(--ink-soft); max-width: var(--measure); }
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin: 2rem 0 3rem; font-family: var(--display); text-transform: uppercase;
  letter-spacing: .06em; font-size: .9rem;
}
.pagination a { color: var(--red); text-decoration: none; font-weight: 500; }
.pagination a:hover { text-decoration: underline; }
.pagination span { color: var(--ink-soft); }

/* ---------- post ---------- */
.post { padding: 2.5rem 1.25rem 3rem; }
.post-header { max-width: var(--measure); margin: 0 auto 1.5rem; }
.post-header h1 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.8rem, 4.5vw, 2.75rem); line-height: 1.08; margin: .3rem 0 0;
}
.post-content { max-width: var(--measure); margin: 0 auto; }
.post-content > p:first-of-type::first-letter {
  font-family: var(--display); font-weight: 700; color: var(--red);
  float: left; font-size: 3.4em; line-height: .85; padding-right: .12em;
}
.post-content img {
  max-width: 100%; height: auto; display: block; margin: 1.5rem auto;
}
.post-content figure { margin: 1.5rem 0; }
.post-content figcaption { font-size: .85rem; color: var(--ink-soft); text-align: center; margin-top: .5rem; }
.post-content iframe { max-width: 100%; display: block; margin: 1.5rem auto; border: 0; }
.post-content iframe[src*="youtube"], .post-content iframe[src*="vimeo"] {
  width: 100%; aspect-ratio: 16/9; height: auto;
}
.post-content a { color: var(--red-dark); }
.post-content a:hover { color: var(--red); }
.post-content blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 4px solid var(--red); color: var(--ink-soft); font-style: italic;
}
.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--display); text-transform: uppercase; line-height: 1.15;
  margin: 2rem 0 .75rem;
}
.post-footer { max-width: var(--measure); margin: 2.5rem auto 0; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.backlink {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .06em;
  font-size: .9rem; color: var(--red); text-decoration: none; font-weight: 500;
}
.backlink:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.colophon { background: var(--ink); color: #b9bcc1; margin-top: 4rem; }
.colophon-inner { padding: 2.5rem 1.25rem; text-align: center; }
.colophon-logo { margin: 0 auto 1rem; filter: brightness(0) invert(1); opacity: .9; }
.colophon nav { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.colophon nav a {
  color: #fff; text-decoration: none; font-family: var(--display);
  text-transform: uppercase; letter-spacing: .08em; font-size: .85rem;
}
.colophon nav a:hover { color: var(--red); }
.colophon p { margin: 0; font-size: .85rem; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .brand img { height: 38px; }
  .topnav .wrap { padding: 0; }
  .navtoggle {
    display: flex; flex-direction: column; gap: 5px;
    padding: 1rem 1.25rem; cursor: pointer;
  }
  .navtoggle span { width: 22px; height: 2px; background: #fff; transition: transform .2s; }
  .topnav ul {
    display: none; width: 100%; flex-direction: column; gap: 0;
    padding-bottom: .5rem;
  }
  .topnav ul.open { display: flex; }
  .card-lead { flex-direction: column; }
  .card-lead .card-media { min-height: 0; aspect-ratio: 16/9; }
  .card-lead .card-body { padding: 1.25rem; }
  .card-lead .card-title { font-size: 1.5rem; }
}
