:root {
  --page-width: 960px;
  --ucsc-blue: #003c6c;
  --ucsc-gold: #ffc500;
  --anchor-color: #216890;
}

@font-face {
  font-family: "PublicSans";
  src: url("/fonts/PublicSans-Regular.woff2") format("woff2");
}

body {
  container-type: inline-size;
  font-family: "PublicSans", "Roboto", sans-serif;
  line-height: 1.5rem;
  min-height: 100vh;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

a {
  color: var(--anchor-color);
  text-underline-offset: 0.2rem;
  text-decoration-thickness: 1.5px;
}

header {
  background-color: var(--ucsc-blue);
  color: white;

  a {
    color: white;
  }

  a:hover {
    text-decoration: underline;
  }
}

nav {
  margin: auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: top;
  max-width: var(--page-width);
  font-size: medium;

  > ul {
    display: flex;
    align-items: center;
    margin: 0;

    > li {
      display: inline;
      width: fit-content;
      position: relative;
      ul {
        display: none;
        background-color: var(--ucsc-blue);
        position: absolute;
        left: -1rem;
        top: 1.5rem;
        padding: 0.5rem;
        border-radius: 0.4rem;
        li {
          padding: 0.3rem 0.5rem;
          width: 120px;
        }
      }
    }

    li:hover {
      ul {
        display: block;
      }
    }
  }
  a {
    text-decoration: none;
  }
  li {
    padding: 0.2rem 0.5rem;
  }

  > ul {
    @container (width < 720px) {
      display: none;
    }
  }

  ul {
    padding: 0px;
  }
  li::marker {
    content: "";
  }

  details {
    position: relative;
    align-self: center;

    summary {
      text-align: right;
    }

    summary::marker {
      content: "";
    }

    @container (width >=720px) {
      display: none;
    }

    > ul {
      width: 180px;
      flex-direction: column;
      padding: 1rem 2rem;
      text-align: right;
      background-color: var(--ucsc-blue);
      border-radius: 0.4rem;
      position: absolute;
      top: 2rem;
      right: -1rem;

      li {
        align-self: normal;
        ul {
          display: none;
        }
      }
      li:hover {
        ul {
          display: block;
        }
      }
    }
  }

  button {
    background-color: transparent;
    color: white;
    font-size: medium;
    border: none;
    cursor: pointer;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 1em;
  background-color: var(--ucsc-blue);
  border-radius: 16px;
  color: white;
}

h1 {
  padding: 1em 1.5em;
}

main {
  position: relative;
  overflow: visible;
}
main,
footer {
  margin: 1rem auto;
  padding: 0 1rem;
  max-width: var(--page-width);
  position: relative;
}

footer {
  margin: 4rem auto;
  padding: 0 1rem 2rem 1rem;
  font-size: smaller;
  text-align: center;
  div {
    padding-top: 2rem;
    border-top: 1px solid grey;
  }
}

table {
  border-collapse: collapse;
}

th {
  font-weight: bold;
}

th,
td {
  padding: 0.5rem 1rem;
}

tr {
  border-bottom: 1px solid lightgrey;
}

thead > tr {
  border-top: 2px solid lightgrey;
  border-bottom: 2px solid lightgrey;
}

tbody.selectible {
  tr:hover {
    background-color: var(--ucsc-blue);
    color: white;

    a {
      color: white;
    }
  }
}

table {
  tr {
    background-color: #f4f4f4;
  }
  tr:nth-of-type(2n + 1) {
    background-color: #e8e8e8;
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;

  @container (width <540px) {
    grid-template-columns: repeat(1, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: fit-content;
  gap: 2rem;
  margin: auto;

  @container (width <540px) {
    grid-template-columns: repeat(1, 1fr);
  }
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: visible;
}

.carousel-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

.carousel-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  padding: 1rem;
  z-index: 2;
  line-height: 1.4;
  overflow: visible;
}

.fade-in {
  animation: fadeInLeft 0.5s ease forwards;
}
.fade-out {
  animation: fadeOutLeft 0.5s ease forwards;
}
@keyframes fadeOutLeft {
  from {
    opacity: 1;
    clip-path: inset(0% 0% 0% 0%);
  }
  to {
    opacity: 0;
    clip-path: inset(0% 100% 0% 0%);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    clip-path: inset(0% 100% 0% 0%);
  }
  to {
    opacity: 1;
    clip-path: inset(0% 0% 0% 0%);
  }
}

.big-button {
  font-size: large;
  background-color: var(--ucsc-gold);
  border: none;
  padding: 1rem;
  margin: 2rem;
  width: 240px;
  cursor: pointer;
}

.big-button:hover {
  background-color: var(--ucsc-blue);
  color: white;
}

.center {
  margin: auto;
}

.justify {
  text-align: justify;
}

.input-filter {
  > span {
    display: inline-block;
    width: 180px;
  }
  line-height: 1.5;
}

#map {
  width: calc(100vw - 2rem);
  left: calc((min(100vw - 2rem, var(--page-width)) + 2rem - 100vw) / 2);
}