/* css styles */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Permanent+Marker&family=Schibsted+Grotesk:wght@400;600&family=Source+Sans+Pro:wght@400;600&display=swap');

:root {
  --headerFont: "Schibsted Grotesk", "Source Sans Pro", sans-serif;
  --pageMaxWidth: 1280px;
  --codeFont: "IBM Plex Mono", ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace;
}

body {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  background-color: #161618;
}

html {
  background-color: #161618;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--headerFont);
  font-weight: 600;
}

/* Resize navbar logo for better visibility */
.navbar-logo {
  max-height: 64px;
  width: auto;
}

@media (max-width: 512px) {
  .navbar-logo {
    max-height: 32px;
  }
  .navbar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .navbar-brand .navbar-title {
    margin-top: 0.4rem;
    white-space: normal;
    font-size: 1rem;
  }
}

/* Apply Permanent Marker font to the navbar title */
.navbar-brand,
.navbar-brand .navbar-title {
  font-family: "Permanent Marker", cursive;
  font-weight: 400;
}

/* Match navbar link typography with heading font */
.navbar-nav .nav-link {
  font-family: var(--headerFont);
  font-weight: 600;
}

/* Blend navbar into the dark page background */
.navbar,
.navbar-dark,
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
  background: transparent;
  color: inherit;
}

.navbar {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.navbar .navbar-container,
.navbar .container-fluid {
  width: 100%;
  max-width: var(--pageMaxWidth);
  margin: 0 auto;
  padding-left: clamp(1rem, 6vw, 4rem);
  padding-right: clamp(1rem, 6vw, 4rem);
}

.quarto-container {
  width: 100%;
  max-width: var(--pageMaxWidth);
  margin: 0 auto;
  padding-left: clamp(1rem, 6vw, 4rem);
  padding-right: clamp(1rem, 6vw, 4rem);
}

.navbar-brand,
.navbar-nav .nav-link {
  color: #f4f4f4 !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus-visible {
  color: #82d3ff !important;
}

@media (min-width: 992px) {
  .navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: clamp(1rem, 3vw, 4rem);
  }

  .navbar-brand-container {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    order: 1;
    margin: 0 !important;
    flex: 0 0 auto;
  }

  .navbar-brand {
    margin-right: 0;
    text-align: left;
    padding-bottom: 0;
  }

  .navbar .navbar-toggler {
    order: 2;
    margin-left: 1rem;
    display: none;
  }

  .navbar .navbar-collapse {
    order: 3;
    flex: 0 1 auto;
    margin-left: auto;
    display: flex !important;
    justify-content: flex-end;
  }

  .navbar-nav {
    flex-direction: row;
    justify-content: flex-end;
    gap: 1.15rem;
    margin-left: 0 !important;
  }

  #quarto-search {
    order: 4;
    flex: 0 0 auto;
    margin-left: 1.15rem;
    display: inline-flex;
    align-items: center;
  }

  .quarto-navbar-tools {
    order: 5;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .quarto-navbar-tools:empty {
    display: none;
  }

  #quarto-search button {
    border-radius: 999px;
    padding: 0.15rem;
    transition: background 0.2s ease, color 0.2s ease;
  }

  #quarto-search button:hover,
  #quarto-search button:focus-visible {
    background: rgba(255, 255, 255, 0.1);
  }
}

.navbar-toggler {
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.35rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-shadow: none;
}

.navbar-toggler:focus,
.navbar-toggler:focus-visible,
.navbar-toggler:active {
  outline: none;
  box-shadow: none;
}

/* Center caption text under Quarto figures */
.quarto-figure .figure-caption,
.quarto-figure figcaption,
figure .figure-caption,
figure figcaption {
  text-align: center;
}

.navbar-toggler[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.55);
}

.navbar-toggler[aria-expanded="true"]:hover,
.navbar-toggler[aria-expanded="true"]:focus-visible {
  border-color: rgba(255, 255, 255, 0.8);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Post title banner aligns with navbar styling */
.post-page #title-block-header {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.post-page #title-block-header .quarto-title-banner {
  width: 100%;
  max-width: var(--pageMaxWidth);
  margin: 0 auto;
  padding-left: clamp(1rem, 6vw, 4rem);
  padding-right: clamp(1rem, 6vw, 4rem);
}

.post-page #title-block-header .quarto-title-meta {
  width: 100%;
  max-width: var(--pageMaxWidth);
  margin: 1.5rem auto 0;
  padding: 1.5rem clamp(1rem, 6vw, 4rem) 1.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.post-page #title-block-header .quarto-title-banner {
  position: relative;
  background: transparent;
  color: #f4f4f4;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.post-page #title-block-header .quarto-title {
  position: relative;
  padding-right: clamp(8rem, 25vw, 20rem);
  min-height: 3.5rem;
}

.post-page #title-block-header .quarto-title-meta > div {
  min-width: 0;
}

.post-page #title-block-header .quarto-title-meta-heading {
  font-family: var(--headerFont);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.3rem;
}

.post-page #title-block-header .quarto-title-meta-contents {
  color: #f4f4f4;
  font-size: 1rem;
}

.post-page #title-block-header .quarto-title-meta-contents p {
  margin: 0;
}


/* Center standalone images by default */
main img:not([style]),
.content img:not([style]),
.quarto-figure img:not([style]) {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.quarto-figure>figure>p:not([style]) {
  text-align: center;
}

.back-to-blog-link {
  font-family: var(--headerFont);
  font-weight: 600;
  color: #f4f4f4;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  position: absolute;
  top: 50%;
  right: clamp(1rem, 4vw, 3rem);
  transform: translateY(-50%);
}

.back-to-blog-link::before {
  content: "←";
  font-size: 1rem;
  line-height: 1;
}

.back-to-blog-link:hover,
.back-to-blog-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .post-page #title-block-header .quarto-title {
    padding-right: 0;
    min-height: 0;
  }

  .post-page .back-to-blog-link {
    position: static;
    transform: none;
    font-size: 0.9rem;
    margin-top: 0.75rem;
  }
}
.post-page #title-block-header .quarto-title-meta .quarto-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.post-page #title-block-header .quarto-title-meta .quarto-category {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.post-page #title-block-header .quarto-title-banner .quarto-categories {
  display: none;
}

/* Give fenced code blocks a subtle framed feel without a solid fill */
.code-copy-outer-scaffold {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.65rem;
  padding: 1.35rem 1.5rem 1.1rem;
  margin: 1.25rem 0;
  box-shadow: none;
  backdrop-filter: blur(3px);
}

.code-copy-outer-scaffold .sourceCode,
.code-copy-outer-scaffold pre.sourceCode,
.code-copy-outer-scaffold pre {
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.code-copy-outer-scaffold pre code {
  color: #f2f2f5;
  font-size: 0.95rem;
  line-height: 1.6;
  font-family: var(--codeFont);
}

/* Restore the gutter Quarto expects for code line numbers */
.code-copy-outer-scaffold pre.numberSource {
  margin-left: 3rem;
  padding-left: 0.4rem;
}

.code-copy-outer-scaffold
  pre.numberSource
  code
  > span
  > a:first-child::before {
  color: rgba(255, 255, 255, 0.45);
}

.code-copy-outer-scaffold .numberSource code {
  color: #d8dee9;
}

.code-copy-outer-scaffold .number-lines {
  padding-left: 0;
}

.code-copy-outer-scaffold .code-copy-button {
  top: 0.85rem;
  right: 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: #f4f4f4;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.code-copy-outer-scaffold .code-copy-button:hover,
.code-copy-outer-scaffold .code-copy-button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}

.code-copy-outer-scaffold .code-copy-button .bi {
  color: inherit;
}
