/* Scryfall Integration — card display inside article/page/review content.
   Uses the public theme tokens (var(--primary) etc.) from style.css. */

/* The figure wraps the card image + name + prices; it carries the outer spacing. */
.mp-scryfall {
  display: inline-block;
  vertical-align: top;
  width: 240px;
  max-width: 100%;
  margin: 1.1rem 0.5rem;
  text-align: center;
}
.mp-scryfall-card {
  display: block;
  line-height: 0;
  border-radius: 4.75% / 3.5%;          /* MTG card corner ratio */
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
  will-change: transform;
}
.mp-scryfall-card img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;                            /* override .mp-prose img { margin:1.5rem 0 } — flush to the frame */
  border-radius: inherit;
}
.mp-scryfall-card:hover,
.mp-scryfall-card:focus-visible {
  transform: translateY(-6px) scale(1.025) rotate(-.4deg);
  box-shadow:
    0 16px 34px color-mix(in srgb, var(--primary) 30%, transparent),
    0 6px 16px rgba(0, 0, 0, .2);
  outline: none;
}

/* Card name, centered + bold, directly under the card. */
.mp-scryfall-name {
  margin: .55rem 0 0;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: var(--foreground);
}

/* Price rows under the name: source on the left, price on the right, each inside a
   single-pixel border rectangle. One row per source so more can be added later. */
.mp-scryfall-prices {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .5rem;
  text-align: left;
}
.mp-scryfall .mp-scryfall-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding: .28rem .55rem;
  border: 1px solid var(--border);   /* single-pixel rectangle frame around source + price */
  border-radius: 4px;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--foreground);
  text-decoration: none;             /* no underline, even inside article prose */
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
/* Hover/focus reacts on the whole block. */
.mp-scryfall a.mp-scryfall-price:hover,
.mp-scryfall a.mp-scryfall-price:focus-visible {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  outline: none;
}
.mp-scryfall a.mp-scryfall-price:hover .mp-scryfall-price-val,
.mp-scryfall a.mp-scryfall-price:focus-visible .mp-scryfall-price-val { color: var(--primary); }
.mp-scryfall-price-src { color: var(--muted-foreground); }
.mp-scryfall-price-val { font-weight: 700; white-space: nowrap; }

.mp-scryfall-fallback {
  display: inline-block;
  font-size: .85rem;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px dashed var(--border);
  border-radius: .5rem;
  padding: .35rem .7rem;
}
@media (max-width: 480px) {
  .mp-scryfall { width: 100%; margin: 1rem 0; }
}
