.showcase-gallery {
  --gap: 22px;
  --radius: 18px;
  --shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --divider: rgba(0, 0, 0, 0.08);
  --showcase-caption-height: 70px;
  background: transparent;
  padding: 4rem 1.5rem 6rem;
}

.showcase-gallery__outer {
  margin: 0 auto;
  max-width: var(--content-max);
}

.showcase-gallery__header {
  margin-bottom: 1.5rem;
}

.showcase-gallery__mobile-link {
  display: none;
}

.showcase-gallery__container {
  margin: 0 auto;
  padding-top: 12px;
  padding-bottom: 12px;
}

.showcase-gallery__grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: var(--gap);
  align-items: stretch;
}

.showcase-gallery__right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: max-content max-content;
  gap: var(--gap);
  align-items: start;
  align-content: start;
}

.showcase-gallery__tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  /* border-radius: var(--radius); */
  overflow: hidden;
  background: transparent !important;
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.showcase-gallery__tile:focus-visible {
  outline: 3px solid rgba(26, 26, 26, 0.5);
  outline-offset: 4px;
}

.showcase-gallery__tile:hover {
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
}

.showcase-gallery__media {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  background: #e9e4dc;
}

.showcase-gallery__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 350ms ease;
  display: block;
}

.showcase-gallery__tile:hover .showcase-gallery__media img {
  transform: scale(1.05);
}

.showcase-gallery__media--featured {
  width: 100%;
}

.showcase-gallery__media--small {
  aspect-ratio: 4 / 3;
}

.showcase-gallery__media--wide {
  aspect-ratio: 16 / 9;
}
.showcase-gallery__caption {
  display: grid;
  gap: 0.35rem;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--divider);
  background: transparent !important;
  height: var(--showcase-caption-height);
  box-sizing: border-box;
  align-content: start;
  overflow: hidden;
}

.showcase-gallery__title {
  font-weight: 700;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.showcase-gallery__meta {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.showcase-gallery__tile:hover .showcase-gallery__title {
  text-decoration: underline;
}

.showcase-gallery__tile--featured {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: 100%;
  min-height: 0;
}

.showcase-gallery__tile--featured .showcase-gallery__media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.showcase-gallery__tile--wide {
  grid-column: 1 / -1;
}

.showcase-gallery__tile--wide .showcase-gallery__media {
  width: 100%;
}

@media (max-width: 1023px) {
  .showcase-gallery__grid {
    grid-template-columns: 1fr;
  }

  .showcase-gallery__tile--featured {
    display: flex;
    height: auto;
  }

  .showcase-gallery__tile--featured .showcase-gallery__media {
    position: static;
    aspect-ratio: 16 / 10;
    flex: unset;
  }
}

@media (min-width: 1024px) {
  .showcase-gallery {
    --showcase-small-media-height: clamp(220px, 16vw, 320px);
    --showcase-wide-media-height: clamp(250px, 18vw, 360px);
    --showcase-featured-media-height: calc(
      (var(--showcase-small-media-height) + var(--showcase-caption-height)) + var(--gap) +
        (var(--showcase-wide-media-height) + var(--showcase-caption-height)) -
        var(--showcase-caption-height)
    );
  }

  .showcase-gallery__media--featured {
    height: var(--showcase-featured-media-height);
  }

  .showcase-gallery__media--small {
    aspect-ratio: auto;
    height: var(--showcase-small-media-height);
  }

  .showcase-gallery__media--wide {
    aspect-ratio: auto;
    height: var(--showcase-wide-media-height);
  }
}

@media (max-width: 767px) {
  .showcase-gallery {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .showcase-gallery__header .section-link {
    display: none;
  }

  .showcase-gallery__mobile-link {
    display: block;
    margin-top: 1.5rem;
    margin-left: auto;
    width: fit-content;
    text-align: right;
  }

  .showcase-gallery__right {
    grid-template-columns: 1fr;
  }

  .showcase-gallery__tile--featured .showcase-gallery__media {
    aspect-ratio: 4 / 3;
  }

  .showcase-gallery__caption {
    height: var(--showcase-caption-height);
  }
}

@media (min-width: 768px) {
  .showcase-gallery {
    padding-left: 3rem;
    padding-right: 3rem;
    padding-bottom: 5rem;
  }
}

@media (min-width: 1024px) {
  .showcase-gallery {
    padding-left: 5rem;
    padding-right: 5rem;
  }
}
