/* Ahodzil blog - loads after style.css, reuses its :root tokens. Blog-only styles. */

/* Sticky site header: on blog/category/article pages the post grid scrolls
   beneath it. The base style.css header is 97% opaque with a blur, so the
   scrolling cards bleed through and read as a translucent "pinned" bar. Make
   the header fully opaque here so the grid scrolls cleanly under it. This rule
   only loads on pages that include blog.css (head.html), never the homepage. */
header {
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Titles are author-typed in the CMS - never let a long word break the layout */
.blog-hero__title, .article__title, .featured-card .post-card__title, .post-card__title { overflow-wrap: break-word }

/* Headlines/titles are sans (system stack) per approved PDF; accent words use italic, not a serif face */
.blog-hero__title, .post-card__title, .newsletter h2 { font-family: var(--font); font-weight: 800 }
.blog-hero__title .accent, .newsletter h2 .accent { font-family: var(--font); font-style: italic; font-weight: 700 }

/* Breadcrumb - mono eyebrow trail, current page in red */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
}
.breadcrumb a { color: var(--dim); transition: color var(--ease) }
.breadcrumb a:hover { color: var(--ink) }
.breadcrumb span[aria-current="page"] { color: var(--signal) }
.breadcrumb .sep { color: rgba(28,28,30,.3) }

/* Blog index hero - 2-column on desktop: intro left, featured card right */
.blog-hero { padding: 40px 0 8px; display: grid; gap: 40px; align-items: start }
/* Stop grid/flex children from forcing the track wider than the viewport
   (nowrap content otherwise blows the column out and clips the title). */
.blog-hero > * { min-width: 0 }
/* Mobile (single column): order is intro -> filter -> featured (set below). */
.blog-hero > .cat-filter { margin-top: 0 }
@media(min-width:960px){
  .blog-hero { grid-template-columns: 1fr 1fr; column-gap: 56px; row-gap: 24px; padding: 48px 0 16px }
  /* Restore the desktop layout: intro top-left, filter under it, featured spans
     the right column across both rows. */
  .blog-hero__intro { grid-column: 1; grid-row: 1 }
  .blog-hero > .cat-filter { grid-column: 1; grid-row: 2; align-self: start }
  .featured-card { grid-column: 2; grid-row: 1 / span 2 }
}
/* Category/term page header - single column (no featured card) */
.term-hero { padding: 40px 0 8px; max-width: 720px }
@media(min-width:768px){ .term-hero { padding: 48px 0 16px } }
.blog-hero__title { margin-top: 16px; font-size: clamp(2rem, 8vw, 4rem); letter-spacing: -.03em; line-height: 1.06 }
.blog-hero__sub {
  margin-top: 24px; max-width: 560px;
  font-size: 17px; line-height: 1.7; color: rgba(28,28,30,.75);
}
.post-meta-line {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(28,28,30,.6);
}
.post-meta-line::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal); flex-shrink: 0;
}

/* Category filter - zero-JS pills are links to taxonomy pages.
   Explicitly static so the pills scroll away with the page; only the site
   header is sticky. This prevents the filter bar from being mistaken for a
   pinned element that the post grid scrolls under. */
.cat-filter {
  position: static; z-index: auto;
  margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px;
}
.cat-pill { position: static }
.cat-pill {
  display: inline-flex; align-items: center;
  padding: 8px 18px; border-radius: var(--pill);
  border: 1px solid var(--ink); background: var(--white);
  font-size: 13px; font-weight: 700; color: var(--ink);
  transition: transform var(--ease), background var(--ease), color var(--ease);
}
.cat-pill:hover { transform: translateY(-2px) }
.cat-pill:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px }
.cat-pill.is-active { background: var(--ink); color: var(--paper) }
/* Mobile: smaller, tighter pills */
@media(max-width:959px){
  .cat-filter { gap: 8px }
  .cat-pill { padding: 6px 14px; font-size: 12px }
  /* Stack order: intro text -> filter -> featured post (DOM is intro,featured,
     filter, so reorder with flex/grid order). */
  /* gap controls filter -> featured (small); cat-filter margin-top adds the
     larger space between the intro text and the filter. */
  .blog-hero { gap: 14px }
  .blog-hero__title { font-size: clamp(1.7rem, 7vw, 3rem); overflow-wrap: anywhere; word-break: break-word }
  .blog-hero__intro { order: 1 }
  .blog-hero > .cat-filter { order: 2; margin-top: 38px }
  .featured-card { order: 3 }
  /* Let the uppercase meta lines wrap instead of forcing width / clipping. */
  .post-meta-line, .featured-card .post-card__meta { flex-wrap: wrap }
}

/* Featured card - white bordered card with a dark code-terminal thumbnail header */
.featured-card {
  position: relative; display: flex; flex-direction: column; align-self: start;
  border-radius: 14px; border: 1px solid var(--border);
  background: var(--white); color: var(--ink); overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
}
.featured-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card) }
.featured-card:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px }
/* Dark terminal-style thumbnail on top */
.featured-card__thumb {
  position: relative; display: block; height: 240px;
  background: #1c1c1c; overflow: hidden;
}
.featured-card__badge {
  position: absolute; top: 16px; left: 16px;
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: var(--pill);
  background: var(--signal); color: var(--white);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
}
.featured-card__rating {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 5px 16px; border-radius: var(--pill);
  background: var(--rating-a); color: var(--ink);
  font-family: var(--serif); font-weight: 600; font-size: 16px;
}
.featured-card__code {
  position: absolute; left: 24px; right: 24px; top: 66px;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--mono); font-size: 13px; line-height: 1.3;
  color: rgba(250,247,238,.92);
}
.featured-card__code .cl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.featured-card__code .cl b { color: var(--mint); font-weight: 600 }
.featured-card__code .cl-ok { color: #8fd98f }
.featured-card__code .cl-dim { color: rgba(250,247,238,.6) }
.featured-card__body { padding: 28px }
@media(min-width:640px){ .featured-card__body{ padding: 32px } }
.featured-card .post-card__title {
  margin-top: 12px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.12;
}
.featured-card .post-card__excerpt { margin-top: 12px }
.featured-card__author {
  margin-top: 24px; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--dim);
}

/* All posts grid - 1 / 2 / 3 col responsive */
.all-posts { margin-top: 28px }
@media(min-width:960px){ .all-posts { margin-top: 56px } }
.all-posts > .eyebrow { text-align: center }
.post-grid { display: grid; gap: 20px; margin-top: 24px }
@media(min-width:600px){ .post-grid{ grid-template-columns: 1fr 1fr } }
@media(min-width:960px){ .post-grid{ grid-template-columns: repeat(3,1fr); gap: 20px } }

/* Card = full-height colour block on the left + text body on the right */
.post-card {
  display: grid; grid-template-columns: 84px 1fr; align-items: stretch;
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--white); overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card) }
.post-card:focus-within { box-shadow: var(--shadow-card) }
.post-card:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px }

/* Left colour block - full card height, icon centred */
.post-card__icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); background: var(--mint);
}
.post-card__icon svg { width: 26px; height: 26px }
/* Card colour - set per post in the CMS (card_color), or auto-rotated by the template.
   Tinted left blocks (mint/pink/cream) + fully-inverted cards (dark/green). */
.pc-mint .post-card__icon { background: var(--mint) }
.pc-pink .post-card__icon { background: #f6dde1 }
.pc-cream .post-card__icon { background: var(--paper-deep) }

.pc-dark { background: var(--ink); border-color: var(--ink) }
.pc-dark .post-card__icon { background: transparent; color: var(--mint) }
.pc-dark .post-card__title { color: var(--paper) }
.pc-dark:hover .post-card__title { color: var(--mint) }
.pc-dark .post-card__excerpt { color: rgba(250,247,238,.7) }
.pc-dark .post-card__meta { color: rgba(250,247,238,.55) }

.pc-green { background: var(--mint-deep); border-color: var(--mint-deep) }
.pc-green .post-card__icon { background: transparent; color: var(--paper) }
.pc-green .post-card__title { color: var(--paper) }
.pc-green:hover .post-card__title { color: var(--ink) }
.pc-green .post-card__excerpt { color: rgba(250,247,238,.85) }
.pc-green .post-card__meta { color: rgba(250,247,238,.7) }
/* Featured thumb reuses the category colour as a tinted dark overlay base */
.featured-card__thumb.post-card__icon--engineering { background: linear-gradient(135deg,#142a24,#1c1c1c) }
.featured-card__thumb.post-card__icon--standards { background: linear-gradient(135deg,#1c1c1c,#22202a) }
.featured-card__thumb.post-card__icon--business { background: linear-gradient(135deg,#2a1414,#1c1c1c) }

.post-card__body { min-width: 0; padding: 22px }

/* Single mono meta row at top: X MIN READ - CATEGORY - DATE */
.post-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.post-card__meta .dot { color: var(--signal) }

.post-card__title {
  margin-top: 12px;
  font-family: var(--font); font-weight: 700; font-size: 18px;
  letter-spacing: -.02em; line-height: 1.2; color: var(--ink);
}
.post-card:hover .post-card__title { color: var(--signal) }
.post-card__excerpt {
  margin-top: 8px; font-size: 14px; line-height: 1.6;
  color: rgba(28,28,30,.7);
}

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--mint-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--ink);
  overflow: hidden;
}
.avatar svg, .avatar img { width: 100%; height: 100% }

/* Pagination - prev/next arrows + circular numbered buttons */
.pager {
  margin-top: 56px; display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center; gap: 8px;
}
.pager__item {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--white);
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: transform var(--ease), background var(--ease), color var(--ease);
}
.pager__item:hover { transform: translateY(-2px) }
.pager__item:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px }
.pager__item.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink) }
.pager__item--nav svg { width: 18px; height: 18px }
.pager__item.is-disabled { opacity: .35; cursor: default }
.pager__item.is-disabled:hover { transform: none }

/* Newsletter card - rounded mint panel with a soft red glow top-right, native form, no JS */
.newsletter {
  position: relative; overflow: hidden;
  margin-top: 80px; margin-bottom: 80px;
  border-radius: var(--r-xl);
  background: radial-gradient(130% 130% at 100% 0%, rgba(206,51,52,.30), rgba(206,51,52,0) 42%), var(--mint-soft);
  padding: 40px 28px;
  display: grid; gap: 32px; align-items: center;
}
@media(min-width:768px){
  .newsletter { grid-template-columns: 1fr 1fr; gap: 48px; padding: 56px 56px; margin-bottom: 112px }
}
.newsletter .eyebrow { color: var(--signal) }
.newsletter h2 {
  margin-top: 16px;
  font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; line-height: 1 ;
}
.newsletter p {
  margin-top: 16px; max-width: 440px;
  font-size: 15px; line-height: 1.7; color: rgba(28,28,30,.75);
}
.newsletter__form {
  display: flex; flex-direction: column; gap: 14px; max-width: 420px;
}
@media(min-width:768px){ .newsletter__form{ margin-left: auto } }
.newsletter__form input[type="email"] {
  width: 100%; padding: 14px 24px;
  border: 1px solid var(--input-border); border-radius: var(--pill);
  font-family: var(--font); font-size: 15px;
  background: var(--white); color: var(--ink);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.newsletter__form input[type="email"]:focus {
  outline: none; border-color: var(--mint-deep);
  box-shadow: 0 0 0 3px rgba(74,168,140,.25);
}
.newsletter__form input::placeholder { color: #9a9a9a }
/* Subscribe button is dark/near-black (red is reserved for the nav CTA) */
.newsletter__submit {
  width: 100%; padding: 14px 24px; border-radius: var(--pill);
  background: #1a1a1a; color: #fff; border: none;
  font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform var(--ease), background var(--ease);
}
.newsletter__submit:hover { transform: translateY(-1px); background: #000 }
.newsletter__submit:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px }
.newsletter__fine {
  margin-top: 0; max-width: none;
  font-size: 12px; line-height: 1.5; color: rgba(28,28,30,.6);
}

/* Screen-reader-only label (off-screen, stays readable to assistive tech) */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Article page ───────────────────────────────────── */
.article { padding: 40px 0 80px }
@media(min-width:768px){ .article{ padding: 56px 0 96px } }
.article > * { max-width: 740px; margin-left: auto; margin-right: auto }

/* Header block (eyebrow, title, dek) is centered per the approved PDF */
.article__eyebrow {
  margin-top: 32px; display: flex; justify-content: center; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--signal);
}
.article__eyebrow::before {
  content: ""; width: 24px; height: 2px; background: var(--signal);
}
/* Article H1 is a heavy SANS display (not serif), centered, with optional .accent words */
.article__title {
  margin-top: 16px; text-align: center;
  font-family: var(--font); font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -.02em; line-height: 1.06;
}
.article__title .accent { font-family: var(--font); font-style: italic; font-weight: 700 }
.article__dek {
  margin-top: 24px; text-align: center;
  font-size: clamp(18px, 2.4vw, 22px); line-height: 1.55; color: var(--dim);
}
/* Author + share row: author name left, SHARE label + round buttons right */
.article__author {
  margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
}
.article__author-id { display: flex; align-items: center; gap: 14px }
.article__author .avatar { width: 44px; height: 44px; font-size: 16px }
.article__author-meta { display: flex; flex-direction: column; gap: 4px }
.article__author-name { font-weight: 700; font-size: 15px }
.article__author .post-meta-line { margin-top: 0 }
.article__author .post-meta-line::before { display: none }
.article__share { display: flex; align-items: center; gap: 10px }
.article__share-label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
}
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--white); color: var(--ink);
  transition: transform var(--ease), background var(--ease), color var(--ease);
}
.share-btn svg { width: 16px; height: 16px }
.share-btn:hover { transform: translateY(-2px); background: var(--ink); color: var(--paper) }
.share-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px }

/* Terminal - prominent dark-to-green gradient panel, mono syntax, rating badge. Shortcode. */
.terminal {
  position: relative; margin-top: 44px;
  border-radius: 22px;
  background: linear-gradient(135deg, #16201b 0%, #131313 55%, #0f1a14 100%);
  color: var(--paper);
  padding: 40px 28px;
  font-family: var(--mono); font-size: 14px; line-height: 1.8;
  overflow-x: auto;
}
@media(min-width:640px){ .terminal{ padding: 48px 40px } }
.terminal pre { margin: 0; font-family: inherit; white-space: pre }
.terminal .cmd { color: var(--paper) }            /* $ command line */
.terminal .cmd::before { content: "$ "; color: var(--mint-deep) }
.terminal .out { color: rgba(250,247,238,.55) }    /* dim arrow output */
.terminal .ok { color: var(--rating-a) }           /* green success */
.terminal .stat { color: var(--mint) }             /* the metrics line */
.terminal__rating {
  position: absolute; top: 24px; right: 24px;
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; color: var(--ink);
  box-shadow: 0 4px 0 0 rgba(0,0,0,.35);
}
.terminal__rating .letter { font-size: 30px; font-weight: 600; line-height: 1 }
.terminal__rating .score { font-family: var(--mono); font-size: 9px; margin-top: 2px }
/* Rating colour maps to letter */
.terminal__rating.rating-a { background: var(--rating-a) }
.terminal__rating.rating-b { background: var(--rating-b) }
.terminal__rating.rating-c { background: var(--rating-c) }
.terminal__rating.rating-d { background: var(--rating-d); color: var(--white) }

/* ── Prose body ─────────────────────────────────────── */
.prose { margin-top: 40px; max-width: 740px }
/* Section headings are sans (system stack) at bold weight per the approved PDF */
.prose h2 {
  margin-top: 48px;
  font-family: var(--font); font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2rem); letter-spacing: -.025em; line-height: 1.15;
}
.prose h3 {
  margin-top: 36px;
  font-family: var(--font); font-weight: 700; font-size: 1.4rem;
  letter-spacing: -.02em; line-height: 1.2;
}
.prose p {
  margin-top: 20px;
  font-size: 17px; line-height: 1.7; color: rgba(28,28,30,.9);
}
.prose a {
  color: var(--signal); text-decoration: underline;
  text-underline-offset: 2px; text-decoration-thickness: 1px;
  transition: color var(--ease);
}
.prose a:hover { color: var(--signal-deep) }
.prose ul, .prose ol { margin-top: 20px; padding-left: 1.4em }
.prose li { margin-top: 8px; font-size: 17px; line-height: 1.65; color: rgba(28,28,30,.9) }
.prose li::marker { color: var(--signal) }
.prose strong { font-weight: 700 }
.prose em { font-style: italic }
.prose code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper-deep); padding: 2px 6px; border-radius: 6px;
}
.prose img, .prose svg { max-width: 100%; height: auto }

/* Raster photo figure - markdown images with a caption, and the figure shortcode. */
.fig-img {
  margin: 40px auto; max-width: 720px; text-align: center;
}
.fig-img img {
  max-width: 100%; height: auto; display: block; margin: 0 auto;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.fig-img figcaption {
  margin-top: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
}

/* Pull-quote - blush tinted panel, thick red left border, serif italic. Shortcode. */
.pullquote {
  margin: 40px 0; padding: 28px 32px;
  background: #fbecec; border-radius: 16px;
  border-left: 5px solid var(--signal);
}
.pullquote p {
  margin: 0;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.35; color: var(--ink);
}
.pullquote__cite {
  display: block; margin-top: 16px;
  font-family: var(--mono); font-style: normal; font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--signal);
}

/* SVG figure - for inline / SVGator-exported animated SVGs. Shortcode. */
.figure-svg {
  margin: 40px 0; max-width: none;
  text-align: center;
}
.figure-svg svg, .figure-svg img {
  width: 100%; max-width: 640px; height: auto;
  border-radius: var(--radius);
}
.figure-svg figcaption {
  margin-top: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
}

/* Scroll reveal - mirror style.css; fallback + reduced-motion guarded */
.post-card, .featured-card {
  animation: fadeUp linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 24%;
}
@supports not (animation-timeline: view()) {
  /* Fallback: visible without scroll animation support */
  .post-card, .featured-card { animation: none }
}
@media (prefers-reduced-motion: reduce) {
  .post-card, .featured-card { animation: none !important }
}
