/*
Theme Name: 28Stone Learning
Theme URI: https://www.28stone.com
Author: 28Stone Consulting
Description: 28Stone brand layer for the Course theme by Automattic (Sensei LMS). Nunito typography, 28Stone orange header, pill buttons and warm course cards. Requires the Course theme to be installed.
Template: course
Version: 1.0.4
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: 28stone-course
*/

/*
 * Note: the Course theme loads this file in place of its own style.css
 * (it uses get_stylesheet_directory_uri()), so the parent rules that are
 * still needed are carried over below.
 *
 * Colours, fonts and sizes come from theme.json presets. This file only
 * references them (var(--wp--preset--...)); raw colour values live in theme.json.
 */

/* ---------------------------------------------------------------
 * Base
 * ------------------------------------------------------------- */
body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

/* Links: ink-coloured text with an orange underline keeps body copy at full contrast. */
a {
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-thickness: 3px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.wp-site-blocks header ~ main {
	margin-block-start: 0;
	padding-block-start: clamp(2rem, 5vw, 4rem);
}

/* ---------------------------------------------------------------
 * Header: the orange bar
 * ------------------------------------------------------------- */
header.wp-block-template-part {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

header .navigation-wrapper {
	min-height: 88px;
	gap: 2rem;
}

.y-brand {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	color: inherit;
	text-decoration: none;
}

.y-brand__logo {
	display: block;
	width: 160px;
	height: auto;
}

.y-brand__product {
	padding-left: 1rem;
	border-left: 2px solid currentColor;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.2;
}

header.wp-block-template-part a {
	color: inherit;
	text-decoration: none;
}

header.wp-block-template-part a:hover,
header .wp-block-navigation a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}

header.wp-block-template-part :focus-visible {
	outline-color: var(--wp--preset--color--background);
}

@media (max-width: 600px) {
	header .navigation-wrapper {
		min-height: 72px;
	}

	.y-brand__logo {
		width: 128px;
	}

	.y-brand__product {
		display: none;
	}
}

/* ---------------------------------------------------------------
 * Buttons (shape and colours come from theme.json; these cover
 * the outline style, which theme.json cannot express on its own)
 * ------------------------------------------------------------- */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button .wp-block-button__link.is-style-outline {
	background-color: transparent;
	border-color: var(--wp--preset--color--primary);
	border-width: 2px;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	padding: var(--wp--custom--button--spacing--padding--top) var(--wp--custom--button--spacing--padding--right) var(--wp--custom--button--spacing--padding--bottom) var(--wp--custom--button--spacing--padding--left);
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):active {
	background-color: var(--wp--preset--color--foreground);
	border-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
}

/* ---------------------------------------------------------------
 * Sensei course list: each course as a warm card
 * ------------------------------------------------------------- */
.wp-block-sensei-lms-course-list .wp-block-post {
	padding: 1.5rem;
	background-color: var(--wp--preset--color--blush);
	border: 2px solid var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--radius--card);
}

/* The card pattern wraps each course in its own bordered group; the card above replaces it. */
.wp-block-sensei-lms-course-list .wp-block-post > .wp-block-group {
	border: 0 !important;
	padding: 0 !important;
	background: none !important;
}

.wp-block-sensei-lms-course-list select {
	padding: 0.5rem 0.875rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--foreground);
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
}

/* Course progress: green is the brand's "positive" colour. */
.sensei-progress-bar__bar {
	background-color: var(--wp--preset--color--tertiary);
	border-radius: var(--wp--custom--button--radius);
}

.sensei-progress-bar__progress {
	background-color: var(--wp--preset--color--secondary);
	border-radius: var(--wp--custom--button--radius);
}

/* ---------------------------------------------------------------
 * Sensei notices (quiz result, "take the quiz" on lessons)
 * Sensei paints these in the text colour (ink); here they become the
 * brand's light callout: warm surface with the orange left rule.
 * ------------------------------------------------------------- */
body.sensei-course-theme .sensei-lms-notice {
	background-color: var(--wp--preset--color--blush);
	color: var(--wp--preset--color--foreground);
	border-left: 10px solid var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--radius--card);
}

/* Exit Course: Sensei underlines the wrapper as well as the link inside it,
 * which draws two lines. Keep only the link's own (orange) underline. */
body .wp-block-sensei-lms-exit-course {
	text-decoration: none;
}

/* Lesson list in the course sidebar: no underlines at rest (it is navigation,
 * and the current lesson is already bold); the title is underlined on hover
 * and keyboard focus. */
body .sensei-lms-course-navigation .sensei-lms-course-navigation-lesson__link,
body .sensei-lms-course-navigation .sensei-lms-course-navigation-lesson__extra {
	text-decoration: none;
}

body .sensei-lms-course-navigation .sensei-lms-course-navigation-lesson__link:is(:hover, :focus-visible) .sensei-lms-course-navigation-lesson__title,
body .sensei-lms-course-navigation .sensei-lms-course-navigation-lesson__extra:is(:hover, :focus-visible) {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

/* ---------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------- */
footer.wp-block-template-part {
	margin-block-start: 0;
	background-color: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--muted);
}

.y-footer {
	padding-block: 2rem;
	font-size: var(--wp--preset--font-size--x-small);
}

.y-footer p {
	margin: 0;
}

.y-footer a {
	color: var(--wp--preset--color--foreground);
}

/* ---------------------------------------------------------------
 * Carried over from the Course theme
 * ------------------------------------------------------------- */
.search .wp-block-post-template .wp-block-post {
	margin: 0;
}

body.page-template-page-wide-width .wp-block-post-content .wp-block-group,
body.page-template-page-wide-width footer .wp-block-group {
	margin-block-end: 0;
}
