/* Official catalog surface treatment only. Layout, cover text and hit areas
   continue to come from mobile.css; no perspective or animated decoration. */
#catalog-grid .discovery-card {
  --catalog-edge: #cbbfb4;
  --catalog-edge-light: #e5dcd2;
  --catalog-contact: #38253f26;
  --catalog-depth: inset 0 1px 0 #ffffff, 0 1px 0 #fdfaf5,
    0 3px 0 var(--catalog-edge-light), 0 5px 0 var(--catalog-edge),
    0 8px 8px -4px var(--catalog-contact), 0 17px 24px -14px #36283e38;
  position: relative;
  isolation: isolate;
  border: 1px solid #d3c7bc;
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: var(--catalog-depth);
  transform: none;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out,
    border-color 160ms ease-out;
}

/* A narrow bevel follows the whole card, including uploaded covers. */
#catalog-grid .discovery-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  box-shadow: inset 1px 0 0 #ffffff66, inset -1px 0 0 #3426380b,
    inset 0 -1px 0 #ffffffb3;
  pointer-events: none;
}

#catalog-grid .discovery-card .card-cover-link {
  background: #fffdf9;
  border-radius: 15px 15px 0 0;
}

/* The cover keeps its existing tone and full-size title. Quiet lighting sits
   underneath the text, with the same surface finish on every poster. */
#catalog-grid .discovery-card .poster-cover::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, #ffffff1c 0%, #ffffff00 43%, #2719310c 100%),
    repeating-linear-gradient(0deg, #ffffff05 0 1px, #ffffff00 1px 4px);
  pointer-events: none;
}

#catalog-grid .discovery-card .cover::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: inset 0 1px 0 #ffffff70, inset 1px 0 0 #ffffff30,
    inset -1px 0 0 #26162f0b, inset 0 -1px 0 #26162f14;
  pointer-events: none;
}

#catalog-grid .discovery-card .card-body {
  position: relative;
  background: linear-gradient(180deg, #fffefa 0%, #fffdfb 38%, #f9f5f1 100%);
  box-shadow: inset 0 1px 0 #ffffff, inset 0 2px 3px #45313f04;
}

#catalog-grid .discovery-card .template-editorial-value {
  color: #745589;
}

#catalog-grid .discovery-card .template-editorial-value b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Two equal controls retain their existing size and grid. The short lower
   edge gives them a physical press without changing the surrounding layout. */
#catalog-grid .discovery-card .card-actions > .btn {
  border-radius: 9px;
  border-color: #d6c7df;
  background: linear-gradient(180deg, #fcf9ff 0%, #eee5f6 100%);
  color: #634776;
  font-weight: 650;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #ffffff60,
    0 2px 0 #c8b5d5, 0 4px 7px #41294f10;
  transform: none;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out,
    border-color 140ms ease-out, background-color 140ms ease-out;
}

#catalog-grid .discovery-card .card-actions > .btn.primary,
#catalog-grid .discovery-card .card-actions > .btn.card-unlock-action {
  border-color: #74509f;
  background: linear-gradient(180deg, #8963c1 0%, #744ba9 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 0 #ffffff40, inset 0 -1px 0 #40255d24,
    0 2px 0 #57367e, 0 4px 8px #51336320;
}

#catalog-grid .discovery-card .card-cover-link:focus-visible {
  outline: 3px solid #b29ad1;
  outline-offset: -5px;
}

#catalog-grid .discovery-card .card-actions > .btn:focus-visible {
  outline: 2px solid #8e68b6;
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  #catalog-grid .discovery-card:hover {
    border-color: #bda9c8;
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 0 #fdfaf5,
      0 3px 0 var(--catalog-edge-light), 0 5px 0 var(--catalog-edge),
      0 10px 12px -5px var(--catalog-contact), 0 22px 29px -15px #36283e3b;
  }

  #catalog-grid .discovery-card .card-actions > .btn:hover:not(:disabled):not([aria-busy=true]):not([aria-disabled=true]) {
    border-color: #bea8cf;
    background: linear-gradient(180deg, #f9f3ff 0%, #e8dcf3 100%);
    box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #ffffff60,
      0 2px 0 #bda7cc, 0 5px 9px #41294f17;
    transform: none;
  }

  #catalog-grid .discovery-card .card-actions > .btn.primary:hover:not(:disabled):not([aria-busy=true]):not([aria-disabled=true]),
  #catalog-grid .discovery-card .card-actions > .btn.card-unlock-action:hover:not(:disabled):not([aria-busy=true]):not([aria-disabled=true]) {
    border-color: #68418f;
    background: linear-gradient(180deg, #8057b7 0%, #69409b 100%);
    box-shadow: inset 0 1px 0 #ffffff40, inset 0 -1px 0 #40255d24,
      0 2px 0 #4e2d73, 0 5px 10px #51336324;
    color: #ffffff;
  }
}

#catalog-grid .discovery-card:has(> .card-cover-link:active) {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 0 var(--catalog-edge-light),
    0 3px 0 var(--catalog-edge), 0 5px 6px -3px var(--catalog-contact),
    0 11px 17px -12px #36283e28;
}

#catalog-grid .discovery-card .card-actions > .btn:active:not(:disabled):not([aria-busy=true]):not([aria-disabled=true]),
#catalog-grid .discovery-card .card-actions > .btn:is(.primary,.card-unlock-action):active:not(:disabled):not([aria-busy=true]):not([aria-disabled=true]) {
  transform: translateY(2px);
  box-shadow: inset 0 1px 3px #40264f19, 0 0 0 #c8b5d5;
}

#catalog-grid .discovery-card .card-actions > .btn:is(:disabled,[aria-disabled=true],[aria-busy=true]) {
  transform: none;
  box-shadow: inset 0 1px 0 #ffffff26;
}

@media (max-width: 520px) {
  #catalog-grid .discovery-card {
    border-radius: 14px;
    --catalog-depth: inset 0 1px 0 #ffffff, 0 1px 0 #fdfaf5,
      0 3px 0 var(--catalog-edge-light), 0 4px 0 var(--catalog-edge),
      0 7px 8px -4px var(--catalog-contact), 0 14px 18px -12px #36283e38;
  }

  #catalog-grid .discovery-card .card-cover-link {
    border-radius: 13px 13px 0 0;
  }

  #catalog-grid .discovery-card .card-actions > .btn {
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #catalog-grid .discovery-card,
  #catalog-grid .discovery-card .card-actions > .btn {
    transition: none !important;
  }

  #catalog-grid .discovery-card:hover,
  #catalog-grid .discovery-card:has(> .card-cover-link:active),
  #catalog-grid .discovery-card .card-actions > .btn:active {
    transform: none !important;
  }
}
