/* Reading typography is a theme layer over the Pajamas interface scale. */
:root {
  --vs-type-body: 1.0625rem;
  --vs-type-h1: 1.75rem;
  --vs-type-h2: 1.4375rem;
  --vs-type-h3: 1.1875rem;
  --vs-type-ui: .9375rem;
  --vs-type-meta: .8125rem;
  --vs-type-code: .875rem;
}

@media (min-width: 48em) {
  :root {
    --vs-type-body: 1.125rem;
    --vs-type-h1: 1.875rem;
    --vs-type-h2: 1.5rem;
    --vs-type-h3: 1.25rem;
    --vs-type-meta: .875rem;
    --vs-type-code: .9375rem;
  }
}

@media (min-width: 75em) {
  :root {
    --vs-type-body: 1.1875rem;
    --vs-type-h1: 2rem;
    --vs-type-h2: 1.5625rem;
    --vs-type-h3: 1.3125rem;
  }
}

@media (min-width: 100em) {
  :root {
    --vs-type-body: 1.25rem;
    --vs-type-h1: 2.125rem;
    --vs-type-h2: 1.625rem;
    --vs-type-h3: 1.375rem;
    --vs-type-ui: 1rem;
    --vs-type-meta: .9375rem;
    --vs-type-code: 1rem;
  }
}

@media (min-width: 137.5em) {
  :root {
    --vs-type-body: 1.3125rem;
    --vs-type-h1: 2.25rem;
    --vs-type-h2: 1.75rem;
    --vs-type-h3: 1.4375rem;
  }
}

.vs-article {
  --vs-reading-width: calc(39 * var(--vs-type-body));
}

.vs-article .vs-reading-grid:not(:has(> .vs-toc:not([hidden]))) {
  grid-template-columns: minmax(0, var(--vs-reading-width));
}

.vs-prose {
  font-size: var(--vs-type-body);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.vs-article-header h1 {
  font-size: var(--vs-type-h1);
  line-height: 1.23;
  text-wrap: balance;
}

.vs-article-content h2,
.vs-article-content h3 {
  line-height: 1.25;
  text-wrap: balance;
}

.vs-article-content h2 { font-size: var(--vs-type-h2); }
.vs-article-content h3 { font-size: var(--vs-type-h3); }

.vs-prose :is(p, ul, ol, pre, figure) {
  margin-block-end: 1.5em;
}

.vs-prose :is(code, pre, kbd) { font-size: var(--vs-type-code); }
.vs-prose pre {
  max-inline-size: 100%;
  line-height: 1.5;
  overflow-wrap: normal;
}
.vs-prose pre code { font-size: inherit; }

.vs-prose table { line-height: 1.5; }
.vs-prose figcaption,
.vs-meta,
.vs-card-footer .vs-meta,
.vs-breadcrumbs {
  font-size: var(--vs-type-meta);
  line-height: 1.45;
}

.vs-topbar,
.vs-sidebar,
.vs-close-nav,
.vs-live-results a,
.vs-button,
.wp-element-button,
.vs-toc,
.vs-mobile-toc,
.vs-prose :is(label, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], select, textarea) {
  font-size: var(--vs-type-ui);
  line-height: 1.45;
}

@media (max-width: 767px) {
  .vs-brand > span:last-child { font-size: var(--vs-type-ui); }
  .vs-search-trigger input,
  .vs-prose :is(input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], select, textarea) {
    font-size: max(1rem, var(--vs-type-ui));
  }
}

/* Reserve room for the wrapped footer at high zoom and on narrow phones. */
@media (max-width: 400px) {
  :root { --vs-footer-height: 2.75rem; }
  .has-js .vs-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    height: var(--vs-footer-height);
    line-height: 1.25;
  }
  .has-js .vs-main { bottom: calc(var(--vs-footer-height) + var(--vs-frame-inset)); }
}
