/*
Theme Name:        Viva Talent
Theme URI:         https://vivatalent.b1gdigital.com
Author:            B1G Digital
Author URI:        https://b1gdigital.com
Description:       Classic PHP theme for Viva Talent, built from the Viva Talent Storybook (storybook/). Design tokens and components live in css/ and are synced from the Storybook with bin/sync-storybook-css.sh.
Version:           0.21.2
Requires at least: 6.6
Tested up to:      7.1
Requires PHP:      8.1
License:           Proprietary
Text Domain:       viva-talent
*/

/*
 * WordPress-layer rules only. The design system lives in css/ (synced verbatim from the Storybook);
 * this file holds states the WordPress templates need that the Storybook does not draw, each built
 * from existing Storybook tokens. Loaded last.
 */

/* Pagination: Previous on the first page / Next on the last page (03) — the 38% disabled token,
   as .vt-btn[aria-disabled] uses in components.css (dp-uiux D4). */
.vt-pagination__page[aria-disabled="true"] {
	opacity: var(--vt-state-disabled-opacity);
	cursor: not-allowed;
}

/* 05 Apply, question 6 follow-up: disabled until "Yes" (js/wp/apply.js), shown with the same 38%
   disabled token (dp-uiux re-gate R3). */
.cv-question .cv-field.is-disabled {
	opacity: var(--vt-state-disabled-opacity);
}
.cv-question .cv-field.is-disabled .cv-textarea {
	cursor: not-allowed;
}

/* 04 Job Detail with no description blocks at all (QA N10). The Storybook has no rule for this; the
   simplest clean layout keeps the apply + share cards in their own 360px column, left-aligned, so no
   empty column is left beside them. Flagged for dp-uiux. */
@media (min-width: 1024px) {
	.jd-content__grid--cards-only {
		grid-template-columns: 360px;
	}
	.jd-content__grid--cards-only .jd-apply,
	.jd-content__grid--cards-only .jd-share {
		grid-column: 1;
	}
}

/* 05 Apply, server-error line: it receives focus programmatically (tabindex=-1, read out via
   role=alert) but is not interactive, and the Storybook draws no focus state for a message, so
   the browser's default ring is not shown (dp-uiux N15). */
[data-apply-error]:focus {
	outline: none;
}

/* 05 / 08 "Check your details": the fields inside a repeating row (Employment History, Education,
   Certifications) get the Storybook's 16px gap; .cv-section spaces only its direct children, and
   the row wrapper is a plain block (dp-uiux F1). */
.cv-section [data-row] {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* 05 / 08 Skills with no chips yet: the empty list takes no flex gap (dp-uiux N18). */
.cv-chips:empty {
	display: none;
}

/* 01 Home hero stats: the markup puts <dt> before <dd> (HTML order, read label-first — QA F-07);
   the Storybook draws the number above its label, so the number is moved back on top. */
.hm-proof__stat > .hm-proof__num {
	order: -1;
}

/* Footer Subscribe while Job Alerts do not exist yet (QA F-02): a polite inline note in the
   footer's own text style; nothing is sent. */
.vt-footer__soon[hidden] {
	display: none;
}

/* 15 Login · Register (templates/login-register.php). The Storybook draws one form (Sign in) as the
   card itself; WordPress has three views, each a <form class="lr-panel"> inside the card, laid out
   exactly like the card's own column (same 20px gap). Flagged for dp-uiux. */
.lr-panel {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.lr-panel[hidden] {
	display: none;
}

/* "I am a...": real radios (keyboard and no-JS) drawn as the Storybook's segmented buttons; the
   checked one takes the .lr-seg[aria-checked="true"] colours from css/pages/login-register.css. */
.lr-seg {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.lr-seg:has(input:checked) {
	background: var(--cliente-p1-rol-deep);
	color: var(--vt-base-white);
}
.lr-seg:has(input:focus-visible) {
	outline: 3px solid var(--vt-raw-state-focus); /* the focus ring of every Storybook control */
	outline-offset: 0;
}

/* Password hint and the privacy tick (not drawn by the Storybook): the meta text style of the page;
   the tick row wraps, unlike "Keep me signed in". */
.lr-hint {
	font-size: 13px;
	line-height: 16px;
	color: var(--vt-semantic-meta);
}
.lr-consent {
	white-space: normal;
	align-items: flex-start;
}
.lr-consent a {
	color: var(--cliente-p1-rol-primary);
	font-weight: 600;
}

/* Server answer line: focused on load so it is read out, not interactive (as 05's, dp-uiux N15). */
[data-lr-answer]:focus {
	outline: none;
}
.lr-panel > .vt-err--row {
	margin-top: 0;
}

/* 21 Article: the post content sits in .ar-prose, which takes no box of its own, so its paragraphs,
   headings, quotes and lists are spaced by .ar-article's own 22px column gap, as the Storybook draws. */
.ar-prose {
	display: contents;
}
.ar-prose > :where(figure, .wp-block-image) img {
	border-radius: var(--vt-radius-24);
}

/* 17 Resources: the empty / no-match line in Latest (not drawn by the Storybook; flagged). */
.rs-latest__empty {
	margin-top: 32px;
}

/* 17 Resources: the filter's visible Apply button (QA S2 B3 — no submit-on-change, a visible
   focusable control). Secondary pill, as tall as the 56px fields beside it; full width on mobile. */
.rs-filter__apply {
	height: 56px;
	align-self: stretch;
}
@media (min-width: 1024px) {
	.rs-filter__apply {
		align-self: flex-end;
	}
}

/* 14 / 19: the server error line takes focus (js/wp/enquiry.js) so it is read first; it is a message,
   not a control, so it shows no focus ring (dp-uiux D1). */
[data-enquiry-error]:focus {
	outline: none;
}

/* 10 / 20 — dp-uiux re-gate (2026-10-21), B1G additions not drawn by the Storybook. */
/* F1: the server error line takes focus so it is read first; it is a message, not a control. */
[data-dashboard-error]:focus {
	outline: none;
}
/* F3: tabs with no page yet (Profile, Settings) look and act disabled. */
.vt-tab[aria-disabled="true"] {
	opacity: var(--vt-state-disabled-opacity);
	cursor: not-allowed;
}
/* F4: the application shown in the side cards. */
.cd-tr[aria-current="true"] {
	border-radius: 16px;
	background: var(--vt-semantic-sunken);
}
.cd-app[aria-current="true"] {
	box-shadow: inset 0 0 0 2px var(--cliente-p1-rol-secondary);
}
.cd-joblink {
	color: inherit;
	text-decoration: none;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.cd-joblink:hover,
.cd-joblink:focus-visible {
	text-decoration: underline; /* dp-uiux note 2: underline on hover / focus only */
}
.cd-detail__job {
	font-size: 15px;
	line-height: 18px;
	font-weight: 600;
	color: var(--vt-semantic-ink);
}
#cd-ladder-title {
	scroll-margin-top: 24px;
}
/* F2: the chosen file's name, on its own line under the slot's buttons. */
.cd-slot .cd-slot__chosen {
	text-transform: none; /* dp-uiux note 1: "Selected: …" in sentence case, not the label caps */
	letter-spacing: normal;
	white-space: normal;
	overflow-wrap: anywhere;
}
/* Error toast: the same toast with an error mark instead of the green success tick. */
.vt-toast--error .vt-toast__icon {
	background: var(--vt-state-error);
	background-image: none;
	position: relative;
}
.vt-toast--error .vt-toast__icon::after {
	content: "!";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-weight: 800;
	font-size: 15px;
	color: var(--vt-base-white);
}
/* 10: the status-email switch until the emails exist (dp-qa N2). */
.cd-toggle--soon {
	cursor: default;
}
.cd-toggle--soon .cd-switch:disabled {
	opacity: var(--vt-state-disabled-opacity);
	cursor: not-allowed;
}
.cd-toggle__soon {
	font-weight: 500;
	color: var(--vt-semantic-meta);
}

/* 20: the Job alerts placeholder line (not drawn; B1G placeholder until the Alerts add-on) wraps, so it
   never runs past the 375 column the way the Storybook's one-line empty state would (nowrap). */
.ja-alerts .ja-empty__text {
	white-space: normal;
}

/* 12: the server error line takes focus; disabled "How We Work" (no page yet). */
[data-vacancy-error]:focus {
	outline: none;
}
.fm-sidecard__link[aria-disabled="true"] {
	opacity: var(--vt-state-disabled-opacity);
	cursor: not-allowed;
}

/* 13 Employer Portal (B1G, not drawn): empty state, the selected vacancy / applicant, the record's stage forms. */
.ep-empty {
	font-size: 15px;
	line-height: 18px;
	color: var(--vt-semantic-body);
}
.ep-table tbody tr[aria-current="true"] td {
	background: var(--vt-neutral-50);
}
.ep-applicant[aria-current="true"] .ep-applicant__name {
	color: var(--cliente-p1-rol-secondary);
}
.ep-record__form {
	display: contents;
}

/* 12: continuing a saved vacancy (N5; B1G, not drawn). */
.rv-editing {
	font-size: 15px;
	line-height: 18px;
	color: var(--vt-semantic-body);
}
.rv-editing a {
	margin-left: 8px;
	font-weight: 600;
	color: var(--cliente-p1-rol-primary);
}
/* 13: the action column is 86px in Figma (fits "Open →"); "Continue editing →" (N5, B1G) needs 150px. */
.ep-table th:nth-child(5) {
	width: 150px;
}

/* 05b picker: the upload pane is hidden while a saved CV is picked (js/wp/apply.js). */
[data-cv-upload-pane][hidden] {
	display: none;
}

/* 05b State B: the keep block and the upload row's arrow are hidden until / once a file is chosen (js/wp/apply.js). */
[data-cv-keep][hidden],
.cv-option__icon[hidden] {
	display: none;
}

/* 13 (dp-uiux S5b note): «Changes requested» gets its own pill, apart from the filled lime «Pending approval» —
   white with the lime stroke of the Changes requested notice (B1G, not drawn). */
.vt-status--changes {
	background: var(--vt-base-white);
	box-shadow: inset 0 0 0 1.5px var(--vt-raw-lime);
	color: var(--cliente-p1-rol-deep);
}
/* 13: "Open record" lands with the record clear of the top edge (dp-uiux S5b note). Below 1024 the fixed
   60px mobile bar (.vt-mini, js/motion.js) covers the top, so it lands 24px under the bar (dp-qa P3). */
#ep-record {
	scroll-margin-top: 24px;
}
@media (max-width: 1023.98px) {
	#ep-record,
	#cd-ladder-title,
	.cd-panel {
		scroll-margin-top: 84px;
	}
}
/* 10 CV replacement with auto-read: one panel at a time (js/wp/dashboard.js); .cd-panel sets display:flex. */
.cd-panel[hidden],
.cd-panel__text[hidden] {
	display: none;
}
/* The panel itself takes focus only so it is read first (as [data-dashboard-error]); no ring around the whole card. */
.cd-panel[tabindex="-1"]:focus {
	outline: none;
}
/* 05b State B: Remove is a <button> drawn as the Storybook's text link. */
button.cv-option__remove {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
}
/* dp-uiux N1 (a8917cf): the Storybook focus ring (3px outside) on the Remove button. */
.cv-option__remove:focus-visible {
	outline: 3px solid var(--vt-raw-state-focus);
	outline-offset: 2px;
}
