/*
Theme Name: Inferne Blog
Theme URI: https://inferne.com/blog/
Description: The Wiro Blog theme restyled for inferne.com: same tokens, type, navigation and footer as the site.
Author: Inferne
Version: 2.0.0
Requires PHP: 8.0
Text Domain: wiro-blog
*/

/* ------------------------------------------------------------ shared with inferne.com (assets/site.css) */
:root {
  --paper: #f6f5f1;
  --paper-2: #efeee8;
  --card: #fbfaf7;
  --ink: #0e0e10;
  --ink-2: #2b2b2f;
  --muted: #5d5d64;
  --faint: #8c8c93;
  --line: #e2e0d8;
  --line-2: #d3d1c8;
  --on-ink: #f6f5f1;
  /* emphasis slabs (AI card, contact card, blog CTA): black on paper, a raised dark surface in dark mode */
  --slab: #0e0e10;
  --slab-2: #1b1b1f;
  --on-slab: #f6f5f1;
  --slab-line: #0e0e10;

  --blue: #1a9fe8;
  --amber: #f4a30f;
  --green: #1fbd68;
  --blend: multiply;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1240px;
  --gutter: clamp(20px, 4.2vw, 56px);
  --radius: 20px;
  --nav-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c0c0d;
    --paper-2: #121214;
    --card: #151517;
    --ink: #f1f0eb;
    --ink-2: #d8d7d2;
    --muted: #a3a3aa;
    --faint: #6f6f76;
    --line: #232326;
    --line-2: #303034;
    --on-ink: #0c0c0d;
    --slab: #151518;
    --slab-2: #1d1d21;
    --on-slab: #f1f0eb;
    --slab-line: #2a2a2f;
    --blend: screen;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px / 1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1, "cv11" 1;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--on-ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--on-ink); text-decoration: none;
}
.skip:focus { top: 16px; }

em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; gap: .55em;
  height: 48px; padding: 0 22px;
  border-radius: 999px;
  font: 500 15px/1 var(--font);
  text-decoration: none; white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: var(--ink-2); }
.btn-line { border: 1px solid var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }

/* ------------------------------------------------------------ nav */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 28px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark { width: 30px; height: 30px; overflow: visible; }
.mark path, .mark circle, .mark rect { fill: none; stroke-width: 5.2; }
.mk-tri { stroke: var(--blue); stroke-linejoin: round; }
.mk-cir { stroke: var(--amber); }
.mk-sq { stroke: var(--green); stroke-linejoin: round; }
.brand .word { font: 700 25px/1 var(--font); letter-spacing: -.045em; transform: translateY(-1px); }
.brand:hover .mk-tri { transform: rotate(-12deg); }
.mark > * { transform-box: fill-box; transform-origin: center; transition: transform .6s var(--ease); }
.brand:hover .mk-sq { transform: rotate(45deg) scale(.86); }
.brand:hover .mk-cir { transform: scale(.9); }

.menu { display: flex; gap: 30px; margin-left: auto; }
.menu a { font: 500 15px/1 var(--font); color: var(--muted); text-decoration: none; transition: color .2s; }
.menu a:hover { color: var(--ink); }
.menu .menu-contact { display: none; }
.nav-cta { height: 42px; padding: 0 18px; font-size: 14px; }

.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; position: relative; }
.burger i { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), top .3s var(--ease); }
.burger i:first-child { top: 18px; }
.burger i:last-child { top: 25px; }
.nav.is-open .burger i:first-child { top: 21.5px; transform: rotate(45deg); }
.nav.is-open .burger i:last-child { top: 21.5px; transform: rotate(-45deg); }


.kicker { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; }
.kicker .num { color: var(--ink); }
.kicker .num::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 14px; vertical-align: middle; background: var(--line-2); }


/* footer */
.footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: clamp(64px, 8vw, 100px) 0 36px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); }
.footer-brand p { margin: 20px 0 28px; max-width: 22em; color: var(--muted); font-size: 15px; }
.footer-cols { display: grid; grid-template-columns: repeat(5, max-content); justify-content: space-between; column-gap: 28px; }
@media (max-width: 1180px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; }
}
.footer-cols h2 { margin: 0 0 16px; font: 500 12.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.footer-cols ul { margin: 0 0 32px; padding: 0; list-style: none; }
.footer-cols li { margin: 0 0 10px; }
.footer-cols a { color: var(--muted); font-size: 14.5px; text-decoration: none; transition: color .2s; }
.footer-cols a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  margin-top: 56px; padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 14px;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--ink); }


/* ------------------------------------------------------------ responsive (nav + footer, as on inferne.com) */
@media (max-width: 1080px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .menu, .nav-cta { display: none; }
  .burger { display: block; }
  .nav.is-open .menu {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; inset: var(--nav-h) 0 auto 0;
    padding: 8px var(--gutter) 28px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nav.is-open .menu a { padding: 16px 0; font-size: 22px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .nav.is-open .menu .menu-contact { display: block; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------ blog */

.sr-only, .screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap-wide { width: min(100% - var(--gutter) * 2, 1240px); margin-inline: auto; }
.wrap-text { width: min(100% - var(--gutter) * 2, 720px); margin-inline: auto; }

.display {
  margin: 0;
  font: 600 clamp(40px, 6vw, 84px) / 1 var(--font);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.lead { max-width: 38em; margin: 22px 0 0; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.lead p { margin: 0; }
.kicker, .card-cat, .card-meta, .crumbs, .article-meta, .cat-nav a, .tag-list a, .pagination {
  font-family: var(--mono);
}
.kicker { font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kicker a { text-decoration: none; }
.h3 { margin: 0 0 24px; font: 600 26px/1.2 var(--font); letter-spacing: -.02em; }

.blog-head { padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 44px); }
.blog-head .search-form { margin-top: 28px; }
.nf { min-height: 60vh; }
.nf .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.cat-nav a {
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s;
}
.cat-nav a:hover { border-color: var(--ink); }
.cat-nav a.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* cards */
.posts-section { padding-bottom: clamp(64px, 9vw, 120px); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.card { min-width: 0; }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.card-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card-link:hover .card-media img { transform: scale(1.025); }
.card-placeholder { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--paper-2) 0 14px, var(--line) 14px 15px); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; }
.card-cat { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-title { margin: 0; font: 600 22px/1.22 var(--font); letter-spacing: -.02em; text-wrap: balance; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-excerpt {
  margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: 4px; font-size: 12px; letter-spacing: .04em; color: var(--faint); }

.card-featured { grid-column: 1 / -1; }
.card-featured .card-link { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.card-featured .card-media { border-radius: 20px; }
.card-featured .card-body { padding: 0; gap: 14px; }
.card-featured .card-title { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.08; letter-spacing: -.035em; }
.card-featured .card-excerpt { font-size: 17px; -webkit-line-clamp: 4; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 64px; font-size: 13px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; min-width: 40px; height: 40px; padding: 0 14px; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; color: var(--ink-2);
}
.pagination .current { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pagination a:hover { border-color: var(--ink); }
.empty { padding: 40px 0 120px; color: var(--muted); font-size: 18px; }

.search-form { display: flex; gap: 10px; max-width: 520px; }
.search-form input {
  flex: 1; min-width: 0; height: 48px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink);
  font: 400 16px var(--font);
}
.search-form input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }

/* article */
.article-head { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 44px); max-width: 900px; }
.crumbs { display: flex; gap: 10px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.article-title { margin: 22px 0 0; font: 600 clamp(36px, 5.2vw, 68px) / 1.03 var(--font); letter-spacing: -.042em; text-wrap: balance; }
.article-lead { margin: 22px 0 0; max-width: 40em; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--muted); }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.article-meta a { color: var(--ink-2); text-decoration: none; }
.article-cover { margin-top: 8px; margin-bottom: clamp(40px, 6vw, 72px); }
.article-cover img { width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); }

.prose { font-size: 18.5px; line-height: 1.72; color: var(--ink-2); }
.prose > * { margin: 0 0 1.15em; }
.prose h2 { margin: 2.1em 0 .6em; font: 600 clamp(26px, 2.6vw, 34px) / 1.15 var(--font); letter-spacing: -.028em; color: var(--ink); scroll-margin-top: calc(var(--nav-h) + 20px); }
.prose h3 { margin: 1.7em 0 .45em; font: 600 21px/1.3 var(--font); letter-spacing: -.012em; color: var(--ink); }
.prose h4 { margin: 1.5em 0 .4em; font: 600 18px/1.35 var(--font); color: var(--ink); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--faint); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--ink); font-family: var(--serif); font-style: italic; font-size: 1.25em; line-height: 1.45; color: var(--ink); }
.prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }
.prose code { padding: .12em .38em; border-radius: 6px; background: var(--paper-2); border: 1px solid var(--line); font: 400 .86em var(--mono); }
.prose pre { overflow-x: auto; padding: 20px 22px; border-radius: 14px; background: var(--ink); color: var(--on-ink); font: 400 14px/1.6 var(--mono); }
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line-2); }
.prose figure { margin: 2em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); }
.prose figcaption, .prose .wp-caption-text { margin-top: 10px; font-size: 14px; color: var(--faint); text-align: center; }
.prose .alignwide { width: min(100vw - var(--gutter) * 2, 1000px); margin-left: 50%; transform: translateX(-50%); }
.prose .aligncenter { margin-inline: auto; }

.article-foot { padding-bottom: clamp(56px, 8vw, 100px); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 0; padding: 0; list-style: none; }
.tag-list a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-decoration: none;
}
.tag-list a:hover { border-color: var(--ink); color: var(--ink); }

.cta {
  margin-top: 56px; padding: clamp(28px, 4vw, 44px);
  border-radius: 22px; background: var(--slab); color: var(--on-slab); border: 1px solid var(--slab-line);
}
.cta .kicker { color: color-mix(in srgb, var(--on-slab) 60%, transparent); }
.cta .kicker .num { color: var(--on-slab); }
.cta .kicker .num::after { background: color-mix(in srgb, var(--on-slab) 30%, transparent); }
.cta h2 { margin: 0; font: 600 clamp(30px, 3.4vw, 44px) / 1.05 var(--font); letter-spacing: -.035em; }
.cta p { margin: 14px 0 24px; max-width: 34em; color: color-mix(in srgb, var(--on-slab) 72%, transparent); font-size: 17px; }
.btn-on-ink { background: var(--on-slab); color: var(--slab); }
.btn-on-ink:hover { background: color-mix(in srgb, var(--on-slab) 88%, var(--slab)); }

.related { padding: clamp(56px, 8vw, 96px) 0 clamp(72px, 10vw, 130px); border-top: 1px solid var(--line); }

@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .post-grid { grid-template-columns: 1fr; gap: 36px; }
  .card-featured .card-link { grid-template-columns: 1fr; gap: 20px; }
  .prose { font-size: 17.5px; }
  .article-cover img { border-radius: 14px; }
}
