/* =============================================================================
   California Bicycle Utopia — Theme
   ============================================================================= */

/* --- Tokens ----------------------------------------------------------------- */
:root {
    --ink:            #0c1a10;
    --ink-mid:        #172b1c;
    --forest:         #1c5d3f;
    --forest-mid:     #2e7d54;
    --forest-light:   #c4e0ce;
    --cream:          #f4efe5;
    --cream-dark:     #e8dfd0;
    --white:          #fafaf7;
    --orange:         #e85d2c;
    --orange-light:   #fce8df;
    --text:           #1a1a14;
    --text-muted:     #6b6560;
    --border:         #ddd7cc;

    --shadow-sm:  0 1px 4px rgba(12,26,16,.06);
    --shadow-md:  0 4px 16px rgba(12,26,16,.10);
    --shadow-lg:  0 8px 32px rgba(12,26,16,.12), 0 24px 48px rgba(12,26,16,.08);

    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Bootstrap overrides */
    --bs-body-bg:           var(--cream);
    --bs-body-color:        var(--text);
    --bs-secondary-color:   var(--text-muted);
    --bs-border-color:      var(--border);
    --bs-link-color:        var(--forest);
    --bs-link-hover-color:  var(--ink);
    --bs-primary:           var(--forest);
    --bs-primary-rgb:       28, 93, 63;
    --bs-font-sans-serif:   var(--font-body);
    --bs-body-font-family:  var(--font-body);
    --bs-body-font-size:    1.0625rem;
    --bs-body-line-height:  1.65;
    --bs-heading-color:     var(--text);
    --bs-card-bg:           var(--white);
    --bs-card-border-color: var(--border);
    --bs-card-border-radius: 0;
    --bs-navbar-color:        var(--text);
    --bs-navbar-hover-color:  var(--forest);
    --bs-navbar-active-color: var(--forest);
    --bs-btn-border-radius: 0;
    --bs-border-radius:     0;
}

/* --- Dark mode -------------------------------------------------------------- */
[data-bs-theme="dark"],
@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) {
        --cream:        #0d1a12;
        --cream-dark:   #152b1f;
        --white:        #152b1f;
        --text:         #e8e0d4;
        --text-muted:   #9a9488;
        --border:       #243d2a;
        --forest-light: #1a3d28;
        --bs-body-bg:         var(--cream);
        --bs-body-color:      var(--text);
        --bs-border-color:    var(--border);
        --bs-link-color:      #5cb87c;
        --bs-link-hover-color:#7dd49a;
        --bs-card-bg:         var(--cream-dark);
    }
}

[data-bs-theme="dark"] {
    --cream:        #0d1a12;
    --cream-dark:   #152b1f;
    --white:        #152b1f;
    --text:         #e8e0d4;
    --text-muted:   #9a9488;
    --border:       #243d2a;
    --forest-light: #1a3d28;
    --bs-body-bg:         var(--cream);
    --bs-body-color:      var(--text);
    --bs-border-color:    var(--border);
    --bs-link-color:      #5cb87c;
    --bs-link-hover-color:#7dd49a;
    --bs-card-bg:         var(--cream-dark);
}

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

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    color: var(--text);
}

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

/* --- Skip link -------------------------------------------------------------- */
.cbu-skip-link {
    position: absolute;
    top: 0; left: 0;
    z-index: 9999;
    padding: .75rem 1.25rem;
    background: var(--forest);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.cbu-skip-link:focus { clip: auto; width: auto; height: auto; }

/* --- Navbar ----------------------------------------------------------------- */
.cbu-site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(244, 239, 229, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-bs-theme="dark"] .cbu-site-header {
    background: rgba(13, 26, 18, 0.94);
}

.cbu-brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    text-decoration: none;
    color: var(--text) !important;
}

.cbu-brand__mark {
    color: var(--forest);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cbu-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.cbu-brand__name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--forest);
}

.cbu-brand__tagline {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.navbar-nav .nav-link {
    font-size: .875rem;
    font-weight: 500;
    padding-inline: 1rem;
    color: var(--text-muted) !important;
    transition: color .15s ease;
    position: relative;
}

.navbar-nav .nav-link:hover { color: var(--text) !important; }

.navbar-nav .nav-link.active {
    color: var(--text) !important;
    font-weight: 700;
}

/* Active dot */
.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: .25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--orange);
}

.cbu-nav-cta { color: var(--orange) !important; }

@media (prefers-reduced-motion: reduce) {
    .navbar-nav .nav-link { transition: none; }
}

/* --- HERO ------------------------------------------------------------------- */
.cbu-hero {
    background: var(--ink);
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Ambient green glow */
.cbu-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 50% at 5% 50%, rgba(28,93,63,.30) 0%, transparent 60%),
        radial-gradient(ellipse 30% 40% at 80% 80%, rgba(28,93,63,.12) 0%, transparent 60%);
    pointer-events: none;
}

.cbu-hero__body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding-top: 7rem;
    padding-bottom: 5rem;
    position: relative;
    z-index: 1;
}

.cbu-hero__eyebrow {
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--forest-mid);
    margin-bottom: 1.75rem;
}

.cbu-hero__headline {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 9vw, 7.5rem);
    font-weight: 400;
    line-height: .92;
    letter-spacing: -.025em;
    color: #fff;
    margin-bottom: 2rem;
}

/* "Better streets." in italic — a second voice */
.cbu-hero__headline em {
    font-style: italic;
    color: rgba(255,255,255,.72);
}

.cbu-hero__sub {
    font-size: clamp(.95rem, 1.5vw, 1.15rem);
    color: rgba(255,255,255,.48);
    max-width: 42ch;
    line-height: 1.65;
    margin-bottom: 2.5rem;
}

.cbu-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* Hero-specific buttons */
.cbu-btn-white {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .9rem 2.25rem;
    background: #fff;
    color: var(--ink) !important;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    transition: background .15s ease;
}

.cbu-btn-white:hover {
    background: var(--forest-light);
    color: var(--ink) !important;
    text-decoration: none;
}

.cbu-btn-outline-white {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .9rem 2.25rem;
    background: transparent;
    color: rgba(255,255,255,.7) !important;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid rgba(255,255,255,.28);
    transition: border-color .15s ease, color .15s ease;
}

.cbu-btn-outline-white:hover {
    border-color: rgba(255,255,255,.65);
    color: #fff !important;
    text-decoration: none;
}

/* Stats strip at hero bottom */
.cbu-hero__foot {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,.07);
    padding-block: 1.25rem;
}

.cbu-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cbu-hero__stats li {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
}

@media (prefers-reduced-motion: reduce) {
    .cbu-btn-white, .cbu-btn-outline-white { transition: none; }
}

/* --- Sections --------------------------------------------------------------- */
.cbu-section { padding-block: 6rem; }

.cbu-section--ink   { background: var(--ink); }
.cbu-section--white { background: var(--white); }

.cbu-section--ink h2,
.cbu-section--ink h3 { color: #fff; }

/* 4px top border variants */
.cbu-section--top-green  { border-top: 4px solid var(--forest); }
.cbu-section--top-orange { border-top: 4px solid var(--orange); }

/* Section labels + headings */
.cbu-label {
    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: .75rem;
}

.cbu-section__heading {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    margin-bottom: 3.5rem;
}

/* --- Route list (magazine style) ------------------------------------------- */
.cbu-route-list {
    border-top: 1px solid var(--border);
}

.cbu-route-row {
    display: grid;
    grid-template-columns: 5rem 1fr 8rem;
    gap: 2.5rem;
    align-items: start;
    width: 100%;
    padding: 2.75rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    border-left: 4px solid transparent;
    transition: border-left-color .2s ease,
                background          .2s ease,
                padding-left        .2s ease;
}

.cbu-route-row:hover {
    border-left-color: var(--orange);
    background: rgba(255,255,255,.55);
    padding-left: 1.5rem;
    text-decoration: none;
    color: var(--text);
}

[data-bs-theme="dark"] .cbu-route-row:hover {
    background: rgba(255,255,255,.04);
}

.cbu-route-row__num {
    font-family: var(--font-display);
    font-size: 3.25rem;
    line-height: 1;
    color: var(--forest-light);
    padding-top: .1rem;
    user-select: none;
}

.cbu-route-row__title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: .625rem;
    transition: color .15s ease;
}

.cbu-route-row:hover .cbu-route-row__title { color: var(--forest); }

.cbu-route-row__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-bottom: 1rem;
}

.cbu-tag {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: .2rem .65rem;
}

.cbu-tag--region   { background: var(--forest-light); color: #134429; }
.cbu-tag--easy     { background: #d0ead8; color: #134429; }
.cbu-tag--moderate { background: #f5e4d0; color: #7a3d10; }
.cbu-tag--hard     { background: #f5d0d0; color: #7a1010; }
.cbu-tag--surface  { background: var(--cream-dark); color: var(--text-muted); }
.cbu-tag--family   { background: #e0edf5; color: #1a4a6a; }

.cbu-route-row__desc {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: .875rem;
}

.cbu-route-row__advocacy {
    font-size: .78rem;
    color: var(--orange);
    display: flex;
    gap: .35rem;
    align-items: flex-start;
    line-height: 1.5;
}

.cbu-route-row__advocacy::before { content: '⚠'; flex-shrink: 0; }

/* Stats column */
.cbu-route-row__stats { text-align: right; padding-top: .1rem; }

.cbu-route-row__dist {
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1;
    color: var(--text);
    white-space: nowrap;
}

.cbu-route-row__dist sup {
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .03em;
}

.cbu-route-row__elev {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .375rem;
}

/* Responsive: 2 columns on tablet, stack on mobile */
@media (max-width: 991.98px) {
    .cbu-route-row {
        grid-template-columns: 4rem 1fr 7rem;
        gap: 1.5rem;
    }
    .cbu-route-row__dist { font-size: 2.25rem; }
    .cbu-route-row__num  { font-size: 2.5rem; }
}

@media (max-width: 575.98px) {
    .cbu-route-row {
        grid-template-columns: 1fr;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        gap: 1rem;
    }
    .cbu-route-row:hover {
        padding-left: 0;
        border-left-color: transparent;
        background: none;
    }
    .cbu-route-row__num   { display: none; }
    .cbu-route-row__stats { text-align: left; }
    .cbu-route-row__dist  { font-size: 2rem; }
}

/* Routes see-all link */
.cbu-see-all {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 2.5rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--forest);
    text-decoration: none;
    border-bottom: 1.5px solid var(--forest);
    padding-bottom: .1rem;
    transition: color .15s ease, border-color .15s ease;
}

.cbu-see-all:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* --- Map -------------------------------------------------------------------- */
.cbu-map-section {
    padding-block: 0;
    border-top: 1px solid rgba(0,0,0,.1);
    border-bottom: 1px solid rgba(0,0,0,.1);
}

.cbu-map-container {
    width: 100%;
    height: 480px;
    background: var(--forest-light);
    display: block;
}

.cbu-map-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-style: italic;
    color: var(--text-muted);
}

/* --- Advocacy panels -------------------------------------------------------- */
/* Section uses .cbu-section--ink; padding-bottom: 0 so panels flush the bottom */
.cbu-advocacy-section {
    padding-bottom: 0;
}

.cbu-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 1rem;
}

@media (max-width: 767.98px) {
    .cbu-panels { grid-template-columns: 1fr; }
}

.cbu-panel {
    padding: 4rem 3.5rem 4.5rem;
    display: flex;
    flex-direction: column;
}

@media (max-width: 991.98px) {
    .cbu-panel { padding: 3rem 2rem 3.5rem; }
}

.cbu-panel--win   { background: rgba(28,93,63,.38); border-right: 1px solid rgba(255,255,255,.06); }
.cbu-panel--fight { background: rgba(232,93,44,.14); }

@media (max-width: 767.98px) {
    .cbu-panel--win { border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
}

.cbu-panel__eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.cbu-panel--win .cbu-panel__eyebrow  { color: #7dd49a; }
.cbu-panel--fight .cbu-panel__eyebrow { color: var(--orange); }

.cbu-panel__icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: .8rem;
    flex-shrink: 0;
}

.cbu-panel--win .cbu-panel__icon   { background: rgba(125,212,154,.18); color: #7dd49a; }
.cbu-panel--fight .cbu-panel__icon  { background: rgba(232,93,44,.22); color: var(--orange); }

.cbu-panel__headline {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    line-height: 1.15;
    flex: 1;
    margin-bottom: 1.5rem;
}

.cbu-panel--win .cbu-panel__headline  { color: #fff; }
.cbu-panel--fight .cbu-panel__headline { color: #ffd5b8; }

.cbu-panel__body {
    font-size: .92rem;
    line-height: 1.72;
    margin-bottom: 2.25rem;
}

.cbu-panel--win .cbu-panel__body   { color: rgba(255,255,255,.62); }
.cbu-panel--fight .cbu-panel__body  { color: rgba(255,218,190,.62); }

.cbu-panel__cta {
    display: inline-block;
    padding: .65rem 1.75rem;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
    transition: background .15s ease;
}

.cbu-panel--win .cbu-panel__cta {
    background: rgba(28,93,63,.55);
    color: #c4e0ce !important;
    border: 1px solid rgba(125,212,154,.25);
}

.cbu-panel--win .cbu-panel__cta:hover {
    background: var(--forest-mid);
    color: #fff !important;
}

.cbu-panel--fight .cbu-panel__cta {
    background: var(--orange);
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.cbu-panel--fight .cbu-panel__cta:hover { background: #c44d1e; color: #fff !important; }

@media (prefers-reduced-motion: reduce) {
    .cbu-panel__cta,
    .cbu-route-row,
    .cbu-route-row__title { transition: none; }
}

/* --- Newsletter strip ------------------------------------------------------- */
.cbu-newsletter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    padding: 3.5rem 0;
    border-top: 4px solid var(--orange);
    border-bottom: 1px solid var(--border);
}

@media (max-width: 991.98px) {
    .cbu-newsletter { grid-template-columns: 1fr; gap: 3rem; }
}

.cbu-newsletter__left {
    border-left: 6px solid var(--orange);
    padding-left: 2rem;
}

.cbu-newsletter__hed {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.0;
    color: var(--text);
    margin-bottom: 1rem;
}

.cbu-newsletter__sub {
    font-size: 1rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 0;
}

.cbu-newsletter__labels {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2.25rem;
}

.cbu-newsletter__pill {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .3rem .8rem;
    background: var(--forest-light);
    color: #134429;
}

.cbu-newsletter__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
}

.cbu-newsletter__secondary {
    font-size: .82rem;
    color: var(--text-muted);
    text-decoration: none;
}

.cbu-newsletter__secondary:hover {
    color: var(--forest);
    text-decoration: underline;
}

/* --- About ------------------------------------------------------------------ */
.cbu-about {
    border-left: 4px solid var(--forest-light);
    padding-left: 2rem;
    max-width: 65ch;
}

.cbu-about p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0;
}

/* --- Footer ----------------------------------------------------------------- */
.cbu-site-footer {
    padding-block: 3.5rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--cream);
}

.cbu-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.cbu-footer-newsletter__heading {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: .35rem;
}

.cbu-footer-newsletter__pitch {
    font-size: .88rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 46ch;
}

.cbu-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.cbu-footer-nav a {
    font-size: .82rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 1.25rem;
}

.cbu-footer-nav a:hover { color: var(--forest); }

.cbu-footer-copy {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
}

/* --- Bootstrap overrides ---------------------------------------------------- */
.btn-primary {
    --bs-btn-bg:           var(--forest);
    --bs-btn-border-color: var(--forest);
    --bs-btn-color:        #fff;
    --bs-btn-hover-bg:     #134429;
    --bs-btn-hover-border: #134429;
    --bs-btn-hover-color:  #fff;
    font-weight: 700;
    border-radius: 0;
    letter-spacing: .02em;
}

.btn-outline-primary {
    --bs-btn-color:              var(--forest);
    --bs-btn-border-color:       var(--forest);
    --bs-btn-hover-bg:           var(--forest);
    --bs-btn-hover-border-color: var(--forest);
    --bs-btn-hover-color:        #fff;
    font-weight: 600;
    border-radius: 0;
}

/* --- Focus ------------------------------------------------------------------ */
:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
}
