/* ============================================================
   KitsuneGuide — post.css
   Layered on top of app.css, used by every /fix/<slug>/ and
   /optimization/<slug>/ post page. Restyles:
     - .post-header (title + meta)
     - .video-embed (lazy-load poster)
     - .fix-content (intro p, .section-h, .steps-list .step)
     - .subscribe-cta
     - .related (related-grid > .post-card)
     - <code> blocks
   ============================================================ */

/* ---------- Article shell ---------- */
article {
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 64px;
}

/* ---------- Post header ---------- */
.post-header {
  margin: 28px 0 20px;
  padding-bottom: 18px;
  border-bottom: var(--border-dot);
  position: relative;
}
.post-header h1 {
  font-family: var(--pixel);
  font-size: clamp(32px, 4.6vw, 46px);
  line-height: 1.05;
  letter-spacing: 0.4px;
  margin: 6px 0 12px;
  color: var(--cream);
  text-wrap: balance;
}
/* tiny JP echo under the H1 (auto, decorative) */
.post-header h1::after {
  content: "/ how-to-fix";
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--cream-faint);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

.post-header .post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream-faint);
  background: none;
  padding: 0;
}
.post-header .post-meta .dot-sep {
  color: var(--cream-faint);
  margin: 0 2px;
}
.post-header .post-meta a {
  color: var(--accent-link);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-link);
}

/* ===========================================================
   VIDEO EMBED  (lazy poster, click-to-load)
   No layout shift: aspect-ratio keeps it stable
   =========================================================== */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 22px 0 28px;
  background-color: #000;
  background-position: center;
  background-size: cover;
  cursor: pointer;
  border: 2px solid var(--cream-faint);
  box-shadow:
    inset 1px 1px 0 var(--bevel-light),
    inset -1px -1px 0 var(--bevel-dark),
    6px 6px 0 var(--accent);
  outline: none;
  transition: transform 0.08s linear;
}
.video-embed:hover {
  transform: translate(1px, 1px);
  box-shadow:
    inset 1px 1px 0 var(--bevel-light),
    inset -1px -1px 0 var(--bevel-dark),
    5px 5px 0 var(--accent);
}
.video-embed:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  background:
    linear-gradient(180deg,
      rgba(0,0,0,0.0) 0%,
      rgba(0,0,0,0.0) 55%,
      rgba(0,0,0,0.78) 100%);
}
.video-poster .play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--cream);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 rgba(0,0,0,0.4),
    4px 4px 0 var(--paper);
  transition: transform 0.08s;
}
.video-embed:hover .play-btn { background: var(--hot); }

.video-info {
  margin-top: auto;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream);
}
.video-info .watch-on { color: var(--cream); opacity: 0.85; }

/* ===========================================================
   FIX-CONTENT  (intro, section-h, prose)
   =========================================================== */
.fix-content {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--cream-2);
}

.fix-content p { margin: 0 0 16px; text-wrap: pretty; }

.fix-content .intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--cream);
  padding: 16px 18px 14px;
  margin: 0 0 28px;
  background: var(--paper-2);
  border-left: 4px solid var(--accent);
  border-top: 1px dotted var(--cream-faint);
  border-right: 1px dotted var(--cream-faint);
  border-bottom: 1px dotted var(--cream-faint);
  position: relative;
}
.fix-content .intro::before {
  content: "TL;DR";
  position: absolute;
  top: -9px;
  left: 14px;
  background: var(--paper);
  padding: 0 8px;
  font-family: var(--pixel);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--accent);
}

.fix-content .section-h {
  font-family: var(--pixel);
  font-size: 28px;
  letter-spacing: 0.5px;
  margin: 36px 0 12px;
  color: var(--cream);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.fix-content .section-h::before {
  content: "▸";
  color: var(--accent);
  font-size: 22px;
}
.fix-content .section-h::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 1px dotted var(--ink-line);
  margin-bottom: 6px;
}

.fix-content a { color: var(--accent-link); }

/* ---------- Inline code ---------- */
.fix-content code,
.step-text code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--paper-3);
  color: var(--cream);
  padding: 2px 6px;
  border: 1px dotted var(--cream-faint);
  white-space: nowrap;
}

/* ===========================================================
   STEPS LIST  (ol.steps-list > li.step > .step-num + .step-body)
   =========================================================== */
.steps-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 16px 18px 18px;
  background: var(--paper-2);
  border: 1px dotted var(--cream-faint);
  position: relative;
  align-items: start;
}
.step::before {
  /* dashed left ribbon */
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: repeating-linear-gradient(180deg,
    var(--accent) 0 6px,
    transparent 6px 10px);
}
.step:hover { border-color: var(--accent); }

.step-num {
  font-family: var(--pixel);
  font-size: 42px;
  line-height: 1;
  color: var(--cream);
  background: var(--paper-3);
  border: 1px solid var(--ink-line);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  letter-spacing: 1px;
  box-shadow:
    inset 1px 1px 0 var(--bevel-light),
    inset -1px -1px 0 var(--bevel-dark);
  position: relative;
}
.step-num::after {
  content: "step";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cream-faint);
  background: var(--paper-2);
  padding: 0 4px;
}

.step-body {
  min-width: 0;
}
.step-text {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  color: var(--cream-2);
  text-wrap: pretty;
}

/* ===========================================================
   SUBSCRIBE CTA (.subscribe-cta)
   =========================================================== */
.subscribe-cta {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  margin: 36px 0 28px;
  padding: 22px 22px 24px;
  background: var(--paper-2);
  border: var(--border);
  position: relative;
  align-items: center;
}
.subscribe-cta::before {
  content: "★ subscribe ★";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  padding: 0 10px;
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 2px;
}
.sub-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: var(--cream);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 rgba(0,0,0,0.4),
    3px 3px 0 var(--paper);
}
.sub-body h3 {
  font-family: var(--pixel);
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: 0.4px;
  color: var(--cream);
  text-wrap: balance;
}
.sub-body p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cream-dim);
  margin: 0 0 14px;
  text-wrap: pretty;
}
.sub-body .btn-row { justify-content: flex-start; }

/* ===========================================================
   RELATED  (.related .related-head .related-grid .post-card)
   =========================================================== */
.related {
  margin-top: 40px;
  padding-top: 28px;
  border-top: var(--border-dot);
}
.related-head { margin-bottom: 16px; }
.related-head h2 {
  font-family: var(--pixel);
  font-size: 26px;
  margin: 0;
  letter-spacing: 0.5px;
  color: var(--cream);
}
.related-head h2::before { content: "» "; color: var(--accent); }
.related-head h2 .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cream-faint);
  background: var(--paper-2);
  padding: 2px 6px;
  margin-left: 8px;
  border: 1px dotted var(--cream-faint);
  vertical-align: middle;
}
.related-head .sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cream-dim);
  margin: 6px 0 0;
  max-width: 60ch;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--cream);
  background: var(--paper-2);
  border: 1px dotted var(--cream-faint);
}
.post-card:hover { border-color: var(--accent); color: var(--cream); }
.post-card .thumb {
  position: relative;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: #000;
  border-bottom: 1px dotted var(--cream-faint);
}
.post-card .thumb .play {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--cream);
}
.post-card .card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-card .card-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream-faint);
}
.post-card .card-top .post-cat {
  background: var(--cream);
  color: var(--paper);
  padding: 1px 5px;
  font-weight: 700;
}
.post-card h3 {
  font-family: var(--pixel);
  font-size: 18px;
  margin: 0;
  line-height: 1.1;
  color: var(--cream);
  text-wrap: balance;
}
.post-card .card-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cream-faint);
  padding-top: 6px;
  border-top: 1px dotted var(--ink-line);
}
.post-card .err { color: var(--cream-dim); }
.post-card .has-vid { color: var(--accent); }

/* ===========================================================
   AFFILIATE DISCLOSURE
   =========================================================== */
.affiliate-disclosure {
  margin-top: 24px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cream-faint);
  background: var(--paper-3);
  border: 1px dashed var(--ink-line);
  text-transform: lowercase;
  letter-spacing: 0.5px;
}
.affiliate-disclosure::before {
  content: "[disclosure] ";
  color: var(--accent);
  font-weight: 700;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 720px) {
  .step { grid-template-columns: 48px 1fr; gap: 12px; padding: 14px; }
  .step-num { width: 48px; height: 48px; font-size: 30px; }
  .subscribe-cta { grid-template-columns: 1fr; text-align: left; }
  .sub-ico { display: none; }
  .post-header h1 { font-size: 28px; }
  .fix-content .section-h { font-size: 24px; }
}
