/*
 * Journey Cards draw (js/journey-cards/draw.js): intake, shuffle, flip reveal, full cards.
 * Moved from admin/journey-cards-playground.html (classes renamed .jc-* → .jcd-*).
 * Needs Cormorant Garamond (Google Fonts) on the page.
 */
.jcd [hidden] { display: none !important; }
.jcd-eyebrow { font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; color: #64b5f6; font-weight: 600; }
.jcd-note { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin: 0.25rem 0 1.25rem; }
.jcd-stage { text-align: center; padding: 1rem 0 0.5rem; }
.jcd .jcd-stage h2 { font-family: 'Cormorant Garamond', serif; font-size: 2.4rem !important; margin: 0.4rem 0 0.3rem !important; font-weight: 600; }
.jcd-teaser { color: rgba(255,255,255,0.7); font-size: 1.02rem; margin-bottom: 1.5rem; }
.jcd-teaser b { color: #35e9c5; font-weight: 600; }

.jcd-table { display: flex; justify-content: center; align-items: flex-end; gap: 18px; perspective: 1400px; margin: 0 auto 1.25rem; }
.jcd-slot { display: flex; flex-direction: column; align-items: center; width: 200px; }
.jcd-slot.guide { width: 230px; }
.jcd-card { width: 100%; aspect-ratio: 5 / 8; position: relative; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(.2,.7,.2,1); cursor: default; }
.jcd-card.flipped { transform: rotateY(180deg); }
.jcd-face { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.jcd-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(233,196,106,0.18), transparent 55%),
    repeating-linear-gradient(45deg, rgba(233,196,106,0.06) 0 2px, transparent 2px 12px),
    linear-gradient(170deg, #1d2a5a, #0b1430 60%, #08102a);
  border: 1.5px solid rgba(233,196,106,0.7);
  box-shadow: 0 16px 36px rgba(0,0,0,0.55), inset 0 0 0 6px rgba(8,16,42,0.9), inset 0 0 0 7px rgba(233,196,106,0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.jcd-back svg { width: 46%; opacity: 0.9; }
.jcd-back .jcd-back-label { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(233,196,106,0.85); }
.jcd-front {
  transform: rotateY(180deg);
  background: radial-gradient(ellipse at 50% 30%, #23346a, #0d1628 70%);
  border: 1.5px solid rgba(255,255,255,0.18);
  box-shadow: 0 16px 36px rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.jcd-slot.guide .jcd-front { border-color: rgba(233,196,106,0.8); box-shadow: 0 0 0 1px rgba(233,196,106,0.2), 0 0 38px rgba(233,196,106,0.25), 0 16px 36px rgba(0,0,0,0.55); }
.jcd-front video, .jcd-front img { width: 100%; height: 100%; object-fit: cover; }
.jcd-slot.shadow .jcd-front video, .jcd-slot.shadow .jcd-front img { filter: saturate(0.75) brightness(0.9); }

.jcd-caption { margin-top: 12px; min-height: 5.2em; opacity: 0; transform: translateY(6px); transition: opacity 0.6s ease, transform 0.6s ease; }
.jcd-caption.show { opacity: 1; transform: none; }
.jcd-pos { font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase; font-weight: 600; color: #e9c46a; }
.jcd-slot.companion .jcd-pos { color: #64b5f6; }
.jcd-slot.shadow .jcd-pos { color: #b39ddb; }
.jcd-name { font-family: 'Cormorant Garamond', serif; font-size: 1.45rem; font-weight: 700; line-height: 1.05; margin-top: 2px; }
.jcd-title { font-family: 'Cormorant Garamond', serif; font-style: italic; color: rgba(255,255,255,0.7); }
.jcd-tagline { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 3px; }

.jcd-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0.5rem 0 1rem; }
.jcd-btn {
  font-family: inherit; font-size: 1rem; font-weight: 600; border-radius: 999px; padding: 10px 22px; cursor: pointer;
  border: 1px solid rgba(233,196,106,0.7); background: rgba(233,196,106,0.12); color: #f3ead2;
}
.jcd-btn.primary { background: linear-gradient(40deg, #4730ce 0%, #1B65BD 45%, #11ACD4 70%, #35e9c5 100%); border: none; color: #fff; }
.jcd-btn[hidden] { display: none; }

/* Intake screens */
.jcd-intake-wrap { position: relative; max-width: 580px; margin: 0.5rem auto 1rem; padding-top: 58px; }
.jcd-intake-wrap[hidden] { display: none; }
.jcd-peek {
  position: absolute; top: 0; height: 100px; width: auto; z-index: 0;
  animation: jcd-peek-in 0.7s cubic-bezier(.2,.8,.3,1.2) both;
}
.jcd-peek.right { right: 40px; transform: rotate(8deg); }
.jcd-peek.left { left: 40px; transform: rotate(-8deg); }
@keyframes jcd-peek-in { from { opacity: 0; translate: 0 34px; } to { opacity: 1; translate: 0 0; } }
.jcd-intake {
  position: relative; z-index: 1; text-align: center;
  background: linear-gradient(175deg, #182544, #0e1830); border: 1px solid rgba(233,196,106,0.45);
  border-radius: 18px; padding: 26px 26px 18px;
}
.jcd-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.jcd-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.jcd-dots span.on { background: #e9c46a; }
.jcd-ai-note {
  display: inline-block; margin: 0 auto 8px; padding: 3px 12px; border-radius: 999px;
  font-size: 0.8rem; color: #cfe3ff; background: rgba(100, 181, 246, 0.12); border: 1px solid rgba(100, 181, 246, 0.35);
}
.jcd-intake-lede { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-bottom: 6px; }
.jcd-q { font-family: 'Cormorant Garamond', serif; font-size: 1.75rem; line-height: 1.2; font-weight: 600; margin-bottom: 4px; }
.jcd-hint {
  display: inline-block; font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em; color: #e9c46a;
  background: rgba(233,196,106,0.12); border: 1px solid rgba(233,196,106,0.45); border-radius: 999px;
  padding: 4px 14px; margin: 6px 0 18px;
}
.jcd-hint.full { background: rgba(233,196,106,0.28); color: #fff6dc; }
.jcd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.jcd-chip {
  font-family: inherit; font-size: 0.95rem; color: #e8ecf5; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; padding: 8px 15px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.jcd-chip:hover:not(:disabled) { border-color: rgba(233,196,106,0.7); }
.jcd-chip:active:not(:disabled) { transform: scale(0.97); }
.jcd-chip.selected { background: rgba(233,196,106,0.22); border-color: #e9c46a; color: #fff6dc; }
.jcd-chip.other { border-style: dashed; }
.jcd-chip:disabled { opacity: 0.35; cursor: default; }
.jcd-other {
  display: block; width: 100%; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(233,196,106,0.5); background: rgba(0,0,0,0.25); color: #fff; font-family: inherit; font-size: 1rem;
}
.jcd-other[hidden] { display: none; }
.jcd-intake-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.jcd-link { background: none; border: none; color: rgba(255,255,255,0.55); font-family: inherit; font-size: 0.95rem; cursor: pointer; padding: 8px 10px; }
.jcd-link:hover:not(:disabled) { color: #fff; }
.jcd-link:disabled { visibility: hidden; }
.jcd-skip-all { display: block; margin: 10px auto 0; font-size: 0.85rem; }
.jcd-shuffling { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.3rem; color: #e9c46a; margin: 0.5rem 0 1rem; }
.jcd-shuffling[hidden] { display: none; }
.jcd-table.shuffling .jcd-card { animation: jcd-wiggle 1.6s ease-in-out infinite; }
.jcd-table.shuffling .jcd-slot:nth-child(2) .jcd-card { animation-delay: 0.25s; }
.jcd-table.shuffling .jcd-slot:nth-child(3) .jcd-card { animation-delay: 0.5s; }
@keyframes jcd-wiggle { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-6px) rotate(-1.5deg); } 75% { transform: translateY(-3px) rotate(1.5deg); } }
.jcd-answers {
  max-width: 620px; margin: 0.5rem auto 0; text-align: left; font-size: 0.88rem; color: rgba(255,255,255,0.65);
  border-top: 1px dashed rgba(255,255,255,0.2); padding-top: 12px;
}
.jcd-answers[hidden] { display: none; }
.jcd-answers b { color: #e9c46a; font-weight: 600; }
.jcd-answers ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 768px) {
  .jcd-q { font-size: 1.4rem; }
  .jcd-intake { padding: 22px 16px 14px; }
  .jcd-peek { height: 84px; }
}

.jcd-full { margin-top: 1.5rem; }
.jcd-full[hidden] { display: none; }
.jcd-frame-wrap { width: 100%; max-width: 818px; margin: 0 auto; overflow: hidden; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); }
/* Letter-width pages (816px, sized for PDF): centered when there's room, scaled down when not (draw.js fitFrame) */
.jcd-frame-wrap iframe { width: 816px; border: 0; display: block; margin: 0 auto; transform-origin: 0 0; background: #020F1F; }
.jcd-error { color: #ffb4a8; }

@media (max-width: 768px) {
  .jcd-table { gap: 8px; }
  .jcd-slot { width: 28vw; }
  .jcd-slot.guide { width: 32vw; }
  .jcd-name { font-size: 1.05rem; }
  .jcd-title, .jcd-tagline { font-size: 0.72rem; }
  .jcd .jcd-stage h2 { font-size: 1.8rem !important; }
}

/* Teaser of the full cards: an unlock bar above the partly locked pages */
.jcd-unlock {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: 818px; margin: 0 auto 1rem; padding: 0.9rem 1.1rem; border-radius: 12px; text-align: left;
  background: linear-gradient(135deg, rgba(24,37,68,0.97), rgba(14,24,48,0.97)); border: 1px solid rgba(233,196,106,0.6);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.jcd-unlock-text { flex: 1; min-width: 220px; }
.jcd-unlock-title { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; font-weight: 600; color: #fff; }
.jcd-unlock-sub { font-size: 0.88rem; color: rgba(255,255,255,0.65); margin-top: 2px; }
.jcd-unlock-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.jcd-owned-link { font-size: 0.9rem; color: #e9c46a !important; text-decoration: underline; padding: 2px 6px; }
.jcd-owned-note { flex-basis: 100%; font-size: 0.85rem; color: #e9c46a; margin-top: -2px; }
.jcd-btn.jcd-owned { border-color: rgba(233,196,106,0.9); background: rgba(233,196,106,0.18); }
