.blog-content h1 {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-weight: 500;
    font-size: 1.5rem; /* 24px (equivalent to text-2xl) */
    color: #000;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
  }
  
  .blog-content h2 {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-weight: 500;
    font-size: 1.25rem; /* 20px (text-xl) */
    color: #000;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
  }
  
  .blog-content h3 {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-weight: 500;
    font-size: 1.125rem; /* 18px (text-lg) */
    color: #000;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .blog-content p {
    margin-bottom: 1.5rem;
  }
  
  .blog-content strong {
    font-weight: 600;
    color: #1f2937; /* gray-800 */
  }
  
  .blog-content em {
    font-style: italic;
    color: #374151; /* gray-700 */
  }
  
  .blog-content ul, .blog-content ol {
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .blog-content li {
    margin-bottom: 0.5rem;
  }
  
  .blog-content a {
    color: #2563eb; /* blue-600 */
    text-decoration: underline;
  }

  .blog-content figure {
    margin-bottom: 2rem;
  }

  .blog-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
  }

  .blog-content figcaption {
    font-size: 14px;
    font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #6b7280;
    font-weight: 400;
    text-align: center;
    margin-top: 0.25rem;
    line-height: 1.2;
  }

  .blog-content .image-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0;
  }
  
  .blog-content .image-row figure {
    max-width: 300px;
    flex: 1 1 auto;
    display: flex;
    margin-bottom: 0;
    align-items: center;
    flex-direction: column;
  }

  /* YouTube video container styles */
  .blog-content .blog-yt-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 2rem 0;
  }

  .blog-content .blog-yt-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  /* --- Footnote styles --- */
  .blog-content .footnote-ref {
    display: inline;
    position: relative;
    cursor: pointer;
    vertical-align: 2px;
    outline: none;
  }

  .blog-content .footnote-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #3b82f6; /* blue-500 */
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin-left: 3px;
    margin-right: 3px;
    user-select: none;
    vertical-align: 2px;
    line-height: 1;
    padding: 0;
  }

  .blog-content .footnote-popover {
    display: none;
    position: absolute;
    left: 50%;
    top: 120%;
    /* Center by default and allow JS to nudge using --popover-dx */
    transform: translateX(-50%) translateX(var(--popover-dx, 0px));
    /* Make width responsive to viewport to avoid horizontal clipping */
    min-width: min(320px, calc(100vw - 24px));
    max-width: min(480px, calc(100vw - 24px));
    max-height: 180px;
    background: #f3f4f6;
    color: #222;
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    box-shadow: 0 6px 32px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.10);
    padding: 16px 24px;
    font-size: 15px;
    z-index: 100;
    overflow-y: auto;
    white-space: pre-line;
    line-height: 1.5;
    font-family: Arial, sans-serif;
  }

  .blog-content .footnote-ref:focus .footnote-popover {
    display: block;
  }

  .blog-content .footnote-popover::before {
    content: "";
    position: absolute;
    top: -10px;
    left: calc(50% + var(--arrow-dx, 0px));
    transform: translateX(-50%);
    border-width: 0 8px 10px 8px;
    border-style: solid;
    /* Match the popover background */
    border-color: transparent transparent #f3f4f6 transparent;
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.08));
  }

  /* Flip to top when necessary */
  .blog-content .footnote-ref[data-popover-position="top"] .footnote-popover {
    top: auto;
    bottom: 120%;
  }

  .blog-content .footnote-ref[data-popover-position="top"] .footnote-popover::before {
    top: auto;
    bottom: -10px;
    border-width: 10px 8px 0 8px;
    border-color: #f3f4f6 transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08));
  }

  /* Optional: visually indicate focus for accessibility */
  .blog-content .footnote-ref:focus .footnote-circle {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
  }

