/* ==========================================================================
   Kandryn Performance - Global Stylesheet
   Shared across all pages: variables, base, header, nav, footer, buttons
   Palette sampled/derived from the K&RYN logo
   ========================================================================== */

:root {
    /* Brand colours */
    --teal:        #03B6B5;   /* primary accent (brand spec) */
    --teal-dark:   #027E7D;   /* hover / active */
    --teal-deep:   #015C5B;   /* deepest, for gradient base */
    --ab-red:      #D9484B;   /* AB Performance pathway */
    --ab-red-dark: #B5393C;   /* AB Performance hover */
    --kandoo:      #016E6D;   /* K&RYN Kandoo pathway (darker teal) */
    --kandoo-dark: #014645;   /* Kandoo hover */
    --charcoal:    #253339;   /* sampled from logo letters - dark sections + headings */
    --charcoal-2:  #1b262b;   /* deeper charcoal for footer */
    --ink:         #2b3940;   /* body text */
    --muted:       #5d6b72;   /* secondary text */
    --grey:        #f4f6f7;   /* soft section background */
    --grey-line:   #e4e9ea;   /* hairlines / borders */
    --white:       #ffffff;

    /* Type */
    --font-head: 'Sora', system-ui, sans-serif;
    --font-body: 'Hanken Grotesk', system-ui, sans-serif;

    /* Rhythm */
    --maxw: 1180px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --section-y: clamp(3.5rem, 8vw, 6.5rem);
    --radius: 14px;
    --radius-lg: 22px;

    /* Effects */
    --shadow-sm: 0 4px 18px rgba(37, 51, 57, 0.06);
    --shadow-md: 0 14px 40px rgba(37, 51, 57, 0.10);
    --shadow-teal: 0 12px 30px rgba(3, 182, 181, 0.28);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a { color: var(--teal-dark); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--teal); }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--charcoal);
    line-height: 1.12;
    margin: 0 0 0.6em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.3rem, 5.5vw, 3.7rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p  { margin: 0 0 1.1em; }

::selection { background: var(--teal); color: #fff; }

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

.section { padding-block: var(--section-y); }
.section--grey { background: var(--grey); }
.section--charcoal { background: var(--charcoal); color: #d7dee1; }
.section--charcoal h2,
.section--charcoal h3 { color: #fff; }

.eyebrow {
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal-dark);
    margin: 0 0 0.9rem;
}
.section--charcoal .eyebrow { color: var(--teal); }

.lead { font-size: 1.15rem; color: var(--muted); }
.section--charcoal .lead { color: #aeb9bd; }

/* --------------------------------------------------------------------------
   Buttons - all solid fills, darken on hover
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    padding: 0.85rem 1.6rem;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
    line-height: 1;
}
.btn i { font-size: 0.9em; }

/* Teal (primary) */
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-dark); color: #fff; }

/* Charcoal (secondary, for light backgrounds) */
.btn--dark { background: var(--charcoal); color: #fff; }
.btn--dark:hover { background: #11181c; color: #fff; }

/* White (for dark / teal backgrounds) - "darker" = light grey */
.btn--light { background: #fff; color: var(--charcoal); }
.btn--light:hover { background: #dde3e4; color: var(--charcoal); }

/* Pathway colour variants */
.btn--red { background: var(--ab-red); color: #fff; }
.btn--red:hover { background: var(--ab-red-dark); color: #fff; }
.btn--kandoo { background: var(--kandoo); color: #fff; }
.btn--kandoo:hover { background: var(--kandoo-dark); color: #fff; }

.btn--lg { padding: 1.05rem 2.1rem; font-size: 1.05rem; }
.btn--block { display: flex; justify-content: center; width: 100%; }

/* --------------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--grey-line);
    box-shadow: 0 2px 0 rgba(3, 182, 181, 0.55);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-block: 1.2rem;
    max-width: 1460px;
}

.brand { display: inline-flex; flex-direction: column; gap: 4px; line-height: 1; flex-shrink: 0; }
.brand__logo { height: 34px; width: auto; object-fit: contain; }
.brand__strap {
    font-family: var(--font-head);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--teal-dark);
    font-weight: 600;
}

.nav { display: flex; align-items: center; gap: 2.4rem; margin-left: auto; }
.nav__inner { display: contents; }
.nav__list {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav__link {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--charcoal);
    position: relative;
    padding-block: 0.4rem;
    white-space: nowrap;
}
.nav__link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 2px;
    background: var(--teal);
    transition: width 0.28s var(--ease);
}
.nav__link:hover { color: var(--teal-dark); }
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }
.nav__link.is-active { color: var(--teal-dark); }

/* --- "What we offer" dropdown (desktop / tablet) --- */
.nav__item--has-sub { position: relative; }
.nav__sub-toggle {
    background: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.nav__chevron {
    font-size: 0.7rem;
    transition: transform 0.25s var(--ease);
}
.nav__item--has-sub:hover .nav__chevron,
.nav__item--has-sub.is-open .nav__chevron { transform: rotate(180deg); }

.nav__sub {
    list-style: none;
    margin: 0;
    padding: 0.45rem;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    transform: translateY(8px);
    min-width: 250px;
    background: #fff;
    border: 1px solid var(--grey-line);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(37, 51, 57, 0.16);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0s linear 0.22s;
    z-index: 60;
}
/* invisible bridge so the mouse can travel from trigger to menu */
.nav__sub::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -12px;
    height: 12px;
}
/* little pointer up to the trigger */
.nav__sub::after {
    content: "";
    position: absolute;
    top: -7px; right: 46px;
    width: 13px; height: 13px;
    background: #fff;
    border-left: 1px solid var(--grey-line);
    border-top: 1px solid var(--grey-line);
    transform: rotate(45deg);
}
.nav__item--has-sub:hover .nav__sub,
.nav__item--has-sub:focus-within .nav__sub,
.nav__item--has-sub.is-open .nav__sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0s linear 0s;
}
.nav__sublink {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--charcoal);
    white-space: nowrap;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav__sublink i {
    color: var(--teal);
    font-size: 0.95rem;
    width: 1.15rem;
    text-align: center;
    flex: 0 0 auto;
    transition: color 0.18s var(--ease);
}
.nav__sublink:hover { background: rgba(3, 182, 181, 0.10); color: var(--teal-dark); }
.nav__sublink:hover i { color: var(--teal-dark); }
.nav__sublink.is-active { background: rgba(3, 182, 181, 0.10); color: var(--teal-dark); }
.nav__sublink.is-active i { color: var(--teal-dark); }

/* left-aligned dropdown (used by the About menu, which sits on the left) */
.nav__sub--left { left: 0; right: auto; }
.nav__sub--left::after { left: 34px; right: auto; }

.nav__toggle {
    display: none;
    background: none;
    border: 0;
    width: 44px; height: 44px;
    cursor: pointer;
    color: var(--charcoal);
    font-size: 1.4rem;
}
.nav__logo, .nav__email, .nav__brand { display: none; }

/* --------------------------------------------------------------------------
   Site footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--charcoal-2);
    color: #aab5b9;
    padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
    font-size: 0.96rem;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.15fr;
    gap: 2.8rem 3.6rem;
    align-items: start;
}
.site-footer h4 {
    font-family: var(--font-head);
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.04em;
    margin: 0 0 1.1rem;
}
.site-footer a { color: #c5cfd2; overflow-wrap: anywhere; }
.site-footer a:hover { color: var(--teal); }

.footer-brand__text {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: -0.01em;
    color: #fff;
    display: block;
    margin-bottom: 0.5rem;
}
.footer-brand__text .amp { color: var(--teal); font-weight: 600; }
.footer-brand__strap {
    font-family: var(--font-head);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8b979b;
    margin-bottom: 1.1rem;
}

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.6rem; }

.footer-social {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.4rem;
}
.footer-social a {
    width: 40px; height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    color: #c5cfd2;
    font-size: 1rem;
    transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.footer-social a:hover { background: var(--teal); color: #fff; transform: translateY(-2px); }

.footer-support {
    margin-top: 1.4rem;
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--teal);
    background: rgba(3, 182, 181, 0.08);
    border-radius: 0 10px 10px 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #c5cfd2;
}
.footer-support strong { color: #fff; }

.site-footer__bar {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: #7e8c91;
}
.site-footer__bar a { color: #9aa6aa; }
.site-footer__bar a.footer-credit { color: var(--teal); font-weight: 600; }
.site-footer__bar a.footer-credit:hover { color: #fff; }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Responsive - header
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .nav__toggle { display: grid; place-items: center; }
    .nav {
        position: fixed;
        inset: 0;
        z-index: 200;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        margin: 0;
        padding: 7.5rem 1.8rem 2.5rem;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0s linear 0.32s;
    }
    .nav__inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-block: auto;
        flex-shrink: 0;
    }
    .nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0s linear 0s;
    }
    .nav__list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; max-width: 380px; border-radius: 14px; overflow: hidden; }
    .nav__list li { width: 100%; text-align: center; }
    .nav__list > li:nth-child(odd)  { background: rgba(3, 182, 181, 0.08); }
    .nav__list > li:nth-child(even) { background: var(--grey); }
    .nav__link { display: block; padding: 1.15rem 0; font-size: 1.15rem; }
    .nav__link::after { display: none; }
    .nav .btn { margin-top: 1.8rem; justify-content: center; font-size: 1.05rem; }

    /* "What we offer" becomes a tap-to-expand accordion in the overlay */
    .nav__item--has-sub { position: static; width: 100%; }
    .nav__sub-toggle {
        width: 100%;
        justify-content: center;
        padding: 1.15rem 0;
        font-size: 1.15rem;
    }
    .nav__sub,
    .nav__item--has-sub:hover .nav__sub,
    .nav__item--has-sub:focus-within .nav__sub,
    .nav__item--has-sub.is-open .nav__sub {
        position: static;
        transform: none;
        min-width: 0;
        background: #fff;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        opacity: 1;
        visibility: visible;
    }
    .nav__sub { max-height: 0; overflow: hidden; transition: max-height 0.32s var(--ease); }
    .nav__sub::before { display: none; }
    .nav__sub::after { display: none; }
    .nav__item--has-sub.is-open .nav__sub { max-height: 360px; }
    .nav__sublink {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.6rem;
        padding: 0.95rem 0;
        border-radius: 0;
        font-size: 1.02rem;
        color: var(--teal-dark);
    }
    .nav__sublink i { color: var(--teal); width: auto; }
    .nav__sublink:hover { background: transparent; }
    .nav__brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        position: absolute;
        top: 1.6rem; left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
    .nav__logo {
        display: block;
        height: 38px; width: auto;
    }
    .nav__strap {
        font-family: var(--font-head);
        font-size: 0.58rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--teal-dark);
        font-weight: 600;
    }
    .nav__email {
        display: block;
        margin-top: 1.2rem;
        font-family: var(--font-head);
        font-weight: 600;
        font-size: 0.98rem;
        color: var(--teal-dark);
    }
    .nav__close {
        position: fixed;
        top: 1.4rem; right: 1.4rem;
        z-index: 10;
        background: none; border: 0; font-size: 1.75rem;
        color: var(--charcoal); cursor: pointer;
        width: 46px; height: 46px;
        display: grid; place-items: center;
    }
    body.nav-open { overflow: hidden; }
}
@media (min-width: 901px) {
    .nav__close { display: none; }
}

/* --------------------------------------------------------------------------
   Responsive - footer
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
    .site-footer__grid { grid-template-columns: repeat(3, 1fr); }
    .footer-col--brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 2.2rem;
        text-align: center;
    }
    .footer-social { justify-content: center; }
    .footer-support {
        border-left: 0;
        border-top: 3px solid var(--teal);
        border-radius: 10px;
        text-align: center;
    }
    .site-footer__bar { justify-content: center; text-align: center; }
}
@media (max-width: 420px) {
    .site-footer__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Site-wide eligibility top bar (.hope-bar)
   Slim utility strip above the header nav, linking to /eligibility.
   Lives in includes/kandryn-header.php as the first element so it appears
   on every page. Calm charcoal - informational, not promotional.
   ========================================================================== */
.hope-bar {
    display: block;
    background: var(--charcoal);
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hope-bar__inner {
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 0.6rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-align: center;
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.35;
}
.hope-bar__inner > i { color: var(--teal); font-size: 0.95rem; flex: 0 0 auto; }
.hope-bar__chev {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
    transition: transform 0.2s var(--ease);
}
.hope-bar:hover { background: #11181c; }
.hope-bar:hover .hope-bar__chev { transform: translateX(3px); }

/* On mobile the bar is hidden - it lives inside the opened menu instead
   (see .nav__eligibility), so it doesn't eat into the small viewport. */
@media (max-width: 900px) {
    .hope-bar { display: none; }
}

/* ==========================================================================
   Eligibility section inside the mobile menu (.nav__eligibility)
   Hidden on desktop; appears as a dedicated block in the opened nav overlay.
   ========================================================================== */
.nav__eligibility { display: none; }

@media (max-width: 900px) {
    .nav__eligibility {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        width: 100%;
        max-width: 380px;
        margin-top: 1.8rem;
        padding: 1rem 1.15rem;
        background: var(--charcoal);
        color: #fff;
        border-radius: 14px;
        text-decoration: none;
        text-align: left;
    }
    .nav__eligibility > i:first-child {
        color: var(--teal);
        font-size: 1.2rem;
        flex: 0 0 auto;
    }
    .nav__eligibility__text {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        font-size: 0.88rem;
        line-height: 1.4;
        color: #d3dbdd;
    }
    .nav__eligibility__text strong {
        color: #fff;
        font-family: var(--font-head);
        font-size: 0.98rem;
        font-weight: 600;
    }
    .nav__eligibility__chev {
        margin-left: auto;
        color: rgba(255, 255, 255, 0.55);
        font-size: 0.8rem;
        flex: 0 0 auto;
    }
}
