/* ============================================
   IGOR'S QUEST — CARDS PAGE STYLESHEET
   cards.css

   This file works alongside style.css —
   it only handles the collection grid
   and the modal popup.
   ============================================ */


/* ============================================
   BACK LINK
   ============================================ */

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.back-link:hover {
  opacity: 1;
}


/* ============================================
   COLLECTION SECTION & GRID
   ============================================ */

.collection-section {
  padding: 3rem 1.5rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));  /* TWEAK ME — card min width */
  gap: 1.5rem;                                                    /* TWEAK ME — gap between cards */
}


/* ============================================
   INDIVIDUAL COLLECTION CARDS
   ============================================ */

.collection-card {
  background: #f5e6c8;
  border: 3px solid var(--rarity-color, #8a7040);
  box-shadow: 3px 3px 0 var(--rarity-color, #8a7040);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.collection-card:hover {
  transform: translateY(-5px) rotate(-0.5deg);   /* TWEAK ME — hover lift amount */
  box-shadow: 5px 8px 0 var(--rarity-color, #8a7040);
}

/* Image area */
.col-card-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;       /* TWEAK ME — card art proportions */
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #d4b896, #b8965a);
}

/* Vignette over the image */
.col-card-img-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,            /* TWEAK ME — size of clear center */
    rgba(0, 0, 0, 0.45) 100%    /* TWEAK ME — vignette darkness */
  );
}

.col-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.col-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(0,0,0,0.12);
  font-style: italic;
}

/* Name + rarity strip at the bottom */
.col-card-footer {
  padding: 0.6rem 0.75rem;
  background: #ede0c0;
  border-top: 1px solid #c8a870;
  text-align: center;
}

.col-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #1a1408;
  line-height: 1.2;
}

.col-card-rarity {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: italic;
  margin-top: 0.2rem;
}


/* ============================================
   MODAL OVERLAY
   The dark backdrop behind the popup
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);  /* TWEAK ME — backdrop darkness */
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;

  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}


/* ============================================
   MODAL POPUP BOX
   ============================================ */

.modal {
  background: #1e1508;
  border: 2px solid var(--accent-dim);
  box-shadow:
    0 0 60px rgba(200, 150, 42, 0.15),
    inset 0 0 40px rgba(0,0,0,0.5);
  max-width: 860px;             /* TWEAK ME — max popup width */
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.25s ease both;
}

@keyframes modalIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Close button */
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 10;
}
.modal-close:hover { opacity: 1; }


/* ============================================
   MODAL BODY — two column layout
   Left: image | Right: info + notes
   ============================================ */

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;   /* TWEAK ME — image vs text column ratio */
  min-height: 400px;
}

/* LEFT side — image */
.modal-image-side {
  background: #150f04;
  border-right: 1px solid var(--accent-dim);
}

.modal-img-wrapper {
  width: 100%;
  height: 100%;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}

/* Vignette on modal image */
.modal-img-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.modal-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  color: rgba(255,255,255,0.05);
  background: linear-gradient(160deg, #2a1f0a, #0d0a04);
}

/* RIGHT side — info */
.modal-info-side {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-card-type {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.7;
  text-transform: uppercase;
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--accent);
  text-shadow: 1px 1px 0 var(--danger);
  line-height: 1.1;
}

.modal-flavor {
  font-style: italic;
  color: var(--ink);
  opacity: 0.65;
  font-size: 1rem;
  border-left: 2px solid var(--accent-dim);
  padding-left: 0.75rem;
}

.modal-description {
  color: var(--ink);
  opacity: 0.85;
  font-size: 1.05rem;
  line-height: 1.7;
}


/* ============================================
   LORE SECTION inside the modal
   Edit the "lore" field per card in cards.html.
   ============================================ */

.modal-lore-section {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--accent-dim);
}

.modal-lore-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.7;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.modal-lore {
  font-size: 1rem;              /* TWEAK ME — lore text size */
  line-height: 1.75;
  color: var(--ink);
  opacity: 0.8;
  font-style: italic;
}


/* ============================================
   RESPONSIVE — stack modal on small screens
   ============================================ */

@media (max-width: 600px) {
  .modal-body {
    grid-template-columns: 1fr;   /* stack image above text on mobile */
  }
  .modal-img-wrapper,
  .modal-img-placeholder {
    min-height: 220px;
  }
  .modal-image-side {
    border-right: none;
    border-bottom: 1px solid var(--accent-dim);
  }
  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}