/**
 * Connections mentor list + application drawer.
 *
 * Fonts and text color come from the theme. The only colors set here are
 * neutral grays plus two brand variables, which are filled in from
 * config/connections-config.php → 'brand' (or override them in the theme).
 *
 * @package WSC
 */
.wsc {
	/* Set on Connections → Settings → Mentor page colors. */
	--wsc-accent: #722161;       /* solid buttons, selected cards */
	--wsc-accent-text: #fff;     /* text on solid buttons */
	--wsc-secondary: var(--wsc-accent); /* outline buttons and links: text + border */
	--wsc-line: #ddd;
	--wsc-muted: #666;
	--wsc-surface: #fff;
	--wsc-soft: #f4f4f4;
	--wsc-drawer-w: 420px;
}
.wsc *, .wsc *::before, .wsc *::after { box-sizing: border-box; }

/* Toolbar */
.wsc-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 20px; }
.wsc-search { flex: 1 1 240px; max-width: 380px; padding: 10px 14px; border: 1px solid var(--wsc-line); border-radius: 8px; background: var(--wsc-surface); }
.wsc-count { color: var(--wsc-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.wsc-open { margin-left: auto; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--wsc-accent); color: var(--wsc-accent-text); font-weight: 700; cursor: pointer; }

/* Grid + cards */
.wsc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.wsc-card { background: var(--wsc-surface); border: 1px solid var(--wsc-line); border-radius: 10px; padding: 18px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-width: 0; }
.wsc-card[hidden] { display: none; }
.wsc-card.is-selected { border-color: var(--wsc-accent); box-shadow: 0 0 0 1px var(--wsc-accent); }
.wsc-card.is-off { opacity: .6; }
.wsc-who { display: flex; gap: 12px; align-items: center; }
.wsc-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.wsc-initials { display: grid; place-items: center; background: var(--wsc-soft); color: var(--wsc-secondary); font-weight: 700; font-size: 20px; }
.wsc-name { font-size: 17px; line-height: 1.25; margin: 0; }
.wsc-title { font-size: 13px; color: var(--wsc-muted); }
.wsc-mid { display: grid; gap: 6px; align-content: start; min-width: 0; }
.wsc-bio { font-size: 14px; color: var(--wsc-muted); }
.wsc-bio p { margin: 0 0 .6em; }
.wsc-bio.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wsc-more { background: none; border: 0; padding: 0; color: var(--wsc-secondary); font-weight: 600; font-size: 13px; cursor: pointer; justify-self: start; }
.wsc-pick { width: 100%; padding: 10px; border-radius: 8px; border: 1.5px solid var(--wsc-secondary); background: transparent; color: var(--wsc-secondary); font-weight: 700; cursor: pointer; }
.wsc-pick:disabled { border-color: var(--wsc-line); color: var(--wsc-muted); cursor: not-allowed; }
.wsc :focus-visible { outline: 3px solid var(--wsc-accent); outline-offset: 2px; }

/* Drawer */
.wsc-drawer { position: fixed; z-index: 99990; background: var(--wsc-surface); display: flex; flex-direction: column; transition: transform .25s ease; color: inherit; }
.wsc-dhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--wsc-line); }
.wsc-dhead h2 { font-size: 19px; margin: 0; }
.wsc-close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--wsc-muted); padding: 4px 8px; }
.wsc-dbody { overflow-y: auto; padding: 18px 20px 28px; flex: 1; }
.wsc-dbody .frm_forms { max-width: none; }

@media (min-width: 1000px) {
	.wsc-drawer { top: 0; right: 0; bottom: 0; width: var(--wsc-drawer-w); border-left: 1px solid var(--wsc-line); transform: translateX(100%); }
	body.admin-bar .wsc-drawer { top: 32px; }
	body.wsc-drawer-open .wsc-drawer { transform: none; box-shadow: -12px 0 32px rgba(10, 20, 40, .12); }
	/* Make room so the drawer never covers the mentor list. */
	/* Fallback if scripts are slow; mentor-directory.js replaces this with the actual overlap. */
	body.wsc-drawer-open .wsc { padding-right: calc(var(--wsc-drawer-w) + 24px); }
	.wsc-bar { display: none; }
	body.wsc-drawer-open .wsc-open { display: none; }
}
@media (max-width: 999px) {
	.wsc-drawer { left: 0; right: 0; bottom: 0; max-height: 88vh; border-top: 1px solid var(--wsc-line); border-radius: 16px 16px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom, 0px); }
	body.wsc-drawer-open .wsc-drawer { transform: none; box-shadow: 0 -12px 32px rgba(10, 20, 40, .18); }
	.wsc-open { display: none; }
	.wsc { padding-bottom: 90px; }
}

/* Phone bar */
.wsc-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99980; background: var(--wsc-accent); color: var(--wsc-accent-text); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
.wsc-bar button { background: var(--wsc-accent-text); color: var(--wsc-accent); border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.wsc-bar-text { font-size: 13px; margin-top: 4px; }
.wsc-dots { display: flex; gap: 4px; }
.wsc-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; }
.wsc-dots i.on { background: currentColor; }
body.wsc-drawer-open .wsc-bar { display: none; }

/* Picks (chips) inside the drawer */
.wsc-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--wsc-line); border-radius: 8px; font-size: 14px; }
.wsc-chip .wsc-avatar { width: 30px; height: 30px; font-size: 12px; flex: none; }
.wsc-chip span { flex: 1; min-width: 0; }
.wsc-chip button { background: none; border: 0; color: var(--wsc-muted); cursor: pointer; font-size: 16px; padding: 2px 6px; line-height: 1; }
.wsc-chip button:hover { color: inherit; }
.wsc-slot { padding: 8px 10px; border: 1px dashed var(--wsc-line); border-radius: 8px; font-size: 13px; color: var(--wsc-muted); }
.wsc-hint { font-size: 13px; color: var(--wsc-muted); margin: 4px 0 0; }

/* Hide the long checkbox list once the chips have replaced it (only when JS has run). */
/* The three pick dropdowns stay in the form (they are what gets submitted) but are replaced by the slots panel. */
.wsc-hidden-field { display: none !important; }

/* Fields stack in the narrow drawer. */
.wsc-dbody .frm_form_field.frm4,
.wsc-dbody .frm_form_field.frm6 { grid-column: span 12 / span 12; width: 100%; margin-left: 0; }
.wsc-dbody .frm_form_field.frm6.frm_first + .frm6 { margin-left: 0; }

@media (prefers-reduced-motion: reduce) { .wsc-drawer { transition: none; } }

/* Ranked slots in the drawer */
.wsc-slots { display: grid; gap: 10px; margin: 4px 0 18px; }
.wsc-slots-head { font-weight: 700; font-size: 15px; }
.wsc-slots > .wsc-hint { margin: -4px 0 2px; }
.wsc-slot-row { display: grid; gap: 4px; }
.wsc-slot-label { font-size: 13px; font-weight: 600; }
.wsc-slot-label .wsc-hint { font-weight: 400; margin: 0; display: inline; }
.wsc-slot.is-none { border-style: solid; background: var(--wsc-soft); }
.wsc-slot-row.has-error .wsc-slot, .wsc-slot-row.has-error .wsc-chip { border-color: #b32d2e; }
.wsc-slot-error { font-size: 13px; color: #b32d2e; }

/* Visitors: log-in banner, no buttons */
.wsc-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px; margin: 0 0 20px; border: 1px solid var(--wsc-line); border-left: 4px solid var(--wsc-accent); border-radius: 8px; background: var(--wsc-surface); }
.wsc-banner strong { display: block; font-size: 16px; margin-bottom: 2px; }
.wsc-banner span { color: var(--wsc-muted); font-size: 14px; }
.wsc-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wsc-btn { display: inline-block; padding: 10px 16px; border-radius: 8px; border: 1.5px solid; font-weight: 700; text-decoration: none; line-height: 1.3; }
.wsc-btn:hover, .wsc-btn:focus { opacity: .9; text-decoration: none; }
.wsc-card .wsc-status { margin: 0; font-size: 13px; font-weight: 600; color: var(--wsc-muted); }
.wsc.is-visitor { padding-bottom: 0; }

/* ─── Button colors ───
   Two styles: solid (accent background, accent text) and outline (secondary
   text and border). !important keeps theme link and button colors from
   overriding them; that's what made "Log in" pink on purple. */
.wsc a.wsc-btn, .wsc a.wsc-btn:link, .wsc a.wsc-btn:visited, .wsc a.wsc-btn:hover, .wsc a.wsc-btn:focus,
.wsc button.wsc-open, .wsc .wsc-bar button,
.wsc button.wsc-pick[aria-pressed="true"] {
	background: var(--wsc-accent) !important;
	border-color: var(--wsc-accent) !important;
	color: var(--wsc-accent-text) !important;
}
.wsc a.wsc-btn.wsc-btn-quiet, .wsc a.wsc-btn.wsc-btn-quiet:link, .wsc a.wsc-btn.wsc-btn-quiet:visited, .wsc a.wsc-btn.wsc-btn-quiet:hover, .wsc a.wsc-btn.wsc-btn-quiet:focus,
.wsc button.wsc-pick {
	background: transparent !important;
	border-color: var(--wsc-secondary) !important;
	color: var(--wsc-secondary) !important;
}
.wsc button.wsc-pick:disabled {
	border-color: var(--wsc-line) !important;
	color: var(--wsc-muted) !important;
}
/* The phone bar is accent-colored, so its button is reversed. */
.wsc .wsc-bar button { background: var(--wsc-accent-text) !important; color: var(--wsc-accent) !important; }

/* Logged-in line with Log out */
.wsc-account { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; margin: 0 0 10px; font-size: 14px; color: var(--wsc-muted); }
.wsc-account a { color: var(--wsc-secondary); font-weight: 600; }

/* Withdraw + closed state */
.wsc-withdraw { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--wsc-line); }
.wsc .wsc-link-danger { background: none !important; border: 0 !important; padding: 0; color: #a12a2a !important; font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 14px; }
.wsc-withdraw-confirm p { margin: 0 0 12px; font-size: 14px; }
.wsc-withdraw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wsc .wsc-withdraw-actions button.wsc-btn { cursor: pointer; font: inherit; font-weight: 700; background: var(--wsc-accent) !important; border-color: var(--wsc-accent) !important; color: var(--wsc-accent-text) !important; }
.wsc .wsc-withdraw-actions button.wsc-btn.wsc-btn-quiet { background: transparent !important; border-color: var(--wsc-secondary) !important; color: var(--wsc-secondary) !important; }
.wsc-withdraw-msg { margin: 8px 0 0; font-size: 14px; }
.wsc-withdraw-msg:empty { display: none; }
.wsc-note { font-size: 14px; background: var(--wsc-soft); border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; }
.wsc-mine { border: 1px solid var(--wsc-line); border-left: 4px solid var(--wsc-accent); border-radius: 8px; background: var(--wsc-surface); padding: 18px 20px; margin: 0 0 24px; }
.wsc-mine h2 { font-size: 20px; margin: 0 0 12px; }
.wsc-mine-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.wsc-mine-list dt { font-size: 13px; font-weight: 700; color: var(--wsc-muted); }
.wsc-mine-list dt .wsc-hint { font-weight: 400; display: block; margin: 0; }
.wsc-mine-list dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
