/* =============================================================================
 * LOADMATE — Design System (v2.1.0)
 *
 * Foundational tokens, typography, components, and utilities for the website
 * revamp. Loaded on every page via inc/enqueue.php.
 *
 * Structure:
 *   1. CSS custom properties (design tokens)
 *   2. Reset and base
 *   3. Typography
 *   4. Buttons
 *   5. Cards
 *   6. Sections, containers, layout
 *   7. Forms
 *   8. Utilities
 *   9. Animations (subtle, performance-budget-friendly)
 *
 * Mobile-first throughout. Breakpoints:
 *   - default: < 768px (mobile)
 *   - md: 768px (tablet)
 *   - lg: 1024px (desktop)
 *   - xl: 1280px (wide)
 *
 * Class naming: BEM-ish (.lm-block__element--modifier) to avoid collision
 * with Astra parent and any builder output.
 *
 * To roll back the design system entirely: remove the enqueue line in
 * inc/enqueue.php. The file can remain in /css/ harmlessly.
 * ========================================================================== */


/* ----- 1. Design tokens ---------------------------------------------------- */

:root {
    /* Brand — yellow scale */
    --lm-yellow:          #ffb600;
    --lm-yellow-hover:    #ffb600;
    --lm-yellow-tint:     #f1f1f1;
    --lm-yellow-deep:     #ffb600;

    /* Neutrals — dark to light */
    --lm-charcoal:        #000000;
    --lm-charcoal-soft:   #000000;
    --lm-grey-900:        #000000;
    --lm-grey-700:        #000000;
    --lm-grey-500:        #000000;
    --lm-grey-300:        #000000;
    --lm-grey-100:        #ffffff;
    --lm-off-white:       #ffffff;
    --lm-white:           #ffffff;

    /* Semantic */
    --lm-success:         #000000;
    --lm-warning:         #ffb600;
    --lm-error:           #000000;
    --lm-info:            #000000;

    /* Shadows */
    --lm-shadow-sm:       0 1px 2px rgba(0,0,0,0.06);
    --lm-shadow-md:       0 4px 12px rgba(0,0,0,0.08);
    --lm-shadow-lg:       0 12px 32px rgba(0,0,0,0.12);
    --lm-shadow-yellow:   0 6px 20px rgba(255,182,0,0.25);

    /* Type families */
    --lm-font-heading:    'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lm-font-body:       'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Type scale — mobile first */
    --lm-text-h1:         2.25rem;   /* 36px */
    --lm-text-h2:         1.75rem;   /* 28px */
    --lm-text-h3:         1.375rem;  /* 22px */
    --lm-text-h4:         1.125rem;  /* 18px */
    --lm-text-h5:         1rem;      /* 16px */
    --lm-text-h6:         0.875rem;  /* 14px */
    --lm-text-lead:       1.125rem;  /* 18px */
    --lm-text-body:       1rem;      /* 16px */
    --lm-text-small:      0.875rem;  /* 14px */
    --lm-text-caption:    0.75rem;   /* 12px */
    --lm-text-display:    3rem;      /* 48px */

    /* Spacing scale (use for margin/padding) */
    --lm-space-1:         0.25rem;
    --lm-space-2:         0.5rem;
    --lm-space-3:         0.75rem;
    --lm-space-4:         1rem;
    --lm-space-5:         1.25rem;
    --lm-space-6:         1.5rem;
    --lm-space-8:         2rem;
    --lm-space-10:        2.5rem;
    --lm-space-12:        3rem;
    --lm-space-16:        4rem;
    --lm-space-20:        5rem;
    --lm-space-24:        6rem;

    /* Layout */
    --lm-container-max:   1280px;
    --lm-container-px:    1.25rem;   /* mobile horizontal padding */
    --lm-radius-sm:       4px;
    --lm-radius-md:       8px;
    --lm-radius-lg:       12px;
    --lm-radius-pill:     999px;

    /* Motion */
    --lm-ease:            cubic-bezier(0.4, 0, 0.2, 1);
    --lm-duration-fast:   150ms;
    --lm-duration:        200ms;
    --lm-duration-slow:   400ms;
}

@media (min-width: 768px) {
    :root {
        --lm-text-h1:      3rem;       /* 48px */
        --lm-text-h2:      2.25rem;    /* 36px */
        --lm-text-h3:      1.75rem;    /* 28px */
        --lm-text-h4:      1.375rem;   /* 22px */
        --lm-text-h5:      1.125rem;   /* 18px */
        --lm-text-h6:      1rem;       /* 16px */
        --lm-text-lead:    1.25rem;    /* 20px */
        --lm-text-body:    1.0625rem;  /* 17px */
        --lm-text-display: 4.5rem;     /* 72px */
        --lm-container-px: 2rem;
    }
}

@media (min-width: 1280px) {
    :root {
        --lm-text-h1:      3.5rem;     /* 56px on wide screens */
        --lm-text-display: 5rem;       /* 80px */
    }
}


/* ----- 2. Reset and base --------------------------------------------------- */

.lm-page *, .lm-page *::before, .lm-page *::after {
    box-sizing: border-box;
}

.lm-page img,
.lm-page svg,
.lm-page video {
    display: block;
    max-width: 100%;
    height: auto;
}

.lm-page a {
    color: #000000;
    text-decoration: none;
}

.lm-page a:hover {
    color: #ffb600;
}


/* ----- 3. Typography ------------------------------------------------------- */

.lm-page h1, .lm-h1 {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-h1);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #000000;
    margin: 0 0 0.75em;
}

.lm-page h2, .lm-h2 {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-h2);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: #000000;
    margin: 0 0 0.75em;
}

.lm-page h3, .lm-h3 {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-h3);
    font-weight: 600;
    line-height: 1.3;
    color: #000000;
    margin: 0 0 0.5em;
}

.lm-page h4, .lm-h4 {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-h4);
    font-weight: 600;
    line-height: 1.35;
    color: #000000;
    margin: 0 0 0.5em;
}

.lm-page p, .lm-body {
    font-family: var(--lm-font-body);
    font-size: var(--lm-text-body);
    font-weight: 400;
    line-height: 1.6;
    color: #000000;
    margin: 0 0 1em;
}

.lm-lead {
    font-size: var(--lm-text-lead);
    line-height: 1.55;
    color: #000000;
}

.lm-eyebrow {
    display: inline-block;
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-caption);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffb600;
    margin: 0 0 0.75rem;
}

.lm-display {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #000000;
    margin: 0;
}

/* Light typography for dark sections */
.lm-section--dark .lm-eyebrow { color: #ffb600; }
.lm-section--dark h1,
.lm-section--dark h2,
.lm-section--dark h3,
.lm-section--dark h4 { color: #ffffff; }
.lm-section--dark p,
.lm-section--dark .lm-body,
.lm-section--dark .lm-lead { color: #000000; }


/* ----- 4. Buttons ---------------------------------------------------------- */

.lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.875rem 1.75rem;
    font-family: var(--lm-font-heading);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    border-radius: var(--lm-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--lm-duration) var(--lm-ease),
                color var(--lm-duration) var(--lm-ease),
                box-shadow var(--lm-duration) var(--lm-ease),
                transform var(--lm-duration) var(--lm-ease);
    white-space: nowrap;
}

.lm-btn:focus-visible {
    outline: 3px solid #ffb600;
    outline-offset: 2px;
}

.lm-btn--primary {
    background: #ffb600;
    color: #000000;
    box-shadow: rgba(0,0,0,.12);
}
.lm-btn--primary:hover {
    background: #ffb600;
    color: #000000;
    box-shadow: #ffb600;
    transform: translateY(-1px);
}

.lm-btn--secondary {
    background: transparent;
    color: #000000;
    border-color: rgba(0,0,0,.12);
}
.lm-btn--secondary:hover {
    background: #f1f1f1;
    color: #000000;
}

.lm-btn--secondary-inverse {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
}
.lm-btn--secondary-inverse:hover {
    background: #ffffff;
    color: #000000;
}

.lm-btn--ghost {
    padding: 0.5rem 0;
    background: transparent;
    color: #000000;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid #ffb600;
    border-radius: 0;
}
.lm-btn--ghost:hover {
    color: #ffb600;
    background: transparent;
}

.lm-btn--lg { padding: 1.125rem 2.25rem; font-size: 1.0625rem; }
.lm-btn--sm { padding: 0.625rem 1.25rem; font-size: 0.875rem; }

.lm-btn--full {
    width: 100%;
}

/* Full-width buttons on mobile by default in stacked CTA groups */
.lm-cta-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}
@media (min-width: 640px) {
    .lm-cta-group {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
}


/* ----- 5. Cards ------------------------------------------------------------ */

.lm-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: var(--lm-radius-md);
    overflow: hidden;
    box-shadow: rgba(0,0,0,.12);
    transition: transform var(--lm-duration) var(--lm-ease),
                box-shadow var(--lm-duration) var(--lm-ease);
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.lm-card:hover {
    transform: translateY(-4px);
    box-shadow: rgba(0,0,0,.12);
    color: inherit;
}

.lm-card__media {
    aspect-ratio: 4 / 3;
    background: #f1f1f1;
    overflow: hidden;
}
.lm-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--lm-duration-slow) var(--lm-ease);
}
.lm-card:hover .lm-card__media img {
    transform: scale(1.04);
}

.lm-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.lm-card__title {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-h4);
    font-weight: 600;
    line-height: 1.3;
    color: #000000;
    margin: 0 0 0.5rem;
}
.lm-card__meta {
    font-size: var(--lm-text-small);
    color: #000000;
    margin: 0 0 0.75rem;
}
.lm-card__excerpt {
    font-size: var(--lm-text-small);
    line-height: 1.55;
    color: #000000;
    margin: 0 0 1rem;
    flex-grow: 1;
}
.lm-card__link {
    margin-top: auto;
    font-family: var(--lm-font-heading);
    font-weight: 600;
    font-size: var(--lm-text-small);
    color: #000000;
    text-decoration: none;
    border-bottom: 2px solid #ffb600;
    align-self: flex-start;
    padding-bottom: 2px;
}

/* Stat card */
.lm-stat {
    text-align: center;
    padding: 2rem 1rem;
}
.lm-stat__number {
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-display);
    font-weight: 700;
    line-height: 1;
    color: #ffb600;
    margin: 0;
}
.lm-stat__divider {
    width: 40px;
    height: 3px;
    background: #ffb600;
    margin: 1rem auto;
    border: none;
}
.lm-stat__label {
    font-family: var(--lm-font-body);
    font-size: var(--lm-text-body);
    font-weight: 400;
    color: #000000;
    margin: 0;
    line-height: 1.4;
}

/* Testimonial card */
.lm-testimonial {
    background: #ffffff;
    padding: 2rem;
    border-radius: var(--lm-radius-md);
    border-left: 4px solid #ffb600;
    box-shadow: rgba(0,0,0,.12);
    height: 100%;
}
.lm-testimonial__quote {
    font-size: var(--lm-text-lead);
    line-height: 1.55;
    color: #000000;
    margin: 0 0 1.5rem;
    font-style: normal;
}
.lm-testimonial__author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.lm-testimonial__name {
    font-weight: 700;
    color: #000000;
    margin: 0;
}
.lm-testimonial__role {
    font-size: var(--lm-text-small);
    color: #000000;
    margin: 0;
}

/* Logo cell — for client trust strip */
.lm-logo-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    filter: grayscale(100%);
    opacity: 0.65;
    transition: filter var(--lm-duration) var(--lm-ease),
                opacity var(--lm-duration) var(--lm-ease);
}
.lm-logo-cell:hover {
    filter: grayscale(0);
    opacity: 1;
}
.lm-logo-cell img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}
@media (min-width: 768px) {
    .lm-logo-cell img { max-height: 48px; }
}


/* ----- 6. Sections, containers, layout ------------------------------------ */

.lm-section {
    padding: 3rem 0;
}
@media (min-width: 768px) {
    .lm-section { padding: 5rem 0; }
}
@media (min-width: 1024px) {
    .lm-section { padding: 6rem 0; }
}

.lm-section--tight  { padding: 2rem 0; }
@media (min-width: 768px) {
    .lm-section--tight { padding: 3rem 0; }
}

.lm-section--loose  { padding: 4rem 0; }
@media (min-width: 768px) {
    .lm-section--loose { padding: 7rem 0; }
}

.lm-section--light    { background: #ffffff; }
.lm-section--muted    { background: #f1f1f1; }
.lm-section--tint     { background: #f1f1f1; }
.lm-section--dark     { background: #f1f1f1; color: #000000; }
.lm-section--yellow   { background: #ffb600; color: #000000; }

.lm-container {
    width: 100%;
    max-width: var(--lm-container-max);
    margin: 0 auto;
    padding-left: var(--lm-container-px);
    padding-right: var(--lm-container-px);
}

.lm-section-header {
    max-width: 720px;
    margin: 0 0 2.5rem;
}
@media (min-width: 768px) {
    .lm-section-header { margin-bottom: 3rem; }
}
.lm-section-header--centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.lm-section-header h2 { margin-bottom: 0.5rem; }
.lm-section-header .lm-lead { margin: 0; }

/* Grids — mobile first, expand at breakpoints */
.lm-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .lm-grid { gap: 1.5rem; }
}
@media (min-width: 768px) {
    .lm-grid { gap: 1.75rem; }
}

.lm-grid--2 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .lm-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.lm-grid--3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .lm-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .lm-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.lm-grid--4 { grid-template-columns: 1fr; }
@media (min-width: 480px) {
    .lm-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .lm-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.lm-grid--6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
    .lm-grid--6 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .lm-grid--6 { grid-template-columns: repeat(6, 1fr); }
}


/* ----- 7. Forms ------------------------------------------------------------ */

.lm-form__group {
    margin-bottom: 1.25rem;
}
.lm-form__label {
    display: block;
    font-family: var(--lm-font-heading);
    font-size: var(--lm-text-small);
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.375rem;
}
.lm-form__label--required::after {
    content: ' *';
    color: #000000;
}
.lm-form__input,
.lm-form__select,
.lm-form__textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--lm-font-body);
    font-size: var(--lm-text-body);
    color: #000000;
    background: #ffffff;
    border: 1.5px solid rgba(0,0,0,.12);
    border-radius: var(--lm-radius-sm);
    transition: border-color var(--lm-duration-fast) var(--lm-ease),
                box-shadow var(--lm-duration-fast) var(--lm-ease);
}
.lm-form__textarea {
    min-height: 140px;
    resize: vertical;
}
.lm-form__input:focus,
.lm-form__select:focus,
.lm-form__textarea:focus {
    outline: none;
    border-color: #ffb600;
    box-shadow: 0 0 0 3px rgba(255,182,0,0.2);
}
.lm-form__input--error {
    border-color: rgba(0,0,0,.12);
}
.lm-form__error {
    font-size: var(--lm-text-small);
    color: #000000;
    margin-top: 0.25rem;
}
.lm-form__help {
    font-size: var(--lm-text-small);
    color: #000000;
    margin-top: 0.25rem;
}


/* ----- 8. Utilities (use sparingly) --------------------------------------- */

.lm-text-center  { text-align: center; }
.lm-text-left    { text-align: left; }
.lm-text-right   { text-align: right; }

.lm-mb-0  { margin-bottom: 0 !important; }
.lm-mb-2  { margin-bottom: var(--lm-space-2) !important; }
.lm-mb-4  { margin-bottom: var(--lm-space-4) !important; }
.lm-mb-6  { margin-bottom: var(--lm-space-6) !important; }
.lm-mb-8  { margin-bottom: var(--lm-space-8) !important; }

.lm-mt-0  { margin-top: 0 !important; }
.lm-mt-4  { margin-top: var(--lm-space-4) !important; }
.lm-mt-6  { margin-top: var(--lm-space-6) !important; }
.lm-mt-8  { margin-top: var(--lm-space-8) !important; }

/* Visibility — mobile/desktop */
.lm-hide-mobile { display: none !important; }
@media (min-width: 768px) {
    .lm-hide-mobile { display: initial !important; }
    .lm-hide-desktop { display: none !important; }
}

/* Screen-reader only */
.lm-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;
}


/* ----- 9. Animations ------------------------------------------------------- */

/* Fade-in on scroll — applied via JS in Sprint 2.2 onwards.
   The .lm-reveal class starts elements invisible; .is-revealed makes them appear.
   On reduced-motion, no animation runs and elements are immediately visible. */

.lm-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms var(--lm-ease),
                transform 600ms var(--lm-ease);
    will-change: opacity, transform;
}
.lm-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .lm-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .lm-btn,
    .lm-card,
    .lm-card__media img {
        transition: none !important;
    }
}

/* End of design system v2.1.0 */
