/* Directory cards (Phase 7b + item-3 upgrades).
   The whole card is rendered by the OrdinalCardFormatter (.ordinal-card).
   The .mqz-index-* block is kept only for backwards compatibility with the
   older rewrite-template layout; it is unused once the View uses the card
   formatter and can be removed later. */

/* ---- Shared thumbnail (image vs. type badge) ---- */
.ordinal-thumb-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
}
/* Tall images (height > 1.5x width) are cropped to a square; everything
   shorter shows its full natural height. The .is-square class is toggled
   per-image in ordinal-directory.js once natural dimensions are known. */
.ordinal-thumb-img.is-square {
  aspect-ratio: 1 / 1;
}
.ordinal-thumb-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 150px;
  border-radius: 6px;
  background: #f1f1f3;
  color: #555;
  font-size: 1.05em;
  letter-spacing: 0.02em;
}
.ordinal-thumb-badge--audio { background: #eef4ff; }
.ordinal-thumb-badge--video { background: #fdeef0; }
.ordinal-thumb-badge--web { background: #eefaf0; }
.ordinal-thumb-badge--text { background: #f6f3ec; }

/* Remove the theme's separator line between rows for this directory only.
   Scoped to the view's css_class (.View-Ordinals) so no other view is touched;
   each card already carries its own border + spacing via .ordinal-card. */
.View-Ordinals .mqz-index-row,
.View-Ordinals .views-row,
.View-Ordinals .views-view-grid__row,
.View-Ordinals .views-view-grid__item {
  border-bottom: 0;
  padding: 0;
}

/* ---- Card layout: media left, details right ---- */
.ordinal-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 14px;
  background: #fff;
  border: 0.5px solid #e3e3e0;
  border-radius: 12px;
}
.ordinal-card-thumb {
  flex: 0 0 180px;
  width: 180px;
  display: block;
}
.ordinal-card-body {
  flex: 1 1 auto;
  min-width: 0;
}
.ordinal-card-title {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

/* ---- Meta line: "Image · Collection" ---- */
.ordinal-card-meta {
  margin-bottom: 9px;
  font-size: 13px;
  color: #555;
}
.ordinal-mtype {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  background: #eef0f4;
  color: #41434a;
}
.ordinal-mtype--image { background: #e6f1fb; color: #0c447c; }
.ordinal-mtype--audio { background: #eef0ff; color: #4a45a8; }
.ordinal-mtype--video { background: #fdeef0; color: #993556; }
.ordinal-mtype--web   { background: #e7f7ec; color: #0f6e56; }
.ordinal-mtype--text  { background: #f6f1e7; color: #6b4a14; }
.ordinal-card-collection::before {
  content: " · ";
  color: #aaa;
}

/* ---- Provenance badges ---- */
.ordinal-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ordinal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 0.5px solid #e0e0dc;
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}
.ordinal-badge--signed {
  border: none;
  background: #e1f5ee;
  color: #0f6e56;
  font-weight: 500;
}

/* ---- Tips received (quality signal) ---- */
.ordinal-card-tips {
  margin-bottom: 10px;
  font-size: 13px;
  color: #b3245e;
}
.ordinal-tips-main {
  font-weight: 600;
}
.ordinal-tips-when {
  color: #999;
  font-weight: 400;
}

/* ---- On-card tip ---- */
.ordinal-card-actions {
  margin-top: 2px;
}
.ordinal-tip-toggle {
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #0c447c;
  background: #eaf2fb;
  border: 0.5px solid #cfe0f2;
  border-radius: 8px;
  cursor: pointer;
}
.ordinal-tip-toggle:hover {
  background: #ddeafa;
}
.ordinal-tip-panel {
  margin-top: 10px;
}
.ordinal-tip-panel[hidden] {
  display: none;
}
.ordinal-tip-panel .ordinal-qr {
  width: 124px;
  height: 124px;
}
.ordinal-tip-panel .ordinal-qr svg,
.ordinal-tip-panel .ordinal-qr img {
  width: 100%;
  height: 100%;
}
.ordinal-tip-panel .ordinal-address-text {
  margin-top: 6px;
  font-family: monospace;
  font-size: 12px;
  color: #444;
  word-break: break-all;
}

@media (max-width: 480px) {
  .ordinal-card-thumb { flex-basis: 130px; width: 130px; }
}
