/* Trailhead Ledger brand — moss green primary / terracotta accent.
   Source of truth: trailheadledger/marketing/static/marketing/css/landing.css
   (--tl-primary #3E563B, --tl-accent #925C3E), converted to the OKLCH L% C H
   form DaisyUI's theme engine expects. See
   docs/superpowers/specs/2026-10-08-internal-app-rebrand-design.md. */
[data-theme="corporate"] {
    --p: 42.54% 0.0526 141.83;
    --pc: 99.15% 0.0057 84.57;
    --a: 52.77% 0.0834 49.29;
    --ac: 99.15% 0.0057 84.57;
    --b1: 98.27% 0.0126 86.83;
    --b2: 95.98% 0.0200 84.59;
    --b3: 92.03% 0.0214 85.95;
}

/* Rounded corners on primary buttons (CTAs), matching the marketing
   site's .tl-btn radius. Color is untouched — DaisyUI's native
   .btn-primary already renders --p (moss green) correctly since Task 1. */
.btn.btn-primary {
    border-radius: 1rem;
}

body {
    font-family: 'Public Sans', sans-serif;
}

/* Active sidebar link: DaisyUI has no native active-state styling for a
   plain <a class="active">, so this is the only thing giving the current
   page a filled highlight — recolored to the brand, not deleted. */
.menu li a.active,
.menu a.active.text-primary {
    background-color: oklch(var(--p)) !important;
    color: oklch(var(--pc)) !important;
}

/* Tom Select on trip create — align with DaisyUI inputs */
.ts-trip-leads .ts-wrapper.single .ts-control,
.ts-trip-leads .ts-wrapper.multi .ts-control {
    border-radius: var(--rounded-btn, 0.5rem);
    border: 1px solid color-mix(in oklab, var(--fallback-bc, oklch(var(--bc))), transparent 80%);
    min-height: 3rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--fallback-b1, oklch(var(--b1)));
}
.ts-trip-leads .ts-wrapper.multi .ts-control.has-items {
    padding: 0.35rem 0.5rem;
}
.ts-trip-leads .ts-wrapper.focus .ts-control {
    outline: 2px solid color-mix(in oklab, var(--fallback-p, oklch(var(--p))), transparent 50%);
    outline-offset: 2px;
}
.ts-trip-leads .ts-dropdown {
    border-radius: var(--rounded-btn, 0.5rem);
    border: 1px solid color-mix(in oklab, var(--fallback-bc, oklch(var(--bc))), transparent 80%);
    background-color: var(--fallback-b1, oklch(var(--b1)));
}

/* Trip create/edit — crew & trip-lead sections are always in the DOM (Tom
   Select initializes once per page load); which one is visible is driven
   purely by which category checkboxes are checked, no JS involved. */
#trip-leads-section,
#crew-section,
#volunteers-section {
    display: none;
}
form:has(input[name="categories"][value="Volunteer Trip"]:checked) #trip-leads-section,
form:has(input[name="categories"][value="Weeds Trip"]:checked) #trip-leads-section {
    display: flex;
}
form:has(input[name="categories"][value="Pro Hitch"]:checked) #crew-section {
    display: flex;
}
form:has(input[name="categories"][value="Volunteer Trip"]:checked) #volunteers-section {
    display: flex;
}

/* Fallback for browsers without :has() support (Firefox < 121, Safari < 15.4,
   Chromium < 105): fail open (always show both sections) instead of fail
   closed (permanently hidden with no way to reveal them). */
@supports not selector(:has(*)) {
    #trip-leads-section,
    #crew-section,
    #volunteers-section {
        display: flex;
    }
}
