/* ============================================================
   Beyond Housing - homepage section (.bh-home) and the /events and /opportunities pages (.bh-page).
   Tokens fall back from the homepage system (--rh-*) to the shared design system (--rmd-*) to literal values, so the same file works on both.
   ============================================================ */
.bh-home, .bh-page {
  --bh-green: var(--rh-green, var(--rmd-primary, #10b981));
  --bh-green-dark: var(--rh-green-dark, var(--rmd-primary-dark, #059669));
  --bh-green-bg: var(--rmd-primary-bg, #ecfdf5);
  --bh-navy: var(--rh-navy, var(--rmd-text, #0f172a));
  --bh-bg: var(--rh-bg, var(--rmd-bg, #fdfaf6));
  --bh-surface: var(--rh-surface, var(--rmd-surface, #fff));
  --bh-border: var(--rh-border, var(--rmd-border, #ece5db));
  --bh-text: var(--rh-text, var(--rmd-text, #0f172a));
  --bh-muted: var(--rh-text-muted, var(--rmd-text-muted, #64748b));
  --bh-faint: var(--rh-text-faint, var(--rmd-text-faint, #94a3b8));
  --bh-accent: var(--rmd-accent, #ff6b4a);
  --bh-r-sm: var(--rh-radius-sm, 12px); --bh-r-md: var(--rh-radius-md, 16px); --bh-r-lg: var(--rh-radius-lg, 20px);
  --bh-shadow: var(--rh-shadow, 0 8px 24px rgba(15, 23, 42, 0.08));
  --bh-font-h: var(--rh-font-heading, var(--rmd-font-heading, 'Poppins', sans-serif));
  --bh-font-b: var(--rh-font-body, var(--rmd-font-body, 'Inter', sans-serif));
}

/* ---------- homepage section ---------- */
.bh-home { padding: 64px 0; }
.bh-home .bh-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.bh-head { max-width: 680px; margin: 0 auto 36px; text-align: center; }
.bh-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--bh-green-bg); color: #047857; font: 800 0.72rem/1 var(--bh-font-b); letter-spacing: 0.08em; text-transform: uppercase; }
.bh-head h2 { font: 800 clamp(1.6rem, 3.2vw, 2.3rem)/1.15 var(--bh-font-h); color: var(--bh-text); margin: 14px 0 10px; }
.bh-head p { color: var(--bh-muted); font: 400 1.02rem/1.6 var(--bh-font-b); margin: 0; }
.bh-cards { margin-top: 0; } /* same two-column grid, card size and spacing as the roommate / landlord cards above (rh-split + rh-split-card) */
.bh-home .bh-card { position: relative; }
.bh-home .bh-card h3 { font-family: var(--rh-font-heading, var(--bh-font-h)); font-weight: 800; font-size: 1.3rem; color: var(--rh-text, var(--bh-text)); margin: 0; }
.bh-home .bh-card p { color: var(--rh-text-muted, var(--bh-muted)); margin: 0; line-height: 1.55; }
.bh-home .bh-card .bh-card-cta { position: static; gap: 8px; }
.bh-home .bh-card-cta::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; } /* the whole card is the click target, with a single link for keyboards and screen readers */
.bh-home .bh-card .rh-split-media img { transition: transform 0.6s ease; }
.bh-home .bh-card:hover .rh-split-media img { transform: scale(1.04); }
.bh-home .bh-card:focus-within { outline: 3px solid var(--bh-green); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .bh-home .bh-card .rh-split-media img { transition: none; } .bh-home .bh-card:hover .rh-split-media img { transform: none; } }

/* ---------- pages ---------- */
body.bh-page { background: var(--bh-bg); font-family: var(--bh-font-b); color: var(--bh-text); margin: 0; }
.bh-hero { padding: 96px 20px 28px; text-align: center; }
.bh-hero .bh-inner, .bh-main, .bh-foot-inner { max-width: 1200px; margin: 0 auto; }
.bh-hero h1 { font: 800 clamp(1.7rem, 4vw, 2.6rem)/1.15 var(--bh-font-h); margin: 14px auto 10px; max-width: 760px; }
.bh-hero p.bh-sub { color: var(--bh-muted); font-size: 1.05rem; line-height: 1.6; margin: 0 auto 22px; max-width: 640px; }
.bh-search { position: relative; max-width: 620px; margin: 0 auto; }
.bh-search input { width: 100%; box-sizing: border-box; min-height: 52px; padding: 0 18px 0 48px; font: 400 1rem var(--bh-font-b); border: 1.5px solid var(--bh-border); border-radius: 999px; background: var(--bh-surface); color: var(--bh-text); box-shadow: var(--bh-shadow); }
.bh-search input:focus { outline: 3px solid rgba(16, 185, 129, 0.35); border-color: var(--bh-green); }
.bh-search i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--bh-faint); pointer-events: none; }
.bh-main { padding: 8px 20px 72px; }
.bh-filters { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 22px; }
.bh-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bh-chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--bh-border); background: var(--bh-surface); color: var(--bh-text); font: 600 0.88rem var(--bh-font-b); cursor: pointer; }
.bh-chip:hover { border-color: var(--bh-green); }
.bh-chip[aria-pressed="true"] { background: var(--bh-green); border-color: var(--bh-green); color: var(--bh-navy); } /* navy on the brand green: white on it is only 2.5:1 */
.bh-chip:focus-visible, .bh-select:focus-visible, .bh-btn:focus-visible, .bh-close:focus-visible { outline: 3px solid var(--bh-green); outline-offset: 2px; }
.bh-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.bh-select { min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--bh-border); background: var(--bh-surface); font: 500 0.92rem var(--bh-font-b); color: var(--bh-text); }
.bh-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; font: 500 0.92rem var(--bh-font-b); cursor: pointer; }
.bh-count { text-align: center; color: var(--bh-muted); font-size: 0.9rem; margin: 0 0 16px; min-height: 1.3em; }
.bh-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .bh-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bh-grid { grid-template-columns: repeat(3, 1fr); } }
.bh-item { background: var(--bh-surface); border: 1px solid var(--bh-border); border-radius: var(--bh-r-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); transition: box-shadow 0.2s, transform 0.2s; }
.bh-item:hover { box-shadow: var(--bh-shadow); transform: translateY(-2px); }
.bh-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #064e3b, #0f766e 60%, #0f172a); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.85); font-size: 2rem; overflow: hidden; }
.bh-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bh-tag { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.95); color: #047857; font: 700 0.72rem var(--bh-font-b); }
.bh-state { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 5px 11px; border-radius: 999px; background: var(--bh-navy); color: #fff; font: 700 0.72rem var(--bh-font-b); }
.bh-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bh-body h2, .bh-body h3 { font: 700 1.05rem/1.3 var(--bh-font-h); margin: 0; color: var(--bh-text); }
.bh-org { font-size: 0.85rem; color: var(--bh-muted); display: flex; align-items: center; gap: 10px; }
.bh-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--bh-green-bg); color: var(--bh-green-dark); display: flex; align-items: center; justify-content: center; font: 800 0.85rem var(--bh-font-h); overflow: hidden; flex-shrink: 0; }
.bh-logo img { width: 100%; height: 100%; object-fit: contain; }
.bh-meta { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 5px; font-size: 0.86rem; color: var(--bh-text); }
.bh-meta li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.bh-meta i { color: var(--bh-green-dark); width: 16px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.bh-sum { color: var(--bh-muted); font-size: 0.88rem; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bh-actions { margin-top: auto; padding-top: 6px; }
.bh-page .bh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--bh-green); background: var(--bh-green); color: var(--bh-navy); font: 700 0.92rem var(--bh-font-b); text-decoration: none; cursor: pointer; }
.bh-page .bh-btn:hover { background: #34d399; border-color: #34d399; color: var(--bh-navy); }
.bh-page .bh-btn--ghost { background: var(--bh-surface); color: var(--bh-navy); }
.bh-page .bh-btn--ghost:hover { background: var(--bh-green-bg); border-color: var(--bh-green); }
.bh-btn[aria-disabled="true"] { background: var(--bh-border); border-color: var(--bh-border); color: var(--bh-muted); cursor: not-allowed; }
.bh-more { text-align: center; margin-top: 26px; }
.bh-empty { text-align: center; padding: 56px 20px; background: var(--bh-surface); border: 1px dashed var(--bh-border); border-radius: var(--bh-r-lg); color: var(--bh-muted); }
.bh-empty h2 { font: 700 1.2rem var(--bh-font-h); color: var(--bh-text); margin: 0 0 8px; }
.bh-empty a { color: var(--bh-green-dark); font-weight: 600; }
.bh-skel { height: 300px; border-radius: var(--bh-r-lg); background: linear-gradient(90deg, #f1ece4 25%, #f8f4ee 50%, #f1ece4 75%); background-size: 200% 100%; animation: bh-shimmer 1.4s infinite; }
@keyframes bh-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .bh-skel { animation: none; } .bh-item { transition: none; } .bh-item:hover { transform: none; } }

/* ---------- detail dialog ---------- */
.bh-modal { position: fixed; inset: 0; z-index: 9000; display: none; align-items: flex-start; justify-content: center; padding: 24px 12px; background: rgba(15, 23, 42, 0.55); overflow-y: auto; }
.bh-modal.open { display: flex; }
.bh-sheet { background: var(--bh-surface); border-radius: var(--bh-r-lg); width: 100%; max-width: 760px; margin: auto; position: relative; overflow: hidden; box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3); }
.bh-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.95); color: var(--bh-text); font-size: 1.1rem; cursor: pointer; box-shadow: var(--bh-shadow); }
.bh-sheet .bh-cover { aspect-ratio: 21 / 9; font-size: 2.4rem; }
.bh-pad { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 14px; }
.bh-pad h2 { font: 800 clamp(1.3rem, 3vw, 1.7rem)/1.2 var(--bh-font-h); margin: 0; }
.bh-pad h3 { font: 700 0.95rem var(--bh-font-h); margin: 8px 0 4px; }
.bh-desc { white-space: pre-line; color: var(--bh-text); line-height: 1.65; font-size: 0.96rem; }
.bh-list { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 0.94rem; }
.bh-note { background: var(--bh-green-bg); border-radius: var(--bh-r-sm); padding: 12px 14px; font-size: 0.9rem; line-height: 1.5; }
.bh-note--warn { background: #fff7ed; }
.bh-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.bh-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.bh-foot { background: #0f172a; color: rgba(255, 255, 255, 0.7); padding: 28px 20px; font-size: 0.86rem; }
.bh-foot-inner { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.bh-foot a { color: rgba(255, 255, 255, 0.8); text-decoration: none; margin-right: 18px; }
.bh-foot a:hover { color: #fff; }
.bh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rmd-home.rmd-home .bh-card .bh-card-cta:active { transform: none; } /* a transform would make the button the containing block of the stretched link and shrink the click area while pressed */
.rmd-home.rmd-home .bh-card .bh-card-cta { background: #047857; box-shadow: none; } /* white on this green is 5.5:1 (white on the lighter brand green is 2.5:1) */
.rmd-home.rmd-home .bh-card:hover .bh-card-cta, .rmd-home.rmd-home .bh-card .bh-card-cta:focus-visible { background: #065f46; }
