/* Page setup */

:root {
  --red-saturated: 0, 100%, 67%;
  --red-light: 0, 100%, 85%;
  --red-background: 0, 100%, 97%;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: hsl(var(--red-light))
}

@font-face {
  font-family: 'Bitter';
  src: url('Assets/Fonts/Bitter/Bitter-VariableFont_wght.ttf');
}

@font-face {
  font-family: 'Work Sans';
  src: url('Assets/Fonts/Work_Sans/WorkSans-VariableFont_wght.ttf');
}

@font-face {
  font-family: 'Josefin Sans';
  src: url('Assets/Fonts/Josefin_Sans/JosefinSans-VariableFont_wght.ttf');
}

html,
body {
  min-height: 100vh;
  background-color: hsl(var(--red-background));
  margin: 0;
  position: relative;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

main {
  padding: 24px;
}

h1,
h2,
h3 {
  font-family: 'Josefin Sans';
  font-weight: 600;
}

h1,
h2 {
  font-size: 48px;
  text-align: center;
}

h3 {
  font-size: 24px;
  line-height: 32px;
}

p,
a,
li {
  font-family: 'Work Sans';
  font-size: 20px;
  line-height: 1.75rem;
}

p {
  max-width: 50ch;
  margin: auto;
}

header {
  background-color: hsl(var(--red-background));

  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  justify-content: center;

  position: sticky;
  top: 0;
  z-index: 2;
  transition: 200ms;
}

nav {
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;
  gap: 24px;
}

nav a {
  text-decoration: none;
  color: black;
  padding: 8px 0;
  overflow: hidden;

  position: relative;
  transition: 200ms;
}

.mobile-sidebar {
  height: calc(100vh - 72px);
  padding: 8px;
  background-color: hsl(var(--red-background));
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 1;
  translate: 144px 0;

  transition: 200ms;
}

.mobile-nav {
  height: calc(100vh - 72px);
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: center;
  gap: 64px;
  transition: 200ms;
  transform: translateX(48px);
}

.mobile-nav a {
  color: hsl(var(--red-saturated));
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 16px;
  transition: 200ms;
}

.mobile-nav a:hover {
  color: white;
  background-color: hsl(var(--red-saturated));
}

#ToggleMobileNav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  cursor: pointer;
  appearance: none;
  background-color: transparent;
  border: none;

  opacity: 0;
  pointer-events: none;
}

#ToggleMobileNav::before,
#ToggleMobileNav::after {
  display: block;
  transition: 200ms;

  position: absolute;
}

#ToggleMobileNav::before {
  content: url('Assets/menu.svg');
}

#ToggleMobileNav:checked::before {
  transform: rotate(-90deg);
  opacity: 0;
}

#ToggleMobileNav::after {
  content: url('Assets/x.svg');
  opacity: 0;
  transform: rotate(90deg);
}
#ToggleMobileNav:checked::after {
  transform: rotate(0);
  opacity: 1;
}

body:has(#ToggleMobileNav:checked) :is(main, footer) {
  transform: translateX(-36px);
  filter: brightness(0.6);
}

body:has(#ToggleMobileNav:checked) .mobile-sidebar {
  box-shadow: -10px 0 10px hsla(0, 0%, 0%, 20%);
  translate: 0 0;
}

body:has(#ToggleMobileNav:checked) .mobile-nav {
  transform: translateX(0);
}

main,
footer {
  background-color: hsl(var(--red-background));

  position: relative;
  z-index: 0;
  transition: 200ms;
}

footer {
  border-top: 4px solid hsl(var(--red-saturated));
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

footer a {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 16px;

  text-decoration: none;
  padding: 16px;
  border-radius: 10px;
  transition: 200ms;

  border: 2px solid hsl(var(--red-saturated));
  color: hsl(var(--red-saturated));
}

.social-media-links {
  display: flex;
  flex-flow: row wrap;
  gap: 16px;
}

section {
  margin: 0 0 96px;
  min-height: calc(70vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.button {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 16px;
  border-radius: 10px;
  transition: 200ms;
}

.button.primary {
  background-color: white;
  color: hsl(var(--red-saturated));
}

.button.secondary {
  border: 2px solid white;
  color: white;
}

/* Home page sections */

.hero {
  min-height: calc(100vh - 120px);
  background-color: hsl(var(--red-saturated));
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 32px;
}

.hero h1 {
  font-family: 'Bitter';
  font-size: 60px;
  text-align: left;
}

.hero .container {
  display: grid;
  grid-template-columns: 2fr 3fr;
  align-items: center;
  justify-items: center;
  gap: 24px;
  min-height: 600px;
  width: 80%;
  margin: auto;
}

.hero .image-container img {
  max-width: 360px;
  aspect-ratio: 1/1;
  animation: spin-in 400ms backwards;
}

.hero .image-container {
  overflow: hidden;
}

.hero .container * {
  margin: 0;
}

.hero > .container > div > * {
  margin: 24px 0;
}

.hero > .container > div:nth-child(2) > * {
  animation: fade-up 400ms backwards;
}

.hero > .container > div:nth-child(2) > *:nth-child(2) {
  animation-delay: 200ms;
}

.hero > .container > div:nth-child(2) > *:nth-child(3) {
  animation-delay: 400ms;
}

.hero-links {
  display: flex;
  gap: 16px;
}

.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 48px;
  gap: 96px;
}

.center-align-children * {
  text-align: center;
}

.center-align-children svg {
  color: hsl(var(--red-saturated));
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  justify-content: center;
  margin: initial auto;
}

.two-column a {
  display: grid;
  grid-template-columns: 24px auto 24px;
  align-items: center;
  gap: 16px;
}

.light-red-link-button a {
  text-decoration: none;
  color: black;
  background-color: hsl(var(--red-light));
  padding: 72px 72px;
  border-radius: 16px;
  transition: 200ms;
}

/* Calendar Page */

.main-calendar > h3 {
  text-align: center;
}

.contents {
  padding: 24px;
  border: 2px solid hsl(var(--red-light));
  margin: 24px auto 72px;
  text-align: center;
  width: fit-content;
  
}

.contents a {
  color: hsl(var(--red-saturated));
  font-weight: 500;
  margin-block: 16px;
}

.contents * {
  display: block;
  margin-inline: 32px;
}

.main-calendar section {
  display: flex;
  flex-flow: row wrap;
  align-items: start;
  gap: 24px;
  min-height: auto;
  margin: 24px 0 72px;
}

.event-card {
  background-color: hsl(var(--red-light));
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 35px 40px -20px hsla(var(--red-light), 50%);
  max-width: 400px;
}

.event-card h3 {
  margin: 0;
}

.grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;

  margin: 24px 0;
  color: hsl(var(--red-saturated));
}

.grid-3x2 p {
  text-transform: uppercase;
  font-weight: 600;
}

/* Committee page */

.committee-profiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.profile-card {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 280px;
  justify-items: center;
  background: linear-gradient(
    to top right,
    hsl(var(--red-saturated)),
    hsl(var(--red-light))
  );
  padding: 16px 24px;
  border-radius: 16px;
  gap: 16px;
  text-align: center;
  align-items: center;
}

@media screen and (max-width: 1060px) {
  .committee-profiles {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 700px) {
  .committee-profiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 500px) {
  .committee-profiles {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-template-columns: 2fr 3fr;
    max-width: none;
  }
}

.profile-card img {
  border-radius: 50%;
  max-width: 200px;
}

.profile-card a {
  color: black;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.profile-card-role {
  text-transform: uppercase;
  background-color: hsl(var(--red-saturated));
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  margin-block: 4px 8px;
}



/* Mobile responsiveness */

@media screen and (max-width: 900px) {
  .three-column,
  .two-column,
  footer {
    grid-template-columns: 1fr;
  }

  .hero h1,
  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 30px;
  }

  h3 {
    font-size: 24px;
  }

  p,
  a,
  li {
    font-size: 18px;
  }

  nav {
    display: none;
  }

  nav a {
    width: fit-content;
  }

  #ToggleMobileNav {
    opacity: 1;
    pointer-events: initial;
    justify-self: center;
    grid-column-start: 3;
  }

  footer {
    padding: 8px;
  }

  .hero-links {
    flex-flow: column nowrap;
  }

  .hero {
    padding: 8px;
  }

  .hero .container {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  nav a:hover {
    color: hsl(var(--red-saturated));
  }

  nav a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    translate: -101% 0;
    background-color: hsla(var(--red-saturated), 0%);
    bottom: 0;
    transition: 200ms;
  }

  nav a:hover::before {
    background-color: hsla(var(--red-saturated), 100%);
    translate: 0 0;
  }

  footer a:before {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    translate: -101% 0;
    background-color: hsl(var(--red-saturated));
    transition: ease-in-out 200ms;
    z-index: -1;
  }

  footer a:hover::before {
    translate: 0 0;
  }

  footer a:hover {
    color: white;
  }

  .button:hover {
    scale: 1.01;
    box-shadow: 0 24px 16px -20px hsla(0, 0%, 0%, 20%);
  }

  .light-red-link-button a:hover {
    background-color: hsl(var(--red-saturated));
    scale: 1.01;
    box-shadow: 0 20px 8px -16px hsl(var(--red-light));
  }

  .light-red-link-button a * {
    transition: 200ms;
  }

  .light-red-link-button a:hover * {
    color: white;
  }

  @keyframes pop-in {
    0% {
      scale: 50%;
      opacity: 0;
    }

    70% {
      scale: 120%;
    }

    100% {
      scale: 100%;
      opacity: 1;
    }
  }

  @keyframes fade-up {
    0% {
      transform: translateY(40px);
      opacity: 0;
    }

    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes spin-in {
    20% {
      opacity: 0;
      transform: rotate(-45deg) scale(0.8);
    }

    100% {
      opacity: 1;
      transform: rotate(0deg) scale(1);
    }
  }

  @keyframes fade-in {
    0% {
      opacity: 0;
    }

    100% {
      opacity: 1;
    }
  }
}
