/* OpportunityHub components (spec Section 15). Tokens come from the child theme's theme.json, with fallbacks. */
:root {
	--oh-primary: var(--wp--preset--color--primary, #1d4ed8);
	--oh-primary-strong: var(--wp--preset--color--primary-strong, #1e3a8a);
	--oh-primary-soft: var(--wp--preset--color--primary-soft, #eff6ff);
	--oh-ink: var(--wp--preset--color--ink, #0f172a);
	--oh-muted: var(--wp--preset--color--ink-muted, #475569);
	--oh-border: var(--wp--preset--color--border, #e2e8f0);
	--oh-surface: var(--wp--preset--color--surface, #fff);
	--oh-surface-alt: var(--wp--preset--color--surface-alt, #f8fafc);
	--oh-warning: var(--wp--preset--color--warning, #b45309);
	--oh-success: var(--wp--preset--color--success, #15803d);
	--oh-danger: var(--wp--preset--color--danger, #b91c1c);
	--oh-neutral: var(--wp--preset--color--neutral, #64748b);
	--oh-radius: 12px;
	--oh-radius-sm: 8px;
	--oh-focus: 0 0 0 2px var(--oh-surface), 0 0 0 4px var(--oh-primary);
}

.oh-directory, .oh-schedule, .oh-detail, .oh-formwrap, .oh-status, .oh-fit-standalone { font-variant-numeric: tabular-nums; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.oh-muted { color: var(--oh-muted); font-size: 0.875rem; }
.oh-link { color: var(--oh-primary); }

/* Buttons */
.oh-btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; min-height: 44px; padding: 0.6rem 1.25rem; border-radius: var(--oh-radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.oh-btn:focus-visible, .oh-chip:focus-visible, .oh-catcard:focus-visible, .oh-card a:focus-visible, .oh-pagination a:focus-visible, .oh-segmented a:focus-visible { outline: none; box-shadow: var(--oh-focus); }
.oh-btn--primary { background: var(--oh-primary); color: #fff; }
.oh-btn--primary:hover { background: var(--oh-primary-strong); color: #fff; }
.oh-btn--secondary { background: var(--oh-surface); color: var(--oh-primary); border-color: var(--oh-primary); }
.oh-btn--secondary:hover { background: var(--oh-primary-soft); }
.oh-btn--ghost { background: transparent; color: var(--oh-primary); }
.oh-btn--block { width: 100%; }
.oh-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* Chips and badges */
.oh-chip { display: inline-flex; align-items: center; gap: .3em; min-height: 28px; padding: .15rem .65rem; border-radius: 999px; border: 1px solid var(--oh-border); background: var(--oh-surface); color: var(--oh-ink); font-size: .8125rem; font-weight: 500; text-decoration: none; }
.oh-chip--type { background: var(--oh-primary-soft); border-color: transparent; color: var(--oh-primary-strong); }
.oh-chip--quiet { color: var(--oh-muted); }
a.oh-chip:hover { border-color: var(--oh-primary); }
.oh-chip--active { background: var(--oh-primary-soft); border-color: var(--oh-primary); color: var(--oh-primary-strong); }
.oh-chips, .oh-tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: .5rem 0; padding: 0; align-items: center; }
.oh-badge { display: inline-flex; align-items: center; min-height: 24px; padding: .1rem .6rem; border-radius: 999px; font-size: .8125rem; font-weight: 600; border: 1px solid currentColor; }
.oh-badge--open { color: var(--oh-success); }
.oh-badge--closing { color: var(--oh-warning); background: #fffbeb; }
.oh-badge--upcoming { color: var(--oh-primary); }
.oh-badge--closed, .oh-badge--cancelled { color: var(--oh-danger); }
.oh-badge--past, .oh-badge--postponed { color: var(--oh-neutral); }

/* Grid of cards */
.oh-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; margin: 1rem 0; padding: 0; }
@media (min-width: 768px) { .oh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .oh-results .oh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .oh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .oh-results .oh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.oh-grid > li { display: flex; }

/* Card */
.oh-card { box-sizing: border-box; position: relative; display: flex; flex-direction: column; gap: .5rem; width: 100%; padding: 1rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius); background: var(--oh-surface); transition: border-color .15s; }
.oh-card:hover, .oh-card:focus-within { border-color: var(--oh-primary); }
.oh-card__top { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.oh-card__title { margin: .25rem 0 0; font-size: 1.125rem; line-height: 1.3; }
.oh-card__title a { color: var(--oh-ink); text-decoration: none; }
.oh-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--oh-radius); }
.oh-card__title a:hover { text-decoration: underline; }
.oh-card__org { margin: 0; color: var(--oh-muted); font-size: .9375rem; }
.oh-card__facts { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1rem; margin: .25rem 0 0; font-size: .875rem; }
.oh-card__facts dt { color: var(--oh-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.oh-card__facts dd { margin: 0; color: var(--oh-ink); }
.oh-card__deadline { grid-column: 1 / -1; }
.oh-card__deadline dd { font-weight: 600; }
.is-urgent dd, .is-urgent .oh-rel { color: var(--oh-warning); }
.oh-rel { color: var(--oh-muted); font-weight: 400; }
.oh-card__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--oh-border); }
.oh-card__foot .oh-tags { margin: 0; }
.oh-verified { color: var(--oh-muted); font-size: .75rem; }

/* Horizontal scroll row on mobile (Home "Closing soon") */
@media (max-width: 767px) {
	.oh-scroll-row .oh-grid { grid-auto-flow: column; grid-auto-columns: 85%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
	.oh-scroll-row .oh-grid > li { scroll-snap-align: start; }
}

/* Directory layout */
.oh-directory__layout { display: block; }
@media (min-width: 1024px) { .oh-directory__layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 2rem; align-items: start; } }
.oh-filters { background: var(--oh-surface-alt); border: 1px solid var(--oh-border); border-radius: var(--oh-radius); padding: 1rem; margin-bottom: 1rem; }
.oh-filters__head { display: flex; justify-content: space-between; align-items: center; }
.oh-filters__title { font-size: 1.125rem; margin: 0; }
.oh-filters__close { display: none; min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 1.75rem; line-height: 1; cursor: pointer; color: var(--oh-ink); }
.oh-filters__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.oh-filters__open { display: none; }
.oh-field { margin: 1rem 0 0; padding: 0; border: 0; min-inline-size: 0; }
.oh-field legend, .oh-field > label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; color: var(--oh-ink); }
.oh-field__opts { display: grid; gap: .15rem; }
.oh-field__opts label, .oh-field--toggle label { display: flex; align-items: center; gap: .5rem; min-height: 36px; font-size: .9375rem; cursor: pointer; }
.oh-field input[type=checkbox], .oh-field input[type=radio] { width: 18px; height: 18px; accent-color: var(--oh-primary); }
.oh-field select, .oh-toolbar input[type=search], .oh-searchbar input[type=search] { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid #94a3b8; border-radius: var(--oh-radius-sm); background: var(--oh-surface); font: inherit; color: var(--oh-ink); }
.oh-segmented { display: flex !important; flex-wrap: wrap; gap: .25rem; }
.oh-segmented label { border: 1px solid var(--oh-border); border-radius: 999px; padding: 0 .75rem; background: var(--oh-surface); }
.oh-segmented label:has(input:checked) { border-color: var(--oh-primary); background: var(--oh-primary-soft); }
.oh-segmented--links { margin: 0 0 .75rem; }
.oh-segmented--links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border: 1px solid var(--oh-border); border-radius: 999px; text-decoration: none; color: var(--oh-ink); font-weight: 600; }
.oh-segmented--links a[aria-current] { background: var(--oh-primary); border-color: var(--oh-primary); color: #fff; }

.oh-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.oh-toolbar__search { display: flex; gap: .5rem; flex: 1 1 320px; }
.oh-field--sort { margin: 0; display: flex; align-items: center; gap: .5rem; }
.oh-field--sort label { margin: 0; white-space: nowrap; }
.oh-field--sort select { width: auto; }
.oh-count { margin: .75rem 0 0; color: var(--oh-ink); }
.oh-fit-summary { margin: .75rem 0 0; padding: .5rem .75rem; background: var(--oh-primary-soft); border-radius: var(--oh-radius-sm); }

/* Mobile: filters become a bottom sheet once JS is available. */
@media (max-width: 1023px) {
	.oh-js .oh-filters__open { display: inline-flex; }
	.oh-js .oh-filters { position: fixed; z-index: 1000; inset: auto 0 0 0; max-height: 85vh; margin: 0; overflow-y: auto; border-radius: var(--oh-radius) var(--oh-radius) 0 0; background: var(--oh-surface); box-shadow: 0 -8px 24px rgba(15, 23, 42, .15); transform: translateY(105%); visibility: hidden; transition: transform .15s ease, visibility .15s; }
	.oh-js .oh-filters.is-open { transform: none; visibility: visible; }
	.oh-js .oh-filters__close { display: inline-block; }
	.oh-js .oh-filters__actions { position: sticky; bottom: -1rem; background: var(--oh-surface); padding: .75rem 0 1rem; }
	.oh-js .oh-filters__actions .oh-btn { flex: 1; }
	body.oh-sheet-open { overflow: hidden; }
}

/* Fit filter */
.oh-fit-wrap { margin: 0 0 1rem; }
.oh-fit-wrap > summary { list-style: none; width: fit-content; }
.oh-fit-wrap > summary::-webkit-details-marker { display: none; }
.oh-fit, .oh-fit-standalone .oh-fit { margin-top: .75rem; padding: 1rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius); background: var(--oh-surface-alt); }
.oh-fit__intro { margin: 0 0 .5rem; color: var(--oh-muted); }
.oh-fit__grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 768px) { .oh-fit__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Search bar (Home hero) */
.oh-searchbar { display: flex; gap: .5rem; max-width: 640px; }
.oh-searchbar input[type=search] { flex: 1; }

/* Pagination */
.oh-pagination ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1.5rem 0; }
.oh-pagination a, .oh-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius-sm); text-decoration: none; color: var(--oh-ink); }
.oh-pagination [aria-current] { background: var(--oh-primary); border-color: var(--oh-primary); color: #fff; font-weight: 600; }

/* Empty states and notices */
.oh-empty { padding: 1.5rem; border: 1px dashed var(--oh-border); border-radius: var(--oh-radius); background: var(--oh-surface-alt); margin: 1rem 0; }
.oh-empty__msg { font-weight: 600; margin-top: 0; }
.oh-empty__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.oh-notice { padding: .75rem 1rem; border-left: 4px solid var(--oh-neutral); background: var(--oh-surface-alt); border-radius: 0 var(--oh-radius-sm) var(--oh-radius-sm) 0; margin: 1rem 0; }
.oh-notice p { margin: 0; }
.oh-notice--closed, .oh-notice--cancelled { border-color: var(--oh-danger); }
.oh-notice--stale, .oh-notice--postponed { border-color: var(--oh-warning); }
.oh-notice--info { border-color: var(--oh-primary); background: var(--oh-primary-soft); }

/* Category cards */
.oh-catcards { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 1rem 0; }
@media (min-width: 768px) { .oh-catcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.oh-catcard { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.25rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius); text-decoration: none; color: var(--oh-ink); background: var(--oh-surface); transition: border-color .15s; }
.oh-catcard:hover { border-color: var(--oh-primary); }
.oh-catcard__name { font-size: 1.25rem; font-weight: 700; color: var(--oh-primary); }
.oh-catcard__desc { color: var(--oh-muted); }
.oh-catcard__count { margin-top: auto; font-weight: 600; font-size: .875rem; }

/* Guide cards */
.oh-guidecards { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 1rem 0; }
@media (min-width: 768px) { .oh-guidecards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.oh-guidecard { height: 100%; padding: 1rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius); }
.oh-guidecard__title { font-size: 1.125rem; margin: 0 0 .35rem; }
.oh-guidecard__title a { color: var(--oh-ink); }
.oh-guidecard p { margin: .25rem 0; }

/* Detail page */
.oh-detail__head { margin-bottom: 1rem; }
.oh-detail__title { margin: .5rem 0 .25rem; }
.oh-detail__org { margin: 0; color: var(--oh-muted); }
.oh-detail__layout { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .oh-detail__layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; } .oh-detail__aside { position: sticky; top: 1.5rem; order: 2; } }
@media (max-width: 1023px) { .oh-detail__aside { order: -1; } }
.oh-section { margin: 0 0 2rem; }
.oh-section h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
.oh-facts-panel { padding: 1rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius); background: var(--oh-surface-alt); }
.oh-factgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin: 0; }
.oh-factgrid > div { min-width: 0; }
.oh-factgrid dt { color: var(--oh-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.oh-factgrid dd { margin: .1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.oh-cta { margin-top: 1rem; }
.oh-cta__reason { margin: .5rem 0 0; color: var(--oh-danger); font-weight: 600; font-size: .9375rem; }
.oh-cta__note { margin: .5rem 0 0; color: var(--oh-muted); font-size: .8125rem; }
.oh-stickybar { display: none; }
@media (max-width: 1023px) {
	.oh-stickybar { display: flex; position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; gap: 1rem; justify-content: space-between; align-items: center; padding: .6rem 1rem; background: var(--oh-surface); border-top: 1px solid var(--oh-border); box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); }
	.oh-is-detail { padding-bottom: 72px; }
	.oh-stickybar__dl { font-size: .875rem; }
}

/* Schedule */
.oh-month { margin: 1.5rem 0; }
.oh-month__title { font-size: 1.25rem; margin: 0 0 .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--oh-border); }
.oh-rows { list-style: none; padding: 0; margin: 0; }
.oh-row { display: grid; grid-template-columns: 4rem 1fr auto; grid-template-areas: "date title badge" "date type mode"; gap: .2rem .75rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--oh-border); }
.oh-row__date { grid-area: date; font-weight: 700; color: var(--oh-ink); }
.oh-row .oh-chip--type { grid-area: type; width: fit-content; }
.oh-row__title { grid-area: title; font-weight: 600; }
.oh-row__mode { grid-area: mode; color: var(--oh-muted); font-size: .875rem; }
.oh-row .oh-badge { grid-area: badge; justify-self: end; }
@media (min-width: 768px) { .oh-row { grid-template-columns: 5rem 7rem 1fr 6rem 8rem; grid-template-areas: "date type title mode badge"; } }

/* Forms */
.oh-form { max-width: 640px; }
.oh-ff { margin: 0 0 1.25rem; }
.oh-ff > label, .oh-ff legend { display: block; font-weight: 600; margin-bottom: .35rem; }
.oh-ff fieldset { border: 0; padding: 0; margin: 0; }
.oh-req, .oh-opt { font-weight: 400; color: var(--oh-muted); font-size: .875rem; }
.oh-ff input[type=text], .oh-ff input[type=email], .oh-ff input[type=url], .oh-ff input[type=number], .oh-ff select, .oh-ff textarea { width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid #94a3b8; border-radius: var(--oh-radius-sm); font: inherit; color: var(--oh-ink); background: var(--oh-surface); }
.oh-ff input:focus-visible, .oh-ff select:focus-visible, .oh-ff textarea:focus-visible, .oh-field select:focus-visible, .oh-toolbar input:focus-visible, .oh-searchbar input:focus-visible { outline: none; border-color: var(--oh-primary); box-shadow: var(--oh-focus); }
.oh-ff__check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400 !important; margin: .35rem 0; cursor: pointer; }
.oh-ff__check input { width: 20px; height: 20px; margin-top: .15rem; flex: none; accent-color: var(--oh-primary); }
.oh-ff__help { margin: .3rem 0 0; color: var(--oh-muted); font-size: .875rem; }
.oh-ff__err { margin: .3rem 0 0; color: var(--oh-danger); font-weight: 600; font-size: .875rem; }
.oh-ff.has-error input, .oh-ff.has-error select, .oh-ff.has-error textarea { border-color: var(--oh-danger); }
.oh-errsum { padding: 1rem; border: 2px solid var(--oh-danger); border-radius: var(--oh-radius-sm); margin: 0 0 1.25rem; }
.oh-errsum h3 { margin: 0 0 .5rem; font-size: 1.125rem; }
.oh-errsum a { color: var(--oh-danger); }
.oh-success { padding: 1rem; border: 2px solid var(--oh-success); border-radius: var(--oh-radius-sm); margin: 0 0 1.25rem; background: #f0fdf4; }
.oh-success p { margin: .25rem 0; }
.oh-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Breadcrumbs */
.oh-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; font-size: .875rem; color: var(--oh-muted); }
.oh-breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--oh-muted); }
.oh-breadcrumbs a { color: var(--oh-muted); }
.oh-breadcrumbs [aria-current] { color: var(--oh-ink); }

/* Status page */
.oh-reply { margin-top: 1.5rem; padding: 1rem; border: 1px solid var(--oh-border); border-radius: var(--oh-radius); }

@media (prefers-reduced-motion: reduce) { .oh-filters, .oh-card, .oh-btn, .oh-catcard { transition: none !important; } }
