/* ============================================
   Google Fonts Import
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.header {
  max-height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header img {
  max-height: 40px;
}

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --background-color: #fdfdfd;
  --text-color: #1a1a1a;
  --link-color: #1a1a1a;
  --blockquote-border: #e6e6e6;
  --blockquote-text: #606060;
}

/* ============================================
   Base Layout
   ============================================ */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1em;
  line-height: 1.3;
  margin: 0 auto;
  padding: 50px;
  max-width: 36em;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  font-weight: normal;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h2 {
  text-align: center;
  font-variant: small-caps;
  /* text-decoration: underline; */
}

h3 a {
  font-size: 0.8em;
}

/* ============================================
   Links
   ============================================ */
a {
  color: var(--link-color);
  text-decoration: underline;
}

a:hover {
  opacity: 0.7;
}

/* ============================================
   Lists
   ============================================ */
ul, ol {
  padding-left: 2em;
  margin: 1em 0;
}

li {}

/* ============================================
   Vocabulary Grid
   ============================================ */
body > h3:nth-of-type(1) {
  text-align: center;
  position: sticky;
  top: 0;
  background-color: var(--background-color);
  padding: 0.5em 0;
  border-bottom: 1px solid var(--blockquote-border);
  z-index: 100;
  margin-top: 0;
}

body > h3:nth-of-type(1) a {
  font-variant: small-caps;
  text-decoration: none;
}

body > h3:nth-of-type(1) + ul {
  list-style: none !important;
  padding-left: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 2em 0 !important;
}

body > h3:nth-of-type(1) + ul li {
  border: 1px solid var(--blockquote-border);
  margin: -0.5px;
  list-style: none !important;
  height: 4em;
}

body > h3:nth-of-type(1) + ul li a {
  display: flex !important;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color 0.2s, color 0.2s;
  font-variant: small-caps;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Active terms: override inline display on span, make it fill the cell */
body > h3:nth-of-type(1) + ul li span {
  display: block !important;
  width: 100%;
  height: 4em;
  padding: 0.5em;
  background-color: #f0f0f0;
  box-sizing: border-box;
}

/* Active term links should be transparent so grey background shows */
body > h3:nth-of-type(1) + ul li span a {
  background-color: transparent !important;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Active term links should be transparent so grey background shows */
body > h3:nth-of-type(1) + ul li span a {
  background-color: transparent !important;
}

body > h3:nth-of-type(1) + ul li a:hover {
  background-color: var(--text-color);
  color: var(--background-color);
  opacity: 1;
}

/* Active term hover: change span background */
body > h3:nth-of-type(1) + ul li span:hover {
  background-color: var(--text-color);
}

body > h3:nth-of-type(1) + ul li span a:hover {
  color: var(--background-color);
}

@media (min-width: 601px) {
  body > h3:nth-of-type(1) + ul {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ============================================
   Media
   ============================================ */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
}

/* ============================================
   Code
   ============================================ */
code {
  font-family: 'Courier New', monospace;
  background-color: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

/* ============================================
   Tables
   ============================================ */
table {
  margin: 1.5em auto;
  border-collapse: collapse;
  width: 100%;
}

th, td {
  border: 1px solid var(--blockquote-border);
  padding: 0.5em 0.75em;
  text-align: left;
}

/* ============================================
   Blockquotes
   ============================================ */
blockquote {
  margin: 1.5em 0;
  padding-left: 1em;
  border-left: 2px solid var(--blockquote-border);
  color: var(--blockquote-text);
  font-style: italic;
}

hr {
  height: 1px;
  background-color: var(--blockquote-border); 
  border: none; /* removes default border */
}

/* ============================================
   Endnotes
   ============================================ */
section[role="doc-endnotes"] {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--blockquote-border);
}

section[role="doc-endnotes"] ol li a[role="doc-backlink"] {
  padding-right: 0.2em;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  body {
    padding: 12px;
    font-size: 0.9em;
  }
}
