/* Inverted scheme: header and footer are light (the horse icon lives on white);
   every former light section is now dark. Loaded last so it wins. */

body { background: var(--black); color: var(--white); }

/* ---------- Dark section tiers ---------- */
.theme-light     { --bg: #0C0C0C; }
.theme-ivory     { --bg: #161616; }
.theme-parchment { --bg: #1C1913; }
.theme-light, .theme-ivory, .theme-parchment {
  --fg: var(--white); --fg-muted: var(--on-dark-muted); --focus: var(--gold); --accent-line: var(--gold);
  --surf: #141414; --edge: var(--gold);
  background: var(--bg); color: var(--fg);
}
.theme-dark { --surf: #141414; --edge: var(--gold); }

.theme-light h1, .theme-light h2, .theme-light h3, .theme-light h4,
.theme-ivory h1, .theme-ivory h2, .theme-ivory h3, .theme-ivory h4,
.theme-parchment h1, .theme-parchment h2, .theme-parchment h3, .theme-parchment h4 { color: var(--white); }
.theme-light .eyebrow, .theme-ivory .eyebrow, .theme-parchment .eyebrow { color: var(--gold); }
.theme-light .prose a, .theme-ivory .prose a, .theme-parchment .prose a,
.theme-light .link, .theme-ivory .link, .theme-parchment .link { color: var(--white); text-decoration-color: var(--gold); }
.theme-light .muted, .theme-ivory .muted, .theme-parchment .muted { color: var(--on-dark-muted); }

/* ---------- Boxes inside dark sections become dark surfaces with gold edges ---------- */
:is(.theme-light,.theme-ivory,.theme-parchment) :is(.card,.records-list,.table-wrap,.res-list,.results-summary,.rec-facts,.facts) {
  background: var(--surf); color: var(--white); border-color: var(--gold);
}
:is(.theme-light,.theme-ivory,.theme-parchment) .card p,
:is(.theme-light,.theme-ivory,.theme-parchment) .records-list p,
:is(.theme-light,.theme-ivory,.theme-parchment) .res__meta,
:is(.theme-light,.theme-ivory,.theme-parchment) .rec-cap,
:is(.theme-light,.theme-ivory,.theme-parchment) .rel__src,
:is(.theme-light,.theme-ivory,.theme-parchment) .suggest li small { color: var(--on-dark-muted); }
.theme-dark .suggest li small { color: #555; }
:is(.theme-light,.theme-ivory,.theme-parchment) .card--link:hover { background: #1F1F1F; }
:is(.theme-light,.theme-ivory,.theme-parchment) .records-list li + li,
:is(.theme-light,.theme-ivory,.theme-parchment) .facts li + li { border-top-color: var(--line-dark); }
:is(.theme-light,.theme-ivory,.theme-parchment) .res-list > li + li,
:is(.theme-light,.theme-ivory,.theme-parchment) .res-list li { border-color: var(--line-dark); }
:is(.theme-light,.theme-ivory,.theme-parchment) .rec-facts dt { background: #1F1F1F; color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .rec-facts dt,
:is(.theme-light,.theme-ivory,.theme-parchment) .rec-facts dd { border-color: var(--line-dark); }
:is(.theme-light,.theme-ivory,.theme-parchment) .res__name,
:is(.theme-light,.theme-ivory,.theme-parchment) .btn-link { color: var(--white); text-decoration-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .res__name:hover { background: var(--gold); color: var(--black); }
:is(.theme-light,.theme-ivory,.theme-parchment) .res__thumb { border-color: var(--gold); }
.res-group__head { border-bottom-color: var(--gold); outline: 1px solid var(--gold); }

/* tables */
:is(.theme-light,.theme-ivory,.theme-parchment) .data-table :is(th,td) { border-color: var(--line-dark); color: var(--white); }
:is(.theme-light,.theme-ivory,.theme-parchment) .data-table thead th { background: var(--gold); color: var(--black); }
:is(.theme-light,.theme-ivory,.theme-parchment) .data-table caption { border-bottom-color: var(--gold); color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .data-table tfoot :is(td,th) { background: #1F1F1F; border-top-color: var(--gold); color: var(--white); }

/* badges */
:is(.theme-light,.theme-ivory,.theme-parchment) .badge { border-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .badge--verified { background: var(--gold); color: var(--black); }
:is(.theme-light,.theme-ivory,.theme-parchment) .badge--check { background: transparent; color: var(--white); }
:is(.theme-light,.theme-ivory,.theme-parchment) .badge--ocr { background: transparent; color: var(--white); }

/* notices */
:is(.theme-light,.theme-ivory,.theme-parchment) .notice { background: var(--surf); color: var(--white); border-color: var(--line-dark); border-left-color: var(--gold); }

/* tiles and chips: dark with gold edge, gold fill on hover */
:is(.theme-light,.theme-ivory,.theme-parchment) :is(.tile,.chip) { background: var(--surf); color: var(--white); border-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) :is(.tile,.chip):hover { background: var(--gold); color: var(--black); }

/* inputs stay white with black text; give them a gold edge on dark */
:is(.theme-light,.theme-ivory,.theme-parchment) :is(.search__box,.select,.suggest,.field input[type="text"],.refine input[type="search"]) { border-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .search__box .btn { border-left-color: var(--black); }
:is(.theme-light,.theme-ivory,.theme-parchment) .field > label, :is(.theme-light,.theme-ivory,.theme-parchment) label { color: var(--white); }
:is(.theme-light,.theme-ivory,.theme-parchment) .suggest li[aria-selected="true"], :is(.theme-light,.theme-ivory,.theme-parchment) .suggest li:hover { background: var(--black); color: var(--gold); }

/* buttons */
:is(.theme-light,.theme-ivory,.theme-parchment) .btn { border-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .btn--primary { background: var(--gold); color: var(--black); }
:is(.theme-light,.theme-ivory,.theme-parchment) .btn--primary:hover { background: var(--white); border-color: var(--white); color: var(--black); }
:is(.theme-light,.theme-ivory,.theme-parchment) .btn--outline { background: transparent; color: var(--white); border-color: var(--white); }
:is(.theme-light,.theme-ivory,.theme-parchment) .btn--outline:hover { background: var(--gold); color: var(--black); border-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .arrow-link { color: var(--white); }

/* rules, steps, resources, refine bar */
:is(.theme-light,.theme-ivory,.theme-parchment) .step { border-top-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .resources { border-top-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .resources li { border-bottom-color: var(--line-dark); }
:is(.theme-light,.theme-ivory,.theme-parchment) .resources a { color: var(--white); }
:is(.theme-light,.theme-ivory,.theme-parchment) .resources a:hover { background: #1F1F1F; color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .resources small { color: var(--on-dark-muted); }
:is(.theme-light,.theme-ivory,.theme-parchment) .refine { border-bottom-color: var(--gold); }
:is(.theme-light,.theme-ivory,.theme-parchment) .rule { color: var(--white); }
.theme-light .pull, .theme-ivory .pull, .theme-parchment .pull { color: var(--white); }
.theme-light .about-close, .theme-ivory .about-close, .theme-parchment .about-close { color: var(--gold); }
.crumb a:hover { color: var(--white); }

/* ---------- Header: white, icon plus wordmark ---------- */
.site-header { background: var(--white); border-bottom: var(--rule) solid var(--black); box-shadow: 0 4px 0 var(--gold); }
.brand { display: inline-flex; align-items: center; gap: 14px; line-height: 1; color: var(--black); text-decoration: none; }
.brand img { height: 56px; width: auto; display: block; }
.brand__word { font-family: var(--font-display); text-transform: uppercase; font-size: 1.55rem; line-height: .95; letter-spacing: .01em; color: var(--black); white-space: nowrap; }
.brand__word span { display: block; font-size: .72em; letter-spacing: .14em; }
@media (max-width: 420px) { .brand__word { font-size: 1.2rem; } .brand img { height: 46px; } }

/* ---------- Footer: white, icon without a box ---------- */
.site-footer { background: var(--white); color: var(--black); border-top: 8px solid var(--gold); }
.site-footer a { color: var(--black); text-decoration-color: var(--gold); }
.site-footer a:hover { color: var(--black); background: var(--gold); }
.footer__logo { background: transparent; padding: 0; display: inline-block; line-height: 0; }
.footer__logo img { width: 150px; height: auto; }
.footer__logo:hover { background: transparent !important; }
.footer__h { color: var(--black); border-bottom: 3px solid var(--gold); display: inline-block; padding-bottom: 6px; }
.footer__slogan { color: var(--black); border-bottom: 1px solid var(--black); position: relative; }
.footer__slogan::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 120px; height: 7px; background: var(--gold); }
.footer__fine { color: #3F3F3F; border-top: 1px solid var(--black); }
.footer__fine a { color: var(--black); text-decoration-color: var(--gold); }
.footer__fine strong { color: var(--black); }
.site-footer .small { color: #3F3F3F; }

/* header text must be black on white (body text is now white) */
.site-header, .site-header a, .nav, .nav a { color: var(--black); }
.nav .nav__donate { background: var(--gold); border-color: var(--black); }
.nav .nav__donate:hover { background: var(--black); color: var(--gold); }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); }

:is(.theme-light,.theme-ivory,.theme-parchment) .data-table caption { background: #1F1F1F; }
.placeholder { background: transparent; }
:is(.theme-light,.theme-ivory,.theme-parchment) small { color: var(--on-dark-muted); }

.cult-photo { margin: 0; border: var(--rule) solid var(--gold); padding: 0; background: transparent; align-self: start; line-height: 0; }
.cult-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.cult-photo figcaption { padding: 10px 2px 2px; font-size: .78rem; color: var(--on-dark-muted); }
.footer__slogan { padding-top: var(--s-8); padding-bottom: var(--s-6); margin-bottom: var(--s-6); line-height: 1; }
@media (min-width: 960px) { .culture__grid { grid-template-columns: 1fr; } }
