/* Basic Setup */

@font-face {
  font-family: 'Amatic SC';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Amatic-SC.woff2') format('woff2');
}

@font-face {
  font-family: 'Vitesse';
  font-style: normal;
  font-weight: bold;
  font-display: swap;
  src: url('/fonts/Vitesse-Bold.otf') format('opentype');
}

:root {
  --blue: #195293;
  --orange: #f78b35;
  --red: #9c1c22;
  --yellow: #fec842;
}

:focus {
  box-shadow: 0 0 0 0.25rem var(--yellow), 0 0 0 0.5rem var(--red);
  outline: 3px solid transparent; /* The transparent color is shown when Windows High Contrast Mode is triggered */
  outline-offset: 3px;
}

/* TLDR: hide the buttons, make the colors more reasonable */
/* Firefox */
* {
  scrollbar-color: var(--yellow) var(--red);
}

/* Chrome / Edge */
::-webkit-scrollbar {
  width: 1rem;
}

::-webkit-scrollbar-button {
  display: none;
}

::-webkit-scrollbar-thumb {
  background: var(--red);
  border-start-start-radius: 1rem;
  border-end-start-radius: 1rem;
}

::-webkit-scrollbar-track {
  background: var(--yellow);
}

html {
  scroll-behavior: smooth;
  scroll-padding-block-start: 7rem;
}

body {
  background-color: var(--orange);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
}

/* Navigation Bar */

nav, .header-content, .section-content, footer {
  padding: 1rem;
}

.logo-like {
  color: var(--red);
  font-family: "Vitesse", sans-serif;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

nav {
  background-color: var(--yellow);
  padding-block-end: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.nav-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-content: center;
  align-items: center;
  justify-content: center;
}

nav ul {
  list-style-type: none;
  display: grid;
  grid-auto-flow: column;
  justify-content: center;
  gap: 0.6rem;
}

a {
  color: var(--red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  font-weight: bold;
}

nav::after {
  background-color: var(--red);
  content: "";
  display: block;
  height: 0.25rem;
  margin-inline-start: -1rem;
  width: calc(100% + 2rem);
}

@media (max-width: 936px) {
  .nav-grid {
    grid-template-columns: 1fr;
  }

  nav ul {
    gap: 1rem;
    padding-inline-start: 0;
  }
}

@media (max-width: 504px) {
  nav ul {
    display: none;
  }
}

/* Home Page Header */

.homepage-header {
  background-color: var(--red);
}

video {
  width: 100%;
}

.header-content {
  padding-block-end: 6rem;
}

h1 {
  color: var(--yellow);
  font-size: calc(1.375rem + 1.5vw);
  margin-block-end: 0.5rem;
}

p {
  font-size: 1.5rem;
}

img:not(.paper-border) {
  max-width: 100%;
}

.header-content p {
  color: white;
  font-size: 1.25rem;
}

h1, h2, p {
  text-align: center;
}

@supports(text-wrap: balance) { /* basically no support for this, but if the browser has it, the final result is much neater and easier than the other options */
  .header-content, .section-content p {
    text-wrap: balance;
  }
}

@supports not (text-wrap: balance) {
  @media (min-width: 770px) {
    .header-content {
      margin-inline: auto;
      width: 50%;
    }

    .section-content p {
      margin-inline: auto;
      width: 70%;
    }
  }
}

/* Main Content */

main {
  background-color: var(--yellow); /* Theoretically unneeded, but could hide an issue if a random gap appears */
  margin-block-end: -0.25rem; /* Fix random gap between <main> and <footer> */
  overflow-x: hidden; /* Allows the paper borders to not have to shrink, but not overflow */
}

.paper-border {
  min-width: 100%;
  width: 2000px; /* Natural width of the SVGs */
}

#footer-paper-border {
  /* The footer paper border is in the box above, causing it to be misaligned */
  margin-block-start: -0.5rem;
}

section {
  padding-block-end: 4rem; /* The offset of "section img" plus some breathing room */
}

.section_grid {
  display: grid;
}

.section_grid img {
  margin-block-start: -4rem;
}

section:nth-of-type(odd) {
  background-color: var(--yellow);
}

section:nth-of-type(even) {
  background-color: var(--orange);
}

section:nth-of-type(odd) .section_grid {
  grid-template-columns: 2fr 3fr;
}

section:nth-of-type(even) .section_grid {
  grid-template-columns: 3fr 2fr;
}

.section-content h2 {
  color: var(--blue);
  font-size: calc(3rem + 0.9vw);
  margin-block-start: calc(1rem + 2vw);
  white-space: nowrap;
}

.section-content h3 {
  color: var(--red);
  font-size: calc(4.25rem + 0.6vw);
  margin-block-start: -4rem;
  text-align: center;
}

h3 {
  font-family: "Amatic SC", cursive;
  font-weight: bold;
  margin-block-end: 0;
}

section:nth-of-type(odd) .section_grid h3 {
  margin-inline-start: 14rem;
}

section:nth-of-type(even) .section_grid h3 {
  margin-inline-end: 14rem;
}

section:nth-of-type(odd) .section_grid .button-ripped {
  background-color: var(--red);
  color: var(--yellow);
}

section:nth-of-type(even) .section_grid .button-ripped {
  background-color: var(--yellow);
  color: var(--red);
}

section:nth-of-type(even) .section_grid picture {
  grid-column-start: 2;
  grid-row-start: 2;
}

section:nth-of-type(even) .section_grid .section-content {
  grid-column-start: 1;
  grid-row-start: 2;
}

@media (max-width: 770px) {
  .section_grid {
    display: block !important;
  }

  .section_grid img {
    width: 80%;
  }

  section:nth-of-type(even) .section_grid img {
    margin-inline-start: 20%; /* Width is set to 80%, so the remaining amount is the margin */
    margin-inline-end: 0;
  }

  .section-content h2 {
    margin-block-start: -1rem;
  }
}

@media (max-width: 455px) {
  .section_grid h3 {
    margin: -3rem 0 -1rem 0 !important;
  }
}

@media (max-width: 400px) {
  .section-content h2 {
    font-size: calc(1rem + 6vw);
  }

  p {
    font-size: 1.2rem;
  }
}

.button-ripped {
  box-sizing: border-box;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  margin-block-start: 0.5rem;
  padding: 1rem 1.5rem;
}

/* Footer */

footer {
  background-color: var(--orange);
  padding-block: 2rem;
}

footer p {
  margin: 0;
}

footer a {
  text-decoration: underline;
}

/* 404 Error Page */

.error-img-overlay {
  position: absolute;
  left: 7.5%;
  top: 20%;
}

.error-img-overlay h2 {
  color: var(--red);
  font-size: min(7.5vw, 5rem); /* More dramatic fluctuations with screen size flows with the image size changes better */
  margin: 0;
}

.error-img-overlay h3 {
  color: var(--yellow);
  font-size: min(12vw, 9rem);
  margin-block-start: -2vw;
  margin-inline-start: 5vw;
}

.error-redirect-link {
  padding-block-end: calc(2rem + 2vw);
  padding-block-start: calc(0.5rem + 2vh);
}

@media (max-width: 340px) {
  .error-img-overlay h2 {
    display: none;
  }
}

@media (max-width: 304px) {
  .error-img-overlay {
    top: 25%;
  }
}