.blog-prose {
  max-width: 48rem;
  color: color-mix(in oklab, var(--foreground) 90%, transparent);
  font-size: 1rem;
  line-height: 1.9rem;
}

.blog-prose > * + * {
  margin-top: 1.5rem;
}

.blog-prose h1,
.blog-prose h2,
.blog-prose h3,
.blog-prose h4,
.blog-prose h5,
.blog-prose h6 {
  margin-top: 2.5rem;
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.025em;
  scroll-margin-top: 6rem;
}

.blog-prose h1 {
  font-size: 2.1rem;
  line-height: 2.35rem;
}

.blog-prose h2 {
  font-size: 1.72rem;
  line-height: 2.05rem;
}

.blog-prose h3 {
  font-size: 1.38rem;
  line-height: 1.85rem;
}

.blog-prose .heading-anchor {
  display: inline-flex;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5rem;
  vertical-align: middle;
  color: color-mix(in oklab, var(--foreground) 75%, transparent);
  text-decoration: none;
  opacity: 0;
  transition:
    color 150ms ease,
    opacity 150ms ease,
    transform 150ms ease;
}

.blog-prose h1:hover > .heading-anchor,
.blog-prose h2:hover > .heading-anchor,
.blog-prose h3:hover > .heading-anchor,
.blog-prose h4:hover > .heading-anchor,
.blog-prose h5:hover > .heading-anchor,
.blog-prose h6:hover > .heading-anchor,
.blog-prose .heading-anchor:focus-visible {
  color: var(--primary);
  opacity: 1;
}

.blog-prose .heading-anchor::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  flex-shrink: 0;
  opacity: 1;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.blog-prose h1:hover > .heading-anchor,
.blog-prose h2:hover > .heading-anchor,
.blog-prose h3:hover > .heading-anchor,
.blog-prose h4:hover > .heading-anchor,
.blog-prose h5:hover > .heading-anchor,
.blog-prose h6:hover > .heading-anchor,
.blog-prose .heading-anchor:focus-visible {
  transform: translateX(1px);
}

@media (hover: none) {
  .blog-prose .heading-anchor {
    opacity: 0.65;
  }
}

.blog-prose p,
.blog-prose li,
.blog-prose blockquote {
  color: color-mix(in oklab, var(--foreground) 90%, transparent);
  font-size: 1rem;
  line-height: 1.9rem;
}

.blog-prose a {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 0.25rem;
  transition: color 150ms ease;
}

.blog-prose a:hover {
  color: var(--primary);
}

.blog-prose ul,
.blog-prose ol {
  margin-left: 1.5rem;
}

.blog-prose ul {
  list-style: disc;
}

.blog-prose ol {
  list-style: decimal;
}

.blog-prose ul li + li,
.blog-prose ol li + li {
  margin-top: 0.75rem;
}

.blog-prose blockquote {
  border-left: 4px solid color-mix(in oklab, var(--primary) 40%, transparent);
  border-top-right-radius: 0.85rem;
  border-bottom-right-radius: 0.85rem;
  background: color-mix(in oklab, var(--muted) 70%, transparent);
  padding: 0.9rem 1.2rem;
  font-style: italic;
}

.blog-prose pre {
  overflow-x: auto;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 1rem;
  background: oklch(0.19 0.02 255);
  box-shadow: 0 10px 30px color-mix(in oklab, black 10%, transparent);
  color: oklch(0.97 0 0);
  padding: 0.9rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.75rem;
}

.blog-prose code:not(pre code) {
  border-radius: 0.375rem;
  background: var(--muted);
  padding: 0.25rem 0.375rem;
  font-size: 0.95em;
}

.blog-prose table {
  width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 0.85rem;
  font-size: 1rem;
  text-align: left;
}

.blog-prose thead {
  background: color-mix(in oklab, var(--muted) 70%, transparent);
}

.blog-prose thead:has(th:empty):not(:has(th:not(:empty))) {
  display: none;
}

.blog-prose th,
.blog-prose td {
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  padding: 0.7rem 0.9rem;
  vertical-align: top;
}

.blog-prose img {
  width: 100%;
  height: auto;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 1rem;
  box-shadow: 0 10px 30px color-mix(in oklab, black 5%, transparent);
}

@media (min-width: 768px) {
  .blog-prose > p:first-child:has(> img:only-child) {
    float: right;
    width: min(19rem, 42%);
    margin: 0.35rem 0 1.25rem 1.5rem;
  }
}

@media (max-width: 767px) {
  .blog-prose table:has(td > img),
  .blog-prose table:has(td > img) thead,
  .blog-prose table:has(td > img) tbody,
  .blog-prose table:has(td > img) tr,
  .blog-prose table:has(td > img) td {
    display: block;
    width: 100%;
  }

  .blog-prose table:has(td > img) td + td {
    padding-top: 0;
  }
}

.blog-video-embed {
  margin: 2rem 0;
}

.blog-video-embed__frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top, color-mix(in oklab, var(--primary) 14%, transparent), transparent 55%),
    oklch(0.12 0.01 240);
  box-shadow: 0 16px 36px color-mix(in oklab, black 12%, transparent);
}

.blog-video-embed__frame > div,
.blog-video-embed__frame iframe {
  width: 100%;
  height: 100%;
}
