/* Use the page surface behind the artwork in both the gallery and editorial figures. */
:is(.art-tile .art-stage, .card-tile .card-stage) {
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  background: radial-gradient(ellipse at 50% 54%, color-mix(in srgb, currentColor 6%, transparent), transparent 69%);
  border: 0;
  border-radius: 0;
  overflow: visible;
}

:is(.art-tile .art-window, .card-tile .card-art) {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  container-type: size;
  overflow: visible;
  box-shadow: none;
  filter: drop-shadow(0 .55rem .68rem #12171045);
  transition: transform 180ms ease, filter 180ms ease;
}

.art-tile .art-window {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  padding: 0;
}

.card-tile .card-art {
  width: 100%;
  height: 100%;
  transform: none;
}

.card-tile .card-link {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.gallery .card-tile .card-caption {
  padding-inline: 0;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.home-cards .card-tile .card-caption {
  border: 0;
}

:is(.art-tile .art-window, .card-tile .card-art) img {
  --art-ratio: var(--card-ratio, .714286);
  --art-width: min(90cqw, calc(90cqh * var(--art-ratio)));
  position: static;
  display: block;
  width: var(--art-width);
  height: calc(var(--art-width) / var(--art-ratio));
  max-width: none;
  max-height: none;
  object-fit: unset;
}

:is(.art-tile, .card-link):is(:hover, :focus-visible) :is(.art-window, .card-art) {
  transform: translateY(-.2rem);
  filter: drop-shadow(0 .75rem .78rem #1217105c);
}

:is(.viewer-art, .dialog-art) {
  background: transparent;
  border: 0;
}

.card-editorial {
  min-width: 0;
}

.card-editorial-art {
  display: grid;
  place-items: center;
  padding: clamp(.6rem, 2vw, 1.7rem);
  filter: drop-shadow(0 .65rem .8rem #12171048);
}

.card-editorial-pair {
  grid-template-columns: minmax(0, .77fr) minmax(0, 1fr);
  gap: clamp(.45rem, 2vw, 1.3rem);
}

.card-editorial .card-editorial-art img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 21rem;
  margin: 0;
  padding: 0;
  aspect-ratio: auto;
  object-fit: unset;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.card-editorial figcaption {
  padding-block: .75rem .5rem;
  border-bottom: 1px solid var(--hair, var(--line));
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.45;
}

.process-card-figures {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.involvement .card-editorial {
  align-self: center;
}

@media (max-width: 650px) {
  .card-editorial-art {
    padding-inline: .4rem;
  }

  .involvement .card-editorial {
    margin-bottom: .55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.art-tile .art-window, .card-tile .card-art) {
    transition: none;
  }
}

/* Keep the folds and printed paper while clearing the photographed surround. */
img[src$="/autumn-leaf-card.webp"],
img[src$="/autumn-leaf-card-420.webp"],
img[src$="/autumn-leaf-card-720.webp"] {
  --card-ratio: 1.237964;
  clip-path: polygon(15% 2.5%, 96.5% 13.2%, 97.8% 67.2%, 88.8% 65%, 83.2% 97.4%, 2% 73.3%);
}
img[src$="/autumn-leaf-card-inside.webp"],
img[src$="/autumn-leaf-card-inside-720.webp"] {
  clip-path: polygon(13.5% 3%, 89.6% 2%, 90% 57%, 98% 97.5%, 2.2% 97.2%, 13% 57%);
}
img[src$="/busy-bee-card.webp"],
img[src$="/busy-bee-card-420.webp"],
img[src$="/busy-bee-card-800.webp"] {
  --card-ratio: 0.654070;
  clip-path: polygon(3% 12%, 80.6% 1.8%, 81.5% 19%, 97.5% 20.6%, 91% 98.6%, 17% 83.2%);
}
img[src$="/busy-bee-card-inside.webp"],
img[src$="/busy-bee-card-inside-720.webp"] {
  clip-path: polygon(2% 4.5%, 49% 2.2%, 98% 3.5%, 94.2% 97.7%, 52% 79%, 8% 95.6%);
}
img[src$="/butterfly-card.webp"],
img[src$="/butterfly-card-420.webp"],
img[src$="/butterfly-card-640.webp"] {
  clip-path: polygon(3% 16%, 49.5% 21.6%, 96.3% 16.7%, 96.3% 77%, 48.8% 74.8%, 2.2% 78.4%);
}
img[src$="/butterfly-card-gallery.webp"],
img[src$="/butterfly-card-gallery-320.webp"] {
  clip-path: polygon(1.1% 1.5%, 49.5% 9.8%, 98.5% 1.8%, 98.6% 97.9%, 49% 91.4%, 1.8% 99%);
}
img[src$="/caterpillar-card.webp"],
img[src$="/caterpillar-card-420.webp"],
img[src$="/caterpillar-card-640.webp"] {
  --card-ratio: 0.749524;
  clip-path: polygon(12.5% 16.1%, 54.5% 13.3%, 54.5% 16.5%, 83.5% 16.7%, 79% 82%, 17.6% 81.7%);
}
img[src$="/caterpillar-card-gallery.webp"],
img[src$="/caterpillar-card-gallery-320.webp"] {
  --card-ratio: 0.779292;
  clip-path: polygon(1.5% 5.1%, 59% 1.6%, 59% 5.6%, 98.1% 5.7%, 91.6% 98.5%, 8.5% 98.5%);
}
img[src$="/deer-card.webp"],
img[src$="/deer-card-420.webp"],
img[src$="/deer-card-640.webp"],
img[src$="/deer-card-960.webp"] {
  --card-ratio: 0.734694;
  clip-path: polygon(2.6% 11.9%, 76.5% 1.9%, 76.6% 15.6%, 97.3% 17.1%, 90.2% 98.2%, 14.8% 88.7%);
}
img[src$="/deer-card-inside.webp"],
img[src$="/deer-card-inside-720.webp"] {
  clip-path: polygon(2.2% 4%, 51.5% 1.5%, 97.9% 3.5%, 93.7% 98.4%, 51.1% 79.2%, 9.1% 98.4%);
}
img[src$="/frog-card.webp"],
img[src$="/frog-card-480.webp"],
img[src$="/frog-card-720.webp"] {
  --card-ratio: 1.217862;
  clip-path: polygon(8.8% 2.5%, 94.4% 6.4%, 98% 70.8%, 87.3% 69.5%, 85% 97%, 2% 76.5%);
}
img[src$="/frog-card-inside.webp"],
img[src$="/frog-card-inside-720.webp"] {
  clip-path: polygon(9% 1.5%, 88% 1.5%, 90% 55%, 98.2% 98.4%, 2% 98.4%, 11% 55%);
}
img[src$="/hello-card.webp"],
img[src$="/hello-card-420.webp"],
img[src$="/hello-card-640.webp"],
img[src$="/hello-card-720.webp"] {
  clip-path: polygon(2% 5%, 51.2% 2.5%, 97.9% 5.1%, 94% 97.7%, 51.5% 82.4%, 8% 96.3%);
}
img[src$="/hummingbird-card.webp"],
img[src$="/hummingbird-card-420.webp"],
img[src$="/hummingbird-card-800.webp"] {
  --card-ratio: 0.745033;
  clip-path: polygon(2.8% 12.4%, 76.2% 2.2%, 76.3% 11.9%, 97% 12%, 95.2% 98.6%, 15.8% 91.9%);
}
img[src$="/hummingbird-card-inside.webp"],
img[src$="/hummingbird-card-inside-720.webp"] {
  clip-path: polygon(2.1% 3.6%, 51% 4.6%, 97.8% 2.4%, 94.6% 97%, 51.2% 83.4%, 6.3% 97.8%);
}
img[src$="/single-fox-card.webp"],
img[src$="/single-fox-card-420.webp"],
img[src$="/single-fox-card-800.webp"] {
  --card-ratio: 1.186552;
  clip-path: polygon(13.8% 5.4%, 97.9% 2.5%, 97.9% 79.3%, 84.7% 75.9%, 80.1% 100%, 56.7% 100%, 2.1% 72.8%);
}
img[src$="/single-fox-card-inside.webp"],
img[src$="/single-fox-card-inside-720.webp"] {
  clip-path: polygon(9.3% 1.5%, 92.3% 1.5%, 86.9% 51.7%, 98.1% 98.5%, 2.2% 98.5%, 15.7% 51.7%);
}
img[src$="/squirrel-card.webp"],
img[src$="/squirrel-card-420.webp"],
img[src$="/squirrel-card-640.webp"] {
  --card-ratio: 0.737403;
  clip-path: polygon(2.8% 11.2%, 60.8% 2.3%, 60.9% 12.7%, 97.2% 13.3%, 91.2% 97.9%, 10% 94.2%);
}
img[src$="/three-fox-pups-card.webp"],
img[src$="/three-fox-pups-card-420.webp"],
img[src$="/three-fox-pups-card-800.webp"] {
  --card-ratio: 1.232877;
  clip-path: polygon(15.6% 2.5%, 93.2% 12%, 98.5% 66.7%, 83.2% 62.7%, 76.6% 97.6%, 2% 71%);
}
img[src$="/three-fox-pups-card-inside.webp"],
img[src$="/three-fox-pups-card-inside-720.webp"] {
  clip-path: polygon(8.9% 2.1%, 91.3% 1.9%, 89.6% 55.8%, 98.2% 98.5%, 2% 97.7%, 12% 56.5%);
}

/* The visible card links open the complete image at its original resolution. */
.card-editorial .card-editorial-art {
  filter: none;
}

.card-editorial-art > a {
  display: grid;
  width: 100%;
  justify-items: center;
  align-content: center;
  gap: .55rem;
  padding-block: .2rem;
  text-align: center;
  text-decoration: none;
}

.card-editorial-art > a img {
  margin-inline: auto;
}

.card-editorial-image {
  display: grid;
  width: 100%;
  justify-items: center;
  filter: drop-shadow(0 .65rem .8rem #12171048);
}

.card-editorial-enlarge,
.card-editorial-transcript {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .23em;
}

.card-editorial-art > a:hover .card-editorial-enlarge {
  text-decoration-thickness: 2px;
}

.card-editorial-transcript {
  margin-top: .23rem;
}

.card-editorial figcaption > span {
  display: block;
}

@media (max-width: 650px) {
  .card-editorial-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
  }

  .card-editorial .card-editorial-art .card-editorial-cover img {
    max-height: 13rem;
  }

  .card-editorial .card-editorial-art .card-editorial-spread img {
    width: 100%;
    max-height: none;
  }
}
