/* ============================================================
   Blog typography
   ============================================================ */

.blog-page,
body {
  --blog-serif: Georgia, "Times New Roman", serif;
  --blog-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--blog-sans);
}

/* Article text */

main.content p,
main.content li {
  font-family: var(--blog-serif);
  font-size: 1.2rem;
  line-height: 1.9;
}

main.content h1,
main.content h2,
main.content h3 {
  font-family: var(--blog-sans);
  letter-spacing: -0.02em;
}

/* Article title */

.quarto-title h1 {
  font-family: var(--blog-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* ============================================================
   Article font-size controls
   ============================================================ */

.blog-font-controls {
  position: fixed;
  top: 205px;
  right: 20px;
  z-index: 9998;

  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.blog-font-controls button {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;

  border: 1px solid var(--bs-border-color, #ccc);
  border-radius: 50%;

  background: var(--bs-body-bg, white);
  color: var(--bs-body-color, #222);

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: var(--blog-serif);
  font-weight: 600;

  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);

  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
}

.blog-font-controls button:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.blog-font-controls button.active {
  background: var(--bs-body-color, #222);
  color: var(--bs-body-bg, white);
}

/* Individual control sizes */

.blog-font-button.blog-font-small {
  font-size: 0.85rem;
}

.blog-font-button.blog-font-medium {
  font-size: 1.15rem;
}

.blog-font-button.blog-font-large {
  font-size: 1.45rem;
}

/* ============================================================
   Article font-size presets
   ============================================================ */

.blog-font-small main.content p,
.blog-font-small main.content li {
  font-size: 1rem;
  line-height: 1.75;
}

.blog-font-medium main.content p,
.blog-font-medium main.content li {
  font-size: 1.3rem;
  line-height: 1.9;
}

.blog-font-large main.content p,
.blog-font-large main.content li {
  font-size: 1.65rem;
  line-height: 2.05;
}

/* ============================================================
   Blog listing
   ============================================================ */

.quarto-listing {
  max-width: 900px;
  margin: 0 auto;
}

.quarto-listing .listing-item {
  padding: 2rem 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.quarto-listing .listing-title {
  font-family: var(--blog-serif);
  font-size: 2rem;
  line-height: 1.15;
}

.quarto-listing .listing-description {
  font-family: var(--blog-serif);
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.8;
}

/* ============================================================
   Reading progress
   ============================================================ */

.blog-progress {
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 3px;

  z-index: 10000;
  pointer-events: none;
  background: transparent;
}

.blog-progress-bar {
  width: 0;
  height: 100%;

  background: currentColor;

  transition: width 0.05s linear;
}

/* ============================================================
   Theme button
   ============================================================ */

.blog-theme-toggle {
  position: fixed;
  top: 70px;
  right: 20px;

  z-index: 9999;

  width: 2.5rem;
  height: 2.5rem;

  border: 1px solid var(--bs-border-color, #ccc);
  border-radius: 50%;

  background: var(--bs-body-bg, white);
  color: var(--bs-body-color, #222);

  font-size: 1.1rem;

  cursor: pointer;

  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);

  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.blog-theme-toggle:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

/* ============================================================
   Article footer
   ============================================================ */

.blog-article-footer {
  display: flex;
  justify-content: center;

  max-width: 900px;

  margin: 5rem auto 3rem;
  padding-top: 2rem;

  border-top: 1px solid var(--bs-border-color, #ddd);
}

.blog-article-footer a {
  display: inline-block;

  padding: 0.7rem 1.2rem;

  border: 1px solid var(--bs-border-color, #ddd);
  border-radius: 6px;

  text-decoration: none;
  font-weight: 500;
}

.blog-article-footer a:hover {
  text-decoration: none;
  opacity: 0.75;
}

/* ============================================================
   More posts
   ============================================================ */

.blog-more-section {
  max-width: 1100px;
  margin: 4rem auto;
}

.blog-more-section h2 {
  font-family: var(--blog-sans);
  margin-bottom: 1.5rem;
}

.blog-more-posts {
  display: flex;
  gap: 1.25rem;

  overflow-x: auto;

  padding-bottom: 1rem;

  scroll-snap-type: x mandatory;
}

.blog-more-card {
  flex: 0 0 300px;

  padding: 1.5rem;

  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 12px;

  text-decoration: none;
  color: inherit;

  scroll-snap-align: start;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-more-card:hover {
  transform: translateY(-3px);

  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.1);
}

.blog-more-category {
  font-family: var(--blog-sans);

  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 0.08em;
  text-transform: uppercase;

  opacity: 0.6;
}

.blog-more-title {
  display: block;

  margin: 0.7rem 0;

  font-family: var(--blog-serif);

  font-size: 1.45rem;
  line-height: 1.15;
}

.blog-more-description {
  display: block;

  font-family: var(--blog-serif);

  line-height: 1.5;

  opacity: 0.75;
}

.blog-more-read {
  display: block;

  margin-top: 1.2rem;

  font-family: var(--blog-sans);

  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================================
   Dark mode
   ============================================================ */

[data-blog-theme="dark"] {
  color-scheme: dark;
}

[data-blog-theme="dark"] body {
  background: #111;
  color: #eee;
}

[data-blog-theme="dark"] .blog-more-card {
  background: #181818;
  border-color: #333;
}

[data-blog-theme="dark"] .blog-theme-toggle,
[data-blog-theme="dark"] .blog-font-controls button {
  background: #181818;
  color: #eee;
  border-color: #444;
}

[data-blog-theme="dark"] .blog-font-controls button.active {
  background: #eee;
  color: #111;
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 700px) {
  .quarto-title h1 {
    font-size: 2.5rem;
  }

  main.content p,
  main.content li {
    font-size: 1.08rem;
    line-height: 1.8;
  }

  .blog-font-small main.content p,
  .blog-font-small main.content li {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .blog-font-medium main.content p,
  .blog-font-medium main.content li {
    font-size: 1.08rem;
    line-height: 1.8;
  }

  .blog-font-large main.content p,
  .blog-font-large main.content li {
    font-size: 1.25rem;
    line-height: 1.9;
  }

  .blog-theme-toggle {
    top: 60px;
    right: 12px;
  }

  .blog-font-controls {
    top: 175px;
    right: 12px;
  }

  .blog-font-controls button {
    width: 2.3rem;
    height: 2.3rem;
  }

  .blog-article-footer {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .blog-more-card {
    flex-basis: 270px;
  }
}