/* Heaven Bound v1.2.13.0 — Isolated Modern Portal Foundation */
.hb-modern-portal,
.hb-modern-portal * { box-sizing: border-box; }

.hb-modern-portal {
  --hb-portal-primary: #1f63dc;
  --hb-portal-secondary: #153a70;
  --hb-portal-sidebar: #ffffff;
  --hb-portal-surface: #f4f7fc;
  --hb-portal-card: #ffffff;
  --hb-portal-text: #14233b;
  --hb-portal-muted: #64748b;
  --hb-portal-border: #dfe6f0;
  --hb-portal-green: #169b55;
  --hb-portal-purple: #7442d6;
  --hb-portal-orange: #e97b12;
  --hb-portal-danger: #d63b3b;
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  width: 100%;
  max-width: 1600px;
  min-width: 0;
  margin: 0 auto;
  overflow: clip;
  color: var(--hb-portal-text);
  background: var(--hb-portal-surface);
  border: 1px solid var(--hb-portal-border);
  border-radius: 20px;
  container-type: inline-size;
  container-name: hbportal;
  font-family: Arial, Helvetica, sans-serif;
}

.hb-modern-sidebar {
  min-width: 0;
  background: var(--hb-portal-sidebar);
  border-right: 1px solid var(--hb-portal-border);
  display: flex;
  flex-direction: column;
  min-height: 680px;
}
.hb-modern-brand { display:flex; align-items:center; gap:12px; padding:22px 20px; border-bottom:1px solid var(--hb-portal-border); }
.hb-modern-brand-mark { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; color:var(--hb-portal-primary); background:color-mix(in srgb, var(--hb-portal-primary) 10%, white); font-size:22px; flex:0 0 auto; }
.hb-modern-brand-copy { min-width:0; display:flex; flex-direction:column; line-height:1.2; }
.hb-modern-brand-copy strong { color:var(--hb-portal-secondary); font-size:16px; overflow-wrap:anywhere; }
.hb-modern-brand-copy small { color:var(--hb-portal-muted); font-size:12px; margin-top:3px; }
.hb-modern-sidebar-close { display:none; margin-left:auto; border:0; background:transparent; font-size:28px; line-height:1; cursor:pointer; color:var(--hb-portal-muted); }
.hb-modern-nav { padding:20px 12px; display:flex; flex-direction:column; gap:6px; }
.hb-modern-nav-heading { margin:0 10px 8px; color:var(--hb-portal-muted); font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.hb-modern-nav-heading:not(:first-child) { margin-top:18px; padding-top:14px; border-top:1px solid var(--hb-portal-border); }
.hb-modern-nav-link[aria-current="page"] { font-weight:800; }
.hb-modern-nav-link:focus-visible,
.hb-modern-menu-button:focus-visible,
.hb-modern-sidebar-close:focus-visible,
.hb-modern-logout:focus-visible { outline:3px solid color-mix(in srgb, var(--hb-portal-primary) 38%, transparent); outline-offset:2px; }
.hb-modern-nav-link { display:flex; align-items:center; gap:12px; min-height:44px; padding:10px 12px; border-radius:10px; color:var(--hb-portal-text); text-decoration:none !important; font-size:14px; font-weight:600; }
.hb-modern-nav-link:hover { background:color-mix(in srgb, var(--hb-portal-primary) 7%, white); color:var(--hb-portal-primary); }
.hb-modern-nav-link.is-active { color:var(--hb-portal-primary); background:color-mix(in srgb, var(--hb-portal-primary) 11%, white); box-shadow:inset 3px 0 0 var(--hb-portal-primary); }
.hb-modern-nav-icon { width:22px; text-align:center; color:currentColor; }
.hb-modern-sidebar-footer { margin-top:auto; padding:16px 20px; border-top:1px solid var(--hb-portal-border); }
.hb-modern-logout { color:var(--hb-portal-danger); font-size:14px; font-weight:700; text-decoration:none !important; }

.hb-modern-main { min-width:0; background:var(--hb-portal-surface); }
.hb-modern-topbar { min-width:0; min-height:78px; padding:14px 22px; display:flex; align-items:center; gap:16px; background:var(--hb-portal-card); border-bottom:1px solid var(--hb-portal-border); }
.hb-modern-menu-button { display:none; min-width:44px; min-height:44px; border:1px solid var(--hb-portal-border); border-radius:10px; background:#fff; color:var(--hb-portal-secondary); cursor:pointer; font-size:20px; }
.hb-modern-topbar-context { min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.hb-modern-topbar-context small { color:var(--hb-portal-muted); font-size:11px; }
.hb-modern-topbar-context strong { color:var(--hb-portal-text); font-size:15px; overflow-wrap:anywhere; }
.hb-modern-user-card { margin-left:auto; min-width:0; display:flex; align-items:center; gap:9px; padding:8px 11px; border:1px solid var(--hb-portal-border); border-radius:12px; background:#fff; }
.hb-modern-user-card > span:last-child { display:flex; min-width:0; flex-direction:column; line-height:1.2; }
.hb-modern-user-card strong { font-size:13px; color:var(--hb-portal-text); overflow-wrap:anywhere; }
.hb-modern-user-card small { margin-top:2px; font-size:11px; color:var(--hb-portal-muted); }
.hb-modern-user-dot { width:9px; height:9px; border-radius:999px; background:var(--hb-portal-green); box-shadow:0 0 0 4px color-mix(in srgb, var(--hb-portal-green) 12%, white); flex:0 0 auto; }
.hb-modern-content { min-width:0; width:100%; padding:24px; overflow-wrap:anywhere; }
.hb-modern-content > :first-child { margin-top:0; }
.hb-modern-content img, .hb-modern-content video, .hb-modern-content iframe { max-width:100%; height:auto; }
.hb-modern-content table { max-width:100%; }
.hb-modern-overlay { display:none; }

/* Foundation-level modern treatments, limited to plugin content. */
.hb-modern-content .hb-card,
.hb-modern-content .hb-member-card,
.hb-modern-content .hb-leader-card,
.hb-modern-content .hb-officer-card,
.hb-modern-content .hb-panel {
  background:var(--hb-portal-card);
  border-color:var(--hb-portal-border);
  border-radius:14px;
}
.hb-modern-content .button-primary,
.hb-modern-content .hb-btn-primary,
.hb-modern-content button[type="submit"] {
  background:var(--hb-portal-primary);
  border-color:var(--hb-portal-primary);
}

@container hbportal (max-width: 980px) {
  /* The container cannot restyle its own grid from this query. Make the
   * main descendant span the full inherited grid as a CSS-only pre-JS
   * safeguard; ResizeObserver then applies the one-column root class. */
  .hb-modern-main { grid-column:1 / -1; }
  .hb-modern-sidebar { position:absolute; inset:0 auto 0 0; z-index:1002; width:min(310px, 88%); min-height:100%; transform:translateX(-105%); transition:transform .2s ease; box-shadow:12px 0 32px rgba(15,35,65,.16); }
  .hb-modern-portal.is-nav-open .hb-modern-sidebar { transform:translateX(0); }
  .hb-modern-sidebar-close, .hb-modern-menu-button { display:inline-grid; place-items:center; }
  .hb-modern-overlay { position:absolute; inset:0; z-index:1001; background:rgba(16,29,50,.42); }
  .hb-modern-portal.is-nav-open .hb-modern-overlay { display:block; }
  .hb-modern-topbar { min-height:70px; padding:12px 16px; }
  .hb-modern-content { padding:18px; }
}
@container hbportal (max-width: 560px) {
  .hb-modern-portal { border-radius:14px; }
  .hb-modern-content { padding:14px; }
  .hb-modern-topbar-context small { display:none; }
  .hb-modern-user-card { border:0; padding:6px; background:transparent; }
  .hb-modern-user-card small { display:none; }
  .hb-modern-user-card strong { max-width:110px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}

@media (max-width: 980px) {
  .hb-modern-portal { grid-template-columns:minmax(0,1fr); }
}
@media print {
  .hb-modern-sidebar, .hb-modern-topbar, .hb-modern-overlay { display:none !important; }
  .hb-modern-portal { display:block !important; border:0 !important; background:#fff !important; overflow:visible !important; }
  .hb-modern-content { padding:0 !important; }
}

/* v1.2.13.1: ResizeObserver-backed compact state.
 * A CSS container cannot change its own grid columns from its own @container
 * query. The measured class fixes that architectural limitation while still
 * reacting to the real portal width inside any WordPress theme container. */
.hb-modern-portal.hb-modern-compact {
  grid-template-columns: minmax(0, 1fr);
}
.hb-modern-portal.hb-modern-compact .hb-modern-sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1002;
  width: min(310px, 88%);
  min-height: 100%;
  transform: translateX(-105%);
  transition: transform .2s ease;
  box-shadow: 12px 0 32px rgba(15,35,65,.16);
}
.hb-modern-portal.hb-modern-compact.is-nav-open .hb-modern-sidebar {
  transform: translateX(0);
}
.hb-modern-portal.hb-modern-compact .hb-modern-sidebar-close,
.hb-modern-portal.hb-modern-compact .hb-modern-menu-button {
  display: inline-grid;
  place-items: center;
}
.hb-modern-portal.hb-modern-compact .hb-modern-overlay {
  position: absolute;
  inset: 0;
  z-index: 1001;
  background: rgba(16,29,50,.42);
}
.hb-modern-portal.hb-modern-compact.is-nav-open .hb-modern-overlay {
  display: block;
}
.hb-modern-portal.hb-modern-compact .hb-modern-topbar {
  min-height: 70px;
  padding: 12px 16px;
}
.hb-modern-portal.hb-modern-compact .hb-modern-content {
  padding: 18px;
}
.hb-modern-portal.hb-modern-narrow {
  border-radius: 14px;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-content {
  padding: 14px;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-topbar {
  gap: 8px;
  padding-right: 10px;
  padding-left: 10px;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-topbar-context {
  flex: 1 1 auto;
  min-width: 0;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-topbar-context strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-topbar-context small {
  display: none;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-user-card {
  flex: 0 1 86px;
  min-width: 0;
  max-width: 86px;
  overflow: hidden;
  border: 0;
  padding: 6px;
  background: transparent;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-user-card small {
  display: none;
}
.hb-modern-portal.hb-modern-narrow .hb-modern-user-card strong {
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v1.2.13.4 — Interactive sidebar groups and section routing. */
.hb-modern-portal [hidden] { display: none !important; }

.hb-modern-portal:not(.hb-modern-compact) .hb-modern-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hb-modern-nav {
  gap: 10px;
}

.hb-modern-nav-group {
  display: block;
  min-width: 0;
}

.hb-modern-nav-group + .hb-modern-nav-group {
  padding-top: 10px;
  border-top: 1px solid var(--hb-portal-border);
}

.hb-modern-nav-group-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--hb-portal-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .075em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.hb-modern-nav-group-toggle:hover,
.hb-modern-nav-group-toggle:focus-visible {
  color: var(--hb-portal-secondary);
  background: color-mix(in srgb, var(--hb-portal-primary) 6%, transparent);
}

.hb-modern-nav-chevron {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
  transition: transform .18s ease;
}

.hb-modern-nav-group-toggle[aria-expanded="false"] .hb-modern-nav-chevron {
  transform: rotate(-90deg);
}

.hb-modern-nav-submenu {
  display: grid;
  gap: 4px;
  padding: 3px 0 4px;
}

.hb-modern-nav-link {
  position: relative;
  min-height: 42px;
  padding: 9px 11px 9px 12px;
  border: 1px solid transparent;
}

.hb-modern-nav-link.is-active {
  border-color: color-mix(in srgb, var(--hb-portal-primary) 18%, transparent);
}

.hb-modern-nav-badge {
  margin-left: auto;
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--hb-portal-danger);
  font-size: 11px;
  line-height: 1;
}

.hb-modern-route-heading {
  margin: 0 0 20px;
  padding: 2px 2px 18px;
  border-bottom: 1px solid var(--hb-portal-border);
}

.hb-modern-route-heading p,
.hb-modern-route-heading h1,
.hb-modern-route-heading span {
  margin-right: 0;
  margin-left: 0;
}

.hb-modern-route-heading p {
  margin-top: 0;
  margin-bottom: 5px;
  color: var(--hb-portal-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hb-modern-route-heading h1 {
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--hb-portal-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.15;
}

.hb-modern-route-heading span {
  display: block;
  max-width: 780px;
  color: var(--hb-portal-muted);
  font-size: 14px;
  line-height: 1.55;
}

.hb-modern-route-output {
  min-width: 0;
  width: 100%;
}

.hb-modern-route-output > * {
  min-width: 0;
}

.hb-modern-portal--routed .hb-modern-route-output .hb-member-nav,
.hb-modern-portal--routed .hb-modern-route-output .hb-secretary-nav {
  display: none !important;
}

.hb-officer-assignments-group {
  display: grid;
  gap: 16px;
}

.hb-modern-portal.hb-modern-compact .hb-modern-sidebar {
  position: absolute;
  top: 0;
  max-height: none;
  overflow-y: auto;
}

@media (max-width: 560px) {
  .hb-modern-route-heading {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }
  .hb-modern-route-heading h1 {
    font-size: 25px;
  }
  .hb-modern-nav-link {
    min-height: 46px;
    font-size: 14px;
  }
}

@media print {
  .hb-modern-route-heading { display: none !important; }
  .hb-modern-route-output [data-hb-router-hidden] { display: revert !important; }
}
