/* ============================================================
   CARDS.CSS — Generic card grid and white card shell
   Used by: conditions, monsters, wildshape, magic-items,
            spelltome (spell cards have additional spelltome.css)
   ============================================================ */

/* ── CARD GRID ───────────────────────────────────────────────── */
#card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding: 24px;
}

/* ── WHITE CARD SHELL ────────────────────────────────────────── */
/* Base for any white content card (conditions, monsters, items, beasts) */
.content-card {
  background: var(--bg-elevated);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--text-light);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.83rem;
  line-height: 1.4;
  border: 2.5px solid transparent;
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--gold-dim) 10%, rgba(0,0,0,0.28));
}

/* Selected state (used by pages with print selection) */
.content-card.selected {
  box-shadow: 0 0 0 3px rgba(201,168,76,0.5), 0 8px 28px rgba(0,0,0,0.5) !important;
  transform: translateY(-4px);
}

.content-card.selected .select-indicator {
  background: var(--gold);
  border-color: #fff;
}

/* ── SHARED CARD HEADER (coloured band) ──────────────────────── */
.card-header {
  padding: 9px 11px 7px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  position: relative;
}

/* Title inside coloured header */
.card-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(0.68rem, 2vw, 0.88rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  overflow-wrap: break-word;
  flex: 1;
}

/* Subtitle / italic line under title */
.card-subline {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  font-style: italic;
  margin-top: 1px;
}

/* CR / rarity badge in header */
.cr-badge {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.95);
  border-radius: 3px;
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── CARD TAGS STRIP ─────────────────────────────────────────── */
.card-tags {
  padding: 4px 11px 5px;
  background: color-mix(in srgb, var(--bg-panel) 20%, #f7f5f0);
  border-top: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag {
  font-family: 'Cinzel', serif;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 2px 5px;
}

/* ── PRINT OUTPUT CONTAINER ──────────────────────────────────── */
#print-output { display: none; }

/* ── PRINT PREVIEW OVERLAY ───────────────────────────────────── */
#print-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--overlay) 92%, rgba(0,0,0,0.88));
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

#print-preview-overlay.active { display: flex; }

.print-preview-page-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.print-preview-page {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: color-mix(in srgb, var(--bg-panel) 24%, #e8e4dc);
  padding: 10px;
  border-radius: 6px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  #card-grid { grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
}

@media (max-width: 480px) {
  #card-grid { grid-template-columns: 1fr; }
}
