/*
 * Courses-specific stylesheet.
 *
 * Intentionally left without header/menu overrides to keep
 * the same native Neve header style across all pages.
 */

/*
 * Masteriyo token mapping.
 *
 * Masteriyo is built on ~60 --masteriyo-* custom properties, all defined in a
 * single :root block in the plugin's public.css. Pointing them at Neve's
 * --nv-* slots reskins the whole LMS without touching a template.
 *
 * Deliberately NOT mapped here: --masteriyo-color-primary, -primary-light,
 * -primary-dark, --masteriyo-button-primary and -hover. Those are written as
 * an inline :root block by ScriptStyle::load_custom_inline_styles() from
 * Masteriyo → Settings → General → Styling. Two :root blocks have equal
 * specificity, so whichever loads last wins — a fight with no stable winner.
 * The settings screen owns brand colour; this file owns everything it can't
 * reach. Change blue in the settings, not here.
 *
 * Why :root:root and not :root — the plugin's public.css is printed AFTER
 * this file (verified in the rendered <head>: neve-child-courses-style-css
 * at 223, masteriyo-public-css at 224). Two :root blocks have identical
 * specificity, so a plain :root here loses on source order and the whole
 * mapping silently does nothing. Repeating the selector raises specificity
 * to (0,2,0) and wins regardless of order. Preferred over adding
 * 'masteriyo-public' to the enqueue's $deps, which would couple the child
 * theme to a plugin handle and break the stylesheet if Masteriyo is ever
 * deactivated or renames it.
 */
:root:root {
	/* Type. Plugin defaults are a near-black navy (#07092f) and a muted
	   indigo (#424360) — both read as "not this site" next to Neve's #111. */
	--masteriyo-color-heading: var(--nv-text-color);
	--masteriyo-color-text: var(--nv-text-color);
	--masteriyo-color-grey-dark: var(--nv-text-color);

	/* Surfaces and rules. */
	--masteriyo-color-border: var(--nv-light-bg);
	--masteriyo-color-background-grey: var(--nv-light-bg);
	--masteriyo-color-grey-light: var(--nv-light-bg);
	--masteriyo-color-disabled: var(--nv-light-bg);

	/* Dark blue slots. The plugin uses #07092f for dark button fills and
	   headings on tinted panels; brand-dark is the accessible blue that
	   carries white text at AA (4.53:1). See design-system.md §2. */
	--masteriyo-color-blue-dark: var(--nv-c-1);
	--masteriyo-color-btn-blue-dark: var(--nv-c-1);
	--masteriyo-color-btn-grey: var(--nv-c-1);

	/* Accent. Masteriyo ships a hot pink (#fd739c) for ribbons and featured
	   badges — the single most off-brand colour in the plugin. */
	--masteriyo-color-accent: var(--nv-secondary-accent);
	--masteriyo-color-accent-dark: var(--nv-secondary-accent);
	--masteriyo-color-accent-darker: var(--nv-secondary-accent);

	/*
	 * Status colours. See design-system.md §2 "Status colours".
	 *
	 * These are the ONE place in this theme where a literal hex is correct
	 * rather than a var(--nv-*) alias, and the reason is structural: Neve's
	 * palette has nine slots, eight are spoken for and the ninth (Extra
	 * Color 2) is one slot for four colours. Status colours are also not
	 * content swatches — the client never picks "danger" when editing a
	 * page — so parking them in the Customizer would clutter every colour
	 * picker on the site to no benefit.
	 *
	 * Chosen to sit with the desaturated blue-grey palette rather than
	 * shout over it, and each one clears WCAG AA (4.5:1) against its own
	 * 10% tint, which is exactly how Masteriyo composes its notices:
	 * text and border take the solid colour, background takes -a10.
	 * Ratios: success 4.71, warning 4.70, danger 5.27, info 4.58.
	 *
	 * The -a10 values are literal rgba() of the line above rather than
	 * color-mix(), unlike the derived tints further down. Nothing here is
	 * downstream of a Customizer value, so there is no drift to guard
	 * against — and it keeps the notices working on browsers without
	 * color-mix instead of falling through to unset.
	 *
	 * Masteriyo also defines --masteriyo-color-{success,warning,danger,
	 * info}-border, deliberately not mapped: no rule in the plugin's CSS
	 * consumes them (checked against 1.20.x). Map them if that changes.
	 */
	--uterus-status-success: #46745a;
	--uterus-status-warning: #8a6420;
	--uterus-status-danger: #9b4a43;
	--uterus-status-info: #4c718a;

	--uterus-status-success-tint: rgba(70, 116, 90, 0.1);
	--uterus-status-warning-tint: rgba(138, 100, 32, 0.1);
	--uterus-status-danger-tint: rgba(155, 74, 67, 0.1);
	--uterus-status-info-tint: rgba(76, 113, 138, 0.1);

	/* Masteriyo's PHP notices — templates/notices/*.php, rendered as
	   .masteriyo-alert.masteriyo-{success,warning,danger,info}-msg on the
	   cart, checkout, login and registration pages. */
	--masteriyo-color-success: var(--uterus-status-success);
	--masteriyo-color-success-a10: var(--uterus-status-success-tint);
	--masteriyo-color-warning: var(--uterus-status-warning);
	--masteriyo-color-warning-a10: var(--uterus-status-warning-tint);
	--masteriyo-color-danger: var(--uterus-status-danger);
	--masteriyo-color-danger-a10: var(--uterus-status-danger-tint);
	--masteriyo-color-info: var(--uterus-status-info);
	--masteriyo-color-info-a10: var(--uterus-status-info-tint);
}

/*
 * Derived tints, gated behind @supports.
 *
 * The usual two-declaration fallback does NOT work for custom properties:
 * `color-mix()` parses fine as a custom-property value on every browser, so
 * an earlier fallback declaration is always overwritten. On a browser without
 * color-mix the value only fails later, at substitution time, resolving to
 * guaranteed-invalid → unset → inherit, which loses the plugin's own default
 * rather than falling back to it. The @supports gate means old browsers never
 * see these declarations at all and keep Masteriyo's stock values — off-brand,
 * but intact. color-mix has been baseline since mid-2023.
 */
@supports (color: color-mix(in srgb, red, blue)) {
	:root:root {
		--masteriyo-color-text-light: color-mix(in srgb, var(--nv-text-color) 60%, var(--nv-site-bg));
		--masteriyo-color-grey-lighter: color-mix(in srgb, var(--nv-light-bg) 50%, var(--nv-site-bg));
		--masteriyo-color-accent-light: color-mix(in srgb, var(--nv-secondary-accent) 70%, var(--nv-site-bg));
		--masteriyo-color-accent-a20: color-mix(in srgb, var(--nv-secondary-accent) 20%, transparent);

		/* The alpha variants are hardcoded rgba() of the OLD default blue and
		   are NOT rewritten by the Styling settings — without these four lines
		   the stock #4584ff survives in every tint, wash and focus ring. */
		--masteriyo-color-primary-a10: color-mix(in srgb, var(--nv-primary-accent) 10%, transparent);
		--masteriyo-color-primary-a20: color-mix(in srgb, var(--nv-primary-accent) 20%, transparent);
		--masteriyo-color-primary-a80: color-mix(in srgb, var(--nv-primary-accent) 80%, transparent);
		--masteriyo-color-primary-lightest: color-mix(in srgb, var(--nv-primary-accent) 8%, var(--nv-site-bg));
	}
}

/*
 * Clean up after the author visibility toggles.
 *
 * In templates/content-course.php the author's <div> wrapper and its two <a>
 * tags render unconditionally — only the <img> and the name <span> sit behind
 * course_archive.components_visibility.author_avatar / .author_name. With both
 * switched off each card is left with an empty link: no accessible name, which
 * fails WCAG 2.4.4 (Link Purpose) and 4.1.2 (Name, Role, Value).
 *
 * Written as :has() rather than a flat `display: none` so it stops applying by
 * itself the moment either toggle is switched back on. Browsers without :has()
 * drop the rule and keep today's behaviour — visually identical, a11y issue
 * unfixed. Baseline since December 2023.
 */
.masteriyo-course-author:not(:has(img, .masteriyo-course-author--name)) {
	display: none;
}

/* Keep breathing room between header/content/footer on courses contexts. */
body:is(.page-template-page-courses, .post-type-archive-mto-course, .single-mto-course, .single-mto-lesson, .single-mto-quiz, .masteriyo-courses-page, .masteriyo-course-category-page, .masteriyo-course-difficulty-page, .tax-course_cat, .tax-course_difficulty) .neve-main {
  padding-top: clamp(12px, 1.4vw, 20px);
  padding-bottom: clamp(12px, 1.4vw, 20px);
}

/* Add extra breathing room around the mobile menu block in courses contexts. */
@media screen and (max-width: 960px) {
  body:is(.page-template-page-courses, .post-type-archive-mto-course, .single-mto-course, .single-mto-lesson, .single-mto-quiz, .masteriyo-courses-page, .masteriyo-course-category-page, .masteriyo-course-difficulty-page, .tax-course_cat, .tax-course_difficulty) .header-menu-sidebar-inner {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  body:is(.page-template-page-courses, .post-type-archive-mto-course, .single-mto-course, .single-mto-lesson, .single-mto-quiz, .masteriyo-courses-page, .masteriyo-course-category-page, .masteriyo-course-difficulty-page, .tax-course_cat, .tax-course_difficulty) .header-menu-sidebar .menu-item-courses-account-masteriyo {
    margin-top: 8px;
    margin-bottom: 8px;
  }
}

/*
 * Account-page alerts — the React ones.
 *
 * /minha-conta/ is a React SPA, and its alerts do NOT go through the PHP
 * notice templates the token block above reskins. They come from a bespoke
 * component in assets/js/build/masteriyo-account.js that hardcodes Chakra's
 * default scales — green.50 / green.500 / green.600 for success, a raw
 * #fdf7e7 / #e4ae0d for warning — and paints them with Emotion at runtime.
 * No Masteriyo setting, no PHP filter and no --masteriyo-* token reaches
 * them. CSS is the only lever.
 *
 * Three consequences shape everything below.
 *
 * 1. Emotion class names (.css-1a2b3c) are build hashes — they change when
 *    Masteriyo updates, so they are unusable as selectors. The stable hooks
 *    are Chakra's semantic classes (.chakra-stack, .chakra-icon,
 *    .chakra-text) plus the mount point's id.
 *
 * 2. Emotion injects its <style> at runtime, i.e. after this stylesheet in
 *    the document. Equal specificity would lose on source order, so every
 *    rule here is anchored on #masteriyo-account-page — the id alone takes
 *    us to (1,x,y) and wins outright. No !important needed.
 *
 * 3. All four statuses render the same markup with the same classes, so
 *    nothing in the DOM says "this one is a success". The only thing that
 *    differs is the icon, and the icons are inline react-icons SVGs whose
 *    path data is fixed. Hence the :has(path[d^=...]) selectors: ugly, but
 *    deterministic. They are also self-degrading — if Masteriyo swaps icon
 *    sets, the status tint stops applying and the alert falls back to the
 *    neutral base style below. Still legible, just no longer colour-coded.
 *
 * Only the alerts are direct .chakra-stack children of the mount point
 * (everything else lives inside .chakra-container), so `>` is the guard
 * that keeps these rules off the rest of the dashboard.
 */
#masteriyo-account-page > .chakra-stack {
	/* Neutral fallback, used when no icon matches below. */
	--uterus-alert-color: var(--nv-c-1);
	--uterus-alert-tint: var(--nv-light-bg);

	/*
	 * The alert renders outside the account container, so `w: full` made it
	 * span the viewport while every card below it sat inset — the main
	 * reason the banner read as broken rather than merely off-colour.
	 * Nudge this if it does not line up with the sidebar card's left edge;
	 * the container's own padding comes from Masteriyo's Chakra theme and
	 * is not readable from CSS.
	 */
	width: auto;
	margin: 0 var(--uterus-account-gutter, 1rem) 1rem;

	/* Matches .masteriyo-alert in the plugin's public.css (8px 16px, 4px
	   radius, 1px border) so both notice systems read as one component. */
	padding: 8px 16px;
	border: 1px solid var(--uterus-alert-color);
	border-radius: 4px;
	background: var(--uterus-alert-tint);
}

/* Success — the Ionicons checkmark-circle, second path is the tick. */
#masteriyo-account-page > .chakra-stack:has(path[d^="M352 176"]) {
	--uterus-alert-color: var(--uterus-status-success);
	--uterus-alert-tint: var(--uterus-status-success-tint);
}

/* Warning — the triangle outline. */
#masteriyo-account-page > .chakra-stack:has(path[d^="M85.57 446.25"]) {
	--uterus-alert-color: var(--uterus-status-warning);
	--uterus-alert-tint: var(--uterus-status-warning-tint);
}

/* Error — circle with an exclamation; shares its first path with success,
   so match on the second. */
#masteriyo-account-page > .chakra-stack:has(path[d^="M250.26 166.05"]) {
	--uterus-alert-color: var(--uterus-status-danger);
	--uterus-alert-tint: var(--uterus-status-danger-tint);
}

/* Info — the only one from a different icon set (Feather, not Ionicons) and
   the only one drawn from <circle> + <line> rather than <path>.
   Deliberately NOT matched on [viewBox="0 0 24 24"], which would be the
   obvious hook: in an HTML document the CSS parser lowercases attribute
   names in selectors, and SVG attributes are case-sensitive, so whether
   `viewbox` still matches `viewBox` is browser-dependent. Element names
   are lowercase in both namespaces, so <line> has no such ambiguity. */
#masteriyo-account-page > .chakra-stack:has(svg > line) {
	--uterus-alert-color: var(--uterus-status-info);
	--uterus-alert-tint: var(--uterus-status-info-tint);
}

/* x-large (24px) next to 14px text made the icon the loudest thing in the
   banner. 20px sits with the copy instead of shouting over it. */
#masteriyo-account-page > .chakra-stack .chakra-icon {
	color: var(--uterus-alert-color);
	font-size: 1.25rem;
	flex: none;
}

/* Chakra styles this from its own font stack and scale. Pull it back to the
   site's body type — 0.9375rem is the design-system body size (§3). */
#masteriyo-account-page > .chakra-stack .chakra-text {
	color: var(--nv-text-color);
	font-family: var(--bodyfontfamily), var(--nv-fallback-ff);
	font-size: 0.9375rem;
	line-height: 1.6;
}

/*
 * Fonts on the account page.
 *
 * The page loses Montserrat entirely, from two overrides that are both
 * injected by JS at runtime and therefore invisible to a grep of the
 * plugin's CSS. (masteriyo.md previously recorded "fonts are a non-issue,
 * the only hardcoded Inter is SCORM" — true of public.css, and wrong about
 * the page as rendered.)
 *
 * 1. Chakra's DEFAULT global styles. Masteriyo builds its theme with
 *    extendTheme({...}) and passes no base, so Chakra's own theme is the
 *    base and its `styles.global` survives the merge — including
 *    `body { font-family: var(--chakra-fonts-body) }`, which resolves to
 *    the -apple-system stack. Neve sets the same property on plain `body`
 *    (0,0,1) from a stylesheet in <head>; Emotion injects later, ties on
 *    specificity and wins on source order. The whole page goes system-font,
 *    header and footer included — not just the app.
 *
 * 2. Masteriyo's own `styles.global`, which hardcodes
 *    `font-family: 'Inter', sans-serif` on p, span, li, a, input, textarea,
 *    button, label and h1-h6 inside #masteriyo-account-page.
 *
 * So the fix needs two rules at two different scopes. `body.masteriyo-account-page`
 * (0,1,1) beats Chakra's `body`; the doubled id (2,0,0) beats Masteriyo's
 * `#masteriyo-account-page p` (1,0,1) — one id is a tie that loses on order.
 *
 * The inner rule uses `inherit` rather than restating the stack so there is
 * one source of truth. Safe as a blanket `*` because the app draws every
 * icon as an inline SVG — verified nothing inside it depends on an icon
 * font. If that ever changes, exclude the icon class here.
 *
 * Chakra's global also sets `color` and `line-height` on body. Deliberately
 * not reasserted: Neve sets line-height responsively and restating one
 * value would flatten the mobile/desktop split. Worth a look on the live
 * logged-in page.
 */
body.masteriyo-account-page {
	font-family: var(--bodyfontfamily), var(--nv-fallback-ff);
}

#masteriyo-account-page#masteriyo-account-page,
#masteriyo-account-page#masteriyo-account-page * {
	font-family: inherit;
}

/* (2,1,0) — deliberately above the blanket rule, so headings inside the app
   pick up Quattrocento Sans rather than inheriting body Montserrat. */
#masteriyo-account-page#masteriyo-account-page :is(h1, h2, h3, h4, h5, h6, .chakra-heading) {
	font-family: var(--headingsfontfamily), var(--nv-fallback-ff);
}

/*
 * Account page layout defects.
 *
 * Three separate bugs, all measured against the live logged-in page rather
 * than inferred. Anchored on the two stable classes Masteriyo does emit —
 * `.mto-account-sidebar` and `.account-sidebar-menu-item` — plus :has()
 * where only structure identifies the element. Every selector below reaches
 * (0,2,0) or better against Emotion's (0,1,0), so source order is irrelevant.
 */

/*
 * 1. Long menu labels pushed the chevron outside the card.
 *
 * Each row is Stack > Flex(flexGrow:1) > span(label) > p, with the chevron
 * as the Stack's second child. The label span already carries an inline
 * `overflow: hidden`, so it would shrink happily — the blocker is one level
 * up. The Flex has `overflow: visible`, so its automatic minimum size stays
 * at min-content, and with `white-space: nowrap` on the label that is the
 * full untruncated string. The row then overflows and the chevron lands on
 * the card border.
 *
 * Measured before: "Histórico de encomendas" scrollWidth 259 vs clientWidth
 * 236, chevron right edge 297 against a card edge of 296. After: 236/236,
 * chevron at 258, identical to every other row.
 *
 * `min-width: 0` alone would clip the text mid-word, since the inline
 * `white-space: nowrap` and `overflow: hidden` survive. Portuguese labels
 * run ~30px longer than the space available and no amount of padding
 * tightening recovers that, so the second rule lets them wrap to two lines
 * instead — nothing is lost or truncated. That row becomes 66px tall
 * against 45px for the rest.
 */
.mto-account-sidebar :has(> * > .account-sidebar-menu-item) {
	min-width: 0;
}

.mto-account-sidebar .account-sidebar-menu-item {
	white-space: normal;
}

/*
 * 2. The profile header did not line up with the menu beneath it.
 *
 * The block holding the avatar and name sits in a column Stack with
 * `align-items: center`, so it was centred in the card while every menu row
 * below is left-aligned — the avatar started 27px right of the menu icons
 * (x81 vs x54), reading as a stray indent rather than a deliberate one.
 *
 * `align-self` on the child beats the parent's `align-items` outright, so
 * only the padding needs matching. The menu icons sit at the card's content
 * edge + 1px (each row is a chakra-link carrying `border: 1px solid
 * transparent`) + the row's own padding-inline, which is Chakra space 3 at
 * base and space 4 from md up. Reproducing that arithmetic keeps the two
 * aligned if Masteriyo ever changes the row padding; the literal fallbacks
 * cover Chakra not having defined its space scale.
 */
.mto-account-sidebar :has(> .chakra-avatar) {
	align-self: flex-start;
	padding-left: calc(1px + var(--chakra-space-3, 0.75rem));
}

@media (min-width: 48em) {
	.mto-account-sidebar :has(> .chakra-avatar) {
		padding-left: calc(1px + var(--chakra-space-4, 1rem));
	}
}

/*
 * 3. The "Preços" filter rendered 12px taller than its two neighbours.
 *
 * This one is OURS, not Masteriyo's. The pricing dropdown is the only
 * react-select on the page built with `isSearchable: false`, and that swaps
 * the real text input for a visually-hidden `dummyInput`. react-select
 * resets it to `padding: 0; border: 0` — but from a single Emotion class
 * (0,1,0), and Neve's form-field rule (`--formfieldpadding`,
 * `--formfieldborderwidth`, `--formfieldfontsize`, from Customizer →
 * Global → Form Fields) matches the same element from a long selector list
 * that outweighs it. The hidden input inflated to 46px, dragging the
 * control to 52px against 40px for the search box and the category select.
 * Because the grid row is top-aligned, that read as the box sitting lower.
 *
 * Restoring react-select's own intent is the right fix rather than forcing
 * a height on the control — the input is invisible and should have no box
 * at all. All three controls now measure 460x40, 460x40, 276x40.
 */
#masteriyo-account-page input[class*="dummyInput"] {
	padding: 0;
	border: 0;
	font-size: inherit;
	line-height: 1;
}

/*
 * 4. "Pesquisar cursos" ran underneath the magnifier icon.
 *
 * Same collision as defect 3, one step further on: Neve's form-field rule
 * again, but the damage here is done by it being a *shorthand*.
 *
 * Chakra's InputGroup positions the icon absolutely and compensates by
 * setting `padding-inline-start: var(--input-height)` on the input — 40px,
 * exactly the left element's width. Neve then sets
 * `padding: var(--formfieldpadding)` (10px 12px), and a shorthand resets
 * every longhand it covers, so padding-inline-start collapsed to 12px and
 * the placeholder started under the icon.
 *
 * Reusing --input-height rather than hardcoding 40px means the padding
 * tracks the input's size variant instead of drifting if it changes.
 * Gated on :has() so it only applies where an element actually needs
 * clearing; the -end rule is defensive — no right element exists on the
 * courses screen today, but the profile screens are the obvious place for
 * one, and it would break identically.
 */
#masteriyo-account-page .chakra-input__group:has(> .chakra-input__left-element) > .chakra-input {
	padding-inline-start: var(--input-height, 2.5rem);
}

#masteriyo-account-page .chakra-input__group:has(> .chakra-input__right-element) > .chakra-input {
	padding-inline-end: var(--input-height, 2.5rem);
}

/*
 * 5. Course cards in the category-archive pattern (layout "B").
 *
 * These classes are written on blocks inside the synced pattern rendered by
 * masteriyo/archive-course-category.php, not by any plugin — see
 * docs/code-review.md, "Fixed on 2026-09-01". They style four things the
 * blocks cannot do on their own: a format badge over the thumbnail, a date
 * line with real weight, a footer holding price and call-to-action, and the
 * empty states both bound paragraphs produce.
 *
 * Colour comes from Neve's slots, never a brand hex — see design-system.md.
 * The badge takes its colour from the term class WordPress already writes on
 * the post element (formato-online / formato-presencial), so nothing needs to
 * inspect the rendered text.
 */
.uterus-card__thumb {
	position: relative;
}

.uterus-card__thumb .wp-block-post-featured-image {
	margin: 0;
}

.uterus-card__pill {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--nv-primary-accent);
	color: var(--nv-text-dark-bg);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.formato-online .uterus-card__pill {
	background: var(--nv-secondary-accent);
}

/*
 * The card body is a flex column with justifyContent:center, so anything that
 * is not full width gets centred on the cross axis — the title and highlights
 * are block-level and stretch, but a bound paragraph and the footer group do
 * not. Stretch them explicitly or the card reads as two different alignments.
 */
.uterus-card__date {
	align-self: stretch;
	color: var(--nv-c-1);
	font-weight: 600;
}

/*
 * Both bound paragraphs render an empty <p> when the course has no value —
 * deliberately empty rather than null, so a missing format never prints the
 * literal placeholder. Empty is still a box, though: without this the badge
 * would be a bare coloured dot and the date line would hold open a gap.
 */
.uterus-card__pill:empty,
.uterus-card__date:empty {
	display: none;
}

.uterus-card__foot {
	/* align-self covers the flex parent, width the block one — the card body's
	   layout differs between breakpoints and only one of the two applies. */
	align-self: stretch;
	width: 100%;
	margin-top: auto;
	padding-top: 0.75rem;
	gap: 0.5rem;
}

.uterus-card__foot .masteriyo-course-price {
	font-weight: 600;
}

/*
 * Looks like a button, deliberately isn't one. The whole card is a single
 * anchor from tiptip/hyperlink-group-block, so a real link here would nest
 * anchors — invalid HTML that browsers repair by closing the outer link
 * early, leaving the card and the button fighting over clicks. See
 * docs/masteriyo.md §7, same trap as the enrol button. This is a <p>; the
 * click is the card's.
 */
.uterus-card__cta {
	padding: 8px 14px;
	border-radius: 3px;
	background: var(--nv-primary-accent);
	color: var(--nv-text-dark-bg);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.uterus-box-with-hover:hover .uterus-card__cta {
	background: var(--nv-c-1);
}

/*
 * Highlights are free text typed per course, so the card shows the first two
 * and leaves the rest for the course page. Editorial, not technical: whichever
 * two lines the course lists first are the two that show. Delete this rule to
 * show them all.
 */
.uterus-card__thumb ~ * .masteriyo-course-highlights--item:nth-child(n + 3) {
	display: none;
}

/*
 * Card hover: shadow only, no fade.
 *
 * Neve fades every link on hover — `a:focus,a:hover{opacity:.9;color:var(
 * --nv-secondary-accent)}`. The colour half no longer reaches the card: the
 * anchor wraps .uterus-box-with-hover, which sets its own colour, so nothing
 * inside inherits the teal.
 *
 * It DID reach it until 2026-09-01, and the reason is worth remembering: the
 * masteriyo/course-user-progress block emitted an unclosed <div>, the parser
 * repaired it by closing the anchor early and reconstructing it *inside* the
 * card group, and with the nesting inverted the group's colour no longer sat
 * between the anchor and the text. Removing that block from the card fixed
 * the colour, the footer width and a duplicate empty link in one go. If teal
 * text ever comes back on hover, look for malformed block output before
 * reaching for more CSS.
 *
 * The opacity fade is still Neve's and still applies; the drop-shadow already
 * signals the hover, so it is turned off here. Delete this rule to get it back.
 */
a.wp-block-tiptip-hyperlink-group-block:hover,
a.wp-block-tiptip-hyperlink-group-block:focus {
	opacity: 1;
}

/*
 * Past courses ("já realizadas") — same card, one step back.
 *
 * They keep the grid, the badge, the date and the footer of the other two
 * loops; the only difference is a light fade, enough to read as archive
 * without turning into a separate component. Opacity rather than greyscale so
 * the badge colours still say Presencial vs Online, and 0.72 rather than
 * lower because the text has to stay legible: #111 at 0.72 over the card's
 * #edededad lands around 8:1, comfortably past AA.
 */
.uterus-cards--past .wp-block-post {
	opacity: 0.72;
}

/*
 * A past course is reference, not an offer: no price, no call to action. That
 * empties the footer, so the whole row goes rather than just its contents —
 * otherwise it stays as 0.75rem of padding under the highlights. The card is
 * still a link, so the course page is one click away either way.
 */
.uterus-cards--past .uterus-card__foot {
	display: none;
}
