/*
Theme Name: AccessNow Learn
Theme URI: https://accessnow.com.au/projects/accessnow-learn/
Author: AccessNow
Author URI: https://accessnow.com.au
Description: A calm, readable block theme for course sites, made to go with AccessNow LMS. Set in Atkinson Hyperlegible, a typeface designed for legibility, with high-contrast colours, clear focus outlines, landing-page patterns and three style variations. Course, lesson and quiz pages pick up the theme's colours automatically.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: accessnow-learn
Tags: education, blog, one-column, wide-blocks, block-patterns, full-site-editing, style-variations, accessibility-ready, custom-colors, editor-style
*/

/* AccessNow LMS: its colours follow the theme (and each style variation). */
body {
	--slms-accent: var(--wp--preset--color--accent);
	--slms-accent-hover: var(--wp--preset--color--accent-strong);
	--slms-on-accent: var(--wp--preset--color--on-accent);
	--slms-link: var(--wp--preset--color--accent);
	--slms-success: var(--wp--preset--color--accent);
	--slms-progress: var(--wp--preset--color--accent);
	--slms-track: var(--wp--preset--color--line);
	--slms-surface: var(--wp--preset--color--surface);
	--slms-surface-alt: var(--wp--preset--color--surface);
	--slms-border: var(--wp--preset--color--line);
	--slms-text: var(--wp--preset--color--contrast);
	--slms-text-muted: var(--wp--preset--color--muted);
	--slms-option-hover: var(--wp--preset--color--soft);
	--slms-option-selected: var(--wp--preset--color--soft);
}

/* Course pages: the LMS's own wrapper, widened a little and given the theme's rhythm. */
.slms-wrap {
	max-width: var(--wp--style--global--wide-size);
	padding: var(--wp--preset--spacing--40) 0 var(--wp--preset--spacing--60);
}
.slms-single-lesson,
.slms-single-quiz {
	max-width: 860px;
}
.slms-course-title,
.slms-lesson-title,
.slms-quiz-title,
.slms-page-title {
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.15;
	margin: 0.25em 0 0.4em;
}
.slms-heading-prefix {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--highlight);
	margin-bottom: 0.35em;
}
.slms-parent-course-title {
	font-weight: 700;
	color: var(--wp--preset--color--muted);
	margin: 0;
}
.slms-btn {
	border-radius: var(--wp--custom--radius--small);
	font-size: var(--wp--preset--font-size--medium);
	padding: 0.8rem 1.6rem;
}
.slms-course-card,
.slms-unit,
.slms-question,
.slms-auth-box,
#slms-quiz-results,
.slms-badge-item,
.slms-certificate-card,
.slms-stat {
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface);
}
.slms-course-card {
	box-shadow: var(--wp--preset--shadow--card);
}
.slms-unit-title {
	background: var(--wp--preset--color--soft);
	font-weight: 700;
}
.slms-lesson-item.slms-complete {
	background: var(--wp--preset--color--soft);
}
.slms-lesson-item.slms-invalidated,
.slms-quiz-timer {
	background: var(--wp--preset--color--highlight-soft);
	color: var(--wp--preset--color--contrast);
}
.slms-course-thumbnail img {
	border-radius: var(--wp--custom--radius--medium);
}

/* Navigation: the last menu item can be a button ("My learning"). */
.wp-block-navigation .is-style-button > a,
.wp-block-navigation .wp-block-navigation-item.is-style-button .wp-block-navigation-item__content {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	border-radius: var(--wp--custom--radius--small);
	padding: 0.45rem 1rem;
}

/* Full-width bands sit edge to edge: no gaps between the header, sections and footer. */
.wp-site-blocks > * {
	margin-block-start: 0;
}
.wp-block-post-content > .alignfull + .alignfull,
.wp-block-post-content > .alignfull:first-child {
	margin-block-start: 0;
}

/* Style switcher: a small labelled pill beside the navigation. */
.agl-style-switcher {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1;
}
.agl-style-switcher[hidden] {
	display: none;
}
.agl-style-switcher label {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.agl-style-switcher select {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
	background-color: var(--wp--preset--color--soft);
	/* The arrow: two gradient triangles in the text colour, so it follows every style. */
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 1.05rem) 52%, calc(100% - 0.7rem) 52%;
	background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
	background-repeat: no-repeat;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: 0.55rem 2.1rem 0.55rem 0.95rem;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}
.agl-style-switcher select:hover {
	border-color: var(--wp--preset--color--accent);
}
.agl-style-switcher select:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
/* Narrow screens: the word "Style" is hidden from sight (screen readers still hear it). */
@media (max-width: 600px) {
	.agl-style-switcher label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

/* Keyboard focus is always visible. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* Cards made with the "Card" group style. */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--preset--shadow--card);
	padding: var(--wp--preset--spacing--40);
}

/* A numbered step: big number above the text. */
.is-style-step-number {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font-weight: 700;
}

/* Details (FAQ): a clear disclosure marker. */
.wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
