/* ==========================================================================
   DISCOVERY — hotspots and formation cards
   
   Invisible clickable zones over workshop objects. Each reveals a
   formation card — a museum placard with the object's story.
   ========================================================================== */


/* ---- Hotspots ---- */
.hotspot {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
  z-index: 22;
}

/* Subtle breathing glow so visitor knows something is clickable */
.hotspot-glow {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(232, 196, 119, 0.12) 0%,
    rgba(232, 196, 119, 0.04) 50%,
    transparent 70%
  );
  animation: hotspot-breathe 4s ease-in-out infinite;
}

@keyframes hotspot-breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50%      { opacity: 0.7; transform: scale(1.05); }
}

.hotspot:hover .hotspot-glow {
  background: radial-gradient(
    ellipse at center,
    rgba(232, 196, 119, 0.25) 0%,
    rgba(232, 196, 119, 0.1) 50%,
    transparent 70%
  );
  animation-play-state: paused;
  opacity: 1;
  transform: scale(1.1);
}


/* ---- Formation cards container ---- */
.formation-cards {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(5, 3, 2, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.formation-cards.visible {
  opacity: 1;
  pointer-events: auto;
}


/* ---- Individual formation card ---- */
.formation-card {
  display: none;
  max-width: min(480px, 85vw);
  max-height: 80vh;
  overflow-y: auto;
  
  /* Same journal paper as the notebook */
  background-color: #f0e6cc;
  background-image: url('assets/images/journal-paper.png');
  background-size: cover;
  background-position: center;
  
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
  
  position: relative;
  transform: translateY(12px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.formation-card.active {
  display: block;
}

.formation-cards.visible .formation-card.active {
  transform: translateY(0);
}

/* Close button */
.formation-card-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #9a8a6a;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.formation-card-close:hover {
  color: #5a4a2a;
}

/* Card title */
.formation-card-title {
  font-family: 'Indie Flower', cursive;
  font-weight: 400;
  font-size: 1.5rem;
  color: #3a3530;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
  padding-right: 2rem;
}

/* Card text */
.formation-card-text {
  font-family: 'Indie Flower', cursive;
  font-size: 1rem;
  line-height: 1.75;
  color: #4a4540;
  margin-bottom: 0.9rem;
}

.formation-card-text:last-child {
  margin-bottom: 0;
}

/* Diagram container */
.formation-card-diagram {
  margin: 0.5rem 0 1.2rem;
  display: flex;
  justify-content: center;
}

.unit-circle-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
}

/* SVG text styled to match pencil handwriting */
.svg-label {
  font-family: 'Indie Flower', cursive;
  font-size: 12px;
}

.svg-label-small {
  font-family: 'Indie Flower', cursive;
  font-size: 11px;
}

.svg-label-tiny {
  font-family: 'Indie Flower', cursive;
  font-size: 9px;
}


/* ---- Responsive ---- */
@media (max-width: 768px) {
  .formation-card {
    padding: 1.5rem 1.8rem;
  }

  .formation-card-title {
    font-size: 1.2rem;
  }

  .formation-card-text {
    font-size: 0.85rem;
  }
}
