/* ============================================================
   benjoco.com blog styles
   Uses the same fonts (/fonts/...) and palette as the main site.
   Independent of base.css/main.css so the blog can't break the home page.
   ============================================================ */
@font-face { font-family: "montserrat-regular"; src: url("/fonts/montserrat/montserrat-regular-webfont.woff2") format("woff2"), url("/fonts/montserrat/montserrat-regular-webfont.woff") format("woff"); font-display: swap; }
@font-face { font-family: "montserrat-bold"; src: url("/fonts/montserrat/montserrat-bold-webfont.woff2") format("woff2"), url("/fonts/montserrat/montserrat-bold-webfont.woff") format("woff"); font-display: swap; }
@font-face { font-family: "librebaskerville-regular"; src: url("/fonts/librebaskerville/librebaskerville-regular-webfont.woff2") format("woff2"), url("/fonts/librebaskerville/librebaskerville-regular-webfont.woff") format("woff"); font-display: swap; }
@font-face { font-family: "librebaskerville-bold"; src: url("/fonts/librebaskerville/librebaskerville-bold-webfont.woff2") format("woff2"), url("/fonts/librebaskerville/librebaskerville-bold-webfont.woff") format("woff"); font-display: swap; }

:root {
  --bc-black: #151515;
  --bc-ink: #161616;
  --bc-muted: #5b5b5b;
  --bc-line: #e1e1e1;
  --bc-paper: #ffffff;
  --bc-soft: #ebebeb;
  --bc-brown: #4c2405;
  --bc-rust: #7c3b08;
  --bc-amber: #f0a359;

  --f-sans: "montserrat-regular", "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --f-sans-bold: "montserrat-bold", "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "librebaskerville-regular", "Libre Baskerville", Georgia, serif;
  --f-serif-bold: "librebaskerville-bold", "Libre Baskerville", Georgia, serif;
  --f-code: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --measure: 70ch;
}

/* ---------- base ---------- */
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
.blog-page {
  margin: 0;
  background: var(--bc-paper);
  color: var(--bc-ink);
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.blog-page *, .blog-page *::before, .blog-page *::after { box-sizing: border-box; }
.blog-page a { color: var(--bc-rust); text-underline-offset: 0.2em; }
.blog-page a:hover { color: var(--bc-brown); }
.blog-page a:focus-visible, .blog-page button:focus-visible { outline: 2px solid var(--bc-amber); outline-offset: 3px; }
.blog-wrap { width: min(100% - 3rem, 68rem); margin-inline: auto; }
main:focus { outline: none; }

/* ---------- skip link: hidden until keyboard focus ---------- */
.skip-link {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 100;
  padding: 0.75rem 1.1rem; background: #fff; color: var(--bc-black);
  font-family: var(--f-sans-bold); font-size: 0.8rem; letter-spacing: 0.08em; text-decoration: none;
  border-radius: 3px; transform: translateY(-200%); transition: transform 0.15s;
}
.blog-page .skip-link:focus { transform: none; color: var(--bc-black); outline: 2px solid var(--bc-amber); outline-offset: 2px; }

/* ---------- header: logo top-left, quiet uppercase links like the home page menu ---------- */
.blog-bar {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(26px + env(safe-area-inset-top, 0px)) 26px 0;
}
.blog-bar__logo {
  display: block; width: 60px; height: 60px;
  background: url("/images/logo.png") no-repeat center / 60px 60px;
}
.blog-bar nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; justify-content: flex-end; }
.blog-page .blog-bar nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--f-sans); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55); text-decoration: none; transition: color 0.3s;
}
.blog-page .blog-bar nav a:hover, .blog-page .blog-bar nav a[aria-current="page"] { color: #fff; }

/* ---------- dark hero band, same treatment as #home ---------- */
.blog-hero {
  position: relative;
  background: var(--bc-black) url("/images/new-bg.jpg") no-repeat center / cover;
  color: #fff;
  padding: calc(9rem + env(safe-area-inset-top, 0px)) 0 5rem;
}
.blog-hero::before { content: ""; position: absolute; inset: 0; background: rgba(5, 5, 5, 0.72); }
.blog-hero > * { position: relative; }
.blog-hero .blog-kicker, .blog-hero .post-category {
  font-family: var(--f-sans-bold); font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--bc-amber); margin: 0 0 1rem; line-height: 1.4;
}
.blog-hero .post-category a { color: inherit; text-decoration: none; }
.blog-hero h1 {
  font-family: var(--f-serif-bold); font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.18; letter-spacing: -0.02em;
  margin: 0 0 1.25rem; max-width: 24ch; text-wrap: balance;
}
.blog-hero p { font-family: var(--f-serif); color: rgba(255, 255, 255, 0.75); font-size: 1.15rem; line-height: 1.7; margin: 0; max-width: 40rem; }
.blog-hero .post-meta { font-family: var(--f-sans); font-size: 0.85rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.5); margin-top: 1.5rem; }

.blog-main { padding-top: 3.5rem; }

/* ---------- index ---------- */
.blog-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2.5rem; padding: 0; list-style: none; }
.blog-filters button {
  font-family: var(--f-sans-bold); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 0.6rem 1rem; border: 1px solid var(--bc-line); border-radius: 3px;
  background: var(--bc-paper); color: var(--bc-ink); cursor: pointer;
}
.blog-filters button:hover { border-color: var(--bc-black); }
.blog-filters button[aria-pressed="true"] { background: var(--bc-black); border-color: var(--bc-black); color: #fff; }

.blog-list { list-style: none; margin: 0 0 4.5rem; padding: 0; border-top: 1px solid var(--bc-line); }

/* ---------- blog call to action, same dark card as the author box ---------- */
.blog-cta {
  margin: 0 0 6rem; padding: 2.5rem 2rem;
  background: var(--bc-black) url("/images/skills-bg.jpg") no-repeat center / cover;
  position: relative; color: #fff; border-radius: 4px; overflow: hidden;
}
.blog-cta::before { content: ""; position: absolute; inset: 0; background: rgba(21, 21, 21, 0.86); }
.blog-cta > * { position: relative; }
.blog-cta h2 { font-family: var(--f-serif-bold); font-weight: 400; font-size: 1.6rem; line-height: 1.3; margin: 0 0 0.6rem; }
.blog-cta p { color: rgba(255, 255, 255, 0.78); margin: 0 0 1.5rem; max-width: var(--measure); }
.blog-item { border-bottom: 1px solid var(--bc-line); }
.blog-page .blog-item a {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.25rem 2.5rem;
  padding-block: 2rem; color: inherit; text-decoration: none;
}
.blog-item time { font-size: 0.85rem; color: var(--bc-muted); padding-top: 0.4rem; }
.blog-item h2 { font-family: var(--f-serif-bold); font-weight: 400; font-size: 1.45rem; line-height: 1.35; margin: 0 0 0.5rem; transition: color 0.2s; }
.blog-page .blog-item a:hover h2 { color: var(--bc-rust); }
.blog-item p { margin: 0; color: var(--bc-muted); max-width: var(--measure); }
.blog-item .blog-cat { grid-column: 2; font-family: var(--f-sans-bold); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bc-brown); margin-top: 0.75rem; }
.blog-empty { padding: 3rem 0; color: var(--bc-muted); }
@media (max-width: 40rem) {
  .blog-page .blog-item a { grid-template-columns: 1fr; }
  .blog-item .blog-cat { grid-column: 1; }

  /* keep the four links on one row at 390px: smaller logo, tighter spacing, 44px touch targets */
  .blog-bar { padding-inline: 18px; gap: 0.75rem; }
  .blog-bar__logo { width: 48px; height: 48px; background-size: 48px 48px; flex-shrink: 0; }
  .blog-bar nav { gap: 0 1rem; }
  .blog-page .blog-bar nav a { font-size: 0.72rem; letter-spacing: 0.12em; }

  /* less empty space above the articles on phones */
  .blog-hero { padding: calc(7rem + env(safe-area-inset-top, 0px)) 0 3rem; }
  .blog-main { padding-top: 2.5rem; }
  .blog-cta { padding: 2rem 1.5rem; }
}

/* ---------- article body ---------- */
.post-body { max-width: var(--measure); font-size: 1.08rem; line-height: 1.85; padding-bottom: 3rem; }
.post-body h2 { font-family: var(--f-serif-bold); font-weight: 400; font-size: 1.65rem; line-height: 1.3; margin: 2.6em 0 0.7em; }
.post-body h3 { font-family: var(--f-sans-bold); font-size: 1.15rem; line-height: 1.4; margin: 2em 0 0.6em; }
.post-body > :first-child { margin-top: 0; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.3em; }
.post-body li { margin-bottom: 0.45em; }
.post-body strong { font-family: var(--f-sans-bold); font-weight: 400; }
.post-body blockquote {
  margin: 1.8em 0; padding: 1rem 1.25rem; background: #faf6f2;
  border-left: 3px solid var(--bc-rust); font-family: var(--f-serif); color: #3a2a1d;
}
.post-body blockquote p:last-child { margin: 0; }
.post-body :not(pre) > code { font-family: var(--f-code); font-size: 0.86em; background: #f3f0ec; padding: 0.12em 0.4em; border-radius: 3px; color: var(--bc-brown); }
.post-body pre {
  font-family: var(--f-code); font-size: 0.88rem; line-height: 1.65;
  background: var(--bc-black); padding: 1.25rem 1.4rem; border-radius: 4px;
  overflow-x: auto; margin: 1.8em 0; border-top: 3px solid var(--bc-rust);
}
.post-body pre code.hljs { background: none; padding: 0; font-size: inherit; }
.post-body pre code:not(.hljs) { background: none; padding: 0; color: #ececec; font-size: inherit; }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; margin: 1.8em 0; }
.post-body th, .post-body td { border: 1px solid var(--bc-line); padding: 0.6rem 0.8rem; text-align: left; }
.post-body th { font-family: var(--f-sans-bold); font-weight: 400; background: var(--bc-soft); }
.post-body img { max-width: 100%; height: auto; }

/* ---------- author / hire card ---------- */
.post-author {
  max-width: var(--measure); margin: 0 0 4rem; padding: 2rem;
  background: var(--bc-black) url("/images/skills-bg.jpg") no-repeat center / cover;
  position: relative; color: #fff; border-radius: 4px; overflow: hidden;
}
.post-author::before { content: ""; position: absolute; inset: 0; background: rgba(21, 21, 21, 0.86); }
.post-author > * { position: relative; }
.post-author h2 { font-family: var(--f-serif-bold); font-weight: 400; font-size: 1.5rem; margin: 0 0 0.25rem; }
.post-author__title { font-family: var(--f-sans-bold); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bc-amber); margin: 0 0 1rem; }
.post-author p { color: rgba(255, 255, 255, 0.78); margin: 0 0 1.25rem; }
.post-skills { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.post-skills li { font-size: 0.8rem; padding: 0.25rem 0.65rem; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 3px; color: rgba(255, 255, 255, 0.85); }
.post-author__actions { display: flex; flex-wrap: wrap; gap: 0.9rem 1.5rem; align-items: center; }
.blog-page .post-author__actions a:not(.blog-btn) { color: #fff; }
.blog-page .blog-btn {
  display: inline-block; padding: 0.95rem 1.6rem; background: #fff; color: var(--bc-black);
  font-family: var(--f-sans-bold); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none; border-radius: 3px; transition: background 0.2s, color 0.2s;
}
.blog-page .blog-btn:hover { background: var(--bc-amber); color: var(--bc-black); }

.post-nav { display: flex; justify-content: space-between; gap: 1.5rem; max-width: var(--measure); margin-bottom: 5rem; font-size: 0.95rem; }

/* ---------- footer, matches home page footer ---------- */
.blog-foot { background: #111; color: rgba(255, 255, 255, 0.5); text-align: center; padding: 4rem 1.5rem calc(4rem + env(safe-area-inset-bottom, 0px)); font-size: 0.9rem; }
.blog-foot__social { list-style: none; display: flex; justify-content: center; gap: 1.5rem; margin: 0 0 1rem; padding: 0; font-size: 1.4rem; }
.blog-page .blog-foot a { color: #fff; }
.blog-page .blog-foot a:hover { color: var(--bc-amber); }
.blog-foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) { .blog-page * { transition: none !important; } }
