/* CARD-HOVER-B · Royal Archive
   Full image-first catalogue cards; visible details and a restrained gold-rule frame. */
.home-page #collection-grid .amulet-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 193, 123, .42);
  border-radius: 14px;
  background: var(--navy);
  color: #f5f0e4;
  text-align: left;
  isolation: isolate;
  transition: border-color .28s ease, border-radius .32s ease,
    box-shadow .32s ease, transform .32s ease;
}

.home-page #collection-grid .card-image {
  z-index: 1;
  flex: none;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  background: #000;
}

.home-page #collection-grid .card-image img {
  transform: none;
  transition: none;
}

/* The alternate is fetched on demand and stays hidden until fully decoded. */
.home-page #collection-grid .card-image .alternate {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background: #000;
  transition: opacity .24s ease;
}

.home-page #collection-grid .card-hover-label {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid rgba(226, 193, 123, .35);
  border-radius: 4px;
  background: rgba(4, 16, 56, .94);
  color: #f1dfb6;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.home-page #collection-grid .card-code {
  top: 9px;
  left: 9px;
  z-index: 2;
  padding: 3px 8px;
  border: 1px solid rgba(226, 193, 123, .45);
  background: rgba(4, 16, 56, .94);
  color: #f1dfb6;
  font-size: 10px;
  letter-spacing: .04em;
}

.home-page #collection-grid .card-meta {
  position: relative;
  z-index: 5;
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 78px;
  min-height: 78px;
  padding: 8px 13px 9px 16px;
  overflow: hidden;
  border-top: 1px solid rgba(226, 193, 123, .38);
  background: var(--navy);
  opacity: 1;
  transform: none;
  transition: opacity .22s ease, transform .32s cubic-bezier(.22,.68,.15,1),
    border-color .22s ease;
}

.home-page #collection-grid .card-meta::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  background: #c29b50;
  content: "";
  transform: scaleY(1);
  transform-origin: center;
  transition: transform .28s ease;
}

.home-page #collection-grid .card-category {
  margin: 0;
  color: #d8bb7f;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .04em;
}

.home-page #collection-grid .card-meta-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.home-page #collection-grid .card-meta h3 {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: 42px;
  margin: 0;
  overflow: hidden;
  color: #f8f5ed;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-page #collection-grid .card-meta-arrow {
  flex: none;
  color: #e2c17b;
  font-size: 18px;
  line-height: 1;
  transition: transform .28s ease;
}

.home-page #collection-grid .card-mobile-id,
.home-page #collection-grid .card-footer {
  display: none;
}

.home-page #collection-grid .amulet-card:focus-visible {
  border-color: rgba(226, 193, 123, .9);
  border-radius: 14px;
  outline: 2px solid #e2c17b;
  outline-offset: 3px;
  box-shadow: 0 9px 26px rgba(0, 0, 0, .22), 0 0 20px rgba(188, 151, 80, .1);
}

.home-page #collection-grid .amulet-card:focus-visible .card-meta {
  border-top-color: rgba(226, 193, 123, .38);
  opacity: 1;
  transform: translateY(0);
}

.home-page #collection-grid .amulet-card:focus-visible .card-meta::before {
  transform: scaleY(1);
}

@media (hover: hover) and (pointer: fine) {
  .home-page #collection-grid .amulet-card.hover-preview-ready:is(:hover, :focus-visible) .alternate,
  .home-page #collection-grid .amulet-card.hover-preview-ready:is(:hover, :focus-visible) .card-hover-label {
    opacity: 1;
  }

  .home-page #collection-grid .amulet-card:hover {
    transform: translateY(-3px);
    border-color: rgba(226, 193, 123, .6);
    border-radius: 14px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, .22), 0 0 18px rgba(188, 151, 80, .08);
  }

  .home-page #collection-grid .amulet-card:hover .card-meta {
    border-top-color: rgba(226, 193, 123, .38);
    opacity: 1;
    transform: translateY(0);
  }

  .home-page #collection-grid .amulet-card:hover .card-meta::before {
    transform: scaleY(1);
  }

  .home-page #collection-grid .amulet-card:hover .card-meta-arrow {
    transform: translateX(3px);
  }
}

/* Touch and compact layouts keep the name and public GNTS ID visible. */
@media (hover: none), (max-width: 767px) {
  .home-page #collection-grid .amulet-card {
    border-color: rgba(226, 193, 123, .34);
    border-radius: 7px;
    transform: none;
    box-shadow: none;
  }

  .home-page #collection-grid .card-image {
    aspect-ratio: 1 / 1.08;
  }

  .home-page #collection-grid .card-code {
    display: none;
  }

  .home-page #collection-grid .card-meta {
    height: auto;
    min-height: 79px;
    gap: 2px;
    padding: 8px 9px 9px;
    border-top-color: rgba(226, 193, 123, .28);
    opacity: 1;
    transform: none;
  }

  .home-page #collection-grid .card-meta::before {
    display: none;
  }

  .home-page #collection-grid .card-category {
    font-size: 10px;
  }

  .home-page #collection-grid .card-meta h3 {
    max-height: 39px;
    font-size: 13px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .home-page #collection-grid .card-meta-arrow {
    display: none;
  }

  .home-page #collection-grid .card-mobile-id {
    display: block;
    margin-top: 2px;
    color: #d5bd8b;
    font-size: 10px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page #collection-grid .amulet-card,
  .home-page #collection-grid .card-meta,
  .home-page #collection-grid .card-meta::before,
  .home-page #collection-grid .card-meta-arrow {
    transition: none;
  }

  .home-page #collection-grid .card-image .alternate,
  .home-page #collection-grid .card-hover-label {
    transition: none;
  }

  .home-page #collection-grid .amulet-card:hover {
    transform: none;
  }
}
