/*
Theme Name: VoteRiders LMS
Theme URI: https://voteriders.org/
Description: Brand child theme for the internal volunteer LMS. Applies the VoteRiders
  typeface pairing (Etna for headings, Config for body) and brand blue on top of
  Automattic's official Sensei "Course" block theme. All layout and Sensei templates
  come from the parent — this theme only carries brand.
Author: VoteRiders
Template: course
Version: 1.15.5
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: voteriders
*/

/*
 * Nearly everything lives in theme.json. Only rules that theme.json cannot express
 * belong here.
 */

/*
 * Config is a variable font with three axes:
 *
 *     wght  100 → 900   (default 100, i.e. Thin)
 *     wdth   50 → 100   (default  50, i.e. Condensed)
 *     slnt    0 →   9   (default   0, upright)
 *
 * Two of those defaults are not what we want, and the slant axis runs the *wrong
 * way*: the OpenType convention is that `slnt` is negative for a rightward lean,
 * so a 0→9 positive range is non-standard. Chromium leaves it at the 0 default and
 * renders upright; Safari resolves it to the slanted extreme, which made every
 * button, nav link and paragraph render italic on iOS even though the computed
 * `font-style` is `normal` everywhere.
 *
 * Pin the axes explicitly instead of trusting each engine's mapping. `wght` is
 * deliberately NOT listed: axes omitted from font-variation-settings stay driven by
 * the corresponding CSS property, so `font-weight` (and <strong>) keep working.
 */
body,
.wp-site-blocks {
	font-variation-settings: "slnt" 0, "wdth" 100;
	font-synthesis-weight: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/*
 * Sticky footer. Short pages — the login screen, an empty My Courses — left the
 * footer floating mid-viewport with white space beneath it. The wrapper fills the
 * viewport and <main> takes up the slack.
 *
 * `flex: 1 0 auto` not `1 1 auto`: main must grow into spare space but never be
 * squeezed below its content on long pages.
 *
 * dvh after vh, not instead of it: on mobile, vh is the *largest* viewport and
 * leaves a gap under the footer while the URL bar is showing. Browsers without dvh
 * keep the vh line.
 */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* ---------------------------------------------------------------------------
 * Page top spacing
 *
 * Two problems, one fix.
 *
 * First, the sticky footer above makes <main> a flex item, and a flex item
 * establishes a block formatting context — so the first heading's top margin stops
 * collapsing with its wrapper's. Two 40px margins that used to overlap began to
 * stack, pushing the archive title from 80px below the header to 120px. That was a
 * regression introduced here, not a pre-existing bug.
 *
 * Second, 80px was too much to begin with.
 *
 * Rather than re-tune margins that only ever lined up by accident of collapsing,
 * <main> now owns the space outright and the leading child margins are zeroed. The
 * result is the same on every template instead of depending on what each one
 * happens to render first.
 * ------------------------------------------------------------------------- */
.wp-site-blocks > main {
	margin-block-start: 0;
	padding-block-start: 48px;
}

.wp-site-blocks > main > :first-child,
.wp-site-blocks > main .entry-content,
.wp-site-blocks > main .entry-content > :first-child,
.wp-site-blocks > main .sensei-archive-controls,
.wp-site-blocks > main .archive-header {
	margin-block-start: 0;
}

/* Sensei's archive header pads its own title; main already provides the space. */
.wp-site-blocks > main .archive-header h1 {
	margin-top: 0;
	padding-top: 0;
}

/*
 * font-variation-settings is inherited, but the `font` shorthand in UA stylesheets
 * resets it to `normal` on form controls — and Sensei renders "Take Course" and the
 * quiz actions as real <button> elements. Restate it for anything that resets.
 */
button,
input,
select,
optgroup,
textarea {
	font-variation-settings: "slnt" 0, "wdth" 100;
}

/*
 * Interface weight: 500, set on the axis.
 *
 * voteriders.org drives Config's weight through the variation axis, not the
 * font-weight property — every nav link and button there computes
 * `font-weight: 400` with `font-variation-settings: "slnt" 0, "wdth" 100, "wght" 500`,
 * while body copy uses the same axes at "wght" 400. Measured off the live site.
 *
 * That is why our nav read thin (axis 400) and our buttons read heavy (axis 600):
 * we were driving weight through font-weight alone. font-weight is set to 500 in
 * theme.json to agree with the axis, so the two never disagree.
 *
 * Body text deliberately does NOT pin wght: an axis listed here overrides the
 * font-weight property outright, which would flatten <strong> to regular. Leaving
 * it unlisted renders identically (font-weight 400 drives the axis to 400) and
 * keeps bold working.
 */
.wp-element-button,
.wp-block-button__link,
.wp-block-navigation a,
.sensei-course-theme__button,
.wp-block-sensei-lms-button-learner-messages a {
	font-variation-settings: "slnt" 0, "wdth" 100, "wght" 500;
}

/*
 * Elements that genuinely mean italic. Config has no italic face, so the slant axis
 * is how you get one — which is also why forcing slnt to 0 above would otherwise
 * leave <em> visually identical to body text.
 */
em,
i,
cite,
q,
blockquote cite,
figcaption em {
	font-variation-settings: "slnt" 9, "wdth" 100;
	font-style: normal; /* the slant comes from the axis, not from synthesis */
}

strong,
b {
	font-weight: 700;
}

/*
 * Lead paragraphs. WordPress core emits
 *   .has-medium-font-size { font-size: var(--wp--preset--font-size--medium) !important }
 * so the *size* is owned by the `medium` preset in theme.json (pinned to 21px, fluid
 * off). Only the properties core does not set belong here — no !important needed.
 */
.has-medium-font-size {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	line-height: 30px;
}

/*
 * Sensei's Learning Mode renders inside its own wrapper and inherits
 * --wp--preset--font-family--body, which theme.json remaps to Config. Its headings
 * sit outside the `heading` element selector, so point them at Etna explicitly.
 */
.sensei-course-theme h1,
.sensei-course-theme h2,
.sensei-course-theme h3,
.sensei-course-theme h4,
.sensei-course-theme__frame h1,
.sensei-course-theme__frame h2,
.sensei-course-theme__frame h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	text-transform: none;
	letter-spacing: -0.01em;
}

/*
 * No heading is bold. The element rules generated from theme.json only have
 * element specificity (0,0,1), so block patterns that ship utility classes —
 * the footer's `has-secondary-font-family has-medium-font-size` headings, for
 * one — outrank them. Match that specificity to win on source order.
 */
/*
 * !important is deliberate. Sensei's block CSS and the parent's footer patterns set
 * 600/700 on headings through class selectors that outrank anything theme.json can
 * emit (its element rules are specificity 0,0,1). Chasing each one individually
 * means re-chasing it after every plugin update. The brand layer owns heading
 * weight; nothing else may set it.
 */
h1,
h2,
h3,
h4,
h5,
h6,
.wp-block-heading,
.wp-block-post-title,
.wp-block-site-title {
	font-weight: 500 !important;
}

/*
 * Body copy scale: 21px / 30px. The Sensei selector is restated verbatim because it
 * is specificity (0,3,1); our stylesheet is enqueued after Sensei's, so an identical
 * selector wins on source order without needing !important.
 */
p,
.wp-block-paragraph,
.wp-block-list,
.wp-block-list li,
.wp-block-sensei-lms-course-outline-lesson,
.entry-content .wp-block-sensei-lms-course-outline-lesson,
.sensei .entry-content .wp-block-sensei-lms-course-outline-lesson:not(.button),
/*
 * The module description ("Everything that determines whether the day works…")
 * is a <div>, not a <p>, so it never matched the paragraph rule and inherited
 * Sensei's 24px/37.2px. The lesson titles were already 21/30 — measured, not
 * assumed — and are listed above only to keep the body scale in one place.
 */
.wp-block-sensei-lms-course-outline-module__description,
/*
 * Tables were already Config but inherited body's 24px/37.2px. Same root cause as
 * the module description: the parent sets `body { font-size: 24px }`, so every
 * element that is not a <p> arrives here 3px too big, one at a time.
 */
.wp-block-table,
.wp-block-table table,
.wp-block-table th,
.wp-block-table td,
.entry-content table,
.entry-content th,
.entry-content td {
	font-size: 21px;
	line-height: 30px;
}

/*
 * One badge treatment, used in three places: the course-outline lesson badges
 * ("Preview" / "Complete"), the "Featured" flag on course cards, and the course
 * category pill. Sensei ships them at three different sizes, radii and paddings.
 *
 * The selectors below are Sensei's own, restated verbatim. Its winning rules are
 *   .wp-block-sensei-lms-course-list .…__image-wrapper .…__text   (0,3,0)
 *   :root .wp-block-sensei-lms-course-categories > a              (0,2,0)
 * so a plain `.badge` class never lands. Our stylesheet is enqueued after
 * global-blocks-style.css, so matching their specificity is enough — no !important.
 *
 * line-height is explicit. The outline badge used to inherit 30px from the
 * paragraph rule above, which was incidental and made the pill needlessly tall.
 */
.wp-block-sensei-lms-course-outline-lesson .wp-block-sensei-lms-course-outline-lesson__badge,
.wp-block-sensei-lms-course-list .sensei-lms-course-list-featured-label__image-wrapper .sensei-lms-course-list-featured-label__text,
.wp-block-sensei-lms-course-list .sensei-lms-course-list-featured-label__meta-wrapper .sensei-lms-course-list-featured-label__text,
:root .wp-block-sensei-lms-course-categories > a {
	font-family: var(--wp--preset--font-family--body);
	font-size: 12.6px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.1px;
	text-transform: uppercase;
	padding: 5px 10px;
	border: 1px solid var(--wp--preset--color--foreground);
	border-radius: 3px;
	color: var(--wp--preset--color--foreground);
	background-color: transparent;
	text-decoration: none;
}

/*
 * The Featured flag sits on top of the course's photo, so it keeps a solid fill.
 * An outlined, transparent badge is unreadable over an arbitrary image.
 */
.wp-block-sensei-lms-course-list .sensei-lms-course-list-featured-label__image-wrapper .sensei-lms-course-list-featured-label__text,
.wp-block-sensei-lms-course-list .sensei-lms-course-list-featured-label__meta-wrapper .sensei-lms-course-list-featured-label__text {
	background-color: var(--wp--preset--color--background);
}

/* ---------------------------------------------------------------------------
 * Content lists
 *
 * The inherited padding-left is 54px, so list text started 54px right of every
 * paragraph and heading on the page while the <ul> itself sat flush — the copy
 * read as indented for no reason. 1.2em keeps the markers in the gutter, hanging
 * just outside the text, so the text lands close to the body's left edge.
 *
 * Scoped to .wp-block-list, not `ul`: navigation, the course outline and Sensei's
 * own chrome are all <ul>s that must keep their own spacing.
 * ------------------------------------------------------------------------- */
.entry-content .wp-block-list,
.wp-block-post-content .wp-block-list {
	padding-left: 1.2em;
}

/* ---------------------------------------------------------------------------
 * Reading rhythm
 *
 * WordPress spaces blocks with `margin-block-start` on the *following* sibling
 * (the 20px block gap), not with margin-bottom — so "space below a paragraph" is
 * really "gap before whatever comes next", and setting margin-bottom here works
 * because adjacent margins collapse to the larger of the two: 40px wins over 20px.
 *
 * Doubled to 40px for prose only. Headings keep the 20px gap deliberately: a
 * heading should sit close to the content it introduces, and doubling the gap
 * under one would detach it from its own section.
 *
 * Direct children only, so paragraphs inside a callout, quote or table keep the
 * tighter rhythm of their container.
 * ------------------------------------------------------------------------- */
/*
 * Every top-level block, not a list of block types. Enumerating them (p, list,
 * separator) meant tables, callout groups and embeds were silently left at the
 * 20px default — the rhythm broke on exactly the blocks that most need air.
 * Spacing everything and exempting headings is the rule that stays true as
 * content gains new block types.
 */
.entry-content > *,
.wp-block-post-content > * {
	margin-bottom: 40px;
}

/* Headings hug the content they introduce; the 20px block gap is theirs. */
.entry-content > h1,
.entry-content > h2,
.entry-content > h3,
.entry-content > h4,
.entry-content > h5,
.entry-content > h6,
.wp-block-post-content > h1,
.wp-block-post-content > h2,
.wp-block-post-content > h3,
.wp-block-post-content > h4,
.wp-block-post-content > h5,
.wp-block-post-content > h6 {
	margin-bottom: 0;
}

/* The container owns the tail; the last block must not add to it. */
.entry-content > :last-child,
.wp-block-post-content > :last-child {
	margin-bottom: 0;
}

/* Nested lists indent from their parent and keep the tight rhythm. */
.entry-content .wp-block-list .wp-block-list,
.wp-block-post-content .wp-block-list .wp-block-list {
	margin-bottom: 0;
	margin-top: 0.25rem;
}

/* ---------------------------------------------------------------------------
 * Room at the foot of a page
 *
 * Content ran flush into the footer with nothing beneath it.
 *
 * Two rules, because Learning Mode is a different document: a lesson page has no
 * <main> at all — .wp-site-blocks holds Sensei's own frame and columns instead, so
 * every `> main` rule here (including the sticky footer above) simply does not
 * apply there. Its container is .sensei-course-theme__main-content, which ships
 * 32px.
 *
 * Padding goes on that container rather than on .entry-content so the space falls
 * after the Complete/Next Lesson buttons, not between the prose and its own
 * actions.
 *
 * Lessons get the generous tail (120px) — they are the long read, and the place
 * you finish. Course and archive pages get 40px; they end on a list, not on
 * something you have just spent ten minutes inside.
 * ------------------------------------------------------------------------- */
/* Course, archive and regular pages: a modest tail. */
.wp-site-blocks > main {
	padding-block-end: 40px;
}

/*
 * Sensei's own selector, restated. It sets the `padding` *shorthand* at (0,2,0)
 * (`padding: 32px 0`), which resets padding-bottom outright — a bare
 * `.sensei-course-theme__main-content` rule is (0,1,0) and loses. Top padding is
 * left to Sensei, which varies it by whether the sidebar is present.
 */
.sensei-course-theme__columns .sensei-course-theme__main-content {
	padding-bottom: 120px;
}

/* ---------------------------------------------------------------------------
 * Links: black text, brand-blue underline
 *
 * Copied from voteriders.org, where a link is ink-coloured and carries a 2px blue
 * underline (measured on their "has your back" link: color #000, decoration-color
 * #0362ff, thickness 2px, offset 0.12em).
 *
 * theme.json owns the colour and the underline itself; text-decoration-color has no
 * theme.json equivalent in v2, so it lives here.
 *
 * :where() keeps specificity at 0 so buttons, nav and the footer legal bar — each
 * of which sets its own colour — are unaffected. Buttons are excluded outright:
 * they are <a> elements too, and a blue underline through a blue button is nobody's
 * idea of a link.
 * ------------------------------------------------------------------------- */
/*
 * The `:root` prefix is not decoration. Core emits its link rules as
 *   :root :where(a:where(:not(.wp-element-button))) { text-decoration: underline }
 * at specificity (0,1,0), and `text-decoration` is a *shorthand* — it resets
 * text-decoration-color back to currentColor. A bare `a { ... }` rule here is
 * (0,0,1) and loses, so the blue silently became black. `:root` + type selector is
 * (0,1,1) and wins. Confirmed with CSS.getMatchedStylesForNode, not guessed.
 */
:root a:where(:not(.wp-element-button):not(.wp-block-button__link):not(.vr-legal-link):not(.vr-logo-link)) {
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.12em;
}

/*
 * Course-card titles. The parent theme sets `text-decoration: none` on post-title
 * links at (0,1,0), so they need the underline putting back explicitly — this is
 * the treatment on voteriders.org's own headlines (black, 2px blue underline).
 */
:root .wp-block-sensei-lms-course-list .wp-block-post-title a:where(:not(.wp-element-button)) {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.12em;
}

/* ---------------------------------------------------------------------------
 * Eyebrows
 *
 * One small-caps label treatment, in Config. Sensei sets several of these in the
 * heading face — "LESSONS" above each module's lesson list, and the module name
 * above a lesson title in Learning Mode — which lands a serif label directly
 * beside the Config "IN PROGRESS" pill on the very same row.
 *
 * Config, because these are interface labels rather than headings, at the same
 * axis weight (500) as the rest of the interface chrome.
 * ------------------------------------------------------------------------- */
.wp-block-sensei-lms-course-outline-module__lessons-title,
.wp-block-sensei-lms-course-theme-lesson-module,
.sensei-course-theme .wp-block-sensei-lms-course-theme-lesson-module,
/*
 * Sensei sizes the lessons title from a (0,3,0) selector (.875rem), which outranks
 * the class on its own, so its selector is restated here verbatim.
 */
.wp-block-sensei-lms-course-outline .wp-block-sensei-lms-course-outline-module .wp-block-sensei-lms-course-outline-module__lessons-title {
	font-family: var(--wp--preset--font-family--body);
	font-size: 12.6px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.1px;
	text-transform: uppercase;
	font-variation-settings: "slnt" 0, "wdth" 100, "wght" 500;
}

/* ---------------------------------------------------------------------------
 * Course list cards
 *
 * Sensei's course-list markup ships inline `margin:0` on the card title and leans
 * on a 40px block gap before the Course Overview link. The result is a title
 * jammed against its excerpt and the overview link adrift below it.
 *
 * !important is load-bearing here, not laziness: the zero margin is an inline
 * style on the <h2>, written into Sensei's own page content, and inline styles
 * outrank every selector. The alternative is editing Sensei's default pages, which
 * is exactly what we have committed not to do.
 * ------------------------------------------------------------------------- */
.wp-block-sensei-lms-course-list .wp-block-post-title {
	margin-bottom: 16px !important;
}

.wp-block-sensei-lms-course-list .wp-block-sensei-lms-course-overview {
	margin-top: 16px;
}

/* ---------------------------------------------------------------------------
 * Course filter selector
 *
 * A clean bordered control in the brand body font (Config) so it reads as a
 * button. The native caret is replaced by a custom chevron pinned 12px from the
 * right, mirroring the 12px left padding.
 * ------------------------------------------------------------------------- */
.wp-block-sensei-lms-course-list-filter select {
	/* Drop the native caret — it strands itself at the far-right edge (the box
	   sizes to the longest option) and reads as tucked/lopsided. A custom chevron
	   pinned 12px from the right mirrors the 12px left padding: balanced. */
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: 1px solid var(--wp--preset--color--foreground);
	border-radius: 4px;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='8'%20viewBox='0%200%2012%208'%3E%3Cpath%20d='M1%201l5%205%205-5'%20fill='none'%20stroke='%23191919'%20stroke-width='1.6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
	padding: 6px 32px 6px 12px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	color: var(--wp--preset--color--foreground);
	box-shadow: none;
	cursor: pointer;
}
.wp-block-sensei-lms-course-list-filter {
	padding-bottom: 10px;
}

/* ---------------------------------------------------------------------------
 * Course card padding + featured image
 *
 * Sensei writes `padding:10px` inline on the card's bordered group, which reads
 * cramped — the image and text sit right up against the faint border. The review
 * called for roughly doubling it; 28px gives the card the generous interior the
 * rest of the site has. Inline padding outranks selectors, so !important is
 * required (same reason as the title margin above).
 *
 * The featured image carried a hard dark edge from the parent theme and square
 * corners. Strip the border and round it to the site's large 20px radius; the
 * figure clips with overflow so the rounding is visible on the <img> itself.
 * ------------------------------------------------------------------------- */
.wp-block-sensei-lms-course-list .wp-block-post > .wp-block-group.has-border-color {
	padding: 28px !important;
}

.wp-block-sensei-lms-course-list .wp-block-post-featured-image,
.wp-block-sensei-lms-course-list .sensei-lms-course-list-featured-label__image-wrapper {
	border: 0;
	border-radius: 20px;
	overflow: hidden;
}

.wp-block-sensei-lms-course-list .wp-block-post-featured-image img {
	border: 0;
	outline: 0;
	border-radius: 20px;
}

/* Sensei's flow layout leaves a ~60px block gap between the featured image and the
   text column — far more than the card's own padding. Pull it back to the 21px base
   unit so the image reads as part of the card, not a separate slab. */
.wp-block-sensei-lms-course-list .wp-block-post > .wp-block-group.has-border-color > .wp-block-columns {
	margin-top: 0;
}

/* ---------------------------------------------------------------------------
 * Progress bars
 *
 * Two layers, and the names are a trap: `__bar` is the *track* (full width) and
 * `__progress` is the *fill*. Painting `__bar` with the brand blue therefore
 * coloured the track, leaving Sensei's default #0064b4 fill on top of it — blue on
 * blue, with the filled portion reading darker than the empty remainder.
 *
 * Fill is the brand blue; the track is the grey `secondary`.
 * ------------------------------------------------------------------------- */
.sensei-course-theme .sensei-course-theme-course-progress-bar-inner,
.sensei-progress-bar__progress {
	background-color: var(--wp--preset--color--primary);
}

.sensei-course-theme .sensei-course-theme-course-progress-bar,
.sensei-progress-bar__bar {
	background-color: var(--wp--preset--color--secondary);
}

/*
 * Course progress fill is the brand blue at every completion level, including 100%
 * — the card index and the single-course page both use `.sensei-progress-bar`.
 * (An earlier pass turned the completed state ink; reverted — blue throughout.)
 */

/* ---------------------------------------------------------------------------
 * Sensei buttons
 *
 * Sensei ships some of its buttons with em-based padding, so "Completed" and
 * "My Messages" rendered at 12.3px/32px while every other button sat at the
 * theme.json 8px/12px. Restate the theme's padding on Sensei's own buttons.
 *
 * The underline is our doing: these are <a> elements without .wp-block-button__link,
 * so the site-wide "black text, blue underline" link rule caught them. A button is
 * not a link — opt them out.
 * ------------------------------------------------------------------------- */
.wp-block-sensei-lms-button-learner-messages a,
.wp-block-sensei-lms-button-learner-messages .wp-block-button__link,
.sensei-course-theme-lesson-actions .wp-block-button__link,
.sensei-course-theme-lesson-actions .wp-element-button,
.wp-block-sensei-button .wp-block-button__link {
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
 * Learning Mode text actions — one link style for all of them
 *
 * "Back to lesson", "Restart Quiz", "Save Progress" and "Exit Course" shipped as
 * three different treatments (14px vs 16px, an <a> vs <button>, an arrow icon, no
 * underline). Unify them: Config, 16px, regular weight, ink text with a blue
 * underline. The primary filled buttons ("Complete Quiz", "Continue to next
 * lesson") are deliberately excluded — they stay solid buttons.
 *
 * The two <button> actions carry Sensei's button chrome, so their background,
 * border and padding are stripped back to render as plain text links.
 * ------------------------------------------------------------------------- */
:root .wp-block-sensei-lms-exit-course a,
:root .sensei-lms-quiz-back-to-lesson,
:root .sensei-course-theme .quiz-submit.reset,
:root .sensei-course-theme .quiz-submit.save,
:root .sensei-course-theme .sensei-lms-notice .sensei-course-theme__button.is-link {
	font-family: var(--wp--preset--font-family--body);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--wp--preset--color--foreground);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
	text-underline-offset: 0.2em;
}

/* The <button> variants: shed the button chrome so they match the anchors.
 *
 * Two Sensei overrides have to be beaten here: the quiz-footer rule
 * `.sensei-course-theme__quiz__footer … .sensei-course-theme__button` (0,5,0) sets
 * `text-decoration:none`, and the button-group rule sets `font-variation-settings`
 * to wght 500 (the source of the bold look — font-weight alone won't touch it).
 * !important on the decoration and an explicit wght 400 settle both. */
:root .sensei-course-theme .quiz-submit.reset,
:root .sensei-course-theme .quiz-submit.save,
:root .sensei-course-theme .sensei-lms-notice .sensei-course-theme__button.is-link {
	background: none;
	border: 0;
	padding: 0;
	min-height: 0;
	font-variation-settings: "slnt" 0, "wdth" 100, "wght" 400;
	text-decoration: underline !important;
	text-decoration-color: var(--wp--preset--color--primary) !important;
}

/* The leading chevron on "Back to lesson" — the underline is the affordance now. */
.sensei-lms-quiz-back-to-lesson svg {
	display: none;
}

/*
 * Sensei underlines the exit-course *container* (`.wp-block-sensei-lms-exit-course`)
 * as well as the inner <a>, stacking a second ink underline beneath our blue one —
 * the "two lines" on Exit Course. Only the anchor should carry the underline.
 * :root wins the (0,1,0) tie with Sensei's own container rule regardless of order.
 */
:root .wp-block-sensei-lms-exit-course {
	text-decoration: none;
}

/*
 * The outline button style still carried the parent's padding vars:
 *   .wp-block-button.is-style-outline .wp-block-button__link {
 *     padding: var(--wp--custom--button--spacing--padding--top) ...
 *   }
 * which resolve to 0.5856em / 1.5238em — 12.3px / 32px at our 21px button text.
 * That is where "My Messages" and "Completed" got their odd size while every other
 * button sat at 8px/12px. Replacing those vars with literals was done for the base
 * button earlier; this is the same fix for the style that was missed.
 *
 * Sensei renders several of its buttons with .is-style-outline.
 *
 * The `:root` prefix is required, not cosmetic. This stylesheet is enqueued twice —
 * the parent calls get_stylesheet_uri(), which in a child theme resolves to *this*
 * file, so it loads as both `course-style` and `voteriders-style` — and the rule
 * carrying these vars still lands after both copies. Matching specificity therefore
 * does not win on source order the way it usually does here. (0,3,0) settles it
 * regardless of order.
 */
:root .wp-block-button.is-style-outline .wp-block-button__link,
:root .wp-block-button.is-style-outline .wp-element-button {
	padding: 0.5rem 0.9rem;
}

/* ---------------------------------------------------------------------------
 * Sensei's dark chrome
 *
 * Learning Mode inverts its notices on purpose:
 *   .sensei-course-theme .sensei-lms-notice {
 *     background-color: var(--wp--preset--color--foreground);
 *     color: var(--wp--preset--color--background);
 *   }
 * With our palette that resolves to a near-black slab (#191919). The course-outline
 * module header is the same idea with a hard-coded #1a1d20.
 *
 * Neither belongs on a site whose reference design is white with ink text, so both
 * become off-white with a hairline. Same specificity as Sensei's own selectors,
 * winning on source order — no !important.
 * ------------------------------------------------------------------------- */
.sensei-course-theme .sensei-lms-notice {
	background-color: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--foreground);
	border: 0;
}

/*
 * The module header's #1a1d20 is hard-coded behind a (0,3,0) selector, so a plain
 * class rule never lands. This is Sensei's own selector restated verbatim.
 */
.wp-block-sensei-lms-course-outline.is-style-default .wp-block-sensei-lms-course-outline-module:not(.is-style-minimal) .wp-block-sensei-lms-course-outline-module__header:not(.has-background),
.wp-block-sensei-lms-course-outline-module.is-style-default .wp-block-sensei-lms-course-outline-module__header:not(.has-background) {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/*
 * Anything inside those slabs was coloured for a dark ground.
 *
 * Buttons are excluded deliberately. This rule was written when the notice was a
 * near-black band and its links needed to be legible; once the band went white it
 * started painting "Take course" ink-black on top of a blue button — a fix that
 * outlived its problem. A button owns its own colour.
 */
.sensei-course-theme .sensei-lms-notice a:not(.sensei-course-theme__button):not(.wp-block-button__link),
.sensei-course-theme .sensei-lms-notice strong,
.wp-block-sensei-lms-course-outline-module__header a,
.wp-block-sensei-lms-course-outline-module__header .wp-block-sensei-lms-course-outline-module__name {
	color: var(--wp--preset--color--foreground);
}

/* The module's status pill ("IN PROGRESS" / "COMPLETED") — styled to match the
   course category / featured badges exactly (same font, size, padding, 3px radius,
   border). Sensei ships it as a 999px stadium; :root lifts specificity so the 3px
   radius and the rest win. */
:root .wp-block-sensei-lms-course-outline-module__header .wp-block-sensei-lms-course-outline-module__progress-indicator {
	font-family: var(--wp--preset--font-family--body);
	font-size: 12.6px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.1px;
	text-transform: uppercase;
	padding: 5px 10px;
	border: 1px solid var(--wp--preset--color--foreground);
	border-radius: 3px;
	color: var(--wp--preset--color--foreground);
	background-color: transparent;
}

/* The label span ships Sensei's `margin: 2px 15px`, and the flex pill sizes to
   include those 30px of side margin — that's what made "IN PROGRESS" float in a
   too-wide box. Zero it so the pill hugs the text like the category badges. */
.wp-block-sensei-lms-course-outline .wp-block-sensei-lms-course-outline-module .wp-block-sensei-lms-course-outline-module__progress-indicator__text,
.wp-block .wp-block-sensei-lms-course-outline-module .wp-block-sensei-lms-course-outline-module__progress-indicator__text {
	margin: 0;
}

/* Module titles ("Orientation & Ground Rules", …) down to the 21px body size. */
.wp-block-sensei-lms-course-outline .wp-block-sensei-lms-course-outline-module .wp-block-sensei-lms-course-outline-module__title,
.wp-block .wp-block-sensei-lms-course-outline-module .wp-block-sensei-lms-course-outline-module__title {
	font-size: 21px;
}

/*
 * Content callout boxes (e.g. "Pre-stage everything" / "Date every source") in
 * lesson content: a bordered, transparent group becomes a borderless sky-blue card
 * with the site's 20px radius and roomier 2rem padding.
 */
.sensei-course-theme .wp-block-group.has-border-color.has-global-padding {
	background-color: var(--wp--preset--color--sky);
	border: 0;
	border-radius: 20px;
	padding: 2rem;
}

/* Header top-right cluster: nav links + logout, sitting on one line. */
.vr-nav-cluster {
	align-items: center;
	gap: 1.75rem;
}

/* Log out lives in the header now, styled to sit quietly beside the nav links:
   same Config face and weight, muted until hover, matching the nav's hover blue. */
.vr-logout-link {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 500;
	font-size: 23px;
	line-height: 1;
	text-decoration: none;
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
}

.vr-logout-link:hover,
.vr-logout-link:focus {
	color: var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------------------
 * Form fields
 *
 * Inputs default to white, which read as cut-outs once the page went off-white.
 * They sit on the page, so they take the page's colour and rely on their border.
 * ------------------------------------------------------------------------- */
/*
 * Form controls do not inherit font — the UA stylesheet gives them their own
 * `font` shorthand, so these were rendering in Arial 13px next to their own
 * Config 21px labels. Nothing had set them; they simply were never inherited.
 * Restate the whole lot so a field matches the label above it.
 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select,
.wp-block-search__input,
.sensei-course-theme__frame input,
form.login input[type="text"],
form.login input[type="password"] {
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	color: var(--wp--preset--color--foreground);
	font-family: var(--wp--preset--font-family--body);
	font-size: 21px;
	line-height: 30px;
	font-weight: 400;
	padding: 0.5rem 0.75rem;
}

/*
 * Sensei styles the My Courses login fields from an ID selector —
 *   #my-courses #customer_login input.input-text { font-size: …--small; padding: .9rem 1.1rem }
 * which is (2,1,1). No class or element rule can reach that, so its selector is
 * restated verbatim. This is the one place where IDs, not specificity tricks, are
 * the answer.
 */
#my-courses #customer_login input.input-text {
	font-family: var(--wp--preset--font-family--body);
	font-size: 21px;
	line-height: 30px;
	padding: 0.5rem 0.75rem;
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	color: var(--wp--preset--color--foreground);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
	border-color: var(--wp--preset--color--primary);
	outline: 1px solid var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------------------
 * Learning Mode sidebar
 *
 * "3 lessons, 3 quizzes" sat 4px under its module heading — the two read as one
 * block of text rather than a heading and its summary. Give it clear separation
 * from the module title above.
 * ------------------------------------------------------------------------- */
.sensei-lms-course-navigation-module__summary {
	margin-top: 20px;
}

/*
 * The header course title ("Running a Voter ID Clinic") sat at 24px while the
 * sidebar module headings ("Before the Clinic") are 28px — the page title read as
 * the smaller of the two. Match it to the module size so they sit as peers.
 */
.wp-block-sensei-lms-course-title {
	font-size: 28px;
	line-height: 1.15;
}

/*
 * Lesson links in the sidebar shipped as 14px underlined links. Make them read as
 * body-size navigation with no underline; the secondary "Quiz" link keeps the
 * global underline so it still signals a link. Status icons (done / half / not
 * started) take the brand blue instead of ink.
 *
 * :root prefixes the underline reset because the site-wide link rule is (0,1,1)
 * via `:root a:where(...)`, which a bare class (0,1,0) would lose to.
 */
:root .sensei-lms-course-navigation-lesson__link {
	text-decoration: none;
}

.sensei-lms-course-navigation-lesson__title {
	font-size: 21px;
	line-height: 1.2;
}

.sensei-lms-course-navigation-lesson__status {
	color: var(--wp--preset--color--primary);
	fill: var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------------------
 * The locked/preview lesson notice
 *
 * Sensei sets its prompt at 24px/700 — the heaviest text on the page, shouting at
 * someone who only wants to sign in. Interface copy, so it gets the interface
 * treatment: Config at axis 500, like the menu.
 *
 * "Take course" is the primary action and was rendering as a pale outline; it takes
 * the brand blue. "Sign in" stays quiet beside it.
 * ------------------------------------------------------------------------- */
/* Sensei's own selectors, restated — it sets these from (0,2,0) and (0,3,0). */
.sensei-course-theme-locked-lesson-notice > .sensei-course-theme-locked-lesson-notice__text {
	font-family: var(--wp--preset--font-family--body);
	font-size: 21px;
	line-height: 30px;
	font-weight: 500;
	font-variation-settings: "slnt" 0, "wdth" 100, "wght" 500;
}

.sensei-course-theme__button.is-primary,
.sensei-course-theme__button.is-primary:visited {
	background-color: var(--wp--preset--color--primary);
	border: 1px solid var(--wp--preset--color--primary);
	color: #ffffff;
}

.sensei-course-theme__button.is-primary:hover {
	background-color: var(--wp--preset--color--button-border-hover);
	border-color: var(--wp--preset--color--button-border-hover);
	color: #ffffff;
}

/*
 * "Sign in" is a link, not a button — it gets the site's link treatment: ink text
 * with a 2px brand-blue underline.
 *
 * Sensei sizes it from (0,3,0) with a clamp(), so the notice class is included here
 * to reach (0,4,0). A plain `.is-secondary` rule loses.
 */
:root .wp-block-sensei-lms-course-theme-notices .sensei-course-theme-locked-lesson-notice .sensei-course-theme__button.is-secondary,
:root .sensei-course-theme-locked-lesson-notice .sensei-course-theme__button.is-secondary {
	font-family: var(--wp--preset--font-family--body);
	font-size: 21px;
	line-height: 25.2px;
	font-weight: 500;
	font-variation-settings: "slnt" 0, "wdth" 100, "wght" 500;
	color: var(--wp--preset--color--foreground);
	background-color: transparent;
	border: 0;
	padding: 0;
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.12em;
}

:root .sensei-course-theme-locked-lesson-notice .sensei-course-theme__button.is-secondary:hover {
	color: var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------------------
 * Wordmark
 *
 * The SVG carries `fill="currentColor"`, so colour comes from the container and
 * the mark inverts for free on a dark ground. Width is set on the wrapper and the
 * SVG fills it; the 991:149 viewBox keeps the height honest without a magic number.
 * ------------------------------------------------------------------------- */
.vr-logo {
	display: block;
	color: var(--wp--preset--color--foreground);
}

.vr-logo svg {
	display: block;
	width: 100%;
	height: auto;
}

.vr-logo-link {
	display: inline-block;
	text-decoration: none;
	/* The header rule below gives links a hover colour; the mark must not take it. */
	color: inherit;
}

.vr-logo--header {
	width: 190px;
}

@media (max-width: 781px) {
	.vr-logo--header {
		width: 150px;
	}
}

/* ---------------------------------------------------------------------------
 * Footer
 *
 * The whole footer is voteriders.org's bottom bar: a rule, copyright left, legal
 * links right. Their small print uses one treatment (`config-all-caps-footer`):
 * Config, 12px/18px, uppercase, weight 400, normal tracking, with a 1px rule under
 * links rather than text-decoration. Every value below is theirs, measured.
 * ------------------------------------------------------------------------- */
.vr-footer-legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.vr-legal-copy {
	margin: 0;
	order: 1;
}

.vr-legal-links {
	display: flex;
	gap: 16px;
	order: 2;
}

.vr-legal-copy,
.vr-legal-link {
	font-family: var(--wp--preset--font-family--body);
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	letter-spacing: normal;
	text-transform: uppercase;
	color: var(--wp--preset--color--foreground);
}

/*
 * `p` above sets 21px/30px on every paragraph; the copyright is a <p>, so restate
 * the size at a specificity that wins rather than relying on source order alone.
 */
.vr-footer-legal .vr-legal-copy {
	font-size: 12px;
	line-height: 18px;
}

.vr-legal-link {
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--foreground);
}

.vr-legal-link:hover {
	color: var(--wp--preset--color--primary);
	border-bottom-color: var(--wp--preset--color--primary);
}

/* Stack the legal bar on narrow screens, copyright last — as voteriders.org does. */
@media (max-width: 600px) {
	.vr-footer-legal {
		flex-direction: column;
		align-items: flex-start;
	}

	.vr-legal-copy {
		order: 2;
	}

	.vr-legal-links {
		order: 1;
	}
}

/* ---------------------------------------------------------------------------
 * Course-completed page
 *
 * The two action buttons ("Find More Courses", "View Certificate") are filled
 * buttons, not links — drop the underline. The total-grade block becomes a sky-blue
 * card: the score in Etna, the whole thing on #dae5fb with the site's 20px radius,
 * no border, and generous padding, set off from the "Volunteer Onboarding" results
 * below it with margin.
 * ------------------------------------------------------------------------- */
.wp-block-button.more-courses .wp-block-button__link,
.wp-block-button.view-certificate .wp-block-button__link {
	text-decoration: none;
}

/* The total-grade score in the brand serif, matching the page's other display type. */
.wp-block-sensei-lms-course-results__grade-score {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
}

/*
 * Hero card: the "Congratulations" message + action buttons sit on a sky-blue card
 * that runs flush into the grade below, so the whole celebratory block reads as one
 * card — separated from the "Course Completed" title above and the course breakdown
 * beneath. The hero rounds its top corners; the grade rounds the bottom.
 */
.vr-cc-hero {
	background-color: var(--wp--preset--color--sky);
	border-radius: 20px 20px 0 0;
	padding: 48px 56px 24px;
	margin-top: 56px;
	margin-bottom: 0;
	text-align: center;
}

/* Course-results follows the hero with no gap so the grade continues the card. */
.entry-content > .wp-block-sensei-lms-course-results {
	margin-top: 0;
}

.wp-block-sensei-lms-course-results__grade {
	box-sizing: border-box;
	width: 100%;
	background-color: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--foreground);
	border-radius: 0 0 20px 20px;
	padding: 24px 56px 48px;
	margin: 0 0 56px;
	text-align: center;
}

/* ===========================================================================
 * Client review pass — volunteer LMS (2026-07-21)
 * ======================================================================== */

/* Course page: the 60px title carried an inline 5rem (80px) tail. Bring it to
   42px. The 5rem is an inline style on the block, so !important is required. */
.single-course .wp-block-post-title {
	margin-bottom: 42px !important;
}

/* (The module status pill is fully styled up in the badge-matched rule above.) */

/* Descenders: Etna's tails on wrapped sidebar module titles clipped against the
   next line. Give the leading room. Lesson titles get the same breathing room. */
.sensei-lms-course-navigation-module__title {
	line-height: 1.25;
}

.sensei-lms-course-navigation-lesson__title {
	line-height: 1.3;
}

/* Log out now lives inside the nav so it joins the mobile hamburger overlay;
   keep its quiet, muted top-right feel on desktop. */
.vr-logout-item .wp-block-navigation-item__content {
	color: var(--wp--preset--color--muted);
}

.vr-logout-item .wp-block-navigation-item__content:hover,
.vr-logout-item .wp-block-navigation-item__content:focus {
	color: var(--wp--preset--color--primary);
}

/* Course title is a fixed 60px — too big on phones, where it broke mid-word.
   Scale it down and tighten its tail so it fits the full width cleanly. */
@media (max-width: 600px) {
	.single-course .wp-block-post-title {
		font-size: 38px;
		line-height: 1.05;
		margin-bottom: 28px !important;
	}
}

/* The LM header course title shipped `overflow:hidden` on a 32px box, which sheared
   the descenders (the "g" in "Running") against the progress bar. Let them show —
   there's ample room above the bar. */
.wp-block-sensei-lms-course-title {
	overflow: visible;
}

/* Quiz question "points" number (the stray "2") — hide it; confusing to learners. */
.sensei-lms-question-block__header .grade {
	display: none;
}

/* Quiz question title: tighten the leading on wrapped questions. */
:root :where(.wp-block-sensei-lms-quiz-question h2) {
	line-height: 1.1;
}

/* Module accordion header read too tight vertically; give the row more air. */
.wp-block-sensei-lms-course-outline-module__header {
	padding-top: 24px;
	padding-bottom: 24px;
}

/* Learning Mode header on mobile.
 *  - The 28px course title overflowed and shoved the sidebar toggle off-screen:
 *    shrink it and clear the burger on the left.
 *  - Pin the burger TOP-LEFT so it never collides with "Exit Course" (top-right)
 *    once the sidebar overlay is open.
 *  - The fixed header sat flush against the lesson content — add breathing room. */
@media (max-width: 782px) {
	.sensei-course-theme__header .wp-block-sensei-lms-course-title {
		font-size: 18px;
		line-height: 1.25;
		padding-left: 44px;
		max-width: 72vw;
	}

	/* When the sidebar overlay is open the header title is redundant (the overlay
	   shows the whole course), and its width shoved "Exit Course" off-screen. Drop
	   it so Exit Course sits cleanly at the right edge, opposite the burger. */
	body.sensei-course-theme--sidebar-open .sensei-course-theme__header .wp-block-sensei-lms-course-title {
		display: none;
	}

	.sensei-course-theme__sidebar-toggle {
		position: fixed;
		top: 24px;
		left: 16px;
		right: auto;
		z-index: 40;
		/* Align the burger's centre with the title. This header is taller than the
		   public site's (it keeps the progress bar), so the title sits lower and the
		   burger needs a small downward nudge — measured, not the public site's -3px. */
		transform: translateY(4px);
	}

	.sensei-course-theme__columns .sensei-course-theme__main-content,
	.sensei-course-theme__main-content {
		padding-top: 40px;
	}
}
