/* ==========================================================================
   KBR National Park — Umbraco 6 stylesheet
   Ported from the React app (Tailwind v4) theme.css / responsive.css / fonts.css.
   This is a hand-written design system that replaces Tailwind utility classes.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Core base */
    --forest-green: #1F4D3A;
    --leaf-green: #3E7C59;
    --earth-brown: #6B4F3A;

    /* Peacock highlights */
    --peacock-teal: #007A73;
    --peacock-blue: #0F4C81;

    /* Accent gold */
    --sunset-gold: #D4A740;
    --darker-gold: #B2872E;

    /* Neutrals */
    --warm-sand: #F3EFE7;
    --off-white: #FAFAF8;
    --soft-charcoal: #1A1A1A;
    --muted-gray: #6E6E6E;

    /* Gen-Z vibrant accents */
    --lime-pop: #BFFF58;
    --teal-glow: #00D4AA;

    /* Mapped theme colors */
    --background: var(--off-white);
    --foreground: var(--soft-charcoal);
    --card: #ffffff;
    --primary: var(--forest-green);
    --secondary: var(--warm-sand);
    --accent: var(--peacock-teal);
    --border: rgba(0, 0, 0, 0.08);
    --input-background: #f3f3f5;

    /* Radius */
    --radius: 0.75rem;
    --radius-sm: calc(var(--radius) - 4px);
    --radius-md: calc(var(--radius) - 2px);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);

    --font-size: 16px;
    --font-heading: "Space Grotesk", sans-serif;
    --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'DM Mono', monospace;

    --container-max: 1216px;
    --easing: cubic-bezier(0.33, 1, 0.68, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size);
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--forest-green) var(--warm-sand);
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--soft-charcoal);
}

h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h4 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted-gray);
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
}

button {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.25s var(--easing);
}

input, textarea, select {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

.text-balance { text-wrap: balance; }
.text-center { text-align: center; }
.tag-mono {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. Layout system (replaces Tailwind container / grid / flex utilities)
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.section {
    padding-block: 5rem;
}

.section-sm { padding-block: 3rem; }

.section-warm { background-color: var(--warm-sand); }
.section-forest-tint { background-color: rgba(31, 77, 58, 0.04); }
.section-charcoal { background-color: var(--soft-charcoal); color: #fff; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 1.5rem; grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-10 { margin-bottom: 2.5rem; }

/* --------------------------------------------------------------------------
   5. Effects & utilities (ported verbatim from theme.css)
   -------------------------------------------------------------------------- */
.peacock-gradient {
    background: linear-gradient(135deg, var(--peacock-teal) 0%, var(--peacock-blue) 100%);
}

.glass {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.gradient-text {
    background: linear-gradient(135deg, var(--peacock-teal) 0%, var(--teal-glow) 50%, var(--lime-pop) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-gold {
    background: linear-gradient(135deg, var(--sunset-gold) 0%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform 0.3s var(--easing);
}
.hover-lift:hover {
    transform: translateY(-4px);
}

/* ── Global page scrollbar (Chromium/Safari) ────────────────────────────── */
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: var(--warm-sand); }
html::-webkit-scrollbar-thumb {
    background: var(--forest-green);
    border-radius: 4px;
    border: 2px solid var(--warm-sand);
}
html::-webkit-scrollbar-thumb:hover { background: var(--leaf-green); }

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* --------------------------------------------------------------------------
   6. Components (buttons, cards, badges, hero) — reused by page templates
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s var(--easing);
}

.btn-primary { background: var(--forest-green); color: #fff; }
.btn-primary:hover { background: var(--leaf-green); transform: translateY(-2px); }

.btn-gold { background: #117a72; color: #fff; padding: 14px 36px; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.03em; border-radius: 9999px; }
.btn-gold:hover { background: #0d6159; color: #fff; transform: translateY(-2px); }

.btn-outline { background: transparent; color: var(--forest-green); border: 1px solid var(--forest-green); }
.btn-outline:hover { background: var(--forest-green); color: #fff; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-pad { padding: 1.5rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(31, 77, 58, 0.08);
    color: var(--forest-green);
}

/* Generic hero used by most pages (image background + overlay + centered text) */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background-size: cover;
    background-position: center;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%);
}
.hero__content {
    position: relative;
    z-index: 1;
    max-width: 56rem;
    padding-inline: 1.25rem;
}
.hero__content h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.5rem); }
.hero__content p { color: rgba(255,255,255,0.9); font-size: 1.125rem; margin-top: 1rem; }

/* Simple colored hero (no image) — species pages use heroBgColor */
.hero-solid {
    min-height: 38vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: var(--forest-green);
}
.hero-solid h1 { color: #fff; font-size: clamp(1.75rem, 4vw, 3rem); }

/* Species / item card (birds, flowers, parks, etc.) */
.item-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s var(--easing), box-shadow 0.3s var(--easing);
}
.item-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -12px rgba(0,0,0,0.15); }
.item-card__img { width: 100%; height: 220px; object-fit: cover; transition: transform 0.4s var(--easing); }
.item-card:hover .item-card__img { transform: scale(1.05); }
.item-card__body { padding: 1rem 1.25rem; }
.item-card__title { font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem; color: var(--soft-charcoal); }
.item-card__sci { font-style: italic; color: var(--muted-gray); font-size: 0.875rem; margin-top: 0.25rem; }

/* --------------------------------------------------------------------------
   7. Responsive breakpoints (ported from responsive.css / fonts.css)
   -------------------------------------------------------------------------- */

/* Tablet landscape (≤1200px): tighten container padding */
@media (max-width: 1200px) {
    .container { padding-inline: 1.5rem; }
}

/* Tablet (≤1023px): 2-col grids */
@media (max-width: 1023px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 2.1rem; }
    .container { padding-inline: 1.25rem; }
}

/* Mobile (≤767px): single column everywhere */
@media (max-width: 767px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding-block: 3.5rem; }
    .section-sm { padding-block: 2rem; }
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.25rem; }
    .container { padding-inline: 1rem; }
}

/* Small phones (≤479px) */
@media (max-width: 479px) {
    .section { padding-block: 2.5rem; }
    h1 { font-size: 1.65rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.1rem; }
    .container { padding-inline: 1rem; }
    .btn { padding: .65rem 1.25rem; font-size: .875rem; }
}

/* --------------------------------------------------------------------------
   8. Scroll-reveal motion system
   Emulates the reference site's framer-motion `whileInView` reveals:
   elements start faded + offset and animate to natural position when they
   scroll into view (one-shot). Driven by the IntersectionObserver in Master.
   Standard reveal = opacity 0 -> 1, translateY(30px) -> 0, 0.6s easeOutCubic.
   -------------------------------------------------------------------------- */
/* Hiding is opt-in: only active once Master adds `.js-anim` to <html>, so with
   JS disabled / IntersectionObserver unsupported the content stays fully visible. */
.js-anim .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--easing), transform 0.6s var(--easing);
    transition-delay: var(--d, 0s); /* per-element override: style="--d:.2s" */
    will-change: opacity, transform;
}
.js-anim .reveal.is-visible { opacity: 1; transform: none; }

/* offset/style variants (mirror framer initial values: y:20 / y:40 / scale .98 / x) */
.js-anim .reveal--sm    { transform: translateY(20px); }
.js-anim .reveal--lg    { transform: translateY(40px); }
.js-anim .reveal--scale { transform: scale(0.98); }
.js-anim .reveal--left  { transform: translateX(-40px); }
.js-anim .reveal--right { transform: translateX(40px); }

/* Staggered container — direct children cascade in (mirrors framer delay:index*step) */
.js-anim .stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--easing), transform 0.6s var(--easing);
    will-change: opacity, transform;
}
.js-anim .stagger.is-visible > * { opacity: 1; transform: none; }
.stagger.is-visible > *:nth-child(1)  { transition-delay: 0s; }
.stagger.is-visible > *:nth-child(2)  { transition-delay: 0.08s; }
.stagger.is-visible > *:nth-child(3)  { transition-delay: 0.16s; }
.stagger.is-visible > *:nth-child(4)  { transition-delay: 0.24s; }
.stagger.is-visible > *:nth-child(5)  { transition-delay: 0.32s; }
.stagger.is-visible > *:nth-child(6)  { transition-delay: 0.40s; }
.stagger.is-visible > *:nth-child(7)  { transition-delay: 0.48s; }
.stagger.is-visible > *:nth-child(8)  { transition-delay: 0.56s; }
.stagger.is-visible > *:nth-child(9)  { transition-delay: 0.64s; }
.stagger.is-visible > *:nth-child(10) { transition-delay: 0.72s; }

/* slow spin accent used by the reference (animate-spin-slow) */
@keyframes kbr-spin-slow { to { transform: rotate(360deg); } }
.animate-spin-slow { animation: kbr-spin-slow 8s linear infinite; }

/* Accessibility + no-JS safety: never hide content when motion is unwanted */
@media (prefers-reduced-motion: reduce) {
    .reveal, .stagger > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
.no-reveal .reveal,
.no-reveal .stagger > * {
    opacity: 1 !important;
    transform: none !important;
}

/* ── Global scroll-to-top button ──────────────────────────────────────────── */
#kbr-scroll-top {
    position: fixed;
    bottom: 1.5rem;
    right: calc(1.5rem + 8px);
    z-index: 60;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    border: none;
    background: var(--forest-green, #1F4D3A);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    outline: 1px solid rgba(255, 255, 255, 0.2);
    /* hidden by default */
    opacity: 0;
    transform: translateY(0.75rem);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, scale 0.15s ease;
}
#kbr-scroll-top.kbr-scroll-top--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#kbr-scroll-top:hover {
    background: #2d6a4f;
    scale: 1.1;
}
#kbr-scroll-top:active {
    scale: 0.95;
}
#kbr-scroll-top:focus-visible {
    outline: 2px solid #bfff58;
    outline-offset: 2px;
}
@media (min-width: 640px) {
    #kbr-scroll-top {
        bottom: 1.75rem;
        right: calc(1.75rem + 8px);
        width: 3rem;
        height: 3rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    #kbr-scroll-top {
        transition: opacity 0.15s ease;
        scale: 1 !important;
        transform: none !important;
    }
}

/* ── Global button standard: 42px height, 32px radius ─────────────────────── */
.btn, .btn-gold, .btn-outline, .btn-primary,
.ln-btn, .tp-btn, .tp-btn--ghost, .tp-btn--solid,
.kbra-btn, .kbra-btn--green, .kbra-btn--outline, .kbra-btn--sm, .kbra-result-btn,
.dn-meet-btn, .dn-pay-btn, .sp-viewmore-btn, .sp-loadmore-form button,
.vi-btn, .vi-guest-btn, .kd-pgbtn, .kd-sync-btn,
.tr-cta a,
button[type="submit"], input[type="submit"] {
    box-sizing: border-box !important;
    height: 42px !important;
    min-height: 42px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: 32px !important;
    line-height: 1.2 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vi-btn, #vi-continue-btn { display: flex; }

/* ── Numbers use Inter (Space Grotesk digits look uneven) ── */
.bd-stat__value, .cv-stat__value, .cv-progcard__stat, .cv-card__impact, .ab-fact__value, .ab-timeline__year, .cv-ach__year,
.ct-timing-value, .ct-map-card__value, .dn-donor__amt, .dn-stat-num, .dn-impact__stat, .kbra-qrcard-num,
.kd-stat__value, .kd-total, .gl-count, .ce-lb__count, .tp-action__impact,
.vi-pcard__amt, .vi-prate, .vi-prate b, .vi-agerate, .vi-quickcard__value, .vi-howstep__num,
.vi-stepper, .vi-stepper input, .vi-step, #vi-qty, #vi-childqty, .vi-qtytotallbl {
    font-family: var(--font-body, 'Inter', sans-serif) !important;
    font-variant-numeric: lining-nums;
}

/* ---------- Fully rounded (pill) buttons ---------- */
button, input[type="submit"], input[type="button"], a[class*="btn"], [class*="btn"] { border-radius: 999px !important; }

/* Buttons: Space Grotesk 14px / 600 */
button, input[type="submit"], input[type="button"], a[class*="btn"], [class*="btn"] { font-family: "Space Grotesk", sans-serif !important; font-size: 14px !important; font-weight: 600 !important; }
