/* Magazine cards reuse the uniform card layout; only the cover and click target differ. */
.magazine-card { cursor: pointer; }
.magazine-card__open { position: absolute; z-index: 3; inset: 0; width: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.magazine-card__open:focus-visible { outline: 3px solid var(--kak-red); outline-offset: 4px; }
.magazine-card__issue { margin: 10px 0 0; color: var(--kak-muted); font-size: 15px; line-height: 1.35; }
.magazine-card__issue span { display: block; white-space: nowrap; }
.magazine-card__visual { right: 30px; top: 60px; bottom: -20px; width: 40%; height: auto; display: flex; align-items: flex-end; justify-content: flex-end; container-type: size; perspective: 1400px; }

/* CSS magazine mockup: a perfect-bound issue turned slightly toward the text, with a stack of
   page edges on the fore-edge and bottom, a creased spine, a glossy sheen and a soft cast shadow. */
.magazine-cover {
  position: relative;
  display: block;
  flex: none;
  height: min(100cqh, 100cqw / (var(--cover-ratio)));
  aspect-ratio: var(--cover-ratio);
  border-radius: 1px 3px 3px 1px;
  transform: rotateY(-14deg) rotateX(3deg);
  transform-origin: right bottom;
  transform-style: preserve-3d;
  box-shadow:
    1px 1px 0 #fbfbfb, 2px 2px 0 #d8d8d8, 3px 3px 0 #f6f6f6, 4px 4px 0 #d2d2d2, 5px 5px 0 #f1f1f1, 6px 6px 0 #c9c9c9,
    -10px 22px 28px -6px rgb(0 0 0 / 30%), 6px 34px 40px -12px rgb(0 0 0 / 22%);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.magazine-card__visual .magazine-cover img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; transform: none; transition: none; }
/* Spine crease and binding shade on the left, light falloff toward the fore-edge. */
.magazine-cover::before {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
    rgb(0 0 0 / 34%) 0, rgb(0 0 0 / 8%) 1.2%, rgb(255 255 255 / 28%) 2.4%, rgb(255 255 255 / 0) 4.4%,
    rgb(0 0 0 / 14%) 5.4%, rgb(0 0 0 / 0) 9%, rgb(0 0 0 / 0) 82%, rgb(0 0 0 / 10%) 100%);
  pointer-events: none;
}
/* Glossy coated cover: a soft diagonal highlight. */
.magazine-cover::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / 22%) 44%, rgb(255 255 255 / 0) 58%), linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 0) 30%);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: background-position .6s var(--ease-out);
  background-size: 220% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
}
@media (hover: hover) {
  .magazine-card:hover .magazine-cover { transform: rotateY(-4deg) rotateX(1deg) translateY(-8px); box-shadow:
    1px 1px 0 #fbfbfb, 2px 2px 0 #d8d8d8, 3px 3px 0 #f6f6f6, 4px 4px 0 #d2d2d2, 5px 5px 0 #f1f1f1, 6px 6px 0 #c9c9c9,
    -6px 30px 34px -8px rgb(0 0 0 / 26%), 6px 44px 48px -14px rgb(0 0 0 / 20%); }
  .magazine-card:hover .magazine-cover::after { background-position: 0 0, 0 0; }
}
@media (max-width: 1100px) {
  .magazine-card__visual { width: 38%; }
}

@media (prefers-reduced-motion: reduce) {
  .magazine-cover, .magazine-cover::after { transition: none; }
}
