/* ─────────────────────────────────────────────────────────────
 * creator-programs.css
 * The UGC program tables on /for-creators/ (scripts/lib/creator-programs.mjs).
 * Builds on modal-site.css tokens (--mk-*) and the hairline .seo-table, so a
 * program table reads like every other table on the site. Bump
 * PROGRAMS_ASSET_VERSION in scripts/lib/creator-programs.mjs after editing.
 * ───────────────────────────────────────────────────────────── */

.cp-page {
  --cp-ink: var(--mk-ink, #121212);
  --cp-ink-2: var(--mk-ink-2, #3d3d44);
  --cp-muted: var(--mk-muted, #626269);
  --cp-muted-2: var(--mk-muted-2, #8a8a93);
  --cp-line: var(--mk-line, #ececef);
  --cp-line-2: var(--mk-line-2, #e2e2e7);
  --cp-primary: var(--mk-primary, #3847fe);
  --cp-soft: var(--mk-soft, #eef0ff);
  --cp-ease: var(--mk-ease, cubic-bezier(.23, 1, .32, 1));
}

.cp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* site-motion.js reveals a section once 12% of it is on screen. The program
   directory, and a long block once its rows stack as cards on a phone, can be
   too tall to ever reach that, so program sections stay put. */
.cp-page :is(.cp-directory, .cp-block).site-reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ── filter chips (revealed by creator-programs.js) ─────────── */

.cp-page .cp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 16px;
}
.cp-page .cp-filters[hidden] { display: none; }

.cp-page .cp-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--cp-line-2);
  color: var(--cp-ink-2);
  font: 500 13.5px/1 var(--mk-body, inherit);
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 140ms var(--cp-ease);
}
.cp-page .cp-chip span {
  color: var(--cp-muted-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transition: color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .cp-page .cp-chip:hover { box-shadow: inset 0 0 0 1px #c9cdf7; color: var(--cp-ink); }
}
.cp-page .cp-chip:active { transform: scale(.97); }
.cp-page .cp-chip:focus-visible { outline: 2px solid var(--cp-primary); outline-offset: 2px; }
.cp-page .cp-chip[aria-pressed="true"] {
  background: var(--cp-soft);
  box-shadow: inset 0 0 0 1px rgb(56 71 254 / .35);
  color: var(--cp-primary);
}
.cp-page .cp-chip[aria-pressed="true"] span { color: rgb(56 71 254 / .7); }

/* ── tables ────────────────────────────────────────────────── */

.cp-page .cp-table-wrap { margin: 18px 0 10px; }
.cp-page .cp-table-wrap:focus-visible { outline: 2px solid var(--cp-primary); outline-offset: 2px; }
.cp-page .cp-table { min-width: 680px; table-layout: fixed; }
.cp-page .cp-table-hub { min-width: 0; }

.cp-page .cp-table :is(th, td) {
  padding: 14px 12px;
  font-size: 14.5px;
  line-height: 1.45;
  vertical-align: top;
}
.cp-page .cp-table thead th { white-space: normal; vertical-align: bottom; }
.cp-page .cp-table thead th.is-sorted { color: var(--cp-ink); }
.cp-page .cp-table thead th svg {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
}

/* brand cell: name, domain, the researched summary */
.cp-page .cp-table tbody th {
  background: transparent;
  color: var(--cp-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.cp-page .cp-table thead th:first-child { width: 35%; }
.cp-page .cp-table:not(.cp-table-more, .cp-table-hub) thead th:nth-child(2) { width: 19%; }
.cp-page .cp-table:not(.cp-table-more, .cp-table-hub) thead th:last-child { width: 19%; }
.cp-page .cp-table-more thead th:first-child { width: 58%; }
.cp-page .cp-table-hub thead th:first-child { width: 46%; }
.cp-page .cp-table-hub tbody th { width: auto; min-width: 0; }
.cp-page .cp-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.cp-page .cp-name a { color: var(--cp-ink); text-decoration: underline; text-decoration-color: rgb(18 18 18 / .2); text-underline-offset: 3px; }
.cp-page .cp-name a:hover { color: var(--cp-primary); text-decoration-color: currentColor; }
.cp-page .cp-domain { color: var(--cp-muted-2); font-size: 12.5px; font-weight: 400; }
.cp-page .cp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
  color: var(--cp-muted);
  font-size: 12.5px;
  font-weight: 400;
}
.cp-page .cp-meta:empty { display: none; }
.cp-page .cp-tag {
  padding: 2px 6px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--cp-line-2);
  color: var(--cp-ink-2);
  font-size: 11.5px;
  line-height: 1.25;
}
.cp-page .cp-summary {
  display: block;
  max-width: 46ch;
  margin-top: 6px;
  color: var(--cp-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

/* pay model badge */
.cp-page .cp-model {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--mk-subtle, #f7f7f8);
  box-shadow: inset 0 0 0 1px var(--cp-line);
  color: var(--cp-ink-2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
}
.cp-page .cp-model.is-base-plus-view-bonus { background: var(--cp-soft); box-shadow: inset 0 0 0 1px rgb(56 71 254 / .18); color: #2b39c9; }
.cp-page .cp-model.is-flat-per-video { background: var(--mk-success-soft, #e7f6ef); box-shadow: inset 0 0 0 1px rgb(8 122 80 / .16); color: var(--mk-success, #087a50); }
.cp-page .cp-model.is-monthly-retainer { background: #fff6e6; box-shadow: inset 0 0 0 1px rgb(168 104 0 / .18); color: #8a5600; }
.cp-page .cp-model.is-unchecked { background: transparent; box-shadow: inset 0 0 0 1px var(--cp-line-2); color: var(--cp-muted-2); }

/* numbers */
.cp-page .cp-base strong,
.cp-page .cp-num strong {
  display: block;
  color: var(--cp-ink);
  font-family: var(--mk-display, inherit);
  font-size: 16.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.cp-page :is(.cp-base, .cp-num, .cp-source) small {
  display: block;
  margin-top: 3px;
  color: var(--cp-muted-2);
  font-size: 12px;
  line-height: 1.35;
}
.cp-page .cp-base:is(.is-unpublished, .is-unchecked, .is-none) strong {
  color: var(--cp-muted);
  font-family: var(--mk-body, inherit);
  font-size: 13.5px;
  font-weight: 500;
}


.cp-page .cp-source a {
  color: var(--cp-primary);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: break-word;
}
.cp-page .cp-source a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cp-page .cp-source svg { width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; }
.cp-page .cp-muted { color: var(--cp-muted-2); font-size: 13px; }

/* filtered rows ease back in */
.cp-page .cp-table tbody tr.cp-in { animation: cp-in 220ms var(--cp-ease) both; }
@keyframes cp-in { from { opacity: 0; transform: translateY(4px); } }

.cp-page .cp-empty {
  margin: 0 0 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--mk-subtle, #f7f7f8);
  color: var(--cp-muted);
  font-size: 14.5px;
}
.cp-page .cp-empty[hidden] { display: none; }

/* ── the "more programs" disclosure ───────────────────────── */

.cp-page .cp-more { margin-top: 26px; }
.cp-page .cp-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--mk-ring, 0 0 0 1px #e2e2e7);
  color: var(--cp-ink);
  font-weight: 600;
  font-size: 15.5px;
  list-style: none;
  cursor: pointer;
  transition: box-shadow 200ms ease;
}
.cp-page .cp-more > summary::-webkit-details-marker { display: none; }
.cp-page .cp-more > summary:hover { box-shadow: var(--mk-ring-lift, 0 0 0 1px #d6d8f5); }
.cp-page .cp-more > summary:focus-visible { outline: 2px solid var(--cp-primary); outline-offset: 2px; }
.cp-page .cp-more > summary svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--cp-muted);
  transition: transform 200ms var(--cp-ease);
}
.cp-page .cp-more[open] > summary svg { transform: rotate(180deg); }
.cp-page .cp-more > p { margin-top: 18px; }

/* ── block footer link ────────────────────────────────────── */

.cp-page .cp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 14px;
}
.cp-page .cp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cp-primary);
  font-weight: 600;
  text-decoration: none;
}
.cp-page .cp-link svg { width: 15px; height: 15px; transition: transform 160ms var(--cp-ease); }
@media (hover: hover) and (pointer: fine) {
  .cp-page .cp-link:hover svg { transform: translateX(3px); }
}
.cp-page .cp-foot span { color: var(--cp-muted-2); font-size: 13.5px; }

/* ── phones: rows become cards ────────────────────────────── */

@media (max-width: 760px) {
  .cp-page .cp-filters {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding: 2px 16px 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent);
  }
  .cp-page .cp-filters::-webkit-scrollbar { display: none; }
  .cp-page .cp-chip { flex: none; }
  .cp-page .cp-table-wrap { overflow: visible; }
  .cp-page .cp-table { min-width: 0; table-layout: auto; }
  .cp-page .cp-table :is(tbody, tr, th, td) { display: block; }
  .cp-page .cp-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .cp-page .cp-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 14px;
    padding: 16px;
    border-bottom: 1px solid var(--cp-line);
  }
  .cp-page .cp-table tbody tr:last-child { border-bottom: 0; }
  .cp-page .cp-table tbody tr[hidden] { display: none; }
  .cp-page .cp-table :is(th, td) { padding: 0; border: 0; }
  .cp-page .cp-table tbody th { grid-column: 1 / -1; width: auto; min-width: 0; }
  .cp-page .cp-summary { max-width: none; }
  .cp-page .cp-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--cp-muted-2);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .cp-page .cp-table-hub tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cp-page .cp-base strong,
  .cp-page .cp-num strong { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .cp-page .cp-table tbody tr.cp-in { animation: cp-fade 160ms ease both; }
  @keyframes cp-fade { from { opacity: 0; } }
  .cp-page :is(.cp-chip, .cp-link svg, .cp-more > summary svg) { transition: none; }
}
