@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&family=Dancing+Script&display=swap");

* {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background: url("assets/bg.jpg") #fed;
  line-height: 1.6;
  color: #222;
}

button {
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0 none;
  cursor: pointer;
}

header {
  padding: 1rem 0;
}

h1,
h2,
h3,
h4 {
  text-align: center;
  font-family: "Cinzel Decorative", cursive;
  line-height: 1.2;
  margin: 1rem;
}
h1 {
  font-size: 5vmax;
}

@media screen and (min-width: 1600px) {
  h1 {
    font-size: 80px;
  }
}

h1 sup {
  font-size: 0.6em;
}

.container {
  max-width: 960px;
  width: 100%;
  margin: 10vh auto 5vh;
  padding: 1em 2em 4em;
  background: rgba(255, 255, 255, 0.9);
}

.grid {
  --col-count: 5;
  --col-size: 140px;
  display: grid;
  justify-content: center;
  grid-auto-flow: row dense;
  grid-template-columns: repeat(var(--col-count), var(--col-size));
  grid-auto-rows: var(--col-size);
  grid-gap: 1.5em;
}

@media screen and (max-width: 960px) {
  .grid {
    --col-size: 14vw;
    --col-count: 5;
  }
}

@media screen and (max-width: 640px) {
  .grid {
    --col-size: 20vw;
    --col-count: 4;
    grid-gap: 1em;
  }
}

@media screen and (max-width: 480px) {
  .grid {
    --col-size: 25vw;
    --col-count: 3;
  }
}

.grid__item {
  width: 100%;
  height: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0.1em 0.25em rgba(0, 0, 0, 0.3);
  will-change: transform;
  transform: scale(1);
  transition: 0.25s transform ease-out, 0.25s box-shadow ease-out;
}

.grid__item.grid--large {
  grid-row: span 2;
  grid-column: span 2;
  font-size: 1.5em;
}

.grid__item.grid--large-landscape {
  grid-row: span 2;
  grid-column: span 3;
  font-size: 1.5em;
}

.grid__item.grid--large-portrait {
  grid-row: span 3;
  grid-column: span 2;
  font-size: 1.5em;
}

.grid__item > .grid__item__content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: top center;
  cursor: pointer;
}

.grid__item:hover {
  transform: scale(1.02) translate3d(0, -0.25em, 0);
  box-shadow: 0 0.5em 0.5em rgba(0, 0, 0, 0.6);
}
.grid__item:hover .play-button {
  opacity: 0.95;
}

.grid__item__text-icon {
  background: #fff;
  font-size: calc(var(--col-size) / 2);
  text-shadow: 0 0.15em 0.25em rgba(0, 0, 0, 0.25);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: center;
  display: none;
  background: rgba(0, 0, 0, 0.6);
  will-change: opacity, transform;
}
.modal.show {
  display: flex;
}
.modal__content {
  padding: 1em 1em 2em;
  background: #faf8f4;
  max-width: 90vw;
  max-height: 90vh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  grid-gap: 1em;
  margin-bottom: 2em;
}
.modal__asset {
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__asset video {
  background: #000;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.modal__asset img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.modal__caption {
  padding: 1em;
  max-height: 30vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template: "text" auto "from" auto / 1fr;
  grid-gap: 2em;
}
@media screen and (min-aspect-ratio: 4/3) {
  .modal--portrait .modal__content {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 30%;
  }

  .modal--portrait .modal__caption {
    max-height: none;
  }
}

.modal__close {
  position: absolute;
  right: 1em;
  top: 1em;
  border-radius: 50%;
  background: #111;
  width: 2.5em;
  height: 2.5em;
  border: 2px solid #fff;
}
.modal__close:hover {
  background: #444;
}
.modal__close svg {
  width: 1.25em;
  height: 1.25em;
}

.modal--large-caption .modal__caption {
  grid-template: "text text" auto "x from" auto / 1fr auto;
  max-height: 80vh;
}
.modal--large-caption .caption__text {
  font-family: serif;
  color: #222;
  font-size: 1.5em;
  max-width: 20em;
}

@media screen and (max-width: 640px) {
  .modal__content {
    max-width: 100%;
    max-height: 100%;
    margin-bottom: 0;
  }
}

.caption__from {
  grid-area: from;
  font-weight: bold;
  color: #666;
}
.caption__text {
  grid-area: text;
  color: #666;
  white-space: pre-wrap;
}

.play-button {
  opacity: 0.7;
  border-radius: 0.75em;
  background: #fff;
  width: 2.5em;
  height: 2em;
}

.play-button svg {
  width: 1em;
  height: 1em;
}
