/*
Theme Name: AfriOSH LMS
Theme URI: https://grupawilson.com/
Author: Grupa Technology
Author URI: https://grupawilson.com/
Description: The AfriOSH Occupational Safety and Health learning platform theme, built on Grupa LMS. Developed by Grupa Technology.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: afriosh
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   Design tokens
   Grounded in the AfriOSH mark: deep teal + safety orange + compliance gold.
   Background is a teal-tinted mist rather than a warm cream, so it reads as
   "safety/compliance" rather than "editorial blog".
   ========================================================================== */

:root {
	--afriosh-teal-900: #123f3d;
	--afriosh-teal-700: #1a6b6b;
	--afriosh-teal-600: #226f6d;
	--afriosh-orange-600: #e8622c;
	--afriosh-orange-700: #cc4f1e;
	--afriosh-gold-500: #d6a429;
	--afriosh-hazard-yellow: #f2c230;
	--afriosh-ink-900: #1f2a30;
	--afriosh-ink-600: #566169;
	--afriosh-mist-50: #f2f7f6;
	--afriosh-mist-100: #e7efee;
	--afriosh-white: #ffffff;
	--afriosh-border: #dbe6e4;

	--afriosh-font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
	--afriosh-font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--afriosh-font-mono: "IBM Plex Mono", ui-monospace, monospace;

	--afriosh-radius: 10px;
	--afriosh-shadow: 0 4px 24px rgba(18, 63, 61, 0.08);

	/* Keep the Grupa LMS plugin's own CSS variables in sync with the theme,
	   so course cards, dashboards, quizzes, and certificates automatically
	   pick up AfriOSH branding without editing plugin files. */
	--grupa-color-primary: var(--afriosh-teal-700);
	--grupa-color-accent: var(--afriosh-orange-600);
	--grupa-color-highlight: var(--afriosh-gold-500);
	--grupa-color-text: var(--afriosh-ink-900);
	--grupa-color-muted: var(--afriosh-ink-600);
	--grupa-color-border: var(--afriosh-border);
	--grupa-color-bg-soft: var(--afriosh-mist-50);
	--grupa-radius: var(--afriosh-radius);
}

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

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--afriosh-font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--afriosh-ink-900);
	background: var(--afriosh-white);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--afriosh-teal-700); }

h1, h2, h3, h4 {
	font-family: var(--afriosh-font-display);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: 0.2px;
	margin: 0 0 .5em;
	color: var(--afriosh-ink-900);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); }
h3 { font-size: 1.4rem; }

.afriosh-eyebrow {
	font-family: var(--afriosh-font-mono);
	font-size: 12px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--afriosh-orange-600);
	font-weight: 600;
	display: inline-block;
	margin-bottom: 14px;
}

.afriosh-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.afriosh-section { padding: 72px 0; }
.afriosh-section--tight { padding: 48px 0; }

:focus-visible { outline: 2px solid var(--afriosh-teal-700); outline-offset: 3px; }

.skip-link {
	position: absolute; left: -9999px; top: 0; background: var(--afriosh-teal-900);
	color: #fff; padding: 12px 20px; z-index: 10000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ==========================================================================
   Header
   ========================================================================== */

.afriosh-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: rgba(255,255,255,.96);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid var(--afriosh-border);
}

.afriosh-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 14px 0;
}

.afriosh-logo {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-family: var(--afriosh-font-display);
	font-weight: 800;
	font-size: 26px;
	text-decoration: none;
	color: var(--afriosh-teal-700);
}
.afriosh-logo span { color: var(--afriosh-orange-600); }
.afriosh-logo img { height: 34px; width: auto; display: block; }
.afriosh-logo small {
	font-family: var(--afriosh-font-mono);
	font-size: 9px;
	letter-spacing: 1.5px;
	color: var(--afriosh-ink-600);
	display: block;
	text-transform: uppercase;
	font-weight: 600;
}

.afriosh-nav { display: flex; align-items: center; gap: 28px; }
.afriosh-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.afriosh-nav a {
	color: var(--afriosh-ink-900);
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
}
.afriosh-nav a:hover { color: var(--afriosh-teal-700); }

.afriosh-header__actions { display: flex; align-items: center; gap: 14px; }

.afriosh-menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
}
.afriosh-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--afriosh-ink-900); margin: 5px 0; }

/* ==========================================================================
   Buttons (shared visual language with the plugin's .grupa-lms-btn)
   ========================================================================== */

.afriosh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
	min-height: 46px;
}
.afriosh-btn--primary { background: var(--afriosh-orange-600); color: #fff; }
.afriosh-btn--primary:hover { background: var(--afriosh-orange-700); transform: translateY(-1px); }
.afriosh-btn--ghost { background: transparent; border-color: var(--afriosh-teal-700); color: var(--afriosh-teal-700); }
.afriosh-btn--ghost:hover { background: var(--afriosh-teal-700); color: #fff; }
.afriosh-btn--on-dark { border-color: rgba(255,255,255,.5); color: #fff; }
.afriosh-btn--on-dark:hover { background: #fff; color: var(--afriosh-teal-900); }

/* ==========================================================================
   Hero
   ========================================================================== */

.afriosh-hero {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, var(--afriosh-mist-50) 0%, var(--afriosh-white) 100%);
}

.afriosh-hero__grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 48px;
	align-items: center;
	padding: 76px 0 64px;
}

.afriosh-hero h1 { margin-bottom: 18px; }
.afriosh-hero h1 em { font-style: normal; color: var(--afriosh-teal-700); }

.afriosh-hero__lead { font-size: 18px; color: var(--afriosh-ink-600); max-width: 46ch; margin-bottom: 30px; }

.afriosh-hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.afriosh-hero__stats { display: flex; gap: 36px; flex-wrap: wrap; }
.afriosh-hero__stat strong {
	display: block;
	font-family: var(--afriosh-font-mono);
	font-size: 26px;
	font-weight: 700;
	color: var(--afriosh-teal-900);
}
.afriosh-hero__stat span { font-size: 12px; color: var(--afriosh-ink-600); text-transform: uppercase; letter-spacing: 1px; }

/* Signature element: the compliance seal — echoes the certificate seal so
   the hero, homepage, and issued certificates all read as one system. */
.afriosh-seal {
	--seal-size: 320px;
	width: var(--seal-size);
	height: var(--seal-size);
	max-width: 100%;
	margin: 0 auto;
	position: relative;
	animation: afriosh-seal-in .7s ease both;
}
@keyframes afriosh-seal-in {
	from { opacity: 0; transform: scale(.92) translateY(10px); }
	to { opacity: 1; transform: scale(1) translateY(0); }
}
.afriosh-seal svg { width: 100%; height: 100%; display: block; }

/* Hazard-stripe divider — used exactly once, between hero and the next
   section, drawn from OSH signage rather than decoration for its own sake. */
.afriosh-hazard-divider {
	height: 10px;
	background: repeating-linear-gradient(
		135deg,
		var(--afriosh-teal-900) 0 22px,
		var(--afriosh-gold-500) 22px 44px
	);
}

/* ==========================================================================
   Pillars (Training / Consulting / OSH — matches the tagline exactly,
   parallel categories, not a sequence, so no numbered markers)
   ========================================================================== */

.afriosh-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.afriosh-pillar {
	background: var(--afriosh-white);
	border: 1px solid var(--afriosh-border);
	border-radius: var(--afriosh-radius);
	padding: 32px;
	transition: box-shadow .2s ease, transform .2s ease;
}
.afriosh-pillar:hover { box-shadow: var(--afriosh-shadow); transform: translateY(-2px); }

.afriosh-pillar__icon {
	width: 52px; height: 52px; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	background: var(--afriosh-mist-50); color: var(--afriosh-teal-700);
	margin-bottom: 18px;
}
.afriosh-pillar__icon svg { width: 26px; height: 26px; }

.afriosh-pillar p { color: var(--afriosh-ink-600); margin: 0; }

/* ==========================================================================
   Stats band
   ========================================================================== */

.afriosh-stats-band { background: var(--afriosh-teal-900); color: #fff; }
.afriosh-stats-band .afriosh-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.afriosh-stat strong {
	display: block;
	font-family: var(--afriosh-font-mono);
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 700;
	color: var(--afriosh-hazard-yellow);
}
.afriosh-stat span { font-size: 13px; letter-spacing: .5px; color: rgba(255,255,255,.8); }

/* ==========================================================================
   Featured courses section header + testimonials + CTA band
   ========================================================================== */

.afriosh-section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.afriosh-section__head p { color: var(--afriosh-ink-600); max-width: 52ch; margin: 8px 0 0; }

.afriosh-testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.afriosh-testimonial {
	background: var(--afriosh-mist-50);
	border-radius: var(--afriosh-radius);
	padding: 28px;
}
.afriosh-testimonial blockquote { margin: 0 0 16px; font-size: 16px; color: var(--afriosh-ink-900); }
.afriosh-testimonial cite { font-style: normal; font-weight: 700; font-size: 14px; }
.afriosh-testimonial cite span { display: block; font-weight: 400; color: var(--afriosh-ink-600); font-size: 13px; }

.afriosh-cta-band {
	background: linear-gradient(135deg, var(--afriosh-teal-700), var(--afriosh-teal-900));
	color: #fff;
	border-radius: 20px;
	padding: 56px;
	text-align: center;
}
.afriosh-cta-band h2 { color: #fff; }
.afriosh-cta-band p { color: rgba(255,255,255,.85); max-width: 52ch; margin: 0 auto 28px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.afriosh-footer { background: var(--afriosh-teal-900); color: rgba(255,255,255,.85); }
.afriosh-footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 32px; }
.afriosh-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; font-family: var(--afriosh-font-body); font-weight: 700; margin-bottom: 16px; }
.afriosh-footer ul { list-style: none; margin: 0; padding: 0; }
.afriosh-footer li { margin-bottom: 10px; }
.afriosh-footer a { color: rgba(255,255,255,.8); text-decoration: none; font-size: 14px; }
.afriosh-footer a:hover { color: #fff; }
.afriosh-footer__tagline { font-family: var(--afriosh-font-mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.6); margin-top: 10px; }

.afriosh-footer__bottom {
	border-top: 1px solid rgba(255,255,255,.12);
	padding: 20px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 13px;
	color: rgba(255,255,255,.6);
}
.afriosh-footer__bottom a { color: rgba(255,255,255,.8); text-decoration: underline; }

/* ==========================================================================
   Generic page / single content wrapper (non-LMS pages)
   ========================================================================== */

.afriosh-page { padding: 56px 0; }
.afriosh-page__content { max-width: 760px; margin: 0 auto; }
.afriosh-page__content h1 { margin-bottom: 24px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
	.afriosh-hero__grid { grid-template-columns: 1fr; padding-top: 40px; }
	.afriosh-seal { order: -1; --seal-size: 200px; margin-bottom: 12px; }
	.afriosh-pillars { grid-template-columns: 1fr; }
	.afriosh-testimonials { grid-template-columns: 1fr; }
	.afriosh-stats-band .afriosh-container { grid-template-columns: repeat(2, 1fr); }
	.afriosh-footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 782px) {
	.afriosh-nav ul { display: none; }
	.afriosh-menu-toggle { display: block; }
	.afriosh-header__actions .afriosh-btn { padding: 10px 16px; font-size: 13px; }
	.afriosh-section { padding: 48px 0; }
	.afriosh-cta-band { padding: 36px 22px; }
}

@media (max-width: 560px) {
	.afriosh-hero__stats { gap: 20px; }
	.afriosh-footer__top { grid-template-columns: 1fr; }
	.afriosh-footer__bottom { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   Single course override layout (theme's grupa-lms/single-course.php)
   ========================================================================== */

@media (max-width: 900px) {
	.afriosh-container > div[style*="grid-template-columns:1fr 340px"] {
		grid-template-columns: 1fr !important;
	}
	aside[style*="position:sticky"] { position: static !important; }
}
