:root {
  --photo-width: 320px;
  --photo-padding: 1em;
  --caption-size: 1em;
}

body {
  overflow-x: hidden;
}

main {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1280px;
  justify-items: center;
  margin: 0 auto;
}

figure.photograph {
  color: black;
  background-color: white;
  padding: var(--photo-padding);
  box-shadow: 0px 4px 48px rgba(0, 0, 0, 0.75);
  margin: 1em;
  display: inline-block;
  rotate: var(--rotation);
  --rotation: -5deg;

  &:nth-of-type(2n) {
    --rotation: 5deg;
  }

  img {
    width: var(--photo-width);
    height: auto;

    &.developing {
      filter: invert(1) brightness(0) invert(0.6) saturate(0);
      background-color: hsl(0 0 60);

      &.developed {
        filter: invert(1) brightness(1) invert(1) saturate(1);
        transition: filter 2s ease-out;
      }
    }
  }

  figcaption {
    font-family: "Caveat", cursive;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: var(--caption-size);
    height: 2em;
    contain: size;

    .right {
      float: right;
      margin-bottom: -1em;
      margin-left: 1em;
    }
  }
}

.note {
  padding: 2em;
  box-shadow: 0px 4px 48px rgba(0, 0, 0, 0.75);
  background-color: #ffeec6;
  color: black;
  z-index: 1;

  max-width: 1000px;

  p {
    font-weight: 400;
    font-style: normal;
    font-size: 1em;
    justify-self: start;
  }
}

@media (width >= 480px) {
  figure.photograph {
    justify-self: flex-start;

    &:nth-of-type(2n) {
      justify-self: flex-end;
      --rotation: 5deg;
    }
  }
}

@media (width >= 780px) {
  :root {
    --photo-width: 640px;
    --photo-padding: 2em;
    --caption-size: 1.5em;
  }
}

@media (width >= 1280px) {
  :root {
    --photo-width: 1024px;
  }
}
