/*
Theme Name: FACI Academy Child
Theme URI: https://faciacademy.com
Description: Child theme for the FACI Academy course library on MasterStudy LMS. Design tokens, readable lesson and quiz styling, and block patterns for a landing page, a how-it-works section and an FAQ. Parent is the free MasterStudy Starter Theme (ms-lms-starter-theme); tested on a throwaway site with that parent (see README.md).
Author: FACI Academy
Template: ms-lms-starter-theme
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: faci-academy-child
*/

/* ---------------------------------------------------------------------------
   Design tokens. Change colours here; everything below uses them.
   Text on --edutech-surface and white passes WCAG AA (4.5:1) with --edutech-ink.
   --------------------------------------------------------------------------- */
:root {
	--edutech-ink: #0b2545;
	--edutech-text: #243b53;
	--edutech-accent: #1d6fd6;
	--edutech-accent-dark: #154f9a;
	--edutech-warm: #f0a030;
	--edutech-surface: #f5f8fc;
	--edutech-border: #d5dfeb;
	--edutech-code-bg: #0f1b2d;
	--edutech-code-text: #e6edf7;
	--edutech-radius: 8px;
}

/* Course page and enrol button */
.masterstudy-buy-button__link,
.masterstudy-buy-button__link_centered {
	background: var(--edutech-accent);
	border-radius: var(--edutech-radius);
	color: #fff;
	font-weight: 700;
}

.masterstudy-buy-button__link:hover,
.masterstudy-buy-button__link:focus-visible {
	background: var(--edutech-accent-dark);
}

.masterstudy-single-course__cta a:focus-visible,
.masterstudy-course-player-header a:focus-visible,
.masterstudy-nav-button:focus-visible {
	outline: 3px solid var(--edutech-warm);
	outline-offset: 2px;
}

/* Course cards: show the whole 16:9 thumbnail instead of a cropped centre */
.stm_lms_courses__single--image__container {
	width: 100%;
	height: auto !important; /* MasterStudy sets a fixed pixel height; without this the 16:9 ratio widens the box */
	aspect-ratio: 16 / 9;
}

.stm_lms_courses__single--image__container img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Lesson reading experience in the course player */
.masterstudy-course-player-lesson {
	color: var(--edutech-text);
	line-height: 1.7;
}

.masterstudy-course-player-lesson h2 {
	color: var(--edutech-ink);
	margin-top: 2em;
	padding-bottom: 0.25em;
	border-bottom: 2px solid var(--edutech-border);
}

.masterstudy-course-player-lesson h3 {
	color: var(--edutech-ink);
}

.masterstudy-course-player-lesson a {
	color: var(--edutech-accent-dark);
	text-decoration: underline;
}

/* Code blocks: the courses are full of real commands and output, so make them easy to read and copy */
.masterstudy-course-player-lesson pre {
	background: var(--edutech-code-bg);
	color: var(--edutech-code-text);
	border-radius: var(--edutech-radius);
	padding: 1em 1.2em;
	overflow-x: auto;
	font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	tab-size: 4;
}

.masterstudy-course-player-lesson pre code {
	background: transparent;
	color: inherit;
	padding: 0;
	font: inherit;
}

.masterstudy-course-player-lesson :not(pre) > code {
	background: var(--edutech-surface);
	color: var(--edutech-ink);
	border: 1px solid var(--edutech-border);
	border-radius: 4px;
	padding: 0.1em 0.35em;
	font: 0.9em ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.masterstudy-course-player-lesson table {
	border-collapse: collapse;
	width: 100%;
	display: block;
	overflow-x: auto;
}

.masterstudy-course-player-lesson th,
.masterstudy-course-player-lesson td {
	border: 1px solid var(--edutech-border);
	padding: 0.5em 0.75em;
	text-align: left;
	vertical-align: top;
}

.masterstudy-course-player-lesson th {
	background: var(--edutech-surface);
	color: var(--edutech-ink);
}

.masterstudy-course-player-lesson blockquote {
	margin: 1.2em 0;
	padding: 0.6em 1em;
	border-left: 4px solid var(--edutech-warm);
	background: var(--edutech-surface);
}

/* Quiz explanations: the teaching text shown after a quiz is submitted */
.masterstudy-course-player-question__explanation {
	margin-top: 0.6em;
	padding: 0.7em 1em;
	border-left: 4px solid var(--edutech-accent);
	background: var(--edutech-surface);
	color: var(--edutech-text);
	font-size: 0.95em;
	line-height: 1.6;
}

/* Landing page patterns (see patterns/) */
.edutech-hero {
	background: var(--edutech-ink);
	color: #fff;
	padding: clamp(2rem, 6vw, 5rem) 1.5rem;
	border-radius: var(--edutech-radius);
}

.edutech-hero h1,
.edutech-hero p {
	color: #fff;
}

.edutech-hero .wp-block-button__link {
	background: var(--edutech-warm);
	color: var(--edutech-ink);
	font-weight: 700;
}

.edutech-card {
	background: var(--edutech-surface);
	border: 1px solid var(--edutech-border);
	border-radius: var(--edutech-radius);
	padding: 1.25rem;
}

.edutech-faq details {
	border: 1px solid var(--edutech-border);
	border-radius: var(--edutech-radius);
	padding: 0.75rem 1rem;
	margin-bottom: 0.6rem;
}

.edutech-faq summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--edutech-ink);
}

/* Respect people who ask for less motion */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* Course list on phones: the "Load More" button is how learners reach every course, so make it an easy touch target. */
.ms_lms_courses_archive__load-more {
	display: flex;
	justify-content: center;
	margin: 24px 0 8px;
}
.ms_lms_courses_archive__load-more-button {
	min-height: 48px;
	min-width: 180px;
	padding: 12px 28px;
	font-size: 16px;
}
@media (max-width: 767px) {
	.ms_lms_courses_archive__load-more-button {
		width: 100%;
		max-width: 360px;
	}
}

/* Contact form */
.faci-contact { max-width: 640px; }
.faci-contact label { display: block; font-weight: 600; margin-bottom: 4px; color: var(--edutech-ink); }
.faci-contact input[type="text"],
.faci-contact input[type="email"],
.faci-contact textarea { width: 100%; padding: 12px; border: 1px solid var(--edutech-border); border-radius: var(--edutech-radius); font-size: 16px; box-sizing: border-box; }
.faci-contact input:focus-visible, .faci-contact textarea:focus-visible, .faci-contact__button:focus-visible { outline: 3px solid var(--edutech-accent); outline-offset: 2px; }
.faci-contact__button { min-height: 48px; padding: 12px 28px; background: var(--edutech-accent); color: #fff; border: 0; border-radius: var(--edutech-radius); font-size: 16px; font-weight: 700; cursor: pointer; }
.faci-contact__button:hover { background: var(--edutech-accent-dark); }
.faci-contact__msg { padding: 12px 16px; border-radius: var(--edutech-radius); }
.faci-contact__msg.is-ok { background: #e8f6ec; color: #14532d; }
.faci-contact__msg.is-error { background: #fdecec; color: #7f1d1d; }
