/**
 * DigitallyLearn link preview / hover card.
 * Editorial palette: pure black + crimson + Playfair/Inter.
 * Disabled on touch via @media (hover: hover) gate.
 */

.dl-preview-card {
  position: absolute;
  z-index: 9999;
  width: 280px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  color: #0A0A0A;
  border: 1px solid rgba(10,10,10,0.10);
  border-radius: 4px;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.08),
    0 16px 40px rgba(0,0,0,0.12);
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dl-preview-card.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dl-preview-card.above {
  transform: translateY(-6px);
}
.dl-preview-card.above.visible {
  transform: translateY(0);
}

.dl-preview-thumb {
  width: 100%;
  height: 0;
  padding-top: 0;
  background-size: cover;
  background-position: center;
  background-color: #f4f4f4;
  transition: padding-top 0ms;
}
.dl-preview-thumb.has-image {
  padding-top: 45%;
  border-bottom: 1px solid rgba(10,10,10,0.06);
}

.dl-preview-body {
  padding: 10px 12px 12px;
}

.dl-preview-card .dl-preview-subject {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E63946;
  margin: 0 0 4px;
  padding: 0;
  background: transparent;
  border: 0;
  line-height: 1.2;
}

/* Specificity (0,2,2) on the compound selector beats Astra's default h3
   rules and our own global .dl-modern h3 rule, so !important is not
   needed. Migrated 2026-05-11 (12 important declarations removed). */
.dl-preview-card h3.dl-preview-title,
.dl-preview-card .dl-preview-title {
  font-family: 'Plus Jakarta Sans', 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
  padding: 0;
  color: #0A0A0A;
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  display: block;
}

.dl-preview-card .dl-preview-excerpt {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(10,10,10,0.72);
  margin: 0;
  padding: 0;
}

/* Disable entirely on devices without true hover (touch). The JS already
   gates this, but keep the styling fallback for robustness. */
@media not all and (hover: hover), not all and (pointer: fine) {
  .dl-preview-card { display: none; }
}
