@font-face {
  font-family: 'Newsreader';
  src: url("/assets/Newsreader-VariableFont_opsz,wght-ca658e9b.ttf") format('truetype');
  font-weight: 200 800;
  font-style: normal;
}

@font-face {
  font-family: 'Newsreader';
  src: url("/assets/Newsreader-Italic-VariableFont_opsz,wght-13063092.ttf") format('truetype');
  font-weight: 200 800;
  font-style: italic;
}

@font-face {
  font-family: 'Gantari';
  src: url("/assets/Gantari-VariableFont_wght-96d69bbc.ttf") format('truetype');
  font-weight: 200 800;
  font-style: normal;
}

@font-face {
  font-family: 'Gantari';
  src: url("/assets/Gantari-Italic-VariableFont_wght-8ee886ae.ttf") format('truetype');
  font-weight: 200 800;
  font-style: italic;
}

:root {
  /* Typography */
  --font-serif: 'Newsreader', Georgia, Times, serif;
  --font-sans: 'Gantari', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  
  /* Base typography settings */
  --font-size: clamp(1rem, 2.225vw, 1.125rem);
  --letter-spacing: -0.0015em;
  --line-height: 1.2;
  --line-height-loose: 1.6;
  --line-height-tight: 1;
  
  /* Text sizes */
  --text-xs: 75%;
  --text-sm: 87.5%;
  --text-base: 100%;
  --text-lg: 125%;
  --text-xl: 175%;
  --text-2xl: 225%;
}

/* .typography is used for document HTML formatting */
.typography {
  font-size: var(--text-base);
  font-family: var(--font-sans);

  &.typography--sans {
    font-family: var(--font-sans);
  }

  line-height: var(--line-height-loose);
  word-break: break-word;
  
  a[href] {
    text-decoration: underline;
    color: var(--color-link);
  }
  
  p {
    margin-bottom: 1em;
  }
  
  blockquote {
    border-left: 4px solid var(--color-border);
    
    > * {
      margin-left: 1.25em;
    }
  }
  
  * {
    max-width: var(--page-width);
    height: auto;
  }
 
  table,
  th,
  td {
    border: 1px solid var(--color-border);
    border-collapse: collapse;
    padding: 0.5em;
    vertical-align: top;
    white-space: nowrap;
  }

  table, pre code {
    overflow-x: scroll;
    display: block;
  }

  img {
    width: max-content;
    margin-bottom: 2em;
  }
  
  h1, h2, h3, h4, h5, h6 {
    margin: 1em 0 .625em;
    font-weight: 600;
    font-family: var(--font-sans);
  }

  h1 {
    font-size: var(--text-2xl);
  }

  h2 {
    font-size: var(--text-xl);
  }

  h3 {
    font-size: var(--text-lg);
  }

  /* assuming here that all iframes are video containers */
  iframe, .video-container iframe {
    display: flex;
    justify-content: center;
    margin-bottom: 2em;
    aspect-ratio: 16/9;
    width: 100%;
  }
  
  strong, b {
    font-weight: bold
  }

  em, i {
    font-style: italic;
  }

  code {
    font-family: var(--font-mono);
  }

  ol, ul {
    list-style: initial;

    li {
      margin: 0.5em 0 0 2em;
    }
  }

  ol > li {
    list-style-type: decimal;
    list-style-position: inside;
  }

  ul > li {
    list-style-type: disc;
    list-style-position: inside;
  }

  details {
    summary {
      cursor: pointer;
      position: relative;
      display: flex;
      align-items: center;
      
      &::before {
        content: "";
        mask-image: url("/assets/icons/caret-right-7a262ffc.svg");
        mask-size: 100%;
        width: 0.8em;
        height: 0.8em;
        transition: transform var(--transition);
        background: var(--color-text);
        margin-right: 0.5em;
      }
    }
    
    &[open] summary::before {
      transform: rotate(90deg);
    }
  }

  pre code {
    background-color: var(--bg-secondary);
    border: 1px solid var(--color-border);
    display: block;
    font-family: var(--font-mono);
  }

  ruby rt {
    font-size: var(--text-sm);
  }

  sub, sup {
    font-size: var(--text-sm);
    margin-left: 0.25em;
  }

  sup {
    vertical-align: super;
  }

  sub {
    vertical-align: sub;
  }

  s {
    text-decoration: line-through;
    color: var(--color-text--subtle);
  }

  :where([hidden]) {
    display: none !important;
  }
}
