@font-face {
  font-family: Montserrat;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

html[data-theme="light"] {
  --primary: #285c53;
  --secondary: #173e36;
  --accent: #f8e9ba;
  --link-fg: #23594f;
  --link-hover-color: #173e36;
}

@supports (color: light-dark(white, black)) {
  :root,
  html[data-theme] {
    --primary: light-dark(#285c53, #24493f);
    --secondary: light-dark(#173e36, #285c53);
    --accent: light-dark(#f8e9ba, #f8e9ba);
    --link-fg: light-dark(#23594f, #9bdacb);
    --link-hover-color: light-dark(#173e36, #c1f3e7);
    --link-selected-fg: light-dark(#173e36, #9bdacb);
    --button-hover-bg: light-dark(#205067, #337064);
    --default-button-bg: light-dark(#205067, #285c53);
    --default-button-hover-bg: light-dark(#173e36, #337064);
  }
}

body {
  font-size: 1rem;
}

#header,
.login #header {
  --orchard-brown: var(--body-fg);
  --orchard-coral: var(--body-fg);
  --orchard-ink: var(--body-fg);
  --orchard-hover: var(--link-hover-color);
  background: var(--body-bg);
  border-bottom: 1px solid var(--hairline-color);
  color: var(--orchard-ink);
  font-family: Montserrat, sans-serif;
  min-height: 60px;
  box-sizing: border-box;
  padding: 12px clamp(16px, 3vw, 40px);
}

@supports (color: light-dark(white, black)) {
  #header,
  .login #header {
    --orchard-brown: light-dark(#886e45, #d4bb92);
    --orchard-coral: light-dark(#fd4f42, #ff8c80);
    --orchard-ink: light-dark(#404040, #eee);
    --orchard-hover: light-dark(#ac2b21, #ff8c80);
    background: light-dark(#fff, #1b1b1b);
  }
}

#header #branding,
.orchard-brand,
.orchard-header-tools,
.orchard-nav,
#header #user-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

#header #site-name a {
  color: var(--orchard-brown);
  text-decoration: none;
}

.orchard-wordmark {
  font-size: 1.35rem;
  font-weight: 600;
  white-space: nowrap;
}

.orchard-wordmark span {
  color: var(--orchard-coral);
}

.orchard-portal-name {
  color: var(--orchard-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.orchard-header-tools {
  gap: 12px 24px;
}

#header .orchard-nav a,
#header #user-tools a,
#header #logout-form button {
  color: var(--orchard-ink);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

#header #user-tools {
  margin: 0;
  padding: 0;
}

#header .orchard-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--link-fg);
  border-radius: 0.35rem;
  color: var(--link-fg);
  text-decoration: none;
}

#header .orchard-nav a:hover,
#header .orchard-nav a:focus-visible {
  background: var(--link-fg);
  color: var(--body-bg);
}

#header .orchard-nav a:focus-visible {
  outline: 2px solid var(--link-fg);
  outline-offset: 2px;
}

#header #user-tools a:hover,
#header #logout-form button:hover {
  color: var(--orchard-hover);
}

.orchard-theme-control {
  display: inline-flex;
  align-items: center;
  color: var(--orchard-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

#header .theme-toggle {
  width: 44px;
  height: 44px;
  margin: 0;
  color: inherit;
}

#header .theme-toggle svg {
  margin-inline: auto;
  fill: currentColor;
  color: inherit;
}

#header .theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

@media (max-width: 900px) {
  #header {
    flex-wrap: wrap;
    gap: 12px 24px;
  }
}

.student-search-bar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline-color);
}

.student-search-bar form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.student-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-block: 12px 20px;
  border-bottom: 1px solid var(--hairline-color);
}

.student-tabs a {
  padding: 8px 12px;
}

.student-tabs a[aria-current="page"] {
  border-bottom: 2px solid currentColor;
  font-weight: 700;
}

.paid-student-name {
  background-color: #d9f2df;
  color: #173c26;
  border-radius: 0.25em;
  padding: 0.06em 0.3em;
  box-decoration-break: clone;
}

.score-percent {
  border-radius: 0.25em;
  padding: 0.06em 0.3em;
  font-weight: 700;
}

.score-percent-red {
  background-color: #ffd9dc;
  color: #641b25;
}

.score-percent-yellow {
  background-color: #fff2ad;
  color: #513c05;
}

.score-percent-green {
  background-color: #d9f2df;
  color: #173c26;
}

.quiz-completion {
  display: inline-block;
  border: 1px solid var(--hairline-color);
  border-radius: 0.25em;
  margin-inline-start: 0.35em;
  padding: 0.1em 0.35em;
  white-space: nowrap;
}

.portal-save-status {
  position: fixed;
  z-index: 10;
  inset-inline-end: 1rem;
  inset-block-end: 1rem;
  max-width: min(22rem, calc(100% - 2rem));
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--hairline-color);
  border-radius: 0.4rem;
  background: var(--body-bg);
  color: var(--body-fg);
  box-shadow: 0 2px 8px #0002;
}

.portal-save-status button {
  margin-inline-start: 0.5rem;
}
