/* data-dare-cards.css — dataset card artwork: SQUARE sticker tile, hover enlarge, description overlay.
   Loaded by data-dare/discovery.blade.php and data-dare/datasets/show.blade.php.
   Decision 10 Sep 2026: the card shows the full 1024×1024 sticker, caption bands included,
   so the card text below it no longer repeats industry or level. */

.fi-dd-dataset-card__media {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  background: #e7e2da;                       /* neutral: the sticker brings its own ground (dark or warm) */
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.28); /* hairline gold edge, reads on both themes */
}

.fi-dd-dataset-card__media.has-art .fi-dd-dataset-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;                          /* square into square — nothing is cropped */
  transform: scale(1);
  transition: transform 220ms ease;
  will-change: transform;
}

/* Enlarge inside the clipped tile — no layout shift. Kept small (1.03) because the sticker
   carries its own captions at the very edges; a larger scale would clip them. */
.fi-dd-dataset-card:hover .fi-dd-dataset-card__media.has-art .fi-dd-dataset-card__thumb,
.fi-dd-dataset-card:focus-within .fi-dd-dataset-card__media.has-art .fi-dd-dataset-card__thumb {
  transform: scale(1.03);
}

/* Description overlay, revealed on hover / keyboard focus. Anchored to the lower third so it
   sits over the sticker's bottom caption band rather than over the scene. */
.fi-dd-dataset-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(17, 17, 17, 0.94) 0%, rgba(17, 17, 17, 0.78) 40%, rgba(17, 17, 17, 0) 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.fi-dd-dataset-card:hover .fi-dd-dataset-card__overlay,
.fi-dd-dataset-card:focus-within .fi-dd-dataset-card__overlay {
  opacity: 1;
  transform: translateY(0);
}

.fi-dd-dataset-card__overlay-text {
  margin: 0;
  color: #fdfbf7;
  font-size: 0.86rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fi-dd-dataset-card__overlay-cta {
  color: #d4a017;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Placeholder keeps the same (square) tile geometry so grids stay aligned */
.fi-dd-dataset-card__thumb--placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5efe3, #e7e2da);
}

/* Detail page header: same sticker, square, no crop */
.fi-dd-detail-header__thumb {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.28);
}

/* Touch devices: no hover — the description lives in Details */
@media (hover: none) {
  .fi-dd-dataset-card__overlay { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fi-dd-dataset-card__thumb,
  .fi-dd-dataset-card__overlay { transition: none; }
  .fi-dd-dataset-card:hover .fi-dd-dataset-card__media.has-art .fi-dd-dataset-card__thumb { transform: none; }
}

/* Override: base card CSS sizes __media as a small thumbnail; make the square tile span the card */
.fi-dd-dataset-card .fi-dd-dataset-card__select { display: block; }
.fi-dd-dataset-card .fi-dd-dataset-card__media { width: 100% !important; max-width: none !important; min-width: 0 !important; height: auto !important; max-height: none !important; flex: none !important; margin: 0 0 12px 0; }

/* ── 11 Sep 2026 (D-04 revised): the sticker is a button that opens the quick-look modal.
   Hover only enlarges + shows the one-line description; nothing is pinned open. ── */
button.fi-dd-dataset-card__media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  text-align: left;
  font: inherit;
  color: inherit;
}
.fi-dd-dataset-card__overlay-text { display: block; }
.fi-dd-dataset-card__details[hidden] { display: none !important; }
.fi-dd-dataset-card .fi-dd-dataset-card__expand { display: none !important; }
.fi-dd-dataset-card__title-link { color: inherit; text-decoration: none; }
.fi-dd-dataset-card__title-link:hover,
.fi-dd-dataset-card__title-link:focus-visible { color: #d4a017; text-decoration: underline; text-underline-offset: 3px; }
a.fi-dd-dataset-card__explore-hint { text-decoration: none; }

/* Quick-look modal */
.fi-dd-quicklook-open { overflow: hidden; }
.fi-dd-quicklook { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.fi-dd-quicklook[hidden] { display: none; }
.fi-dd-quicklook__backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, 0.62); backdrop-filter: blur(4px); }
.fi-dd-quicklook__dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: 28px;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border-radius: 20px;
  background: #fdfbf7;
  border: 1px solid rgba(212, 160, 23, 0.35);
  box-shadow: 0 30px 80px rgba(17, 17, 17, 0.35);
  outline: none;
}
.fi-dd-quicklook__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid #e7e2da;
  background: #fff; color: #111; font-size: 24px; line-height: 1; cursor: pointer;
}
.fi-dd-quicklook__close:hover { border-color: #d4a017; color: #d4a017; }
.fi-dd-quicklook__art { border-radius: 14px; overflow: hidden; background: #e7e2da; box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.28); align-self: start; }
.fi-dd-quicklook__art img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.fi-dd-quicklook__body { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.fi-dd-quicklook__code { margin: 0; font-family: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace; font-size: 0.8rem; letter-spacing: 0.06em; color: #a67c0a; }
.fi-dd-quicklook__title { margin: 0; font-size: 1.5rem; line-height: 1.2; color: #111; padding-right: 40px; }
.fi-dd-quicklook__content .fi-dd-dataset-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin: 0; }
.fi-dd-quicklook__content .fi-dd-dataset-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #6b6257; }
.fi-dd-quicklook__content .fi-dd-dataset-meta dd { margin: 0; font-weight: 600; color: #111; }
.fi-dd-quicklook__content .fi-dd-dataset-card__summary { margin: 14px 0 0; color: #3b352d; line-height: 1.55; }
.fi-dd-quicklook__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.fi-dd-quicklook__scope { font-size: 0.9rem; color: #a67c0a; text-decoration: none; }
.fi-dd-quicklook__scope:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .fi-dd-quicklook { padding: 12px; }
  .fi-dd-quicklook__dialog { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .fi-dd-quicklook__art { max-width: 260px; margin: 0 auto; }
}
