/* ── Code blocks — Prism overrides ──────────────────────────── */
pre[class*="language-"] > code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
}
pre[class*="language-"] {
  background: #0d1117 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  margin: 1rem 0 1.2rem !important;
  padding: 1rem 1.2rem !important;
  font-size: 0.87rem !important;
  line-height: 1.7 !important;
}
/* Plain pre blocks (natural language prompts) */
pre:not([class*="language-"]) {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1rem 0 1.2rem;
}
pre:not([class*="language-"]) code {
  background: none;
  border: none;
  padding: 0;
  color: #bbb;
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ── Blockquote / tip boxes ───────────────────────────────────── */
blockquote {
  border-left: 3px solid #f06400;
  padding: 0.75rem 1rem 0.75rem 1.2rem;
  margin: 1.2rem 0;
  background: rgba(240, 100, 0, 0.05);
  border-radius: 0 8px 8px 0;
  color: #bbb;
}
blockquote strong { color: #f06400; }

.tip {
  background: rgba(240, 100, 0, 0.06);
  border: 1px solid rgba(240, 100, 0, 0.2);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.2rem;
  color: #bbb;
  font-size: 0.93rem;
}
.tip strong { color: #f06400; }

/* ── Selector widget ─────────────────────────────────────────── */
.tutorial-selector {
  background: #0d0d0d;
  border: 1px solid rgba(240, 100, 0, 0.22);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.selector-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #f58025;
  font-weight: 800;
  margin: 0 0 0.4rem;
}
.selector-rows {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.selector-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.selector-label {
  color: #777;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  min-width: 74px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .selector-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .selector-label {
    min-width: unset;
  }
}
.sel-btns {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.sel-btn {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.sel-btn:hover {
  border-color: rgba(240, 100, 0, 0.6);
  color: #f06400;
}
.sel-btn.active {
  background: #f06400;
  border-color: #f06400;
  color: #fff;
  font-weight: 700;
}
.sel-btn-icon-svg {
  height: 1.1em;
  width: auto;
  vertical-align: -0.15em;
}
.sel-btn-icon {
  height: 1.1em;
  width: auto;
  vertical-align: -0.15em;
  filter: grayscale(1) brightness(0.6);
  transition: filter 0.15s;
}
.sel-btn:hover .sel-btn-icon {
  filter: grayscale(1) brightness(0.9);
}
.sel-btn.active .sel-btn-icon {
  filter: grayscale(1) brightness(10);
}
/* ── Model picker (tab bar attached to code block) ─────────── */
.model-picker {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  background: #0a0e13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin: 1rem 0 0;
  padding: 0.35rem 0.4rem 0;
  overflow: hidden;
}
.model-picker .sel-btn {
  font-size: 0.76rem;
  padding: 0.35rem 0.85rem;
  border: none;
  border-radius: 6px 6px 0 0;
  color: #666;
  background: transparent;
  font-weight: 600;
}
.model-picker .sel-btn:hover {
  color: #ccc;
  border: none;
  background: rgba(255, 255, 255, 0.04);
}
.model-picker .sel-btn.active {
  background: #0d1117;
  color: #f06400;
  border: none;
  font-weight: 700;
}
[data-picker-content] pre[class*="language-"] {
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
[data-picker-content] {
  margin-bottom: 0;
}
[data-picker-content]:last-of-type {
  margin-bottom: 1.2rem;
}

.selector-summary {
  font-size: 0.8rem;
  color: #555;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.7rem;
  margin-top: 0.1rem;
}
.selector-summary span {
  color: #f06400;
  font-weight: 700;
}

/* ── Architecture diagram ────────────────────────────────────── */
.arch-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.8rem 0 1.2rem;
}
.arch-node {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 3px solid rgba(240,100,0,0.65);
  border-radius: 7px;
  padding: 0.7rem 1.3rem;
}
.arch-node i {
  color: #F06400;
  font-size: 1rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.arch-node svg.arch-icon {
  height: 1.1rem;
  width: auto;
  flex-shrink: 0;
  color: #F06400;
}
.arch-node img.arch-icon {
  height: 1.2rem;
  width: auto;
  flex-shrink: 0;
}
.arch-node-title {
  color: #e8e8e8;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}
.arch-node-sub {
  color: #666;
  font-size: 0.75rem;
  margin-top: 0.1rem;
  line-height: 1.2;
}
.arch-connector {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(240,100,0,0.55), rgba(240,100,0,0.25));
  position: relative;
  margin: 0;
}
.arch-connector::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid rgba(240,100,0,0.55);
}
.arch-engines {
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 3px solid rgba(240,100,0,0.65);
  border-radius: 7px;
  overflow: hidden;
}
.arch-engine-half {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1rem 1.5rem;
  white-space: nowrap;
}
.arch-engine-half i {
  color: #F06400;
  font-size: 1.15rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}
.arch-engine-half svg.arch-icon {
  height: 1.25rem;
  width: auto;
  flex-shrink: 0;
  color: #F06400;
}
.arch-engine-half img.arch-icon {
  height: 1.35rem;
  width: auto;
  flex-shrink: 0;
}
.arch-engine-divider {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: #3a3a3a;
  font-size: 0.72rem;
  font-style: italic;
  border-left: 1px solid rgba(255,255,255,0.07);
  border-right: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.15);
}
@media (max-width: 500px) {
  .arch-engines { flex-direction: column; }
  .arch-engine-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0.3rem 1.1rem;
  }
}

/* ── Step numbering ──────────────────────────────────────────── */
.step-label {
  display: inline-block;
  background: #f06400;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 0.15rem 0.55rem;
  margin-bottom: 0.5rem;
}

/* ── Part header ─────────────────────────────────────────────── */
.part-intro {
  border-left: 3px solid #f06400;
  padding-left: 1rem;
  margin: 2rem 0 1.2rem;
}
.part-intro h2 { margin-top: 0; }

/* ── Checklist ───────────────────────────────────────────────── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0;
}
.checklist li {
  padding: 0.45rem 0;
  padding-left: 1.8rem;
  position: relative;
  color: #bbb;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: #f06400;
  font-size: 1rem;
}

/* ── Heading colors: only .part-intro h2 stays orange ──────── */
.blog-section h2 { color: #f06400; }
.blog-section h3 { color: #ccc; font-size: 1.25em; }
.blog-section h4 { color: #aaa; font-size: 1.05em; }
.part-intro h2   { color: #f06400; }

/* ── Collapsible sections ─────────────────────────────────── */
.blog-section.collapsible > .part-intro,
.blog-section.collapsible > h2:first-child {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.blog-section.collapsible > .part-intro h2::after,
.blog-section.collapsible > h2:first-child::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.55em;
  margin-left: 0.6em;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.4;
  transition: transform 0.25s ease;
}
.blog-section.collapsed > .part-intro h2::after,
.blog-section.collapsed > h2:first-child::after {
  transform: rotate(-90deg);
}
.blog-section.collapsed > *:not(:first-child) {
  display: none !important;
}

/* ── Speed-run section ─────────────────────────────────────── */
.speedrun-card {
  background: #08090c;
  border: 1px solid rgba(240, 100, 0, 0.15);
  border-radius: 14px;
  overflow: hidden;
  margin: 2rem 0 2.5rem;
}
.speedrun-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.4rem;
  background: linear-gradient(135deg, rgba(240,100,0,0.14) 0%, rgba(240,100,0,0.04) 100%);
  border-bottom: 1px solid rgba(240, 100, 0, 0.12);
}
.speedrun-bar i {
  color: #f06400;
  font-size: 0.85rem;
}
.speedrun-bar span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f06400;
}
.speedrun-body {
  padding: 1.4rem 1.6rem 1.2rem;
}
.speedrun-body > p:first-child {
  margin-top: 0;
}
.speedrun-body h2 {
  color: #e0e0e0;
  font-size: 1.35rem;
  margin: 0 0 0.6rem;
}
.speedrun-body > p {
  color: #888;
  font-size: 0.92rem;
  line-height: 1.65;
}
.speedrun-body pre[class*="language-"] {
  background: #0b0e14 !important;
  border-color: rgba(255,255,255,0.07) !important;
  font-size: 0.82rem !important;
}
.speedrun-footer {
  padding: 0 1.6rem 1.4rem;
  color: #555;
  font-size: 0.85rem;
  font-style: italic;
}
.speedrun-footer a {
  color: #f06400;
  text-decoration: none;
}
.speedrun-footer a:hover {
  text-decoration: underline;
}

/* ── Code block line spacing ─────────────────────────────────── */
pre[class*="language-"] {
  line-height: 1.55 !important;
}

/* ── Table header override (muted, not orange) ──────────────── */
.blog-table thead {
  background: rgba(255, 255, 255, 0.07);
}
.blog-table thead th {
  color: #aaa;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.88em;
}
/* ── game teaser ── */
.game-teaser {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(240,100,0,0.06) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(240,100,0,0.18);
  border-radius: 14px;
  padding: 2rem 2rem 2rem 2rem;
  margin-bottom: 2.5rem;
}
.game-teaser-text { flex: 1; min-width: 200px; }
.game-teaser-text .teaser-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f06400;
  background: rgba(240,100,0,0.12);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 0.85rem;
}
.game-teaser-text h3 {
  font-size: 1.25rem;
  color: #e8e8e8;
  margin: 0 0 0.7rem;
  line-height: 1.4;
}
.game-teaser-text p {
  color: #999;
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0 0 0.9rem;
}
.game-teaser-text .teaser-hint {
  font-size: 0.8rem;
  color: #666;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.game-teaser-text .teaser-hint i { color: rgba(240,100,0,0.6); flex-shrink: 0; margin-top: 0.15em; }
.teaser-hint-desktop { display: inline; }
.teaser-hint-mobile  { display: none; }
@media (max-width: 640px) {
  .teaser-hint-desktop { display: none; }
  .teaser-hint-mobile  { display: inline; }
}
.game-teaser-frame {
  flex-shrink: 0;
  width: 280px;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
}
.game-teaser-frame iframe {
  display: block;
  width: 400px;
  height: 600px;
  border: none;
  transform: scale(0.7);
  transform-origin: top left;
}
@media (max-width: 640px) {
  .game-teaser { flex-direction: column; align-items: center; gap: 1.5rem; padding: 1.4rem; }
  .game-teaser-text { width: 100%; }
  .game-teaser-frame { width: 280px; height: 420px; }
}
