/*
 * Shared styles for every page. Linked before Tailwind on purpose: where both
 * set the same property with equal specificity, Tailwind's later rule wins.
 */

:root {
  --site-fg: black;
  --site-accent: #111111;
  --site-inverse: white;
  --site-inverse-muted: lightgray;
}

/* ---------- Base ---------- */

/* "Minecraft" by Craftron Gaming, from https://www.dafont.com/minecraft.font (listed as 100% Free). */
@font-face {
  font-family: "Minecraft";
  src: url("/static/fonts/Minecraft.ttf") format("truetype");
  font-display: swap;
}

/* "html body" outranks Tailwind's preflight, which loads later and resets body's font. */
html body {
  font-family: "Minecraft", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
  left: 0;
  top: 0;
  right: 0;
}

/* Hide the scrollbar while keeping the page scrollable. */
html,
body {
  overflow-y: scroll;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

a {
  color: var(--site-fg);
  text-decoration: none;
  border-bottom: 1px solid var(--site-accent);
}

/* Visually hidden but read by screen readers.
   Borrowed from https://haltersweb.github.io/Accessibility/svg.html */
.screen-reader-text {
  position: absolute !important;
  display: block;
  visibility: visible;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0px, 0px, 0px, 0px); /* deprecated */
  clip-path: polygon(0px 0px, 0px 0px, 0px 0px, 0px 0px);
  white-space: nowrap; /* LFs are not read as spaces by screen readers */
}

/* ---------- Navigation ---------- */

.menu {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu ul {
  padding: 0 10px;
  margin: 0;
}

.menu li {
  list-style: none;
  text-align: right;
  display: inline-block;
  padding-right: 8px;
}

.menu a {
  display: block;
  font-size: 22pt;
  font-weight: 300;
  width: 100%;
  border: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.menu a:hover {
  border-bottom: 1px solid var(--site-accent);
}

.menu .active {
  font-weight: 500;
}

/* The pixel font is wide; keep the three nav links on one line on phones. */
@media (max-width: 600px) {
  .menu a {
    font-size: 15pt;
  }
}

@media (max-width: 360px) {
  .menu a {
    font-size: 12pt;
  }
}

/* ---------- Main content ---------- */

.content {
  flex-grow: 1;
  font-weight: 300;
  font-size: 18pt;
  padding: 0 10%;
}

/* The homepage has extra space above its heading. */
.content-home {
  padding: 2.5rem 10%;
}

/* ---------- Footer ---------- */

.footer {
  background-color: var(--site-accent);
  color: var(--site-inverse);
  height: 100px;
  margin-top: 20px;
  display: flex;
  flex-direction: row;
}

.footer-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
}

.footer a {
  margin: 5px;
  color: var(--site-inverse);
  width: 20px;
  height: 20px;
  display: inline-block;
}

.footer a:hover {
  color: var(--site-inverse-muted);
}

.footer span {
  padding-top: 10px;
  color: var(--site-inverse-muted);
}

/* ---------- Homepage: about section ---------- */

.about-image {
  aspect-ratio: 3 / 4;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
}

.about {
  display: flex;
  flex-direction: column;
}

.about-content {
  margin-bottom: 40px;
}

@media (min-width: 1200px) {
  .about {
    flex-direction: row;
    align-items: flex-start;
  }

  .about-content {
    margin-bottom: 0;
    padding-top: 1%;
    flex-grow: 1;
    flex-basis: 0;
    margin-right: 10%;
  }

  .about-image {
    flex-grow: 1;
    flex-basis: 0;
  }
}
