/* ════════════════════════════════════════════════════════════════════
   Counseling Journey — "wellbeing journal" aesthetic
   Warm parchment · forest-teal ink · growth spine (seed → bloom)
   Display: Fraunces (serif) · Body: Hanken Grotesk (humanist sans)
   ════════════════════════════════════════════════════════════════════ */

.cj-wrap {
    --cj-parchment: #fbf6ec;
    --cj-paper: #fffdf8;   /* node glyphs + the avatar ring, NOT the session card - see .cj-card */
    --cj-ink: #1e3a34;
    --cj-ink-soft: #547069;
    --cj-seed: #3f8e7b;
    --cj-leaf: #5ba88c;
    --cj-honey: #e0a33e;
    --cj-bloom: #d9744b;
    --cj-sage: #9fbca8;
    --cj-edge: #ece3d2;

    /* The surfaces that used to be literals further down the file. Same values, so light mode
       renders exactly as before; naming them is what makes a dark twin possible at all. */
    --cj-tint-seed: #e4f1ea;
    --cj-edge-seed: #c9e3d4;
    --cj-chip-seed: #dff0e6;
    --cj-on-seed: #2c6356;
    --cj-on-seed-2: #2f6d5c;
    --cj-seed-strong: #4caf8e;

    --cj-tint-bloom: #fae8df;
    --cj-edge-bloom: #f3d2c2;
    --cj-on-bloom: #a64c2c;

    /* Ink for text sitting ON the honey-to-bloom accent itself (the LATEST chip), as opposed to
       on its tint. The accent is a mid-luminance orange in both themes, so white cannot carry
       text on it - see .cj-chip-latest. */
    --cj-on-accent: #331906;

    --cj-tint-honey: #fcf2db;
    --cj-tint-honey-2: #f8e6c2;
    --cj-edge-honey: #eccf95;
    --cj-on-honey: #8a5a1f;
    --cj-on-honey-2: #8a5d12;

    --cj-tint-neutral: #eef3ec;
    --cj-edge-neutral: #dde7da;

    /* The paper grain: a dark speckle on a light ground. Inverted it has to become a light
       speckle, or the texture reads as dirt on the page. */
    --cj-grain: rgba(30, 58, 52, .045);
    /* The lip of light along the top of the well. On a dark ground a white line is a scratch. */
    --cj-well-lip: rgba(255, 255, 255, .6);

    --cj-well-a: #fbf6ec;
    --cj-well-b: #f3ece0;
    --cj-orb-a: #e9f4ee;
    --cj-orb-b: #d9ebe0;
    --cj-orb-edge: #cfe5d7;

    --cj-serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
    --cj-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

    font-family: var(--cj-sans);
    color: var(--cj-ink);
    padding: 18px;
    border-radius: 20px;
    background-color: var(--cj-parchment);
    background-image: radial-gradient(var(--cj-grain) 1px, transparent 1px);
    background-size: 18px 18px;
    box-shadow: inset 0 0 0 1px var(--cj-edge);
}

/* ── Header ───────────────────────────────────────────────────────── */
.cj-head {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    margin-bottom: 26px;
    border-radius: 16px;
    color: #f6efe1;
    background: radial-gradient(140% 120% at 0% 0%, #285048 0%, #1e3a34 55%, #16302a 100%);
    box-shadow: 0 16px 38px rgba(22, 48, 42, .34);
}

.cj-head-contour {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .5;
    pointer-events: none;
}

.cj-head-contour path {
    fill: none;
    stroke: rgba(224, 163, 62, .22);
    stroke-width: 1.5;
}

.cj-head-main {
    position: relative;
    z-index: 1;
}

.cj-kicker {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .22em;
    color: var(--cj-honey);
    margin-bottom: 4px;
}

.cj-title {
    font-family: var(--cj-serif);
    font-optical-sizing: auto;
    font-weight: 500;
    font-size: 1.9rem;
    line-height: 1.05;
    margin: 0;
    letter-spacing: -.01em;
}

.cj-metrics {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cj-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 92px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(251, 246, 236, .10);
    border: 1px solid rgba(251, 246, 236, .18);
    backdrop-filter: blur(3px);
    transition: transform .25s ease, background .25s ease;
}

.cj-metric:hover {
    transform: translateY(-3px);
    background: rgba(251, 246, 236, .18);
}

.cj-metric-num {
    font-family: var(--cj-serif);
    font-weight: 500;
    font-size: 1.15rem;
    line-height: 1.1;
    color: #fdfaf3;
}

.cj-metric-cap {
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cj-sage);
    margin-top: 3px;
}

/* ── Timeline ─────────────────────────────────────────────────────── */
.cj-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cj-row {
    display: flex;
    gap: 18px;
}

.cj-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 46px;
    flex: 0 0 46px;
}

.cj-node {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cj-paper);
    border: 2.5px solid var(--cj-leaf);
    box-shadow: 0 4px 12px rgba(30, 58, 52, .14);
    z-index: 1;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), box-shadow .28s ease;
}

.cj-node-num {
    font-family: var(--cj-serif);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--cj-ink);
}

.cj-node-glyph {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: .66rem;
    color: #fff;
    box-shadow: 0 2px 5px rgba(30, 58, 52, .25);
}

.cj-node-start {
    border-color: var(--cj-seed);
    box-shadow: 0 4px 12px rgba(63, 142, 123, .28), 0 0 0 5px rgba(63, 142, 123, .10);
}

.cj-node-start .cj-node-glyph {
    background: linear-gradient(135deg, var(--cj-seed-strong), var(--cj-seed));
}

.cj-node-mid {
    border-color: var(--cj-leaf);
}

.cj-node-latest {
    border-color: var(--cj-bloom);
    box-shadow: 0 4px 14px rgba(217, 116, 75, .30), 0 0 0 5px rgba(217, 116, 75, .12);
}

.cj-node-latest .cj-node-num {
    color: var(--cj-bloom);
}

.cj-node-latest .cj-node-glyph {
    background: linear-gradient(135deg, var(--cj-honey), var(--cj-bloom));
}

.cj-row:hover .cj-node {
    transform: scale(1.12) rotate(-4deg);
    box-shadow: 0 8px 20px rgba(30, 58, 52, .24), 0 0 0 6px rgba(91, 168, 140, .16);
}

.cj-line {
    flex: 1 1 auto;
    width: 3px;
    min-height: 34px;
    margin: 4px 0;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cj-seed), var(--cj-leaf) 45%, var(--cj-honey) 80%, var(--cj-bloom));
}

/* ── Card ─────────────────────────────────────────────────────────── */
/* ⚠ A session card is an <article>, and site.css paints every <article> with
   `background-color: var(--bg-color) !important; color: var(--text-color) !important` in BOTH
   themes. Nothing outranks an !important, so a card has never actually worn --cj-paper or
   --cj-ink: it renders on the app's own surface - #ffffff in light, #121212 in dark. This rule
   claimed otherwise for as long as the two light values were both near-white and the difference
   was invisible.

   KEPT, not fixed (owner, 2026-09-07, after looking at both in the browser): at #121212 the cards
   read as cards against the parchment ground, where the warm #2a241d this rule used to name made
   them merge into it and cost the date well its edge. So the rule now names the surface it is
   actually given, and stays right if the tag ever stops being <article>.

   --cj-paper is still a live token - it paints the spine's node glyphs and the avatar ring,
   neither of which is an <article>. */
.cj-card {
    position: relative;
    flex: 1 1 auto;
    margin-bottom: 18px;
    padding: 16px 18px 16px 20px;
    border: 1px solid var(--cj-edge);
    border-radius: 16px;
    background: var(--bg-color);
    color: var(--text-color);
    box-shadow: 0 3px 10px rgba(30, 58, 52, .06);
    transition: box-shadow .28s ease, transform .28s ease;
}

.cj-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 4px;
    background: var(--cj-leaf);
    transition: top .28s ease, bottom .28s ease;
}

.cj-card-start::before { background: linear-gradient(180deg, var(--cj-seed-strong), var(--cj-seed)); }
.cj-card-mid::before { background: linear-gradient(180deg, var(--cj-leaf), var(--cj-seed)); }
.cj-card-latest::before { background: linear-gradient(180deg, var(--cj-honey), var(--cj-bloom)); }

.cj-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(30, 58, 52, .16);
}

.cj-card:hover::before {
    top: 6px;
    bottom: 6px;
}

.cj-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cj-session-badge {
    display: inline-flex;
    align-items: center;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--cj-ink);
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--cj-tint-neutral);
    border: 1px solid var(--cj-edge-neutral);
}

.cj-card-start .cj-session-badge { color: var(--cj-on-seed); background: var(--cj-tint-seed); border-color: var(--cj-edge-seed); }
.cj-card-latest .cj-session-badge { color: var(--cj-on-bloom); background: var(--cj-tint-bloom); border-color: var(--cj-edge-bloom); }

.cj-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .64rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.cj-chip-start { color: var(--cj-on-seed); background: var(--cj-chip-seed); }

/* ⚠ This chip is NOT a tinted one: its background is the accent gradient at full strength, and
   it carried white text. White on --cj-honey was 2.2:1 in light and 1.85:1 in dark - the chip is
   .64rem uppercase, which WCAG treats as normal text needing 4.5:1, so it failed everywhere and
   failed worst in the theme this PR added.

   Darkening the gradient until white passed would have cost the bloom its point, so the ink
   inverts instead: --cj-on-accent against the two ends of the gradient measures 7.4:1 / 5.1:1 in
   light and 8.9:1 / 6.3:1 in dark. The chip keeps its colour and its meaning; only the text stops
   dissolving into it. */
.cj-chip-latest { color: var(--cj-on-accent); background: linear-gradient(135deg, var(--cj-honey), var(--cj-bloom)); box-shadow: 0 3px 8px rgba(217, 116, 75, .30); }

.cj-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

/* Date — editorial serif plate (distinct from counselor) */
.cj-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 16px 8px 14px;
    border-radius: 12px;
    background: linear-gradient(160deg, var(--cj-well-a), var(--cj-well-b));
    border: 1px solid var(--cj-edge);
    box-shadow: inset 0 1px 0 var(--cj-well-lip);
}

.cj-date-day {
    font-family: var(--cj-serif);
    font-weight: 600;
    font-size: 2rem;
    line-height: 1;
    color: var(--cj-ink);
}

.cj-date-rest {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.cj-date-mon {
    font-family: var(--cj-serif);
    font-weight: 600;
    font-size: .92rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--cj-seed);
}

.cj-date-yr {
    font-size: .74rem;
    font-weight: 600;
    color: var(--cj-ink-soft);
}

.cj-date-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    align-self: flex-end;
    margin-bottom: 2px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--cj-ink-soft);
}

.cj-date-time i {
    font-size: .8rem;
    opacity: .7;
}

/* Counselor — warm, person-coloured (distinct from the date plate) */
.cj-counselor {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.cj-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-family: var(--cj-sans);
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg,
        hsl(var(--cj-av-hue, 150) 52% 58%),
        hsl(calc(var(--cj-av-hue, 150) + 24) 56% 42%));
    box-shadow: 0 4px 10px hsla(var(--cj-av-hue, 150) 50% 40% / .35);
    border: 2px solid var(--cj-paper);
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.cj-counselor:hover .cj-avatar {
    transform: scale(1.1) rotate(4deg);
}

.cj-counselor-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.cj-counselor-label {
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
    color: var(--cj-sage);
}

.cj-counselor-name {
    font-family: var(--cj-serif);
    font-weight: 600;
    font-style: italic;
    font-size: 1.04rem;
    /* Vivid, per-counsellor colour (matches the avatar hue) so the name never reads
       as dull and stays high-contrast on the light card in both light and dark mode. */
    color: hsl(var(--cj-av-hue, 150) 55% 34%);
}

/* Gap connector */
.cj-gap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.cj-gap-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cj-honey);
    box-shadow: 0 0 0 3px rgba(224, 163, 62, .18);
}

.cj-gap-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--cj-on-honey);
    background: var(--cj-tint-honey);
    border: 1px dashed var(--cj-edge-honey);
    transition: background .25s ease, transform .25s ease;
}

.cj-gap-pill i {
    font-size: 1rem;
    transition: transform .25s ease;
}

.cj-card:hover .cj-gap-pill {
    background: var(--cj-tint-honey-2);
    transform: translateX(2px);
}

.cj-card:hover .cj-gap-pill i {
    transform: translateY(2px);
}

/* ── Action / empty state ─────────────────────────────────────────── */
.cj-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.cj-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--cj-sans);
    font-weight: 600;
    font-size: .9rem;
    color: #fdfaf3;
    padding: 10px 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2f6a5c, #1e3a34);
    box-shadow: 0 8px 20px rgba(30, 58, 52, .30);
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.cj-add-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 26px rgba(30, 58, 52, .40);
}

.cj-add-btn:active {
    transform: translateY(0);
}

.cj-empty {
    text-align: center;
    padding: 40px 20px;
    border-radius: 20px;
    background-color: var(--cj-parchment);
    background-image: radial-gradient(var(--cj-grain) 1px, transparent 1px);
    background-size: 18px 18px;
    box-shadow: inset 0 0 0 1px var(--cj-edge);
}

.cj-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 16px;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--cj-seed);
    background: radial-gradient(circle at 30% 25%, var(--cj-orb-a), var(--cj-orb-b));
    box-shadow: inset 0 0 0 1px var(--cj-orb-edge), 0 6px 16px rgba(63, 142, 123, .18);
}

.cj-empty-title {
    font-family: var(--cj-serif);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--cj-ink);
    margin-bottom: 4px;
}

.cj-empty-sub {
    font-size: .9rem;
    color: var(--cj-ink-soft);
    max-width: 30rem;
    margin: 0 auto 18px;
}

/* ── Entrance (staggered) ─────────────────────────────────────────── */
.cj-in {
    opacity: 0;
    transform: translateY(16px);
    animation: cjIn .55s cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes cjIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cj-in {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .cj-card,
    .cj-node,
    .cj-avatar,
    .cj-add-btn {
        transition: none;
    }
}

/* ── Parent intimation, per session ──────────────────────────────────────────
   Three states, deliberately distinguishable rather than collapsed into
   informed / not-informed:

     recorded  the parent WAS told  - leaf green, the journey's positive colour
     pending   answered "not yet"   - honey, an open action rather than a fault
     none      predates the field   - sage on parchment, quiet by design

   The third is the one that needs the restraint. Most historical sessions are
   in it, and giving it a warning colour would paint a wall of amber across
   every existing child's history for a question nobody was ever asked. It is
   muted and dashed so it reads as absence, not as an alarm. */
.cj-intimation {
    align-items: center;
    border: 1px solid var(--cj-edge);
    border-radius: 10px;
    display: flex;
    gap: .5rem;
    margin-top: .55rem;
    padding: .4rem .55rem;
}

.cj-intimation-glyph {
    flex: none;
    font-size: .95rem;
    line-height: 1;
}

.cj-intimation-text {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.cj-intimation-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.cj-intimation-meta {
    align-items: center;
    color: var(--cj-ink-soft);
    display: flex;
    flex-wrap: wrap;
    font-size: .68rem;
    gap: .35rem;
}

.cj-intimation-mode {
    background: rgba(63, 142, 123, .12);
    border-radius: 5px;
    padding: .05rem .3rem;
}

.cj-intimation-recorded {
    background: rgba(91, 168, 140, .12);
    border-color: rgba(91, 168, 140, .38);
}

.cj-intimation-recorded .cj-intimation-glyph,
.cj-intimation-recorded .cj-intimation-label {
    color: var(--cj-on-seed-2);
}

.cj-intimation-pending {
    background: rgba(224, 163, 62, .13);
    border-color: rgba(224, 163, 62, .42);
}

.cj-intimation-pending .cj-intimation-glyph,
.cj-intimation-pending .cj-intimation-label {
    color: var(--cj-on-honey-2);
}

.cj-intimation-none {
    background: transparent;
    border-style: dashed;
}

.cj-intimation-none .cj-intimation-glyph,
.cj-intimation-none .cj-intimation-label {
    color: var(--cj-ink-soft);
    font-weight: 500;
}

/* The "N/total" denominator on the header metric, quieter than the figure. */
.cj-metric-of {
    font-size: .62em;
    opacity: .72;
}

/* ════════════════════════════════════════════════════════════════════
   The dark twin (#audit-29)

   The journal had no dark rules at all, so a counsellor with dark mode on got a full-luminance
   cream panel inside the dark shell. Owner's decision (2026-09-05): keep the identity this file
   set out — "warm parchment · forest-teal ink · growth spine" — and give it a dark counterpart in
   the same family, rather than retiring the palette for the app's neutral tokens.

   So the ground is a warm ink rather than a neutral grey, and the teal/honey/bloom accents are the
   same hues raised for legibility on it. Nothing here changes light mode: every value above is
   what the file already rendered.

   ⚠ This has to redefine the SURFACES too, not just the ground. Thirteen cream and mint tints
   lived as literals in the rules below; overriding only the original ten tokens would have left
   light cards sitting on a dark page, which is worse than not doing it.
   ════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] .cj-wrap {
    --cj-parchment: #211c17;
    --cj-paper: #2a241d;   /* the same two surfaces; the card is the app's #121212 on purpose */
    --cj-ink: #e8ded0;
    --cj-ink-soft: #b3a595;
    --cj-seed: #5bbfa4;
    --cj-leaf: #74d3b6;
    --cj-honey: #e8b761;
    --cj-bloom: #e8895f;
    --cj-sage: #6f8a7b;
    --cj-edge: #3a3128;

    --cj-tint-seed: #1d3830;
    --cj-edge-seed: #2c5548;
    --cj-chip-seed: #1f3d34;
    --cj-on-seed: #7fd8bd;
    --cj-on-seed-2: #7fd8bd;
    --cj-seed-strong: #61c9a8;

    --cj-tint-bloom: #3a251c;
    --cj-edge-bloom: #5c392b;
    --cj-on-bloom: #f0a184;

    /* Unchanged, and deliberately so: --cj-honey and --cj-bloom are RAISED for the dark ground,
       so the chip's own background is lighter here than in light mode. The ink that works on the
       lighter version works on the darker one. */
    --cj-on-accent: #331906;

    --cj-tint-honey: #332a17;
    --cj-tint-honey-2: #3d3119;
    --cj-edge-honey: #5a4a26;
    --cj-on-honey: #eec478;
    --cj-on-honey-2: #e9c07a;

    --cj-tint-neutral: #262019;
    --cj-edge-neutral: #3a3128;

    --cj-grain: rgba(232, 222, 208, .05);
    --cj-well-lip: rgba(255, 255, 255, .06);

    --cj-well-a: #241e18;
    --cj-well-b: #2a241d;
    --cj-orb-a: #1e3a32;
    --cj-orb-b: #172b25;
    --cj-orb-edge: #2c5548;
}
