/*
Theme Name:  Koji Academy
Template:    astra
Description: Koji Academy child theme — accessible, ASD-friendly, no page builder.
Version:     1.0.0
Author:      Your Name
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {

  /* --- Brand palette (use for backgrounds, borders, accents) --- */
  --color-sky-blue:    #7BAAB8;
  --color-teal-grey:   #6A9494;
  --color-sage-green:  #6A8C80;
  --color-steel-blue:  #5C7F8C;
  --color-soft-teal:   #8AADA0;
  --color-warm-sand:   #C4B49A;
  --color-dusty-rose:  #D4A898;
  --color-mauve:       #A898B4;
  --color-olive:       #8C9878;

  /* --- Functional colours (text, buttons, page backgrounds) --- */
  --color-primary:       #3D7A8A; /* Primary CTA buttons, links          */
  --color-primary-hover: #2E6676; /* Darker on hover                     */
  --color-secondary:     #2E6B5E; /* Secondary buttons                   */
  --color-heading:       #1A4A58; /* All headings                        */
  --color-body:          #2C2C2A; /* Body text — 16.2:1 on --color-bg    */
  --color-muted:         #5A5A58; /* Captions, labels, secondary text    */
  --color-bg:            #F5F2EE; /* Page background                     */
  --color-bg-alt:        #FFFFFF; /* Card backgrounds, sections          */
  --color-bg-dark:       #1A4A58; /* Dark band sections                  */
  --color-border:        #D4CFC8; /* Subtle borders                      */
  --color-focus:         #3D7A8A; /* Focus ring colour                   */

  /* --- Typography --- */
  --font-primary:   'Nunito', sans-serif;
  --font-dyslexia:  'OpenDyslexic', cursive; /* loaded by accessibility plugin */

  /* --- Font sizes (fluid scale) --- */
  --text-xs:   0.75rem;   /*  12px */
  --text-sm:   0.875rem;  /*  14px */
  --text-base: 1rem;      /*  16px */
  --text-lg:   1.125rem;  /*  18px */
  --text-xl:   1.25rem;   /*  20px */
  --text-2xl:  1.5rem;    /*  24px */
  --text-3xl:  1.875rem;  /*  30px */
  --text-4xl:  2.25rem;   /*  36px */
  --text-5xl:  3rem;      /*  48px */

  /* --- Spacing scale --- */
  --space-xs:  0.5rem;    /*  8px  */
  --space-sm:  1rem;      /* 16px  */
  --space-md:  2rem;      /* 32px  */
  --space-lg:  4rem;      /* 64px  */
  --space-xl:  6rem;      /* 96px  */

  /* --- Border radius --- */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(26,74,88,0.08);
  --shadow-md: 0 4px 16px rgba(26,74,88,0.10);
  --shadow-lg: 0 8px 32px rgba(26,74,88,0.12);

  /* --- Transitions --- */
  --transition: 200ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-body);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SKIP LINK — must be first focusable element
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--space-sm);
}

/* ============================================================
   FOCUS STYLES — visible on every interactive element
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
/* Remove default outline only when :focus-visible is supported */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-heading);
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* Fluid H1 on larger screens */
@media (min-width: 1024px) {
  h1 { font-size: var(--text-5xl); }
}

p {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  max-width: 68ch; /* optimal reading line length */
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-primary-hover);
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}
li {
  margin-bottom: var(--space-xs);
  line-height: 1.7;
}

strong { font-weight: 700; }

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-md);
  }
}

.section {
  padding-block: var(--space-lg);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: #fff;
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: #fff;
}
.section--dark p {
  color: rgba(255,255,255,0.85);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem 1.75rem;
  min-height: 48px; /* minimum tap target */
  min-width: 48px;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition),
              color var(--transition),
              border-color var(--transition),
              transform var(--transition);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* Primary button */
.btn--primary {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn--primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}

/* Secondary button */
.btn--secondary {
  background-color: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}
.btn--secondary:hover {
  background-color: #255a4f;
  border-color: #255a4f;
  color: #fff;
}

/* Ghost button */
.btn--ghost {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--ghost:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* Ghost button on dark backgrounds */
.btn--ghost-white {
  background-color: transparent;
  color: #fff;
  border-color: #fff;
}
.btn--ghost-white:hover {
  background-color: #fff;
  color: var(--color-heading);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}
.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}
.card__text {
  font-size: var(--text-base);
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

/* Card grids */
.card-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: var(--space-md);
}

.site-logo img {
  height: 48px;
  width: auto;
}
.site-logo__text {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-heading);
  text-decoration: none;
}

/* Main nav */
.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-xs);
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.875rem;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-heading);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition), color var(--transition);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background-color: var(--color-sky-blue);
  color: var(--color-heading);
}

/* Dropdown */
.main-nav li {
  position: relative;
}
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  padding: var(--space-xs);
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
  display: flex;
}
.main-nav .sub-menu a {
  font-size: var(--text-sm);
  color: var(--color-body);
  padding: 0.625rem 0.875rem;
}
.main-nav .sub-menu a:hover {
  background-color: var(--color-bg);
  color: var(--color-heading);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-heading);
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm);
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav .sub-menu {
    position: static;
    display: flex;
    box-shadow: none;
    border: none;
    padding-left: var(--space-sm);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-top: 4px;
  }
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb {
  padding: var(--space-sm) 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}
.breadcrumb li + li::before {
  content: '›';
  color: var(--color-border);
}
.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb [aria-current="page"] {
  color: var(--color-muted);
  font-weight: 400;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background-color: var(--color-bg-dark);
  padding-block: var(--space-xl);
  color: #fff;
}
.hero__inner {
  display: grid;
  gap: var(--space-md);
  align-items: center;
}
@media (min-width: 768px) {
  .hero__inner { grid-template-columns: 1fr 1fr; }
}
.hero__title {
  font-size: var(--text-4xl);
  color: #fff;
  margin-bottom: var(--space-sm);
}
@media (min-width: 1024px) {
  .hero__title { font-size: var(--text-5xl); }
}
.hero__text {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-md);
  max-width: 52ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.hero__image {
  border-radius: var(--radius-xl);
  width: 100%;
  height: auto;
}

/* ============================================================
   PROCESS STEPS
   ============================================================ */
.process-steps {
  display: grid;
  gap: var(--space-md);
  counter-reset: step-counter;
}
@media (min-width: 768px) {
  .process-steps { grid-template-columns: repeat(3, 1fr); }
}
.process-step {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  position: relative;
  counter-increment: step-counter;
}
.process-step::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xl);
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: var(--space-sm);
}
.process-step__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}
.process-step__text {
  font-size: var(--text-base);
  color: var(--color-muted);
  margin: 0;
}

/* ============================================================
   PORTAL SELECTOR (Login page)
   ============================================================ */
.portal-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  max-width: 900px;
  margin-inline: auto;
}
@media (min-width: 640px) {
  .portal-grid { grid-template-columns: repeat(3, 1fr); }
}
.portal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-md);
  text-decoration: none;
  color: var(--color-heading);
  transition: border-color var(--transition),
              box-shadow var(--transition),
              transform var(--transition);
}
.portal-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  color: var(--color-heading);
}
.portal-card__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.portal-card__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-xs);
}
.portal-card__desc {
  font-size: var(--text-base);
  color: var(--color-muted);
  margin: 0;
}

/* ============================================================
   FORMS (Contact page)
   ============================================================ */
.form-group {
  margin-bottom: var(--space-sm);
}
.form-label {
  display: block;
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: 0.375rem;
  color: var(--color-heading);
}
.form-label .required {
  color: #c0392b;
  margin-left: 0.25rem;
  aria-hidden: true;
}
.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-body);
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
  min-height: 48px;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(61,122,138,0.2);
}
.form-textarea {
  min-height: 160px;
  resize: vertical;
}
.form-error {
  display: none;
  color: #c0392b;
  font-size: var(--text-sm);
  margin-top: 0.375rem;
  font-weight: 600;
}
.form-group.has-error .form-error { display: block; }
.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
  border-color: #c0392b;
}
/* Honeypot — hide from real users, bots fill it in */
.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  tab-index: -1;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.85);
  padding-block: var(--space-lg);
}
.site-footer__grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer h3 {
  font-size: var(--text-base);
  color: #fff;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-footer a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: var(--text-sm);
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer ul li {
  margin-bottom: 0.5rem;
}
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* ============================================================
   SECTION HEADING UTILITY
   ============================================================ */
.section-heading {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}
.section-heading__label {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}
.section-heading h2 {
  margin-bottom: var(--space-sm);
}
.section-heading p {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 60ch;
  margin-inline: auto;
}

/* ============================================================
   COLOUR BAND UTILITIES
   ============================================================ */
.band--sky    { background-color: rgba(123,170,184,0.15); }
.band--sage   { background-color: rgba(106,140,128,0.15); }
.band--sand   { background-color: rgba(196,180,154,0.15); }

/* ============================================================
   ASTRA OVERRIDES — strip defaults we don't want
   ============================================================ */
.ast-container { max-width: unset; }
#masthead { display: none; } /* We use our own header */
.ast-breadcrumbs-wrapper { display: none; } /* We use our own breadcrumbs */
