/*
Theme Name:        RSustain Academy
Theme URI:         https://academy.rsustain.co.uk
Author:            Resilient Sustainance Limited
Author URI:        https://rsustain.co.uk
Description:       Proprietary LMS theme for RSustain Academy — ESG, Net Zero, CSRD, UK SDR and ISSB practitioner training. Supports Learner, Tutor and Admin roles with course upload, enrolment management, ISEP-aligned certification pathways, LearnDash and WooCommerce integration.
Version:           2.0.0
Requires at least: 6.2
Tested up to:      6.7
Requires PHP:      8.1
License:           Proprietary — All rights reserved, Resilient Sustainance Limited
Text Domain:       rsustain-academy
Tags:              lms, esg, sustainability, e-learning, learndash, woocommerce, custom-menu, custom-logo, full-width-template
*/

/* ── DESIGN TOKENS ── */
:root {
  /* Primary palette — Navy */
  --rs-navy:     #1B2A4A;
  --rs-navy-m:   #243B5C;
  --rs-navy-l:   #2E4A6E;

  /* Accent — Green (CTAs, badges, highlights only) */
  --rs-mint:     #4DAB84;
  --rs-mint-l:   #7DCBA8;
  --rs-sage:     #2E7D5F;

  /* Accent — Gold (premium) */
  --rs-gold:     #C9982A;
  --rs-gold-l:   #E5B84A;

  /* Neutrals */
  --rs-charcoal: #1A1A1A;
  --rs-gray:     #4A4A4A;
  --rs-gray-l:   #888888;
  --rs-white:    #FFFFFF;
  --rs-surface:  #F7F8FA;
  --rs-surface-alt: #F0F2F5;
  --rs-border:   #E5E7EB;
  --rs-border-d: #D1D5DB;

  /* Footer */
  --rs-footer:   #111827;

  /* Semantic */
  --rs-error:    #C0392B;
  --rs-success:  #1A7A4E;

  /* Legacy compat aliases */
  --rs-forest:   var(--c-navy);
  --rs-forest-m: var(--rs-navy-m);
  --rs-forest-l: var(--c-navy-l);
  --rs-cream:    var(--rs-surface-alt);
  --rs-cream-d:  #E8EAF0;

  /* Typography */
  --font-serif:  'Inter', Georgia, serif;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-mono:   'SF Mono', 'Consolas', monospace;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .10);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, .12);

  /* Transitions */
  --ease: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-sans);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rs-sage); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-navy); }

/* Scrollbar — Firefox standard + WebKit */
* { scrollbar-width: thin; scrollbar-color: #9CA3AF var(--rs-surface-alt); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--rs-surface-alt); }
::-webkit-scrollbar-thumb { background: #9CA3AF; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6B7280; }

/* Selection */
::selection { background: rgba(77, 171, 132, .2); color: var(--c-navy); }

/* ── LAYOUT ── */
.rs-wrap { max-width: 1240px; margin: 0 auto; padding: 0 2rem; }
.rs-wrap--narrow { max-width: 780px; }
.rs-section { padding: 5rem 0; }
.rs-section--dark { background: var(--c-navy); color: #fff; }
.rs-section--cream { background: var(--rs-surface-alt); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-serif);
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h5 { font-size: 1.1rem; margin-bottom: 0.5rem; }
h6 { font-size: 1rem; margin-bottom: 0.5rem; }

.rs-eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--rs-sage);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.rs-title {
  font-family: var(--f-serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.rs-desc {
  font-size: 16px;
  color: var(--c-border);
  line-height: 1.7;
}

/* ── BUTTONS ── */
.rs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--r-lg);
  transition: var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.rs-btn--primary {
  background: var(--c-sage);
  color: var(--c-navy);
  padding: 13px 28px;
  font-size: 15px;
}
.rs-btn--primary:hover {
  background: var(--c-sage-l);
  box-shadow: 0 6px 20px rgba(77, 171, 132, .35);
  color: var(--c-navy);
  transform: translateY(-1px);
}
.rs-btn--dark {
  background: var(--c-navy);
  color: #fff;
  padding: 13px 28px;
  font-size: 15px;
}
.rs-btn--dark:hover {
  background: var(--rs-navy-m);
  transform: translateY(-1px);
  color: #fff;
}
.rs-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .3);
  padding: 12px 26px;
  font-size: 15px;
}
.rs-btn--ghost:hover {
  border-color: var(--c-sage);
  color: var(--c-sage-l);
  background: rgba(77, 171, 132, .08);
}
.rs-btn--outline {
  background: transparent;
  color: var(--c-navy);
  border: 1.5px solid var(--c-navy);
  padding: 12px 26px;
  font-size: 15px;
}
.rs-btn--outline:hover {
  background: var(--c-navy);
  color: #fff;
}
.rs-btn--sm {
  padding: 8px 18px;
  font-size: 14px;
  border-radius: var(--r-md);
}
.rs-btn:focus-visible {
  outline: 2px solid var(--c-sage);
  outline-offset: 2px;
}

/* ── FORMS ── */
.rs-field { margin-bottom: 1.25rem; }
.rs-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-navy);
  margin-bottom: 6px;
}
.rs-label .req { color: var(--c-error); margin-left: 2px; }
.rs-input, .rs-select, .rs-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--rs-border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: #fff;
  transition: var(--ease);
  outline: none;
  appearance: none;
}
.rs-input:focus, .rs-select:focus, .rs-textarea:focus {
  border-color: var(--c-sage);
  box-shadow: 0 0 0 3px rgba(77, 171, 132, .12);
}
.rs-input:focus-visible, .rs-select:focus-visible, .rs-textarea:focus-visible {
  outline: 2px solid var(--c-sage);
  outline-offset: 2px;
}
.rs-textarea { resize: vertical; min-height: 90px; }
.rs-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%234A4A4A' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
  cursor: pointer;
}
.rs-hint { font-size: 11.5px; color: var(--c-border-l); margin-top: 4px; }
.rs-error-msg { font-size: 11.5px; color: var(--c-error); margin-top: 4px; display: none; }
.rs-error-msg.show { display: block; }
.rs-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── CARDS (base) ── */
.rs-card {
  background: #fff;
  border: 1px solid var(--rs-border);
  border-radius: var(--r-xl);
  padding: 1.5rem 2rem;
}
.rs-card--lift {
  background: #fff;
  border: 1px solid var(--rs-border);
  border-radius: var(--r-xl);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s cubic-bezier(.4, 0, .2, 1), border-color .3s ease;
}
.rs-card--lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--rs-border-d);
}

/* ── BADGES ── */
.rs-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
}
.rs-badge--green { background: rgba(46, 125, 95, .12); color: #1E6B52; }
.rs-badge--gold { background: rgba(201, 152, 42, .15); color: #8B6200; }
.rs-badge--blue { background: rgba(56, 139, 189, .12); color: #185FA5; }
.rs-badge--purple { background: rgba(139, 84, 195, .12); color: #6B35B5; }
.rs-badge--red { background: rgba(192, 57, 43, .12); color: #922B21; }

/* ── DELIVERY MODE BADGES ── */
.rsa-course-card__delivery-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}
.rsa-delivery-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.rsa-delivery-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.rsa-delivery-badge svg {
  flex-shrink: 0;
  opacity: .85;
}
/* Self-Paced — teal/mint */
.rsa-delivery--self-paced {
  background: linear-gradient(135deg, rgba(77,171,132,.08), rgba(77,171,132,.15));
  color: #1E6B52;
  border: 1px solid rgba(77,171,132,.2);
}
/* Live Online — vibrant coral/orange */
.rsa-delivery--live-online {
  background: linear-gradient(135deg, rgba(232,93,47,.06), rgba(232,93,47,.14));
  color: #C24415;
  border: 1px solid rgba(232,93,47,.2);
}
/* Face-to-Face — deep blue */
.rsa-delivery--face-to-face {
  background: linear-gradient(135deg, rgba(56,139,189,.06), rgba(56,139,189,.15));
  color: #185FA5;
  border: 1px solid rgba(56,139,189,.2);
}

/* ── PROGRESS ── */
.rs-progress { height: 4px; background: rgba(0, 0, 0, .06); border-radius: 2px; overflow: hidden; }
.rs-progress__fill { height: 100%; background: var(--c-sage); border-radius: 2px; transition: width .6s ease; }

/* ── TOAST ── */
#rs-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--c-navy);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all .35s cubic-bezier(.4, 0, .2, 1);
  z-index: 9999;
  max-width: 360px;
}
#rs-toast.show { transform: translateY(0); opacity: 1; }

/* ── WP ALIGNMENTS ── */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 0 auto 1.5rem; }
.screen-reader-text {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .rs-wrap { padding: 0 1.25rem; }
  .rs-section { padding: 3rem 0; }
  .rs-row-2 { grid-template-columns: 1fr; }
}
