/*
 * The VocabCue learning card (markup: includes/vocabcue-card.php), shared by raisul/card-demo and raisul/card-anatomy.
 * VocabCue's own component, not a Raisul Builds interpretation: the study face follows runtime-card.css and the
 * elevated placement (theme visual-vocabulary 3.20.0); the recall, review and done faces follow VocabCue's recall
 * preview (.vv-rp in marketing.css). Values are VocabCue's tokens, copied below. data-step on the card is one of:
 * study, recall, answer, done. Without JS the study face shows; every control that needs JS is rendered [hidden].
 */

.rb-vc-place {
	/* VocabCue tokens (site.css :root). */
	--vv-inset: #F9F9F9;
	--vv-on-ink: #F9F9F9;
	--vv-surface: #FFFFFF;
	--vv-subtle: #F0EFEC;
	--vv-ink: #16150F;
	--vv-raised-ink: #121110;
	--vv-near-black: #000001;
	--vv-secondary: #56544E;
	--vv-muted: #6E6B63;
	--vv-accent: #FF4D00;
	--vv-accent-text: #BE3A00;
	--vv-accent-wash: #FFF0E9;
	--vv-success: #0F6B45;
	--vv-warning: #8A5A00;
	--vv-error: #A5231B;
	--vv-focus: #1F4E79;
	--vv-border: rgba(22, 21, 15, .12);
	--vv-border-strong: rgba(22, 21, 15, .22);
	--vv-font-body: var(--wp--preset--font-family--body, Inter, sans-serif);
	--vv-font-heading: var(--wp--preset--font-family--display, Montserrat, sans-serif);
	--vv-font-bn: "Noto Sans Bengali", "Nirmala UI", Vrinda, "Shonar Bangla", sans-serif;
	--vv-fast: 140ms;
	--vv-standard: 200ms;
	--vv-ease: cubic-bezier(.2, 0, .2, 1);
	--vv-ease-enter: cubic-bezier(.05, .7, .1, 1);
}

/* .vv-runtime-placement--elevated: a soft orange pool under the card, a restrained resting shadow, and on hover or
   focus a 2px lift with a warmer shadow and an orange-tinted border. */
.rb-vc-place { position: relative; isolation: isolate; min-width: 0; max-width: 460px; margin-inline: auto; }
.rb-vc-place::before {
	content: "";
	position: absolute;
	z-index: -1;
	left: 10%;
	right: 10%;
	bottom: -10px;
	height: 34%;
	border-radius: 50%;
	background: rgba(255, 77, 0, .11);
	filter: blur(24px);
	pointer-events: none;
}

.rb-vc {
	width: 100%;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--vv-border);
	border-radius: 20px;
	background: var(--vv-surface);
	color: var(--vv-ink);
	font: 400 16px/1.6 var(--vv-font-body);
	box-shadow: 0 18px 42px rgba(22, 21, 15, .09), 0 9px 24px rgba(255, 77, 0, .06);
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) and (pointer: fine) {
	.rb-vc-place:hover > .rb-vc { border-color: rgba(255, 77, 0, .32); box-shadow: 0 21px 48px rgba(22, 21, 15, .1), 0 11px 30px rgba(255, 77, 0, .1); transform: translateY(-2px); }
}
.rb-vc-place:focus-within > .rb-vc { border-color: rgba(255, 77, 0, .32); box-shadow: 0 21px 48px rgba(22, 21, 15, .1), 0 11px 30px rgba(255, 77, 0, .1); transform: translateY(-2px); }

.rb-vc [hidden] { display: none !important; }
.rb-vc p { margin: 0; color: inherit; }
.rb-vc [lang="bn"] { font-family: var(--vv-font-bn); line-height: 1.7; }
.rb-vc button { touch-action: manipulation; min-height: 44px; cursor: pointer; }
.rb-vc :is(button, input):focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 3px; }

.rb-vc__copy { display: grid; gap: 0; padding: 26px 28px 22px; }
/* Vertical rhythm (VocabCue: header + * 16px, meaning and example 20px). */
.rb-vc__copy > .rb-vc__pron { margin-top: 16px; }
.rb-vc__copy > :is(.rb-vc__meaning, .rb-vc__example, .rb-vc__go, .rb-vc__try, .rb-vc__answer, .rb-vc__done) { margin-top: 20px; }
.rb-vc__top:not([hidden]) + .rb-vc__head { margin-top: 14px; }

.rb-vc .rb-vc__label { font: 600 11.5px/1.5 var(--vv-font-body); letter-spacing: .11em; text-transform: uppercase; color: var(--vv-muted); }
.rb-vc .rb-vc__target {
	margin: 8px 0 0;
	font: 700 clamp(26px, 3vw, 36px)/1.16 var(--vv-font-heading);
	letter-spacing: -.045em;
	color: var(--vv-ink);
	overflow-wrap: anywhere;
}

/* Pronunciation: UK and US, then the respelling. */
.rb-vc__pron { display: grid; gap: 6px; font-size: 14px; color: var(--vv-secondary); }
.rb-vc__accents { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rb-vc__respell { min-width: 0; overflow-wrap: anywhere; }

.rb-vc__audio-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rb-vc__audio-row:empty { display: none; }
.rb-vc__audio {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-shrink: 0;
	padding: 7px 11px;
	border: 1px solid var(--vv-border);
	border-radius: 999px;
	background: var(--vv-inset);
	color: var(--vv-ink);
	font: 500 12px/1.4 var(--vv-font-body);
}
.rb-vc__speaker { width: 28px; height: 22px; flex: none; overflow: visible; }
.rb-vc__wave { color: var(--vv-accent); }
.rb-vc__audio:hover { background: var(--vv-subtle); }
.rb-vc__audio[aria-pressed="true"] { background: var(--vv-accent-wash); border-color: var(--vv-accent); box-shadow: inset 0 -2px var(--vv-accent); }
.rb-vc__audio.is-playing .rb-vc__wave { animation: rb-vc-wave 1.05s ease-out infinite; transform-origin: 13px 12px; }
.rb-vc__audio.is-playing .rb-vc__wave:nth-child(2) { animation-delay: .12s; }
.rb-vc__audio.is-playing .rb-vc__wave:nth-child(3) { animation-delay: .24s; }
@keyframes rb-vc-wave { 0%, 100% { opacity: .35; transform: translateX(0); } 50% { opacity: 1; transform: translateX(1px); } }

/* Meaning: Definition / বাংলা অর্থ, one at a time. */
.rb-vc__switch { display: inline-flex; justify-self: start; max-width: 100%; gap: 2px; margin-bottom: 8px; padding: 3px; border: 1px solid var(--vv-border); border-radius: 999px; background: var(--vv-subtle); }
.rb-vc__switch button { padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--vv-secondary); font: 500 13px/1.4 var(--vv-font-body); }
.rb-vc__switch button[lang="bn"] { font-family: var(--vv-font-bn); line-height: 1.4; }
.rb-vc__switch button[aria-pressed="true"] { background: var(--vv-surface); color: var(--vv-ink); box-shadow: 0 2px 0 var(--vv-accent); }
.rb-vc__meaning { display: grid; }
.rb-vc .rb-vc__cue[data-panel="bn"] { font-size: 22px; }

/* Example. */
.rb-vc .rb-vc__example-copy { margin-top: 10px; padding-left: 16px; border-left: 2px solid var(--vv-accent); }

/* Illustration: full width at the foot of the card. */
.rb-vc__media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--vv-surface); }
.rb-vc__image { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: contain; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* ---------- Recall, review and done faces (VocabCue's recall preview) ---------- */

.rb-vc__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rb-vc__mode {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 11px 5px 8px;
	border-radius: 999px;
	background: var(--vv-accent-wash);
	color: var(--vv-accent-text);
	font: 700 12.5px/1.5 var(--vv-font-heading);
	letter-spacing: .02em;
}
.rb-vc__mode-dot { position: relative; width: 14px; height: 14px; border: 1.75px solid currentColor; border-radius: 50%; }
.rb-vc__mode-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
.rb-vc[data-step="recall"] .rb-vc__cue[data-panel="en"] { font-size: 18.5px; line-height: 1.45; text-wrap: pretty; }
.rb-vc[data-step="recall"] .rb-vc__cue[data-panel="bn"] { font-size: 20px; }

.rb-vc__try, .rb-vc__answer, .rb-vc__done { display: grid; gap: 10px; }
.rb-vc .rb-vc__ask { font-size: 14px; color: var(--vv-secondary); }
.rb-vc__field { position: relative; display: flex; align-items: center; }
.rb-vc__input {
	width: 100%;
	min-height: 52px;
	padding: 10px 16px;
	border: 1.5px solid var(--vv-border-strong);
	border-radius: 16px;
	background: var(--vv-inset);
	color: var(--vv-ink);
	font: 400 17px/1.3 var(--vv-font-body);
	transition: border-color var(--vv-fast) var(--vv-ease), background-color var(--vv-fast) var(--vv-ease);
}
.rb-vc .rb-vc__input:focus { outline: 3px solid var(--vv-focus); outline-offset: 2px; border-color: var(--vv-focus); background: var(--vv-surface); }
.rb-vc__input[aria-invalid="true"] { border-color: var(--vv-error); }
.rb-vc__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 30px; }
.rb-vc :is(.rb-vc__hint, .rb-vc__again) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--vv-secondary);
	font: 700 14px/1.2 var(--vv-font-heading);
	transition: background-color var(--vv-fast) var(--vv-ease), color var(--vv-fast) var(--vv-ease), transform 90ms var(--vv-ease);
}
.rb-vc .rb-vc__hint { min-height: 36px; margin-block: -3px; margin-inline-start: -12px; padding: 6px 12px; font-size: 13.5px; }
.rb-vc .rb-vc__again { justify-self: start; margin-inline-start: -14px; }
.rb-vc__shape { padding: 3px 12px; border: 1px dashed var(--vv-border-strong); border-radius: 999px; color: var(--vv-secondary); font: 700 14px/1.5 var(--vv-font-heading); letter-spacing: .14em; }
.rb-vc__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb-vc__btn {
	min-height: 48px;
	padding: 8px 14px;
	white-space: nowrap;
	border: 1.5px solid var(--vv-border-strong);
	border-radius: 999px;
	background: var(--vv-surface);
	color: var(--vv-ink);
	font: 700 15px/1.2 var(--vv-font-heading);
	transition: background-color var(--vv-fast) var(--vv-ease), border-color var(--vv-fast) var(--vv-ease), transform 90ms var(--vv-ease);
}
.rb-vc__btn--primary { border-color: var(--vv-near-black); background: var(--vv-near-black); color: var(--vv-on-ink); }
.rb-vc__go .rb-vc__btn { padding-inline: 22px; }

.rb-vc__answer { padding-top: 14px; border-top: 1px solid var(--vv-border); }
.rb-vc__answer:not([hidden]), .rb-vc__done:not([hidden]), .rb-vc__try:not([hidden]) { animation: rb-vc-rise 320ms var(--vv-ease-enter) backwards; }
@keyframes rb-vc-rise { from { opacity: 0; transform: translateY(10px); } }
.rb-vc .rb-vc__verdict { display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.rb-vc__verdict:empty { display: none; }
.rb-vc__verdict b { font-weight: 700; }
.rb-vc__verdict::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; transform: translateY(1px); }
.rb-vc .rb-vc__verdict[data-outcome="got"] { color: var(--vv-success); }
.rb-vc .rb-vc__verdict[data-outcome="almost"] { color: var(--vv-warning); }
.rb-vc .rb-vc__verdict[data-outcome="forgot"] { color: var(--vv-error); }
.rb-vc__rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.rb-vc__rate button {
	position: relative;
	padding: 8px 10px;
	border: 1.5px solid var(--vv-border-strong);
	border-radius: 14px;
	background: var(--vv-surface);
	color: var(--vv-ink);
	font: 700 14.5px/1.2 var(--vv-font-heading);
	transition: background-color var(--vv-fast) var(--vv-ease), border-color var(--vv-fast) var(--vv-ease), transform 90ms var(--vv-ease);
}
.rb-vc__rate button.is-suggested { border-color: var(--vv-accent); box-shadow: 0 0 0 3px rgba(255, 77, 0, .14); }
.rb-vc__rate button.is-suggested::after {
	content: "Suggested";
	position: absolute;
	left: 50%;
	top: -9px;
	transform: translateX(-50%);
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--vv-accent);
	color: #fff;
	font: 700 10px/1.5 var(--vv-font-body);
	letter-spacing: .04em;
	white-space: nowrap;
}
.rb-vc__rate button[aria-pressed="true"] { border-color: var(--vv-near-black); background: var(--vv-near-black); color: var(--vv-on-ink); }
.rb-vc__rate button[aria-pressed="true"]::after { display: none; }
.rb-vc .rb-vc__due { padding: 12px 14px; border-radius: 14px; background: var(--vv-accent-wash); color: var(--vv-ink); font-size: 14.5px; line-height: 1.5; }

:is(.rb-vc__btn, .rb-vc__rate button, .rb-vc__hint, .rb-vc__again):active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
	.rb-vc__btn:not(.rb-vc__btn--primary):hover,
	.rb-vc__rate button:not([aria-pressed="true"]):hover { border-color: rgba(255, 77, 0, .5); background: var(--vv-accent-wash); }
	.rb-vc__btn--primary:hover { background: var(--vv-raised-ink); }
	.rb-vc :is(.rb-vc__hint, .rb-vc__again):hover { background: var(--vv-accent-wash); color: var(--vv-accent-text); }
}

/* ---------- Which parts each face shows ---------- */

/* Recall: the expression and its sound are hidden; the meaning and the illustration are the cue. */
.rb-vc[data-step="recall"] :is(.rb-vc__head, .rb-vc__pron, .rb-vc__example) { display: none; }
/* Review: the expression comes back with its sound; the example waits. */
.rb-vc[data-step="answer"] .rb-vc__example { display: none; }
/* Remember: the expression and when it comes back. */
.rb-vc[data-step="done"] :is(.rb-vc__pron, .rb-vc__meaning, .rb-vc__example) { display: none; }

@media (max-width: 550px) {
	.rb-vc-place { max-width: none; }
	.rb-vc__copy { padding: 20px 18px 18px; }
	.rb-vc__copy > .rb-vc__pron { margin-top: 14px; }
	.rb-vc__copy > :is(.rb-vc__meaning, .rb-vc__example, .rb-vc__go, .rb-vc__try, .rb-vc__answer, .rb-vc__done) { margin-top: 18px; }
	.rb-vc .rb-vc__target { font-size: 28px; }
	.rb-vc__btn { padding-inline: 8px; font-size: 14px; }
	.rb-vc[data-step="recall"] .rb-vc__cue[data-panel="en"] { font-size: 17px; }
}
@media (max-width: 350px) {
	.rb-vc__copy { padding: 18px 16px 16px; }
	.rb-vc .rb-vc__target { font-size: 26px; }
	.rb-vc__switch button { padding-inline: 12px; }
	.rb-vc__audio { padding-inline: 8px; }
	.rb-vc__audio-row { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.rb-vc-place * { transition-duration: 1ms !important; animation: none !important; }
	.rb-vc-place:hover > .rb-vc, .rb-vc-place:focus-within > .rb-vc { transform: none; }
}
