/* development.plekbooking.com (#931): the plekbooking.com look (Nunito, the mascot's colours) */
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --plum: #2a1740;
  --purple: #6b2fc4;
  --purple-deep: #4c1f95;
  --teal-deep: #0b6e74;
  --yellow: #ffd84a;
  --lavender: #a99be8;

  --bg: #fffcf6;
  --surface: #ffffff;
  --tint: #f2eefd;
  --text: var(--plum);
  --muted: #5a4d6b;
  --border: #e6e0f2;
  --link: var(--purple);
  --focus: var(--teal-deep);
  --primary-bg: var(--purple);
  --primary-text: #ffffff;
  --primary-hover: var(--purple-deep);
  --code-bg: #f7f3fd;
  --radius: 1rem;
  --header-height: 4.25rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150f1d;
    --surface: #211930;
    --tint: #1c1528;
    --text: #f4effa;
    --muted: #c3b8d2;
    --border: #3a2f4c;
    --link: #c9b5ff;
    --focus: var(--yellow);
    --primary-bg: var(--yellow);
    --primary-text: var(--plum);
    --primary-hover: #ffe680;
    --code-bg: #1c1528;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.01em;
}

code,
pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--primary-bg);
  color: var(--primary-text);
  border-radius: 0.5rem;
  z-index: 20;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--primary-bg);
  border-radius: 999px;
  background: var(--primary-bg);
  color: var(--primary-text);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button-quiet:hover {
  background: var(--tint);
  border-color: var(--lavender);
}

.button-small {
  min-height: 2.25rem;
  padding: 0.25rem 0.875rem;
  font-size: 0.9375rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
}

@supports (backdrop-filter: blur(8px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(8px);
  }
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  max-width: 80rem;
  min-height: var(--header-height);
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 900;
  font-size: 1.375rem;
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
}

.brand-sub {
  font-weight: 700;
  color: var(--muted);
  font-size: 1rem;
}

.main-nav {
  margin-right: auto;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current] {
  color: var(--link);
  text-decoration: underline;
}

.key-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

@media (max-width: 40rem) {
  .brand-sub {
    display: none;
  }

  .main-nav {
    order: 3;
    width: 100%;
  }

  .header-inner {
    justify-content: space-between;
  }
}

/* Home */
main {
  display: block;
}

.hero,
.cards,
.test-key {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    padding-top: 4.5rem;
  }
}

.hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  margin: 0 0 1rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--teal-deep);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.875rem;
}

@media (prefers-color-scheme: dark) {
  .eyebrow {
    color: #7fe0e2;
  }
}

.lead {
  color: var(--muted);
  font-size: 1.1875rem;
}

.hero-actions,
.test-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-art {
  justify-self: center;
}

.hero-art img {
  width: min(20rem, 70vw);
}

.cards {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

.cards h2,
.test-key h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  margin: 0 0 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1875rem;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--link);
  text-decoration: underline;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card .meta {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
}

.test-key {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--tint);
  border: 1px solid var(--border);
  max-width: 70rem;
}

@media (min-width: 52rem) {
  .test-key {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
  }
}

@media (max-width: 74rem) {
  .test-key {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

.test-key p {
  margin: 0;
}

/* Guides */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 2rem;
}

@media (min-width: 60rem) {
  .doc-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .doc-aside {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 2rem);
    overflow-y: auto;
  }
}

.guide-nav {
  padding-top: 2rem;
}

.guide-nav ul {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.guide-nav li a {
  display: block;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
}

.guide-nav li a:hover {
  background: var(--tint);
}

.guide-nav li a[aria-current] {
  background: var(--tint);
  color: var(--link);
  font-weight: 800;
}

.nav-title {
  margin: 0 0 0.25rem;
  padding: 0 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 59.99rem) {
  .doc-aside {
    border-bottom: 1px solid var(--border);
  }

  .guide-nav {
    padding-top: 1rem;
  }

  .guide-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .nav-title {
    padding: 0;
  }

  .guide-nav li a {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    font-size: 0.9375rem;
  }
}

.doc {
  min-width: 0;
  max-width: 48rem;
  padding: 2rem 0 3rem;
}

.doc h1 {
  font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
  margin: 0 0 0.5rem;
}

.doc h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
}

.doc h3 {
  font-size: 1.1875rem;
  margin: 1.75rem 0 0.5rem;
}

.doc .anchor {
  float: left;
  margin-left: -1.1em;
  padding-right: 0.25em;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
}

.doc h2:hover .anchor,
.doc h3:hover .anchor {
  opacity: 1;
}

.toc {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc .nav-title {
  padding: 0;
}

.toc ol {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 800;
}

blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--lavender);
  background: var(--tint);
  border-radius: 0 0.75rem 0.75rem 0;
}

blockquote p {
  margin: 0;
}

/* API reference: Scalar under the header and the API tabs */
.reference-page {
  --header-height: 4.25rem;
}

.api-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 9;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.api-tabs ul {
  display: flex;
  gap: 0.25rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
  overflow-x: auto;
}

.api-tabs a {
  display: block;
  padding: 0.6rem 0.9rem;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.api-tabs a[aria-current] {
  color: var(--link);
  border-bottom-color: var(--link);
}

.reference-page #plek-api-reference {
  --header-height: calc(4.25rem + 3rem);
}

.loading,
.noscript {
  max-width: 48rem;
  margin: 3rem auto;
  padding: 0 1rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.not-found {
  margin: 0 auto;
  padding: 3rem 1rem;
}
