.blog-post {
  --tutorial-blue: #315d78;
  --tutorial-blue-soft: #dce8ed;
  --tutorial-code: #132a24;
  --tutorial-code-line: #2f4a41;
  --tutorial-output: #f1f3ef;
}

.post-content {
  counter-reset: tutorial-section;
}

.post-content .post-lede {
  max-width: 58ch;
  margin: 0 0 clamp(3rem, 7vw, 4.5rem);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.45;
}

.post-content .post-note {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0.7rem;
  color: var(--forest);
  background: var(--surface-strong);
  border-radius: 4px;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 650;
}

.post-content .post-note--warning {
  border-left: 3px solid var(--gold);
}

.post-content .tutorial-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 100%;
  margin: 1.75rem 0 3.5rem;
  padding: 0;
  counter-reset: tutorial-step;
  list-style: none;
}

.post-content .tutorial-steps li {
  counter-increment: tutorial-step;
  padding: 1rem 1.1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--forest-light);
  border-radius: 6px;
}

.post-content .tutorial-steps li::before {
  content: "Step " counter(tutorial-step);
  display: block;
  margin-bottom: 0.35rem;
  color: var(--forest-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-content h2 {
  counter-increment: tutorial-section;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-top: clamp(3.75rem, 9vw, 5.5rem);
  font-size: clamp(1.8rem, 4vw, 2.35rem);
}

.post-content h2::before {
  content: "0" counter(tutorial-section);
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: white;
  background: var(--forest);
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.post-content h2 + p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.post-content div.highlighter-rouge {
  position: relative;
  max-width: 100%;
  margin-block: 1.75rem;
  padding-top: 2.15rem;
  background: var(--tutorial-code);
  border: 1px solid var(--tutorial-code-line);
  border-left: 4px solid var(--forest-light);
  border-radius: 6px 6px 0 0;
}

.post-content div.highlighter-rouge::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.55rem 1.1rem;
  color: #a9bab2;
  border-bottom: 1px solid var(--tutorial-code-line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-content div.language-python::before {
  content: "Python  ·  " attr(data-label);
}

.post-content div.language-shell::before {
  content: "Shell  ·  " attr(data-label);
}

.post-content div.highlighter-rouge .highlight,
.post-content div.highlighter-rouge pre {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.post-content .language-python pre {
  padding: 1.25rem 1.35rem 1.4rem;
  font-size: 0.92rem;
  line-height: 1.7;
  tab-size: 4;
}

.post-content .language-shell pre {
  padding: 1.25rem 1.35rem 1.4rem;
  color: #e7eee9;
  font-size: 0.92rem;
  line-height: 1.7;
}

.post-content div.language-python,
.post-content div.language-shell {
  border-radius: 6px;
}

.post-content .language-python code {
  color: #e7eee9;
}

.post-content div.language-python + div.language-plaintext {
  margin-top: -1.75rem;
  padding-top: 2rem;
  color: var(--ink);
  background: var(--tutorial-output);
  border-color: var(--line);
  border-left-color: var(--forest-light);
  border-radius: 0 0 6px 6px;
  box-shadow: none;
}

.post-content div.language-python + div.language-plaintext::before {
  content: "Output";
  padding: 0.5rem 1.1rem;
  color: var(--forest-light);
  border-bottom: 1px solid var(--line);
}

.post-content div.language-python + div.language-plaintext pre {
  padding: 0.9rem 1.35rem 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
}

.post-content div.language-python + div.language-plaintext .highlight,
.post-content div.language-python + div.language-plaintext pre,
.post-content div.language-python + div.language-plaintext code {
  color: var(--ink);
  background: transparent;
}

.post-content .highlight pre .c,
.post-content .highlight pre .c1 {
  color: #91a39a;
  font-style: italic;
}

.post-content .highlight pre .k,
.post-content .highlight pre .kn {
  color: #8fc8e8;
}

.post-content .highlight pre .nf,
.post-content .highlight pre .nb {
  color: #a8d3a0;
}

.post-content .highlight pre .s,
.post-content .highlight pre .s1,
.post-content .highlight pre .s2 {
  color: #e5c07b;
}

.post-content .highlight pre .nd {
  color: #e79a75;
}

.post-content .highlight pre .mi,
.post-content .highlight pre .mf {
  color: #c4a7e7;
}

.post-content .tutorial-conclusion,
.post-content .tutorial-discussion {
  max-width: 100%;
  margin-block: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 6px;
}

.post-content .tutorial-conclusion {
  color: var(--ink);
  background: var(--surface-strong);
  border-left: 4px solid var(--forest-light);
}

.post-content .tutorial-discussion {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}

@media (max-width: 600px) {
  .post-content .tutorial-steps {
    grid-template-columns: 1fr;
  }

  .post-content div.highlighter-rouge {
    margin-inline: -0.35rem;
    border-radius: 4px 4px 0 0;
  }

  .post-content div.highlighter-rouge .highlight,
  .post-content div.highlighter-rouge pre {
    border-radius: 0;
  }

  .post-content div.language-python + div.language-plaintext {
    border-radius: 0 0 4px 4px;
  }
}

@media print {
  .post-content div.highlighter-rouge {
    box-shadow: none;
  }
}
