/* ============================================================
   CLL Patient Journey — archive-patients.php styles
   All rules scoped under .cll-archive so they won't leak into
   the rest of the theme. Enqueue this file from functions.php.
   ============================================================ */

.cll-archive {
  /* Brand palette */
  --bg:          oklch(0.985 0.005 290);
  --bg-soft:     oklch(0.965 0.015 290);
  --bg-card:     #ffffff;
  --line:        oklch(0.92 0.02 290);
  --line-strong: oklch(0.86 0.03 290);

  --ink:       oklch(0.22 0.04 285);
  --ink-soft:  oklch(0.42 0.05 285);
  --ink-muted: oklch(0.58 0.04 285);

  --brand:      oklch(0.55 0.18 290);
  --brand-deep: oklch(0.38 0.18 285);
  --brand-soft: oklch(0.94 0.04 290);
  --brand-mid:  oklch(0.72 0.13 290);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(50, 28, 90, 0.04), 0 1px 1px rgba(50, 28, 90, 0.03);
  --shadow:    0 6px 18px -8px rgba(60, 30, 100, 0.18), 0 2px 4px rgba(60, 30, 100, 0.04);

  --font-display: "Newsreader", "Source Serif 4", Georgia, serif;
  --font-body:    "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1200px 600px at 90% -10%, oklch(0.96 0.05 290 / 0.7), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, oklch(0.94 0.06 320 / 0.5), transparent 60%),
    var(--bg);
}

.cll-archive *,
.cll-archive *::before,
.cll-archive *::after { box-sizing: border-box; }

.cll-archive a { color: inherit; text-decoration: none; }

/* ---------- Toolbar ---------- */
.cll-archive .toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 32px;
  background: oklch(0.985 0.005 290 / 0.85);
  border-bottom: 1px solid var(--line);
}
.cll-archive .toolbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--ink);
}
.cll-archive .toolbar__brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, oklch(0.65 0.18 320) 100%);
  position: relative;
}
.cll-archive .toolbar__brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  background: var(--bg-card);
  opacity: 0.85;
}
.cll-archive .toolbar__spacer { flex: 1; }
.cll-archive .toolbar__crumb { font-size: 13px; color: var(--ink-muted); letter-spacing: 0.01em; }

/* ---------- Page ---------- */
.cll-archive .page { animation: cll-page-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes cll-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.cll-archive .group {
  padding: 48px 32px 80px;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

.cll-archive .group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 56px;
}

.cll-archive .group__balloons {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  min-width: 0;
  opacity: 0.95;
}
.cll-archive .group__balloons svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  overflow: visible;
}
.cll-archive .group__balloons .b-warm {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: cll-balloon-warm 8s ease-in-out infinite;
}
.cll-archive .group__balloons .b-cool {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: cll-balloon-cool 11s ease-in-out infinite;
}
@keyframes cll-balloon-warm {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(2px, -11px) rotate(0.6deg); }
}
@keyframes cll-balloon-cool {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-3px, -7px) rotate(-0.7deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cll-archive .group__balloons .b-warm,
  .cll-archive .group__balloons .b-cool { animation: none; }
}
@media (max-width: 980px) {
  .cll-archive .group__header { flex-direction: column; align-items: flex-start; }
  .cll-archive .group__balloons { display: none; }
}

.cll-archive .group__intro { max-width: 620px; margin: 0; }
.cll-archive .group__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 18px;
}
.cll-archive .group__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 22px;
  color: var(--ink);
}
.cll-archive .group__title em { font-style: italic; color: var(--brand); }
.cll-archive .group__sub {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 64ch;
  margin: 0;
}

.cll-archive .group__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 28px;
}
.cll-archive .legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}
.cll-archive .legend-chip__dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- Patient cards grid ---------- */
.cll-archive .pj-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 1100px) {
  .cll-archive .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cll-archive .pj-grid { grid-template-columns: 1fr; }
}

.cll-archive .pj-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.2s ease;
}
.cll-archive .pj-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* Portrait */
.cll-archive .pj-card__portrait {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--portrait-bg, var(--brand-soft));
  overflow: hidden;
}
.cll-archive .pj-card__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, oklch(0.18 0.04 285 / 0.15) 100%);
  pointer-events: none;
}
.cll-archive .pj-card__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}
.cll-archive .pj-card__portrait--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 56px;
  font-style: italic;
  color: var(--brand);
  background: var(--brand-soft);
}

/* Head: name + age/steps + current stage badge */
.cll-archive .pj-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 10px;
}
.cll-archive .pj-card__ident { min-width: 0; }
.cll-archive .pj-card__name {
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
}
.cll-archive .pj-card__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}
.cll-archive .pj-card__current {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--stage-bg, var(--brand-soft));
  color: var(--stage-text, var(--brand-deep));
}

/* Progress rail */
.cll-archive .pj-rail {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 6px 20px;
}
.cll-archive .pj-rail__step {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.cll-archive .pj-rail__dot {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stage-color, var(--brand));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cll-archive .pj-rail__dot:hover,
.cll-archive .pj-rail__dot:focus-visible {
  transform: scale(1.18);
  box-shadow: 0 0 0 3px oklch(1 0 0), 0 0 0 4px var(--stage-color, var(--brand));
  outline: none;
}
.cll-archive .pj-rail__line {
  height: 2px;
  flex: 1;
  background: var(--line);
}
.cll-archive .pj-rail__line[data-end] { background: transparent; }

/* Sentence + link */
.cll-archive .pj-card__sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  padding: 10px 20px 16px;
}
/* One <span> per stage: translation plugins treat each label as its own
   string, and the arrows are decorative separators outside those strings. */
.cll-archive .pj-card__stage { white-space: nowrap; }
.cll-archive .pj-card__arrow {
  color: var(--ink-muted);
  user-select: none;
}
.cll-archive .pj-card__sentence--empty {
  display: block;
  font-style: italic;
  color: var(--ink-muted);
}
.cll-archive .pj-card__link {
  margin-top: auto;
  padding: 20px 20px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  transition: color 0.15s ease;
}
.cll-archive .pj-card__link:hover { color: var(--brand-deep); }

.cll-archive .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .cll-archive .group { padding: 32px 20px 60px; }
  .cll-archive .toolbar { padding: 14px 20px; }
}