/* ============================================================================
   case-personal.css — the two personalised blocks on a case study page
   ----------------------------------------------------------------------------
   Loaded by every page in src/projects/, next to whichever case-study
   stylesheet the page uses (the shared one or hotel-game's own). Rendered by
   src/js/case-page.js via src/js/personalize.js. Every --cs-* token has a
   fallback so the blocks look the same on a page that never defines them.

     1.  Personal comment banner   .cs-persona     (from an invite)
     2.  AI Summary                .jh-cs-summary  (from a typed goal)
   ========================================================================== */

/* ── 1. Personal comment banner ──────────────────────────────────────────── */
/* Jonas's note for this case, written per invite in the admin tool and filled
   in by renderPersonalComment(). The markup ships with the `hidden` attribute;
   JS removes it and adds .cs-persona--on when an invite has a comment for this
   page. Nothing else ever shows it. */
@keyframes cs-persona-fade-up {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.cs-persona {
  display: none;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--cs-hair, rgba(0, 0, 0, .15));
  border-left: 3px solid var(--cs-accent, #0a66c2);
  border-radius: var(--cs-radius-sm, 10px);
  background: var(--cs-surface, #f6f7f9);
  animation: cs-persona-fade-up var(--dur-slow, 500ms) var(--cs-ease, cubic-bezier(0.25, 0.46, 0.45, 0.94)) both;
}
.cs-persona--on { display: flex; }
.cs-persona-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cs-accent, #0a66c2);
}
.cs-persona-text {
  font-family: 'Inter Tight', sans-serif;
  font-size: 16px;
  line-height: 140%;
  color: var(--cs-ink, rgba(0, 0, 0, .85));
  margin: 0;
}

/* ── 2. AI Summary ───────────────────────────────────────────────────────── */
/* Collapsible block rendered under .cs-tags by renderProjectOverview() when
   the visitor typed a goal and the cached response describes this case. */
.jh-cs-summary {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--cs-hair, rgba(0, 0, 0, .15));
}

.jh-cs-summary .jh-case-summary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter Tight', sans-serif;
  color: var(--cs-ink, rgba(0, 0, 0, .85));
}

.jh-cs-summary .jh-case-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #111;
}

.jh-cs-summary .jh-personal-spark {
  flex: none;
  color: currentColor;
}

.jh-cs-summary .jh-case-summary-chevron {
  flex: none;
  color: var(--cs-muted, rgba(0, 0, 0, .4));
  transition: transform 250ms var(--cs-ease, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}

.jh-cs-summary.is-open .jh-case-summary-chevron {
  transform: rotate(180deg);
}

.jh-cs-summary .jh-case-summary-toggle:hover {
  color: var(--cs-accent, #0a66c2);
}

/* Animated expand/collapse via grid-template-rows (no height measuring) */
.jh-cs-summary .jh-case-summary-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms var(--cs-ease, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}

.jh-cs-summary.is-open .jh-case-summary-body {
  grid-template-rows: 1fr;
}

.jh-cs-summary .jh-case-summary-text {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cs-muted, rgba(0, 0, 0, .4));
}

.jh-cs-summary.is-open .jh-case-summary-text {
  padding-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .cs-persona { animation: none; }
  .jh-cs-summary .jh-case-summary-chevron,
  .jh-cs-summary .jh-case-summary-body {
    transition: none;
  }
}
