/* ==========================================================================
   SPAN TRAINING & DEVELOPMENT LTD — Master Stylesheet

   Colour palette extracted from brand logos:
   - SpanCloudspace teal + purple for interactive UI (buttons, links, lines)
   - FilePurity calm aesthetic for overall feel (white space, soft lavender)
   - Strand-specific colours for section identity
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS CUSTOM PROPERTIES (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* === PRIMARY: SpanCloudspace Teal & Purple === */
    --teal:             #0B8B6E;
    --teal-dark:        #07705A;
    --teal-light:       #E6F5F1;
    --teal-mid:         #3DA891;

    --purple:           #6E5BA6;
    --purple-dark:      #5A4A8A;
    --purple-light:     #F0ECF6;
    --purple-mid:       #8B7BBF;

    /* === BRAND STRAND COLOURS (from logos) === */
    --hair-pink:        #C74B8A;
    --hair-pink-light:  #FBEEF5;
    --business-blue:    #3B4DA0;
    --business-blue-light: #ECEEF8;
    --master-gradient:  linear-gradient(135deg, var(--purple) 0%, var(--hair-pink) 100%);

    /* === NEUTRALS: Light & Airy (FilePurity calm) === */
    --white:            #FFFFFF;
    --off-white:        #FAFBFD;
    --grey-50:          #F5F6F8;
    --grey-100:         #ECEDF1;
    --grey-200:         #D8DAE0;
    --grey-300:         #B4B7C1;
    --grey-400:         #8E92A0;
    --grey-500:         #6B7080;
    --grey-600:         #4A4E5A;
    --grey-700:         #2D3039;
    --grey-800:         #1A1C23;
    --black:            #111218;

    /* === SEMANTIC === */
    --text-primary:     var(--grey-700);
    --text-secondary:   var(--grey-500);
    --text-light:       var(--grey-400);
    --text-heading:     var(--grey-800);
    --text-on-teal:     var(--white);
    --text-on-purple:   var(--white);

    --bg-body:          var(--white);
    --bg-section-alt:   var(--off-white);
    --bg-card:          var(--white);
    --bg-nav:           var(--white);
    --bg-footer:        var(--grey-700);

    --border-light:     var(--grey-100);
    --border-mid:       var(--grey-200);

    --link:             var(--teal);
    --link-hover:       var(--teal-dark);

    --btn-primary-bg:   var(--teal);
    --btn-primary-hover: var(--teal-dark);
    --btn-secondary-bg: var(--purple);
    --btn-secondary-hover: var(--purple-dark);

    --line-accent:      var(--teal);
    --line-accent-alt:  var(--purple);

    /* Soft lavender tint — the FilePurity calm wash */
    --lavender-wash:    rgba(110, 91, 166, 0.04);

    /* === TYPOGRAPHY === */
    --font-body:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-heading:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* === SPACING === */
    --space-xs:         0.25rem;   /* 4px */
    --space-sm:         0.5rem;    /* 8px */
    --space-md:         1rem;      /* 16px */
    --space-lg:         1.5rem;    /* 24px */
    --space-xl:         2rem;      /* 32px */
    --space-2xl:        3rem;      /* 48px */
    --space-3xl:        4rem;      /* 64px */
    --space-4xl:        6rem;      /* 96px */

    /* === LAYOUT === */
    --container-max:    1200px;
    --container-padding: var(--space-lg);
    --nav-height:       72px;

    /* === RADIUS === */
    --radius-sm:        4px;
    --radius-md:        8px;
    --radius-lg:        12px;
    --radius-xl:        16px;
    --radius-full:      9999px;

    /* === SHADOWS (subtle, airy) === */
    --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md:        0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg:        0 12px 32px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-card:      0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-nav:       0 1px 0 var(--border-light);

    /* === TRANSITIONS === */
    --ease-out:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast:  150ms var(--ease-out);
    --transition-base:  250ms var(--ease-out);
    --transition-slow:  400ms var(--ease-out);
}


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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: var(--font-weight-normal);
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.65;
    min-height: 100vh;
}

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

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--link-hover);
}


/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    line-height: 1.25;
    font-weight: var(--font-weight-semibold);
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    letter-spacing: -0.015em;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h4 {
    font-size: 1.125rem;
}

p {
    margin-bottom: var(--space-md);
    max-width: 70ch;
}

p:last-child {
    margin-bottom: 0;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-light {
    color: var(--text-light);
}

.text-teal {
    color: var(--teal);
}

.text-purple {
    color: var(--purple);
}


/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

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

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

.section--lavender {
    background-color: var(--lavender-wash);
}

.section__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section__header h2 {
    margin-bottom: var(--space-sm);
}

.section__header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 60ch;
    margin-inline: auto;
}

/* Accent line under section headings */
.section__header h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--line-accent);
    margin: var(--space-md) auto 0;
    border-radius: var(--radius-full);
}

/* Alternate purple accent line */
.section__header--purple h2::after {
    background: var(--line-accent-alt);
}

/* Grid utility */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}


/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid var(--teal-mid);
    outline-offset: 2px;
}

/* Primary — Teal (solid) */
.btn--primary {
    background-color: var(--btn-primary-bg);
    color: var(--text-on-teal);
    border-color: var(--btn-primary-bg);
}

.btn--primary:hover {
    background-color: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: var(--text-on-teal);
    box-shadow: var(--shadow-md);
}

/* Secondary — Purple (solid) */
.btn--secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--text-on-purple);
    border-color: var(--btn-secondary-bg);
}

.btn--secondary:hover {
    background-color: var(--btn-secondary-hover);
    border-color: var(--btn-secondary-hover);
    color: var(--text-on-purple);
    box-shadow: var(--shadow-md);
}

/* Outline — Teal border, transparent fill */
.btn--outline {
    background-color: transparent;
    color: var(--teal);
    border-color: var(--teal);
}

.btn--outline:hover {
    background-color: var(--teal);
    color: var(--text-on-teal);
}

/* Outline Purple */
.btn--outline-purple {
    background-color: transparent;
    color: var(--purple);
    border-color: var(--purple);
}

.btn--outline-purple:hover {
    background-color: var(--purple);
    color: var(--text-on-purple);
}

/* Ghost — no border, subtle hover */
.btn--ghost {
    background-color: transparent;
    color: var(--teal);
    border-color: transparent;
}

.btn--ghost:hover {
    background-color: var(--teal-light);
}

/* Small button */
.btn--sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

/* Large button */
.btn--lg {
    padding: 1rem 2.25rem;
    font-size: 1.05rem;
}


/* --------------------------------------------------------------------------
   LINES & DIVIDERS
   -------------------------------------------------------------------------- */
.line {
    border: none;
    height: 2px;
    background: var(--border-light);
}

.line--teal {
    background: var(--teal);
    height: 3px;
    border-radius: var(--radius-full);
}

.line--purple {
    background: var(--purple);
    height: 3px;
    border-radius: var(--radius-full);
}

.line--gradient {
    background: linear-gradient(90deg, var(--teal), var(--purple));
    height: 3px;
    border-radius: var(--radius-full);
}

.line--short {
    width: 48px;
}

.line--medium {
    width: 120px;
}


/* --------------------------------------------------------------------------
   NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-nav);
    box-shadow: var(--shadow-nav);
    height: var(--nav-height);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.nav__logo img {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav__link {
    color: var(--text-primary);
    font-size: 0.925rem;
    font-weight: var(--font-weight-medium);
    padding: var(--space-sm) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav__link:hover,
.nav__link--active {
    color: var(--teal);
}

/* Subtle teal underline on hover */
.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--teal);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

/* Dropdown */
.nav__dropdown {
    position: relative;
}

.nav__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    list-style: none;
    margin-top: var(--space-sm);
}

.nav__dropdown:hover .nav__dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav__dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav__dropdown-menu a:hover {
    background-color: var(--teal-light);
    color: var(--teal);
}

/* Mobile toggle */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}


/* --------------------------------------------------------------------------
   CARDS (Tiles)
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

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

.card__title {
    font-size: 1.15rem;
    margin-bottom: var(--space-sm);
}

.card__text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

.card__link {
    font-weight: var(--font-weight-medium);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.card__link::after {
    content: '\2192';
    transition: transform var(--transition-fast);
}

.card__link:hover::after {
    transform: translateX(4px);
}

/* Strand-coloured top border on cards */
.card--hair {
    border-top: 3px solid var(--hair-pink);
}

.card--business {
    border-top: 3px solid var(--business-blue);
}

.card--mentor {
    border-top: 3px solid var(--teal);
}

.card--subcontracting {
    border-top: 3px solid var(--purple);
}


/* --------------------------------------------------------------------------
   HERO / CAROUSEL
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--grey-50);
}

.hero__track {
    position: relative;
}

.hero__slide {
    position: absolute;
    inset: 0;
    min-height: 480px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 600ms var(--ease-out);
    pointer-events: none;
}

.hero__slide--active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}

.hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Light overlay instead of dark — keeps it airy */
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 540px;
    padding: var(--space-3xl) var(--container-padding);
}

.hero__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: var(--font-weight-bold);
    color: var(--text-heading);
    margin-bottom: var(--space-md);
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 44ch;
}

/* Carousel dots */
.hero__dots {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    padding: var(--space-lg) 0;
}

.hero__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--grey-200);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hero__dot--active {
    background-color: var(--teal);
    width: 28px;
    border-radius: var(--radius-full);
}

/* Carousel arrows */
.hero__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.hero__arrow:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
    color: var(--teal);
}

.hero__arrow--prev {
    left: var(--space-lg);
}

.hero__arrow--next {
    right: var(--space-lg);
}


/* --------------------------------------------------------------------------
   ACCREDITATION BAR (partner logos)
   -------------------------------------------------------------------------- */
.accreditation {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.accreditation__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.accreditation__logo {
    height: 48px;
    width: auto;
    opacity: 0.7;
    filter: grayscale(30%);
    transition: opacity var(--transition-fast), filter var(--transition-fast);
}

.accreditation__logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}


/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.footer {
    background-color: var(--bg-footer);
    color: var(--grey-300);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer a {
    color: var(--grey-300);
}

.footer a:hover {
    color: var(--white);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer__heading {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer__list {
    list-style: none;
}

.footer__list li {
    margin-bottom: var(--space-sm);
}

.footer__list a {
    font-size: 0.9rem;
}

.footer__bar {
    border-top: 1px solid var(--grey-600);
    padding-top: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: 0.85rem;
}

/* Teal accent line at very top of footer */
.footer::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--purple));
    margin-bottom: var(--space-3xl);
}


/* --------------------------------------------------------------------------
   FORMS (contact page)
   -------------------------------------------------------------------------- */
.form__group {
    margin-bottom: var(--space-lg);
}

.form__label {
    display: block;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.form__input,
.form__textarea,
.form__select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: var(--white);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-light);
}

.form__textarea {
    min-height: 140px;
    resize: vertical;
}


/* --------------------------------------------------------------------------
   UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }


/* --------------------------------------------------------------------------
   RESPONSIVE — Mobile First
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
        --container-padding: var(--space-md);
    }

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

    /* Mobile nav */
    .nav__links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: var(--white);
        padding: var(--space-xl);
        gap: var(--space-lg);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: 99;
    }

    .nav__links--open {
        transform: translateX(0);
    }

    .nav__toggle {
        display: block;
    }

    /* Dropdown on mobile — show inline */
    .nav__dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        padding-left: var(--space-md);
        min-width: auto;
    }

    /* Hero */
    .hero__slide {
        min-height: 360px;
    }

    .hero__overlay {
        background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.7) 100%
        );
    }

    .hero__content {
        padding: var(--space-2xl) var(--container-padding);
    }

    /* Footer */
    .footer__grid {
        grid-template-columns: 1fr;
    }

    .footer__bar {
        flex-direction: column;
        text-align: center;
    }

    /* Accreditation */
    .accreditation__inner {
        gap: var(--space-lg);
    }

    .accreditation__logo {
        height: 36px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero__slide {
        min-height: 420px;
    }
}

@media (min-width: 1025px) {
    .hero__slide {
        min-height: 540px;
    }
}
