/* ═══════════════════════════════════════════════════════════
   RBC Race for the Kids Jersey — Global Stylesheet
   Order: tokens → reset → base → typography → layout →
          buttons → utilities → footer.
   Page-specific styles live in:
     - css/nav.css   (sticky header)
     - css/home.css  (hero, key-numbers, about, presented-by)
   ═══════════════════════════════════════════════════════════ */


/* ─── DESIGN TOKENS ────────────────────────────────────────── */

:root {
    /* Blues */
    --rbc-dark-blue:          #003168;
    --rbc-bright-blue:        #0051A5;
    --rbc-bright-blue-tint-1: #006AC3;
    --rbc-bright-blue-tint-2: #73B0E3;
    --rbc-bright-blue-tint-3: #C3E2FA;
    --rbc-bright-blue-tint-4: #E3F4FF;
    --rbc-ocean:              #0091DA;

    /* Neutrals */
    --rbc-cool-white:         #E7EEF1;
    --rbc-light-gray:         #C1B5A5;
    --rbc-carbon:             #899299;
    --rbc-gray:               #9EA2A2;
    --rbc-slate-gray:         #6F6E6F;

    /* Warm accents */
    --rbc-warm-yellow:        #FFC72C;
    --rbc-sunburst:           #FCA311;
    --rbc-beige:              #B8A970;
    --rbc-sand:               #B58500;
    --rbc-apple:              #AABA0A;

    /* Cool accents */
    --rbc-sky:                #51B5E0;
    --rbc-tundra:             #87AFBF;
    --rbc-seaweed:            #588886;

    /* Semantic aliases */
    --color-rbc-navy:         var(--rbc-dark-blue);
    --color-rbc-blue:         var(--rbc-bright-blue-tint-1);
    --color-rbc-blue-hover:   #005BAA;
    --color-rbc-blue-light:   #f0f6fc;
    --color-text-heading:     #252525;
    --color-text-body:        #585858;
    --color-text-muted:       #8A99A8;
    --color-surface-page:     #FFFFFF;
    --color-surface-white:    #FFFFFF;
    --color-bg-block-grey:    #F2F3F3;
    --color-border-subtle:    #E5E7EB;

    /* Gradients */
    --gradient-rbc-secondary: linear-gradient(45deg, #014691 0%, #0064B6 100%);
    --gradient-rbc-subtle:    linear-gradient(180deg, #EEF4FB 0%, #FFFFFF 100%);
    --gradient-rbc-light:     linear-gradient(180deg, #cee6f3 0%, #daecf6 100%);
    --gradient-hero-overlay:  linear-gradient(90deg, rgba(0, 33, 80, 0.78) 0%, rgba(0, 33, 80, 0.45) 55%, rgba(0, 33, 80, 0.15) 100%);

    /* Typography */
    --font-display: 'RBC Display', system-ui, sans-serif;
    --font-ui:      'Roboto', system-ui, sans-serif;

    --text-xs:   11px;
    --text-sm:   13px;
    --text-base: 16px;
    --text-md:   17px;
    --text-lg:   20px;
    --text-xl:   24px;
    --text-2xl:  28px;
    --text-3xl:  32px;
    --text-4xl:  40px;
    --text-5xl:  48px;

    --leading-tight:   1.2;
    --leading-snug:    1.35;
    --leading-normal:  1.5;
    --leading-relaxed: 1.65;

    --tracking-tight:  -0.01em;
    --tracking-normal:  0;
    --tracking-wide:    0.06em;
    --tracking-widest:  0.1em;

    --weight-regular:  400;
    --weight-medium:   500;
    --weight-semibold: 600;
    --weight-bold:     700;

    /* Spacing */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* Radii */
    --radius-xs:   4px;
    --radius-sm:   6px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card:       0px 2px 4px rgba(0, 0, 0, 0.08), 0px 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0px 4px 8px rgba(0, 0, 0, 0.10), 0px 8px 28px rgba(0, 0, 0, 0.10);
    --shadow-nav:        0 2px 12px rgba(0, 0, 0, 0.08);

    /* Layout */
    --max-width-content: 1140px;
    --header-height-top:      136px;
    --header-height-scrolled:  76px;

    /* Motion */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}


/* ─── RESET / NORMALIZE ─────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text-body);
    background: var(--color-surface-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

a {
    color: var(--color-text-body);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-rbc-blue-hover);
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--color-rbc-blue);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}


/* ─── TYPOGRAPHY ────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-rbc-navy);
    margin: 0 0 16px;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: clamp(36px, 5.5vw, 56px);
    font-weight: 700;
}

h2 {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 500;
    line-height: var(--leading-snug);
}

h3 {
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 500;
}

h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    font-family: var(--font-ui);
    letter-spacing: var(--tracking-normal);
}

h5 {
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-ui);
    letter-spacing: var(--tracking-normal);
}

h6 {
    font-size: var(--text-xs);
    font-weight: 700;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
}

p {
    margin: 0 0 16px;
}

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


/* ─── LAYOUT ────────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: var(--max-width-content);
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 32px);
}

main {
    /* Pushes content below the sticky header — only used where the
       hero isn't already covering the gap (faq, gallery shells).   */
}

main.has-spacer {
    padding-top: var(--header-height-top);
}

.section {
    padding-block: clamp(48px, 8vw, 96px);
}


/* ─── BUTTONS ───────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 0;
    border: 1.5px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast);
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-rbc-blue);
    color: #ffffff;
}

.btn--primary:hover,
.btn--primary:focus-visible {
    background: var(--color-rbc-blue-hover);
    color: #ffffff;
}

.btn--outline {
    background: transparent;
    color: var(--color-rbc-blue);
    border-color: var(--color-rbc-blue);
}

.btn--outline:hover,
.btn--outline:focus-visible {
    background: var(--rbc-bright-blue-tint-4);
    color: var(--color-rbc-blue-hover);
}

.btn--ghost-light {
    background: transparent;
    color: #ffffff;
    padding-inline: 0;
}

.btn--ghost-light:hover,
.btn--ghost-light:focus-visible {
    color: #ffffff;
    opacity: 0.85;
}

.btn--ghost-light::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
}

.btn--ghost-light:hover::after {
    transform: rotate(45deg) translate(2px, -2px);
}


/* ─── UTILITIES ─────────────────────────────────────────────── */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.coming-soon {
    min-height: 70vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 64px 24px;
}

.coming-soon h1 {
    margin-bottom: 16px;
}

.coming-soon p {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
}


/* ─── FOOTER ────────────────────────────────────────────────── */

.site-footer {
    background: var(--rbc-bright-blue);
    color: #ffffff;
    padding-top: 64px;
    padding-bottom: 32px;
}

.site-footer a {
    color: #ffffff;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--rbc-bright-blue-tint-3);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
}

.site-footer__col h3 {
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    margin-bottom: 20px;
}

.site-footer__col address {
    font-style: normal;
    line-height: var(--leading-normal);
    margin-bottom: 20px;
}

.site-footer__col p {
    margin-bottom: 8px;
}

.site-footer__col--partners ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-footer__socials {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.site-footer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 0;
    color: #ffffff;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: opacity var(--transition-fast);
}

.site-footer__socials a:hover,
.site-footer__socials a:focus-visible {
    color: #ffffff;
    opacity: 0.7;
}

.site-footer__socials svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: block;
    shape-rendering: geometricPrecision;
}

.site-footer__legal {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 768px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}


/* ─── SITE HEADER / NAV ─────────────────────────────────────── */
/* Two states driven by [data-state] on .site-header:
   top      = page-load, translucent, tall, logo 108px
   scrolled = solid white, shorter, logo 56px              */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background var(--transition-base),
                box-shadow var(--transition-base),
                padding var(--transition-base);
    padding-block: 12px;
}

.site-header[data-state="scrolled"] {
    background: #ffffff;
    box-shadow: var(--shadow-nav);
    padding-block: 8px;
}

.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.site-header__logo {
    display: inline-flex;
    justify-self: center;
    line-height: 0;
}

.site-header__logo img {
    height: 108px;
    width: auto;
    transition: height var(--transition-base);
}

.site-header[data-state="scrolled"] .site-header__logo img {
    height: 56px;
}

.primary-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 32px;
    align-items: center;
}

.primary-nav__link {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-rbc-navy);
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.primary-nav__link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--color-rbc-blue);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--transition-fast);
}

.primary-nav__link:hover,
.primary-nav__link[aria-current="page"] {
    color: var(--color-rbc-blue);
}

.primary-nav__link:hover::after,
.primary-nav__link[aria-current="page"]::after {
    transform: scaleX(1);
}

.site-header__cta {
    justify-self: end;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    color: var(--color-rbc-navy);
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-toggle__bars {
    position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after  { top:  7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
    top: 0;
    transform: rotate(-45deg);
}

@media (max-width: 860px) {
    .site-header__inner {
        grid-template-columns: auto 1fr auto;
    }

    .nav-toggle {
        display: inline-flex;
        justify-self: start;
    }

    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: var(--shadow-nav);
        padding: 24px 24px 32px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition-base), opacity var(--transition-base);
    }

    .primary-nav[data-open="true"] {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .primary-nav__list {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .primary-nav__link {
        font-size: var(--text-lg);
    }

    .site-header__logo img {
        height: 72px;
    }

    .site-header[data-state="scrolled"] .site-header__logo img {
        height: 48px;
    }

    .site-header__cta .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .site-header__cta .btn-label-long {
        display: none;
    }
}


/* ─── REDUCED MOTION ────────────────────────────────────────── */

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