@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --color-secondary: #0d1f4e;
    --color-primary: #2c64ab;
    --color-accent: #4fa6dc;
    /* Real theme's .container: padding 1.75rem (28px), max-width 1880px
       at >=1400px viewport, auto-centered. Below 1880px this is flat
       28px; above it, it grows to keep content capped at 1880px wide. */
    --edge-pad: max(28px, calc((100vw - 1880px) / 3 + 28px));

    /* Shared roles, extracted from values repeated identically (same hex,
       same meaning) across public.css and every public template's own
       inline <style> block -- this file previously had none of these and
       every template re-hardcoded its own copy. Values preserved exactly
       as already used; this is a pure tokenization pass, not a redesign,
       so nothing here changes what any page looks like. */
    --pub-text: #1a1a18;
    --pub-text-muted: #6b6b64;
    --pub-surface: #fff;
    --pub-border: #e2e2dc;
    --pub-border-input: #d0d0c8;
    --pub-surface-input: #fafaf8;
    --pub-surface-divider: #f0f0ec;
    --pub-warning: #f59e0b;
    --pub-danger: #dc2626;
    --pub-link: #2a52e0;
    --pub-text-faint: #9ca3af;
}

/* ============================================================
   public.css — shared styles for all public-facing pages
   ============================================================ */


/* ── 1. Global reset & body ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f3;
    color: var(--pub-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* ── 2. Public header ───────────────────────────────────── */
.site-header {
    background: var(--color-primary);
    margin: 12px var(--edge-pad) 0;
    border-radius: 12px;
}
.site-header__inner {
    position: relative;
    padding: 0 12px;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 40px;
}
.site-header__home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
.site-header__home-btn:hover { background: rgba(255,255,255,.15); color: var(--pub-surface); }
.site-header__logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--pub-surface);
    text-decoration: none;
    letter-spacing: .02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.site-header__logo-img {
    /* Source SVG is ~9.4:1 wide — a fixed height alone makes this ~340px
       wide, which overflows narrow viewports on its own. Scale with
       viewport width instead, bounded to the original 36px at desktop. */
    height: clamp(22px, 6vw, 36px);
    width: auto;
    display: block;
}
.site-header__nav {
    /* Normal flex flow, not absolute -- an absolutely positioned element
       is removed from flow entirely, so the header's min-height never
       sees it grow when content wraps; it just overflows above/below a
       box that never resizes. Flex flow fixes that for free: the header
       grows to fit the tallest child automatically, whether that's the
       nav after wrapping or anything else. .site-header__right is given
       a min-width matching the logo's own max width, making this flex
       item's available space symmetric -- so centering within it
       (justify-content:center) lands on the bar's true visual centre,
       not just the leftover gap. */
    flex: 1 1 auto;
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(4, minmax(90px, max-content));
    align-items: center;
    column-gap: 12px;
}
/* slots 1-2 right-align toward centre; slots 3-4 left-align away from centre */
.site-header__nav > *:nth-child(1),
.site-header__nav > *:nth-child(2) { text-align: right; padding-right: 24px; }
.site-header__nav > *:nth-child(3),
.site-header__nav > *:nth-child(4) { text-align: left;  padding-left: 24px; }
.site-header__nav a {
    /* Scales smoothly with viewport width instead of jumping between
       fixed sizes -- full 19px with room to spare, shrinking down to 13px
       as the screen narrows toward the hide breakpoint. */
    font-size: clamp(13px, 0.86vw + 5.3px, 19px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    line-height: 1.25;
    display: block;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    transition: color .12s;
}
.site-header__nav a:hover { color: var(--pub-surface); }
.site-header__nav-placeholder { display: block; }
.site-header__right {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}
@media (min-width: 901px) {
    /* Matches the logo's own max rendered width (~350px) so the nav's
       flex slot is symmetric between the logo and this side -- without
       this, centering the nav within its slot visibly favoured the right
       side, since the logo is much wider than the hamburger/lang
       controls on their own. Scoped to only apply while .site-header__nav
       is actually visible (900px+) -- below that, this reservation serves
       no purpose and was pushing the hamburger off-screen on narrow
       mobile widths where 360px alone can exceed the viewport. */
    .site-header__right { min-width: 360px; }
}
.site-header__menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}
.site-header__menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--pub-surface);
    border-radius: 2px;
}


/* ── 3. Nav drawer ──────────────────────────────────────── */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.nav-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}
.nav-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 100%;
    max-width: 360px;
    height: 100%;
    background: var(--color-primary);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 22px 24px 40px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.nav-drawer.is-open {
    transform: translateX(0);
}
.nav-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 36px;
    flex-shrink: 0;
}
.nav-drawer__logo {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--pub-surface);
    text-decoration: none;
    line-height: 1.2;
}
.nav-drawer__close {
    background: none;
    border: none;
    color: var(--pub-surface);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: .85;
    transition: opacity .12s;
    flex-shrink: 0;
}
.nav-drawer__close:hover { opacity: 1; }
.nav-drawer__links {
    display: flex;
    flex-direction: column;
}
.nav-drawer__links a {
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--pub-surface);
    text-decoration: none;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
    transition: opacity .12s;
    line-height: 1.1;
}
.nav-drawer__links a:first-child {
    border-top: 1px solid rgba(255,255,255,.12);
}
.nav-drawer__links a:hover { opacity: .7; }
/* The riding-specific nav links (About/Donate/Our Team/etc.) duplicate
   what's already visible in the header on wide screens -- only show them
   here, at the top of the drawer, once the header nav itself is hidden
   (see the matching max-width:900px rule hiding .site-header__nav). */
.nav-drawer__dynamic-links { display: none; }
@media (max-width: 900px) {
    .nav-drawer__dynamic-links { display: contents; }
}


/* ── 4. Public footer ───────────────────────────────────── */
.site-footer {
    position: relative;
    overflow: hidden;
    background: var(--pub-surface-divider);
    border: 1px solid var(--pub-border);
    border-radius: 12px;
    margin: 0 var(--edge-pad) 16px;
    margin-top: auto;
}
.site-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url(/static/img/bg_trillium_white.png) no-repeat center / 100% auto;
    filter: invert(1);
    opacity: 0.07;
    pointer-events: none;
}
.site-footer > * { position: relative; z-index: 1; }
.site-footer__inner {
    padding: 48px 48px 36px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    align-items: start;
}
.site-footer__logo {
    font-size: 16px;
    font-weight: 800;
    color: var(--pub-text);
    text-decoration: none;
    display: block;
    margin-bottom: 14px;
    letter-spacing: .02em;
}
.site-footer__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.site-footer__links a {
    font-size: 13px;
    color: var(--pub-text-muted);
    text-decoration: none;
    transition: color .12s;
}
.site-footer__links a:hover { color: var(--pub-text); }
.site-footer__col--right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.site-footer__col--center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.site-footer__tagline {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pub-text);
    line-height: 1.1;
}
.site-footer__stay {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pub-text-muted);
    margin-bottom: 10px;
}
.site-footer__email-form {
    display: flex;
    border: 1px solid var(--pub-border-input);
    border-radius: 6px;
    overflow: hidden;
    background: var(--pub-surface);
}
.site-footer__email-input {
    flex: 1;
    border: none;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--pub-text);
    outline: none;
    font-family: inherit;
    background: transparent;
    min-width: 0;
}
.site-footer__email-btn {
    background: var(--color-primary);
    color: var(--pub-surface);
    border: none;
    padding: 9px 14px;
    font-size: 15px;
    cursor: pointer;
    transition: background .12s;
    flex-shrink: 0;
}
.site-footer__email-btn:hover { background: #1e40c8; }
.site-footer__bottom {
    border-top: 1px solid var(--pub-border);
    padding: 14px 24px;
    text-align: center;
    font-size: 11px;
    color: var(--pub-text-faint);
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 680px) {
    .site-footer__inner { grid-template-columns: 1fr; gap: 24px; }
    .site-footer__col--center { justify-content: flex-start; }
    .site-footer__tagline { font-size: 24px; }
}
@media (max-width: 900px) {
    /* Below this, the right-side hamburger button crowds into the last
       column even with capped/wrapping text -- the hamburger + nav-drawer
       (already in the markup) is the intended mobile/tablet nav, same
       pattern the reference site uses. */
    .site-header__nav { display: none; }
}


/* ── 5. Banner ──────────────────────────────────────────── */
/* Unified as .page-banner (was also .public-banner in some files) */
.page-banner {
    position: relative;
    overflow: hidden;
    background: var(--color-secondary);
    margin: 16px var(--edge-pad) 0;
    border-radius: 12px;
    padding: 36px 24px;
    text-align: center;
}
.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url(/static/img/bg_trillium_white.png) no-repeat center / 100% auto;
    opacity: 0.15;
    pointer-events: none;
}
.page-banner > * { position: relative; z-index: 1; }
.page-banner__eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #93b4d4;
    margin-bottom: 8px;
}
.page-banner__title {
    font-size: 28px;
    font-weight: 800;
    color: var(--pub-surface);
    text-transform: uppercase;
}
.page-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
}
.page-banner__sub {
    font-size: 13px;
    color: rgba(255,255,255,.65);
    margin-top: 4px;
    text-align: center;
}


/* ── 5. Form card system ────────────────────────────────── */
/* Unified as .form-card (was also .reg-card in some files) */
.form-card {
    background: var(--pub-surface);
    border: 1px solid var(--pub-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}
.form-card__header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--pub-border);
    background: var(--pub-surface-input);
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-card__header h2 { font-size: 13px; font-weight: 700; color: var(--pub-text); }
.form-card__num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: var(--pub-surface);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.form-card__body { padding: 20px; }


/* ── 6. Form fields ─────────────────────────────────────── */
.fg { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.fg:last-child { margin-bottom: 0; }
.fg label { font-size: 11px; font-weight: 600; color: var(--pub-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.fg input, .fg select {
    padding: 8px 11px;
    border: 1px solid var(--pub-border-input);
    border-radius: 6px;
    font-size: 14px;
    color: var(--pub-text);
    background: var(--pub-surface-input);
    width: 100%;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
    font-family: inherit;
}
.fg input:focus, .fg select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(13,31,78,.1);
    background: var(--pub-surface);
}
.fg textarea {
    padding: 8px 11px;
    border: 1px solid var(--pub-border-input);
    border-radius: 6px;
    font-size: 14px;
    color: var(--pub-text);
    background: var(--pub-surface-input);
    width: 100%;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}
.fg textarea:focus { border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(13,31,78,.1); background: var(--pub-surface); }
.frow-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.req { color: var(--pub-danger); margin-left: 2px; }
.giftcard-choice { margin-top: 16px; }
.giftcard-choice__row { display: flex; align-items: center; gap: 24px; margin-top: 8px; }
.giftcard-choice__option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--pub-text);
    text-transform: none;
    letter-spacing: normal;
}
.giftcard-choice__option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-secondary);
    cursor: pointer;
}


/* ── 7. Submit button & form footer ─────────────────────── */
.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--color-secondary);
    color: var(--pub-surface);
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s;
    font-family: inherit;
}
.btn-submit:hover { background: var(--color-primary); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }

/* .form-footer and .reg-footer are identical — both kept for compatibility */
.form-footer,
.reg-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--pub-border);
    background: var(--pub-surface-input);
    border-radius: 0 0 8px 8px;
}
.form-footer__note,
.reg-footer__note {
    font-size: 11px;
    color: var(--pub-text-muted);
    text-align: center;
    margin-top: 8px;
}


/* ── 8. Payment card fields ─────────────────────────────── */
.card-input-wrap {
    border: 1px solid var(--pub-border-input);
    border-radius: 6px;
    overflow: hidden;
    background: var(--pub-surface);
}
.card-input-wrap input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--pub-border);
    font-size: 14px;
    color: var(--pub-text);
    background: var(--pub-surface);
    outline: none;
    font-family: inherit;
    transition: background .1s;
}
.card-input-wrap input:focus { background: #f8f9ff; }
.card-input-wrap input::placeholder { color: #b0b0a8; }
.card-row { display: grid; grid-template-columns: 1fr 1fr; }
.card-row input:first-child { border-right: 1px solid var(--pub-border); }
.card-input-wrap input:last-child,
.card-row { border-bottom: none; }
.card-row input { border-bottom: none; }


/* ── 9. Toast notifications ─────────────────────────────── */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}
.toast--success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.toast--error   { background: #fef2f2; border: 1px solid #fca5a5; color: var(--pub-danger); }


/* ── 10. Utility classes ────────────────────────────────── */
.page-wrap { max-width: 620px; margin: 0 auto; padding: 40px 20px 80px; }
.payment-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--pub-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
}


/* ── 11. Candidate CTA row ──────────────────────────────── */
/* Riding-specific CTA (e.g. "Contribute / I'm With Paul! / Volunteer"),
   shown on content/form pages — separate feature from the homepage's own
   .cta-row (home.html), which only appears on the homepage. */
.candidate-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 12px var(--edge-pad) 24px;
}
.candidate-cta-block {
    border-radius: 12px;
    background: var(--color-primary);
    padding: 60px 24px;
    text-align: center;
    cursor: pointer;
    transition: opacity .12s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.candidate-cta-block:hover { opacity: .9; }
.candidate-cta-block--dark { background: var(--color-secondary); }
.candidate-cta-block--accent { background: var(--color-accent); }
.candidate-cta-block__title {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--pub-surface);
}
@media (max-width: 680px) {
    .candidate-cta-row { grid-template-columns: 1fr; }
}
