/*!
 * Manga Taxonomy Grid — "manga" layout
 * 2:3 poster cards with the name and count overlaid on a bottom scrim,
 * matching the shelf styling Madara uses for manga covers.
 */

.mtg-layout--manga {
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  --mtg-gap: 16px;
}

.mtg-layout--manga .mtg-card {
  position: relative;
  border-radius: 10px;
  background: var(--mtg-surface-2);
  aspect-ratio: 2 / 3;
}

.mtg-layout--manga .mtg-thumb {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  height: 100%;
  border-radius: inherit;
}

.mtg-layout--manga .mtg-img {
  transition: transform 0.4s ease;
}

.mtg-layout--manga .mtg-card:hover .mtg-img,
.mtg-layout--manga .mtg-card:focus-visible .mtg-img {
  transform: scale(1.06);
}

/* Scrim: a gradient rather than a flat bar, so cover art stays visible. */
.mtg-layout--manga .mtg-body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  text-align: left;
  gap: 2px;
  padding: 28px 12px 12px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.65) 45%,
    rgba(0, 0, 0, 0) 100%
  );
}

.mtg-layout--manga .mtg-name {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.mtg-layout--manga .mtg-count {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.mtg-layout--manga .mtg-desc {
  color: rgba(255, 255, 255, 0.72);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* A poster reads better with a lift-free hover; the zoom already responds. */
.mtg-layout--manga .mtg-card:hover,
.mtg-layout--manga .mtg-card:focus-visible {
  transform: none;
  box-shadow: var(--mtg-shadow-hover);
}

.mtg-skin--neon.mtg-layout--manga .mtg-card:hover,
.mtg-skin--neon.mtg-layout--manga .mtg-card:focus-visible {
  box-shadow: 0 0 26px hsl(var(--mtg-hue) 90% 60% / 0.5);
}

@supports not (aspect-ratio: 1 / 1) {
  .mtg-layout--manga .mtg-card {
    height: 0;
    padding-top: 150%;
  }

  .mtg-layout--manga .mtg-body {
    position: absolute;
    inset: auto 0 0 0;
  }
}

@media (max-width: 480px) {
  .mtg-layout--manga {
    grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  }

  .mtg-layout--manga .mtg-name {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mtg-layout--manga .mtg-img,
  .mtg-layout--manga .mtg-card:hover .mtg-img {
    transition: none;
    transform: none;
  }
}
