/* ============================================================
   The Canvas Directory (/canvas/)
   Tokens only (platform-tokens.css loads via includes/header.php).
   Grammar: .cv-* page-local classes + ws_* components.
   ============================================================ */

.cv-wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-6); }

/* --- Hero ---------------------------------------------------- */
.cv-hero { padding: var(--space-10) 0 var(--space-6); }
.cv-hero__eyebrow {
    margin: 0 0 var(--space-2);
    font-size: var(--text-meta);
    font-weight: var(--font-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--phase-learn-dark);
}
.cv-hero__title {
    margin: 0 0 var(--space-4);
    font-family: var(--font-heading);
    font-size: clamp(var(--text-h1), 5vw, var(--text-display));
    line-height: 1.15;
    color: var(--text-dark);
}
.cv-hero--tight { padding-top: var(--space-4); }
.cv-grid--offset { padding-top: var(--space-4); }
.cv-hero__title em { font-style: italic; color: var(--phase-learn-dark); }
.cv-hero__lede {
    max-width: 62ch;
    margin: 0;
    font-size: var(--text-body);
    line-height: 1.625;
    color: var(--text-muted);
}
.cv-hero__lede + .cv-hero__lede { margin-top: var(--space-3); }

/* --- Category chips ------------------------------------------ */
/* --- Tool filters + ready-made board links --------------------- */
/* The tool pills share the category row but filter a different axis, so they
   sit behind a hairline and wear a quieter, outlined treatment. */
.cv-chips__split {
    width: 1px; align-self: stretch; margin: var(--space-1, 4px) var(--space-2);
    background: var(--gray-300);
}
.cv-chip--tool { border-style: dashed; color: var(--text-muted); }
.cv-chip--tool:hover { border-style: solid; }
.cv-chip--tool.is-active {
    border-style: solid; border-color: var(--phase-learn-dark);
    background: var(--phase-learn-dark); color: var(--text-inverse);
}

.cv-attrib__boards { margin-top: var(--space-4); }
.cv-attrib__boardlabel {
    margin: 0 0 var(--space-2); font-size: var(--text-caption, 0.75rem);
    font-weight: var(--font-semibold); letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
}
.cv-boardlink {
    display: inline-flex; align-items: center; gap: var(--space-1-5, 6px);
    margin: 0 var(--space-2) var(--space-2) 0;
    padding: var(--space-2) var(--space-3-5);
    border: 1px solid var(--gray-300); border-radius: var(--radius-full);
    background: var(--bg-white, #FFFFFF); color: var(--text-dark);
    font-size: var(--text-small); font-weight: var(--font-medium); text-decoration: none;
    transition: border-color 150ms var(--ease-out), background 150ms var(--ease-out);
}
.cv-boardlink:hover { border-color: var(--phase-learn); background: var(--phase-learn-very-light); }
.cv-boardlink .material-symbols-outlined { font-size: 15px; }

/* --- Canvas of the day ---------------------------------------- */
/* scroll-margin keeps the block clear of the sticky header when the nav
   anchor jumps to it; tabindex="-1" + :focus-visible:none moves the keyboard
   caret there without drawing a focus ring on a non-interactive element. */
.cv-today { margin: var(--space-6) 0 var(--space-2); scroll-margin-top: var(--space-20, 80px); }
.cv-today:focus { outline: none; }
.cv-today__label {
    display: flex; align-items: center; gap: var(--space-1-5, 6px);
    margin: 0 0 var(--space-2);
    font-size: var(--text-meta); font-weight: var(--font-semibold);
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--phase-learn-dark);
}
.cv-today__label .material-symbols-outlined { font-size: 18px; }
.cv-today__card {
    display: block; padding: var(--space-5) var(--space-6);
    border: 1px solid var(--phase-learn-dark);
    border-radius: var(--radius-lg, 12px);
    background: var(--phase-learn-very-light);
    text-decoration: none; color: inherit;
    transition: border-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.cv-today__card:hover { border-color: var(--phase-learn-dark); transform: translateY(-1px); }
.cv-today__name {
    margin: 0 0 var(--space-2); font-family: var(--font-heading);
    font-size: var(--text-h2, 1.5rem); line-height: 1.2; color: var(--text-dark);
}
.cv-today__line { margin: 0 0 var(--space-2); font-size: var(--text-body); line-height: 1.55; color: var(--text-dark); max-width: 62ch; }
.cv-today__credit { margin: 0 0 var(--space-3); font-size: var(--text-small); color: var(--text-muted); }
.cv-today__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cv-today__go { margin-left: auto; font-size: var(--text-small); font-weight: var(--font-semibold); color: var(--phase-learn-dark); }
@media (max-width: 640px) {
    .cv-today__card { padding: var(--space-4); }
    .cv-today__go { margin-left: 0; }
}

.cv-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-4) 0 var(--space-2); }
.cv-chip {
    display: inline-flex; align-items: center; gap: var(--space-1-5, 6px);
    padding: var(--space-2) var(--space-3-5);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    background: var(--bg-white, #FFFFFF);
    color: var(--text-dark);
    font-size: var(--text-small);
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: border-color 150ms var(--ease-out), background 150ms var(--ease-out);
}
.cv-chip:hover { border-color: var(--phase-learn); background: var(--phase-learn-very-light); }
.cv-chip.is-active { border-color: var(--phase-learn-dark); background: var(--phase-learn-dark); color: var(--text-inverse); }
.cv-chip__count { font-size: var(--text-caption, 0.75rem); color: inherit; opacity: 0.7; }

/* --- Section headers on the index ---------------------------- */
.cv-section { padding: var(--space-6) 0 var(--space-2); }
.cv-section__title {
    margin: 0 0 var(--space-1, 4px);
    font-family: var(--font-heading);
    font-size: var(--text-h3, 1.25rem);
    color: var(--text-dark);
}
.cv-section__sub { margin: 0 0 var(--space-4); font-size: var(--text-small); color: var(--text-muted); }

/* --- Card grid ------------------------------------------------ */
.cv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
    padding-bottom: var(--space-6);
}
@media (max-width: 960px) { .cv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cv-grid { grid-template-columns: 1fr; } }

.cv-card {
    display: flex; flex-direction: column;
    background: var(--bg-white, #FFFFFF);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.cv-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: reduce) { .cv-card, .cv-chip { transition: none; } .cv-card:hover { transform: none; } }

.cv-card__media {
    aspect-ratio: 16 / 10;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.cv-card__media img { width: 100%; height: 100%; object-fit: contain; background: var(--bg-white, #FFFFFF); padding: var(--space-2); box-sizing: border-box; }

/* The designed fallback: typographic, deliberate, not apologetic. */
.cv-card__media--fallback {
    background: var(--phase-learn-very-light);
    border-bottom: 1px solid var(--phase-learn-light);
    padding: var(--space-4);
}
.cv-fallback {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: var(--text-h2, 1.5rem);
    line-height: 1.2;
    color: var(--phase-learn-dark);
    text-align: center;
}
.cv-fallback small {
    display: block;
    margin-top: var(--space-2);
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--text-caption, 0.75rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--phase-learn-dark);
    opacity: 0.75;
}

.cv-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); flex: 1 1 auto; }
.cv-card__name { margin: 0; font-size: var(--text-ui); font-weight: var(--font-semibold); color: var(--text-dark); }
.cv-card__line { margin: 0; font-size: var(--text-small); line-height: 1.5; color: var(--text-muted); }
.cv-card__credit { margin: auto 0 0; padding-top: var(--space-2); font-size: var(--text-meta); color: var(--text-muted); }
.cv-card__foot { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-2); }
.cv-card__license {
    display: inline-block;
    padding: var(--space-0-5, 2px) var(--space-2);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: var(--text-caption, 0.75rem);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    white-space: nowrap;
}
.cv-card__license--cc { border-color: var(--phase-learn-light); background: var(--phase-learn-very-light); color: var(--phase-learn-dark); }
.cv-card__cat { margin-left: auto; font-size: var(--text-caption, 0.75rem); font-weight: var(--font-semibold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray-500); }

/* --- Detail page ---------------------------------------------- */
.cv-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-8); padding: var(--space-6) 0 var(--space-10); align-items: start; }
@media (max-width: 960px) { .cv-detail { grid-template-columns: 1fr; } }

.cv-detail__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
.cv-pill {
    display: inline-block;
    padding: var(--space-0-5, 2px) var(--space-2-5, 10px);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: var(--text-caption, 0.75rem);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    white-space: nowrap;
}
.cv-pill--cat {
    border-color: var(--phase-learn-light);
    background: var(--phase-learn-very-light);
    color: var(--phase-learn-dark);
    font-weight: var(--font-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cv-pill--year { font-variant-numeric: tabular-nums; }
.cv-detail__title { margin: 0 0 var(--space-2); font-family: var(--font-heading); font-size: clamp(var(--text-h1), 4vw, var(--text-display)); line-height: 1.15; color: var(--text-dark); }
.cv-detail__line { margin: 0 0 var(--space-6); font-size: var(--text-h4, 1.125rem); line-height: 1.5; color: var(--text-muted); max-width: 62ch; }

.cv-detail__body h2 {
    margin: var(--space-8) 0 var(--space-3);
    font-family: var(--font-heading);
    font-size: var(--text-h3, 1.25rem);
    color: var(--text-dark);
}
.cv-detail__body h2:first-child { margin-top: 0; }
.cv-detail__body p, .cv-detail__body li { font-size: var(--text-body); line-height: 1.625; color: var(--text-dark); max-width: 68ch; }
.cv-detail__body ul { margin: 0; padding-left: var(--space-5); }
.cv-detail__body ol { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }

.cv-watchout {
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: var(--phase-learn-very-light);
    border: 1px solid var(--phase-learn-light);
    border-radius: var(--radius-lg);
}
.cv-watchout p { margin: 0; font-size: var(--text-small); line-height: 1.6; color: var(--text-dark); }
.cv-watchout strong { color: var(--phase-learn-dark); }

/* Attribution rail */
.cv-rail { position: sticky; top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.cv-rail__media { margin: 0; border: 1px solid var(--gray-200); border-radius: var(--radius-xl); overflow: hidden; background: var(--bg-white, #FFFFFF); }
.cv-rail__media img { display: block; width: 100%; height: auto; }
.cv-rail__media .cv-fallback { padding: var(--space-10) var(--space-4); }
.cv-rail__media--fallback { background: var(--phase-learn-very-light); border-color: var(--phase-learn-light); }
.cv-rail__imgcredit { margin: 0; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--gray-200); font-size: var(--text-caption, 0.75rem); color: var(--text-muted); background: var(--gray-50); }

.cv-attrib {
    background: var(--bg-white, #FFFFFF);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}
.cv-attrib h2 { margin: 0 0 var(--space-3); font-family: var(--font-heading); font-size: var(--text-h4, 1.125rem); color: var(--text-dark); }
.cv-attrib dl { margin: 0 0 var(--space-4); display: grid; grid-template-columns: auto 1fr; gap: var(--space-1, 4px) var(--space-3); }
.cv-attrib dt { font-size: var(--text-meta); font-weight: var(--font-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cv-attrib dd { margin: 0; font-size: var(--text-small); color: var(--text-dark); }
.cv-attrib__note { margin: 0 0 var(--space-4); font-size: var(--text-small); line-height: 1.6; color: var(--text-muted); }
.cv-attrib .ws-btn { width: 100%; justify-content: center; }
.cv-attrib__related { display: block; margin-top: var(--space-3); font-size: var(--text-small); color: var(--phase-learn-dark); }

/* Attribution footnote block (index) */
.cv-note { margin: var(--space-6) 0 var(--space-10); padding: var(--space-6); background: var(--gray-100); border-radius: var(--radius-xl); }
.cv-note h2 { margin: 0 0 var(--space-2); font-family: var(--font-heading); font-size: var(--text-h4, 1.125rem); color: var(--text-dark); }
.cv-note p { margin: 0 0 var(--space-2); max-width: 75ch; font-size: var(--text-small); line-height: 1.6; color: var(--text-muted); }
.cv-note p:last-child { margin-bottom: 0; }
.cv-note a { color: var(--phase-learn-dark); font-weight: var(--font-semibold); }

/* Lede inside the contact modal those two links open (js/canvas-contact.js). */
.cv-contact__lede { margin: 0 0 var(--space-4); font-size: var(--text-small); line-height: 1.6; color: var(--text-muted); }

/* Breadcrumb spacing on subpages */
.cv-crumbs { padding-top: var(--space-6); }

/* --- Find your canvas (guided recommender) -------------------- */
.cv-find {
    margin: 0 0 var(--space-6);
    padding: var(--space-5) var(--space-6);
    border: 1px solid var(--phase-learn-dark);
    border-radius: var(--radius-lg);
    background: var(--phase-learn-very-light);
}
.cv-find__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-4); flex-wrap: wrap;
}
.cv-find__title {
    margin: 0 0 var(--space-2); font-family: var(--font-heading);
    font-size: var(--text-h3, 1.25rem); line-height: 1.2; color: var(--text-dark);
}
.cv-find__invite { margin: 0; font-size: var(--text-body); color: var(--text-muted); max-width: 52ch; }
.cv-find__open, .cv-find__send {
    flex: none; border: 0; cursor: pointer;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    background: var(--phase-learn-dark); color: var(--bg-white);
    font-size: var(--text-small); font-weight: var(--font-semibold);
    font-family: inherit;
}
.cv-find__open:hover, .cv-find__send:hover { opacity: 0.9; }
.cv-find__body { margin-top: var(--space-4); }
.cv-find__thread { display: flex; flex-direction: column; gap: var(--space-3); }
.cv-find__msg p {
    margin: 0; display: inline-block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-body); line-height: 1.5;
}
.cv-find__msg--agent p { background: var(--bg-white); border: 1px solid var(--gray-200); color: var(--text-dark); }
.cv-find__msg--user { text-align: right; }
.cv-find__msg--user p { background: var(--phase-learn-light); color: var(--text-dark); }
.cv-find__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cv-find__starter { margin-top: var(--space-3); }
.cv-find__chips[hidden], .cv-find__form[hidden] { display: none; }
button.cv-find__chip { cursor: pointer; font-family: inherit; }
.cv-find__typing { display: none; gap: var(--space-1, 4px); padding: var(--space-2) 0; }
.cv-find.is-thinking .cv-find__typing { display: flex; }
.cv-find__typing span {
    width: 6px; height: 6px; border-radius: var(--radius-full);
    background: var(--phase-learn-dark);
    animation: cvFindDot 1s infinite var(--ease-out);
}
.cv-find__typing span:nth-child(2) { animation-delay: 0.15s; }
.cv-find__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cvFindDot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .cv-find__typing span { animation: none; opacity: 0.6; }
}
.cv-find__form { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.cv-find__input {
    flex: 1; padding: var(--space-2) var(--space-4);
    border: 1px solid var(--gray-300); border-radius: var(--radius-full);
    font-size: var(--text-body); font-family: inherit;
    background: var(--bg-white); color: var(--text-dark);
}
.cv-find__send:disabled, .cv-find__input:disabled { opacity: 0.5; cursor: default; }
.cv-find__reset {
    margin-top: var(--space-3); padding: 0;
    border: 0; background: none; cursor: pointer;
    font-size: var(--text-small); color: var(--phase-learn-dark);
    text-decoration: underline; font-family: inherit;
}
.cv-find__rec { margin-top: var(--space-2); }
.cv-find__best {
    margin: 0 0 var(--space-2);
    font-size: var(--text-meta); font-weight: var(--font-semibold);
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--phase-learn-dark);
}
.cv-find__why { margin: 0 0 var(--space-2); font-size: var(--text-small); color: var(--text-muted); font-style: italic; }
.cv-find__rec .cv-card { max-width: 420px; }
@media (max-width: 640px) {
    .cv-find { padding: var(--space-4); }
    .cv-find__head { flex-direction: column; align-items: flex-start; }
}

/* --- Directory pager ------------------------------------------ */
.cv-pager {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) 0 var(--space-8);
}
.cv-chip--disabled { opacity: 0.45; pointer-events: none; }
