/* assets/css/bsa-theme.css
   Global theme + layout primitives for BSA
   Updated to match BSA 2026 Brand Guidelines palette:
   Pure Red #F51414, Brick Ember #C10808, Coffee Bean #1C1616,
   Espresso #3D2222, Old Lace #FFF7EA
*/

/* ======================================
   Tokens
   ====================================== */
:root {
  /* Brand palette */
  --page: #FFF7EA;                 /* Old Lace */
  --ink: #1C1616;                  /* Coffee Bean */
  --muted: rgba(28, 22, 22, .68);  /* Coffee Bean softened */
  --accent: #F51414;               /* Pure Red */
  --accent-2: #C10808;             /* Brick Ember (deeper red) */
  --espresso: #3D2222;             /* Espresso (warm dark) */

  --section-pad: 34px;
  --section-pad-lg: 42px;

  /* base max width for most laptops / 1080p */
  --max: 1100px;
  --radius: 18px;

  /* warm ether tint (avoid icy white) */
  --ether-tint: rgba(255, 247, 234, 0.55);
}

/* widen on larger desktops / ultrawide */
@media (min-width: 1400px) {
  :root { --max: 1320px; }
}
@media (min-width: 1800px) {
  :root { --max: 1480px; }
}

/* ======================================
   Back to Top Button
   ====================================== */
#backToTop {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(28, 22, 22, .22);
  background: rgba(255, 247, 234, .95); /* Old Lace */
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity .25s ease, transform .25s ease, box-shadow .2s ease, background .2s ease;
  z-index: 1020; /* above content, below navbar/modals */
}
/* visible state */
#backToTop.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* hover */
#backToTop:hover {
  background: var(--accent);
  color: #FFF7EA; /* Old Lace */
  box-shadow: 0 10px 26px rgba(28, 22, 22, .25);
}
/* mobile tweak */
@media (max-width: 768px) {
  #backToTop {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}

/* ======================================================
   Sticky navbar safety boundary
   ====================================================== */
#page-content {
  position: relative;
  z-index: 1;
}

/* ======================================
   Base
   ====================================== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--ink);
  background: var(--page);
  overflow-x: hidden;
}

/* NOTE:
   Do NOT set body padding-top here.
   navbar.css owns body padding-top (fixed nav height) so we don't double-stack spacing.
*/
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* make containers responsive + centered */
.container {
  max-width: var(--max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ======================================
   Liquid Ether -
   stable layering (harmless even if not used)
   ====================================== */
#root {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important; /* keep behind everything */
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  background: transparent !important;
}
#root canvas, #root svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}
#root .controls, #root .ui, #root nav, #root button, #root input, #root select, #root textarea, #root a {
  display: none !important;
}
#etherTint {
  position: fixed;
  inset: 0;
  background: var(--ether-tint);
  z-index: -1;
  pointer-events: none;
}
/* Keep main content above ether */
body > header, body > main, body > section, body > footer, body > div {
  position: relative;
  z-index: 2;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 247, 234, .92); /* Old Lace */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .45s ease, visibility .45s ease;
}
#preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

/* Glass helper */
.glass {
  background: rgba(255, 247, 234, .85); /* Old Lace */
  border: 1px solid rgba(28, 22, 22, .18);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(28, 22, 22, .18);
}
.glass-border-glow { position: relative; }
.glass-border-glow::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(245, 20, 20, .22), rgba(193, 8, 8, .14));
  filter: blur(3px);
  opacity: .35;
  z-index: -1;
}

/* ======================================
   HERO
   ====================================== */
header.hero {
  position: relative;
  min-height: 54vh;
  display: flex;
  align-items: center;
  background-image: url('../img/photos/ex.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 26%;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-top: 32px;
  padding-bottom: 32px;
}
@media (max-width: 991.98px) {
  header.hero {
    min-height: 58vh;
    padding-top: 42px;
    padding-bottom: 32px;
    background-position: center 30%;
    padding-top: 42px;
  }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 22, 22, .0), rgba(28, 22, 22, .0) 35%, rgba(28, 22, 22, .0));
}

/* full-width subtle glass across hero */
.hero-overlay {
  position: relative;
  width: 100%;
  padding: 0.9rem 0.1rem;
  background: rgba(255, 247, 234, .06);
  backdrop-filter: blur(6px) saturate(95%);
  -webkit-backdrop-filter: blur(10px) saturate(95%);
}
.hero-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 247, 234, .30), rgba(255, 247, 234, .12) 60%, rgba(255, 247, 234, .28));
  pointer-events: none;
}

/* neutralise glass card -
 keep layout, kill card look */
.hero-card {
  max-width: 980px;
  margin: 0 auto;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.hero-card::after { display: none !important; }

.hero-eyebrow {
  font-size: .85rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: .02rem;
}
.hero h1 {
  font-family: Merriweather, serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  margin: 0 0 .4rem;
  color: var(--ink);
  text-shadow: 0 10px 26px rgba(28, 22, 22, .15);
}
.hero-sub {
  font-size: clamp(.9rem, 1.4vw, 1.02rem);
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 .6rem;
}
.hero p {
  margin: 0 0 .75rem;
  color: var(--ink);
  opacity: .92;
  max-width: 78ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .01rem;
}

/* Glass buttons */
.btnx {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  background: rgba(255, 247, 234, .22);
  border: 1px solid rgba(28, 22, 22, .22);
  color: var(--accent);
  box-shadow: 0 12px 30px rgba(28, 22, 22, .14);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  text-decoration: none;
}
.btnx:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(28, 22, 22, .18);
  background: rgba(255, 247, 234, .32);
}
.btnx.secondary {
  background: rgba(61, 34, 34, .16); /* Espresso tint */
  border: 1px solid rgba(61, 34, 34, .34);
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(28, 22, 22, .18);
}

/* ======================================
   Sections
   ====================================== */
section { padding: var(--section-pad) 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
  font-family: Merriweather, serif;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--accent);
  font-size: 1.6rem;
}
.section-note {
  color: var(--muted);
  font-size: .95rem;
}
#insights { padding-top: 22px; }

/* ======================================
   Generic cards / stats
   ====================================== */
.cardx {
  background: rgba(255, 247, 234, .92); /* Old Lace */
  border: 1px solid rgba(28, 22, 22, .10);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(28, 22, 22, .05);
}
.cardx .pad { padding: 16px; }

.tag {
  display: inline-block;
  font-size: .75rem;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid rgba(245, 20, 20, .22);
  background: rgba(245, 20, 20, .06);
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }

.stats h3 {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0;
  color: var(--ink);
}
.stats p {
  margin: .25rem 0 0;
  color: var(--muted);
}

/* ======================================
   WSJ-ish Trends block (base)
   ====================================== */
.wsj-block {
  background: rgba(255, 247, 234, .78);
  border: 1px solid rgba(28, 22, 22, .10);
  border-radius: 22px;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 18px 50px rgba(28, 22, 22, .10);
  overflow: hidden;
}
/* ... (keeping your WSJ block rules unchanged) ... */
/* NOTE: everything below this point can remain as-is stylistically. */

/* Footer neutrality */
footer, .bsa-footer {
  background: var(--ink); /* Coffee Bean */
  color: #FFF7EA;         /* Old Lace */
}
.bsa-footer-card {
  background: rgba(28, 22, 22, 0.92) !important;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

/* HARD RESET for any global flex wrappers */
html, body { display: block !important; }
body {
  flex: none !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}
body > nav, body > header, body > main, body > section, body > footer, body > div {
  width: 100% !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}
.page, .wrapper, .main, .layout, #app, #page { display: block !important; }

/* ======================================
   Navbar CTAs + sticky behaviour (BSA)
   ====================================== */
.navbar-bsa { margin-top: 0 !important; }

/* JOIN CTA (if you still use pills somewhere else) */
.navbar-bsa .join-cta > a.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(245, 20, 20, .08) !important;
  border: 1.5px solid rgba(245, 20, 20, .35) !important;
  color: var(--accent) !important;
  font-weight: 900;
  border-radius: 999px;
  padding: .55rem 1.05rem;
  box-shadow: 0 10px 24px rgba(28, 22, 22, .10);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  text-decoration: none;
}
.navbar-bsa .join-cta > a.btn:hover,
.navbar-bsa .join-cta > a.btn:focus {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #FFF7EA !important;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(28, 22, 22, .18);
  text-decoration: none;
}
.navbar-bsa .join-cta > a.btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(28, 22, 22, .12);
}
.navbar-bsa .join-cta > a.btn:focus-visible {
  outline: 3px solid rgba(245, 20, 20, .22);
  outline-offset: 2px;
}

/* Optional intranet button style (if used) */
.navbar-bsa .intranet-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--muted) !important;
  background: transparent;
  border: 1px dashed rgba(28, 22, 22, .25);
  border-radius: 999px;
  padding: .45rem .9rem;
  opacity: .9;
  transition: all .15s ease;
  text-decoration: none;
}
.navbar-bsa .intranet-btn:hover {
  color: var(--accent) !important;
  border-color: rgba(245, 20, 20, .45);
  background: rgba(245, 20, 20, .05);
  opacity: 1;
  text-decoration: none;
}
@media (max-width: 991px) {
  .navbar-bsa .intranet-btn {
    width: 100%;
    justify-content: center;
    margin-top: .5rem;
  }
}

/* Ether layers already behind everything */
.modal-backdrop { z-index: 1040 !important; }
.modal { z-index: 1050 !important; }

/* FINAL: ensure navbar stays above content, below modals */
nav.navbar-bsa, nav.navbar-bsa.sticky-top, .navbar.navbar-bsa, .navbar.navbar-bsa.sticky-top {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 1030;
}

/* Scheduler (safe) */
.slot {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  pointer-events: none;
}
table.scheduler { user-select: none; }

/* =========================
   Video Band (CONTAINED)
   ========================= */
/* section stays normal width */
.video-band {
  width: 100%;
  padding: 0; /* no weird section padding */
  margin: 0;
  margin-top: 40px; /* requested whitespace above the video */
}
/* the inner wrapper is what controls width */
.video-band .video-band-inner {
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
}
/* the video must never exceed its container */
.video-band video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* EVENTS SECTION -
 tighten + stop the "giant empty join card” look */
#events .events-grid {
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 18px;
  align-items: start; /* ✅ don’t stretch both columns */
}
@media (max-width: 992px) {
  #events .events-grid { grid-template-columns: 1fr; }
}

/* Events list: reduce the "big poster” feel */
#events .cardx .pad { padding: 18px; }
#events .event { padding: 14px 0; } /* keep consistent */

/* Make the month header match BSA accent */
#events .datebox .m {
  background: var(--accent);
  color: #FFF7EA;
}

/* Join panel: stop centering and huge whitespace */
#events .join-panel {
  display: block;
  text-align: left;
}
#events .join-pad { padding: 22px; }
#events .join-title { margin: 10px 0 8px; }
#events .join-dek {
  margin: 0 0 14px;
  max-width: 46ch;
}

/* EVENTS - match "calendar list” card UI */
#events .cardx .pad { padding: 16px; }

#events .event-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
}
#events .event-row + .event-row {
  border-top: 1px solid rgba(28, 22, 22, .10);
}
#events .event-date {
  width: 64px;
  flex: 0 0 64px;
  border-radius: 12px;
  border: 1px solid rgba(28, 22, 22, .12);
  overflow: hidden;
  background: rgba(255, 247, 234, .92);
  box-shadow: 0 6px 14px rgba(28, 22, 22, .06);
}
#events .event-month {
  background: var(--accent-2); /* Brick Ember */
  color: #FFF7EA;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  padding: 6px 0;
  text-align: center;
}
#events .event-day {
  text-align: center;
  font-weight: 950;
  font-size: 1.15rem;
  padding: 10px 0 9px;
  color: var(--ink);
}
#events .event-body { min-width: 0; }
#events .event-title {
  margin: 0 0 6px;
  font-family: Merriweather, serif;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.15;
  font-size: 1.08rem;
}
#events .event-meta {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
}

/* Optional: make CTA feel like a real button */
#events .join-panel .btnx {
  display: inline-flex;
  width: auto;
}

/* Calendar-style list */
.cal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(28, 22, 22, .10);
}
.cal-kicker {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cal-title {
  margin: 2px 0 0;
  font-family: Merriweather, serif;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--ink);
}
.cal-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--accent-2);
}
.cal-link:hover { text-decoration: underline; }

.cal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-item {
  position: relative;
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 14px;
  align-items: stretch;
  padding: 12px 12px;
  border: 1px solid rgba(28, 22, 22, .12);
  border-radius: 16px;
  background: rgba(255, 247, 234, .85);
}
.cal-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(28, 22, 22, .14);
  background: linear-gradient(180deg, rgba(245, 20, 20, .10), rgba(255, 247, 234, .92));
  padding: 8px 6px;
  text-align: center;
}
.cal-month {
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-2);
  line-height: 1;
}
.cal-day {
  font-size: 1.65rem;
  font-weight: 950;
  color: var(--ink);
  line-height: 1.05;
  margin-top: 4px;
}
.cal-dow {
  font-size: .78rem;
  font-weight: 800;
  color: rgba(28, 22, 22, .62);
  margin-top: 4px;
}
.cal-body { min-width: 0; }
.cal-event {
  margin: 0 0 4px;
  font-family: Merriweather, serif;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.18;
  font-size: 1.05rem;
  color: var(--ink);
}
.cal-meta {
  font-size: .92rem;
  margin-bottom: 6px;
}
.cal-desc {
  margin: 0;
  line-height: 1.55;
}
.cal-chip {
  align-self: start;
  margin-top: 2px;
  font-size: .78rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(28, 22, 22, .12);
  background: rgba(245, 20, 20, .10);
  color: var(--accent-2);
  white-space: nowrap;
}
.cal-chip--alt {
  background: rgba(28, 22, 22, .06);
  color: var(--ink);
}
.cal-chip--night {
  background: rgba(245, 20, 20, .08);
  color: var(--accent-2);
}
@media (max-width: 560px) {
  .cal-item { grid-template-columns: 76px 1fr; }
  .cal-chip {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
  }
}

/* --- Ether: force correct layering --- */
#root {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important; /* not negative = fewer browser quirks */
  pointer-events: none !important;
}
#etherTint {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1 !important; /* tint above ether */
  pointer-events: none !important;
}
/* Everything else above */
body > header, body > nav, body > main, body > section, body > footer {
  position: relative;
  z-index: 10;
}
/* IMPORTANT: do NOT force ALL body > div above the ether */
body > div {
  position: relative;
  z-index: 10;
}
/* ...except the ether layers themselves */
body > #root, body > #etherTint {
  z-index: 0 !important;
  position: fixed !important;
}
