@font-face {
  font-family: 'Questrial';
  src: url('fonts/Questrial-Regular.ttf') format('truetype');
}

:root {
  /* Structure */
  --header-height: 3rem;
  --square-logo-dim: 2.5rem;
  --paper-shadow: 5px 5px 7px black;
  --photo-w: 460px;

  /* Colours */
  --medical: hsl(124 47.4% 50%);
  --insurance: hsl(356 49.5% 49.3%);
  --telecom: hsl(41 49.5% 49.3%);
  --software: hsl(194 59.3% 50%);
  --data-analytics: hsl(284 59.3% 50%);
}

[class*='--medical'] {
  --clr-main: var(--medical);
}

[class*='--insurance'] {
  --clr-main: var(--insurance);
}

[class*='--telecom'] {
  --clr-main: var(--telecom);
}

[class*='--software'] {
  --clr-main: var(--software);
}

[class*='--data-analytics'] {
  --clr-main: var(--data-analytics);
}

body {
  font-family: 'Questrial';
  background-image: url('./images/mountain-landscape.svg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

ul,
ol {
  padding-left: 1rem;
}

a:link,
a:visited {
  text-decoration: none;
}

.centering {
  display: flex;
  justify-content: center;
}

.chat {
  background-color: white;
  box-shadow: -5px 5px black;
  border-radius: 20px;
  border: 1px solid black;
  width: fit-content;
}

.sticky-note {
  background-color: yellow;
  aspect-ratio: 1 / 1;
  box-shadow: var(--paper-shadow);
}

.photo {
  position: relative;
  background-color: white;
  box-shadow: var(--paper-shadow);
  border: 5px solid transparent;

  width: 100%;
  max-width: var(--photo-w);
  height: auto;
  transform: rotate(-5deg);
  transition: transform 0.1s linear;

  & > img {
    object-fit: contain;
  }

  &:nth-child(2n) {
    transform: rotate(5deg);
  }

  &:hover {
    transform: scale(1.25);
    z-index: 3;
  }
}

.btn-anchor {
  color: #d16711;
}

header {
  width: 100%;
  z-index: 10;
  position: fixed;
  top: 0;

  & > nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.25rem;
    width: 100vw;
    backdrop-filter: blur(5px);

    /* CSSS Logo */
    & > a {
      /* This keeps the icon at the far left and the nav links centered */
      position: absolute;
      left: 1vw;
      top: 1vh;

      & > #home-logo {
        width: var(--square-logo-dim);
        height: var(--square-logo-dim);
      }
    }

    & a:visited,
    a:active,
    a:link,
    a:hover {
      color: black;
    }

    & > ul {
      display: flex;
      justify-content: space-evenly;
      list-style-type: none;
      margin: 0;
      padding: 1rem 0 0;

      & > li {
        & > a {
          text-align: center;
          padding: 0 1rem;
        }
      }
    }
  }
}

.hero {
  height: 110vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;

  & > .hero-content {
    position: relative;
    height: 70%;
    width: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    & > p {
      font-size: max(1rem, 2vw);
    }

    h1 {
      font-size: max(2rem, 5vw);
    }

    & > img {
      width: min(30vw, 30rem);
      height: auto;
    }

    & > section {
      padding: 1rem;
    }
  }
}

main {
  & > article {
    display: grid;

    & a:visited,
    a:active,
    a:link,
    a:hover {
      color: #d16711;
    }

    & > section {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 0 1rem 0;

      & > aside {
        display: none;
      }

      & .section__content {
        margin: var(--header-height) 0 2rem;
        padding: 1.5rem;
        max-width: 40rem;
      }

      & > .section__main {
        display: flex;
        flex-direction: column;
        align-items: center;

        & > .chat-section {
          display: flex;
          flex-direction: column;
          align-items: center;

          & > .right {
            align-self: flex-end;
            display: block;
            box-shadow: 5px 5px black;
            width: fit-content;
            max-width: 80%;
            margin-right: 1rem;
          }

          & > .left {
            align-self: flex-start;
            width: fit-content;
            max-width: 80%;
            margin-left: 1rem;
          }
        }

        & > p,
        ul,
        ol {
          font-size: clamp(1rem, 1.5vw, 1.05rem);
        }

        & > ul,
        ol {
          margin: 0;

          del {
            color: #c5c5c5;
          }
        }
      }
    }
  }
}

#company-gallery {
  padding: 0;
  display: block;
}

ul.section__main {
  padding-left: 0;
}

.company__gallery {
  display: flex;
  gap: 4vw;
  padding: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.company-card {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  grid-template-rows: 40% 55% 5%;
  padding: 1.5rem;
  width: 20.75rem;
}

.company-card__img {
  display: flex;
  height: 100%;
  aspect-ratio: 1 / 1;
  padding: 1rem;

  & > img {
    object-fit: contain;
  }
}

.company-card__footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: relative;
  bottom: 0;

  & > * {
    color: white;
    border-radius: 50px;
    padding: 0.5rem;
    font-size: clamp(1rem, 60%, 1.7rem);
    -webkit-user-select: none;
    user-select: none;
  }

  & > a {
    color: #d16711;
  }

  & > p {
    background-color: var(--clr-main);
  }
}

#final {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 3rem;

  & > h2 {
    text-align: center;
    font-size: 2rem;
  }

  & > .gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 70vw;
  }
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;

  .icons {
    display: flex;
    gap: 0.5rem;

    & .icon {
      width: 1.5em;
      height: 1.5em;
    }
  }
}

/* Media queries */
@media (max-width: 400px) {
  header > nav {
    /* These will ensure the nav links will be pushed to the right so CSSS icon will become 
     * part of the nav's flow again */
    & > a {
      position: relative;
      left: 0;

      & > img {
        height: 2rem;
        width: 2rem;
      }
    }

    & > ul {
      flex-shrink: 0;
    }
  }

  #students {
    height: fit-content;
  }
}

@media (min-width: 1200px) {
  main {
    & > article {
      & > section {
        display: grid;
        grid-template-columns: 1fr 50% 1fr;
        grid-template-areas: 'left center right';

        & > .main {
          grid-area: center;
          display: flex;
          flex-direction: column;
          align-items: center;
        }

        & > aside {
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          row-gap: 5rem;
          height: fit-content;
          padding: var(--header-height) 0 0;
        }

        & > aside:nth-of-type(1) {
          grid-area: left;
          align-items: end;
        }

        & > aside:nth-of-type(2) {
          grid-area: right;
          align-items: start;
        }
      }
    }
  }
}

@media (hover: none) {
  ul.section__main {
    padding-left: 0;
  }

  .company__gallery {
    width: 100vw;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .company-card {
    width: 19rem;
    scroll-snap-align: center;
  }
}
