@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap");

:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --ink: #171716;
  --muted: #716f69;
  --rule: #8b877f;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --serif: "EB Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
}

button {
  color: inherit;
  font: inherit;
}

.masthead {
  align-items: center;
  border-block: 1px solid var(--ink);
  display: flex;
  margin: 2.5rem var(--gutter) 0;
  min-height: 7rem;
}

.masthead__mark {
  font-size: 1.5rem;
}

.masthead__brand {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.masthead__title {
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.masthead__dot {
  background: var(--rule);
  border-radius: 50%;
  height: 0.55rem;
  justify-self: end;
  width: 0.55rem;
}

.masthead__instagram {
  display: flex;
  line-height: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.masthead__instagram:hover,
.masthead__instagram:focus-visible {
  opacity: 1;
  transform: scale(1.08);
}

.masthead__instagram-icon {
  fill: url(#instagram-gradient);
  height: 1.15rem;
  width: 1.15rem;
}

main {
  padding: clamp(2.75rem, 6vw, 6rem) var(--gutter) 8rem;
}

.intro {
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-style: italic;
  margin: 0 0 clamp(3rem, 7vw, 7rem);
}

.collection-grid {
  align-items: start;
  display: grid;
  gap: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 3vw, 3rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.collection-card {
  display: block;
  text-decoration: none;
}

.collection-card:nth-child(3n + 2) {
  margin-top: clamp(2rem, 7vw, 7rem);
}

.collection-card__image {
  aspect-ratio: 4 / 5;
  background: #e9e5dc;
  display: block;
  overflow: hidden;
}

.collection-card:nth-child(3n + 2) .collection-card__image {
  aspect-ratio: 5 / 4;
}

.collection-card__image img {
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease-out;
  width: 100%;
}

.collection-card__caption {
  align-items: center;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1.15rem;
  padding-top: 0.65rem;
}

.collection-card h2 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

.collection-card__arrow {
  font-size: 2rem;
  transition: transform 180ms ease-out;
}

.collection-card:hover img,
.collection-card:focus-visible img {
  transform: scale(1.015);
}

.collection-card:hover .collection-card__arrow,
.collection-card:focus-visible .collection-card__arrow {
  transform: translateX(0.35rem);
}

.collection-header {
  align-items: baseline;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: clamp(3rem, 6vw, 6rem);
}

.collection-header h1 {
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 400;
  line-height: 0.9;
  margin: 0;
}

.back-link {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.image-grid {
  columns: 3 18rem;
  column-gap: clamp(1rem, 2vw, 2rem);
}

.image-grid button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  margin: 0 0 clamp(1rem, 2vw, 2rem);
  padding: 0;
  width: 100%;
}

.image-grid img {
  display: block;
  height: auto;
  width: 100%;
}

.empty,
.loading,
.error {
  color: var(--muted);
  font-family: var(--sans);
}

footer {
  border-top: 1px solid var(--rule);
  font-style: italic;
  margin: 0 var(--gutter);
  padding: 1.25rem 0 3rem;
}

.lightbox {
  background: rgba(20, 20, 19, 0.96);
  border: 0;
  color: white;
  height: 100%;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 2rem;
  width: 100%;
}

.lightbox[open] {
  align-items: center;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.lightbox::backdrop {
  background: rgba(20, 20, 19, 0.96);
}

.lightbox figure {
  display: grid;
  height: calc(100vh - 4rem);
  margin: 0;
  place-items: center;
}

.lightbox img {
  max-height: calc(100vh - 7rem);
  max-width: min(82vw, 1200px);
  object-fit: contain;
}

.lightbox figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
}

.lightbox button {
  background: transparent;
  border: 0;
  color: white;
  cursor: pointer;
  font-size: 2rem;
  padding: 1rem;
}

.lightbox__close {
  position: absolute;
  right: 1rem;
  top: 0.5rem;
}

@media (max-width: 760px) {
  .masthead {
    min-height: 5rem;
  }

  .masthead__title {
    font-size: clamp(1.4rem, 7vw, 2rem);
    letter-spacing: 0.08em;
  }

  .masthead__brand {
    gap: 0.25rem;
  }

  .masthead__instagram-icon {
    height: 0.85rem;
    width: 0.85rem;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }

  .collection-card:nth-child(3n + 2) {
    margin-top: 0;
  }

  .collection-card__image,
  .collection-card:nth-child(3n + 2) .collection-card__image {
    aspect-ratio: 4 / 5;
  }

  .collection-header {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox[open] {
    grid-template-columns: 1fr;
  }

  .lightbox__previous,
  .lightbox__next {
    bottom: 0.5rem;
    position: absolute;
  }

  .lightbox__previous {
    left: 1rem;
  }

  .lightbox__next {
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
