/* ==========================================================================
   Generative Chamber Styles
   Pinakotheke, Khronos, Bibliotheke, Oikos, Agora activation
   ========================================================================== */

/* Pinakotheke canvases */
.pinakotheke-canvas {
  display: block;
}

/* Khronos timeline */
#khronos-timeline svg {
  width: 100%;
  cursor: grab;
}

.khronos-milestone {
  cursor: pointer;
  transition: transform 0.2s;
}

.khronos-milestone:hover {
  transform: scale(1.3);
}

.khronos-detail {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.khronos-detail.active {
  pointer-events: auto;
  opacity: 1;
}

/* Bibliotheke poems */
.bibliotheke-poem {
  min-height: 80px;
}

.bibliotheke-regenerate {
  opacity: 0.3;
  transition: opacity 0.2s;
  cursor: pointer;
  font-size: 1.2rem;
}

.bibliotheke-regenerate:hover {
  opacity: 1;
}

/* Oikos journal */
.oikos-textarea {
  background: transparent;
  border: 1px solid rgba(255, 140, 0, 0.3);
  color: white;
  width: 100%;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
  padding: 0.5rem;
  border-radius: 0.25rem;
  box-sizing: border-box;
}

.oikos-textarea:focus {
  border-color: #ff8c00;
  outline: none;
}

.oikos-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.oikos-entry {
  border-bottom: 1px solid rgba(255, 140, 0, 0.1);
}

.oikos-entry-delete {
  opacity: 0.3;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.oikos-entry-delete:hover {
  opacity: 1;
  color: #ff6b6b;
}

/* Agora expand */
.agora-full-text {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.agora-full-text.expanded {
  max-height: 500px;
  overflow-y: auto;
}

.agora-read-more {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.agora-read-more:hover {
  opacity: 1;
}

/* Symposion dialogues */
.symposion-dialogue {
  min-width: 280px;
}

.symposion-line {
  margin-bottom: 0.75rem;
}

.symposion-regenerate {
  opacity: 0.3;
  transition: opacity 0.2s;
  cursor: pointer;
  font-size: 1.2rem;
}

.symposion-regenerate:hover {
  opacity: 1;
}

/* Theatron active card highlight */
.theatron-active {
  border-color: #da70d6 !important;
  box-shadow: 0 0 10px rgba(128, 0, 128, 0.3);
}

/* Theatron p5 sketch container */
.theatron-sketch-active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theatron-sketch-active canvas {
  width: 100% !important;
  height: auto !important;
}

/* ==========================================================================
   Responsive: Mobile (< 30em / 480px)
   Stack cards, reduce canvas sizes, full-width dialogues
   ========================================================================== */
@media screen and (max-width: 30em) {
  /* Stack chamber cards vertically at full width */
  .chamber-card {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Constrain Pinakotheke canvases */
  .pinakotheke-canvas {
    max-width: 100%;
    height: auto;
  }

  /* Khronos timeline: allow horizontal scroll */
  #khronos-timeline {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #khronos-timeline svg {
    min-width: 600px;
  }

  /* Symposion dialogues: full width on mobile */
  .symposion-dialogue {
    min-width: 0;
    width: 100%;
  }

  /* Theatron canvas: constrain to viewport */
  .theatron-sketch-active canvas {
    max-height: 50vh;
  }
}

/* ==========================================================================
   Responsive: Tablet (30em–60em / 480px–960px)
   Two-column cards, medium canvas sizes
   ========================================================================== */
@media screen and (min-width: 30em) and (max-width: 60em) {
  .chamber-card {
    width: calc(50% - 2rem);
  }

  .symposion-dialogue {
    min-width: 220px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .khronos-milestone,
  .bibliotheke-regenerate,
  .symposion-regenerate,
  .oikos-entry-delete,
  .agora-read-more {
    transition: none;
  }

  .agora-full-text {
    transition: none;
  }

  .khronos-detail {
    transition: none;
  }
}
