/* SAFE Hub Dashboard — app shell styling */
:root {
  --shub-navy: #044974;
  --shub-maroon: #9d033c;
  --shub-gold: #b49240;
  --shub-lightblue: #b1c8d6;
  --shub-accent-gold: #e8ad29;
  --shub-accent-mauve: #8c6b7a;
  --shub-bg: #f4f6f8;
  --shub-white: #ffffff;
  --shub-text: #1f2d3a;
  --shub-text-muted: #6b7c8c;
}

* { box-sizing: border-box; }

body.shub-dashboard-body {
  margin: 0;
  font-family: 'Poppins', -apple-system, sans-serif;
  background: var(--shub-bg);
  color: var(--shub-text);
}

.shub-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.shub-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--shub-navy) 0%, #033355 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.shub-sidebar-top {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.shub-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.5px;
  display: block;
}

.shub-back-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.shub-back-link:hover { color: #fff; }

.shub-forum-back {
  margin-bottom: 18px;
}
.shub-forum-back a {
  color: var(--shub-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.shub-forum-back a:hover { color: var(--shub-navy); }

.shub-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shub-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.shub-nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.shub-nav-link.is-active {
  background: var(--shub-accent-gold);
  color: #1f2d3a;
  font-weight: 600;
}

.shub-nav-icon { font-size: 16px; width: 20px; text-align: center; }

.shub-sidebar-bottom {
  padding: 20px 24px 28px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.shub-user { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.shub-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--shub-accent-gold);
  color: #1f2d3a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}

.shub-user-name { font-size: 14px; font-weight: 500; color: #fff; }

.shub-logout {
  display: inline-block;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 14px;
  border-radius: 8px;
}
.shub-logout:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Main content */
.shub-main {
  margin-left: 260px;
  flex: 1;
  padding: 40px 48px;
}

.shub-main-inner {
  max-width: 900px;
  margin: 0 auto;
  background: var(--shub-white);
  border-radius: 16px;
  padding: 40px 44px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(4,73,116,0.06);
}

.shub-main-inner h1 {
  color: var(--shub-navy);
  font-weight: 700;
  margin-top: 0;
}
.shub-main-inner h3 { color: var(--shub-navy); font-weight: 600; }

.shub-main-inner a { color: var(--shub-maroon); font-weight: 500; }

/* Member info / resource list styling */
.shub-member-info ul, .shub-resource-list { list-style: none; padding: 0; }
.shub-member-info li, .shub-resource-list li {
  padding: 12px 16px;
  background: var(--shub-bg);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14.5px;
}

/* Resource Library: tabs, grid, cards, preview */
.shub-tab-input { display: none; }
.shub-tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--shub-bg);
}
.shub-tab-btn {
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--shub-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
#shub-tab-docs:checked ~ .shub-tab-buttons label[for="shub-tab-docs"],
#shub-tab-videos:checked ~ .shub-tab-buttons label[for="shub-tab-videos"] {
  color: var(--shub-navy);
  border-bottom-color: var(--shub-accent-gold);
}
.shub-tab-panel { display: none; }
#shub-tab-docs:checked ~ .shub-panel-docs,
#shub-tab-videos:checked ~ .shub-panel-videos { display: block; }

.shub-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.shub-resource-card {
  background: var(--shub-bg);
  border-radius: 12px;
  padding: 18px;
}
.shub-resource-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--shub-text);
}
.shub-preview-toggle summary {
  cursor: pointer;
  color: var(--shub-navy);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 10px;
  list-style: none;
}
.shub-preview-toggle summary::-webkit-details-marker { display: none; }
.shub-preview-toggle summary::before { content: '\25B6  '; font-size: 10px; }
.shub-preview-toggle[open] summary::before { content: '\25BC  '; }
.shub-preview-toggle iframe {
  width: 100%;
  height: 320px;
  border: none;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fff;
}
.shub-download-btn {
  display: inline-block;
  background: var(--shub-navy);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}
.shub-view-only-badge {
  display: inline-block;
  background: #e9edf0;
  color: var(--shub-text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
}
.shub-empty-note { color: var(--shub-text-muted); font-size: 13.5px; font-style: italic; }
.shub-encharge-btn {
  display: inline-block;
  background: var(--shub-navy);
  color: #fff !important;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  margin-top: 8px;
}
.shub-encharge-btn:hover { background: #033355; }

/* Full-screen preview modal */
.shub-modal-toggle { display: none; }
.shub-preview-open-btn {
  display: inline-block;
  cursor: pointer;
  color: var(--shub-navy);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 10px;
  border: 1px solid var(--shub-navy);
  padding: 7px 14px;
  border-radius: 8px;
}
.shub-preview-open-btn:hover { background: var(--shub-navy); color: #fff; }
.shub-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.shub-modal-toggle:checked ~ .shub-modal-overlay { display: flex; }
.shub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 35, 0.75);
  cursor: pointer;
}
.shub-modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: min(1000px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.shub-modal-box h4 {
  margin: 0 0 14px;
  padding-right: 100px;
  color: var(--shub-navy);
  font-size: 17px;
}
.shub-modal-box iframe {
  width: 100%;
  flex: 1;
  min-height: 60vh;
  border: none;
  border-radius: 10px;
  background: #eef1f3;
}
.shub-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--shub-text-muted);
  background: var(--shub-bg);
  padding: 6px 14px;
  border-radius: 20px;
}
.shub-modal-close:hover { color: var(--shub-navy); }
@media (max-width: 700px) {
  .shub-modal-box { width: 96vw; padding: 16px; max-height: 94vh; }
  .shub-modal-box iframe { min-height: 50vh; }
}

/* Public SAFE Hub intro page hero (sits inside normal site header/footer) */
.shub-public-hero {
  font-family: 'Poppins', -apple-system, sans-serif;
  max-width: 900px;
  margin: 20px auto 40px;
  padding: 48px 40px;
  background: linear-gradient(135deg, var(--shub-navy) 0%, #033355 100%);
  border-radius: 20px;
  color: #fff;
  text-align: center;
}
.shub-public-hero h1 {
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 14px;
  color: #fff;
}
.shub-public-tagline {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.shub-public-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 36px;
  text-align: left;
}
.shub-public-feature {
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
}
.shub-public-feature h3 {
  color: var(--shub-accent-gold);
  font-size: 16px;
  margin: 0 0 8px;
}
.shub-public-feature p {
  font-size: 13.5px;
  color: rgba(255,255,255,0.8);
  margin: 0;
  line-height: 1.5;
}
.shub-public-login-btn {
  display: inline-block;
  background: var(--shub-accent-gold);
  color: #1f2d3a !important;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none !important;
  font-size: 15px;
}
.shub-public-note {
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  margin-top: 20px;
}
@media (max-width: 700px) {
  .shub-public-features { grid-template-columns: 1fr; }
  .shub-public-hero { padding: 32px 20px; }
}

.shub-cert-section {
  font-family: 'Poppins', -apple-system, sans-serif;
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.shub-cert-col h2 {
  color: var(--shub-navy);
  font-size: 18px;
  margin: 0 0 14px;
}
.shub-cert-col p {
  font-size: 14px;
  line-height: 1.6;
  color: #3a4750;
  margin: 0 0 14px;
}
.shub-cert-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.shub-cert-list li {
  font-size: 13.5px;
  line-height: 1.5;
  color: #3a4750;
  padding: 12px 0 12px 28px;
  position: relative;
  border-bottom: 1px solid #eef1f3;
}
.shub-cert-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--shub-gold);
  font-weight: 700;
}
.shub-cert-subhead {
  color: var(--shub-maroon) !important;
  font-size: 15px !important;
  margin-top: 20px !important;
  margin-bottom: 10px !important;
}
@media (max-width: 800px) {
  .shub-cert-section { grid-template-columns: 1fr; gap: 28px; }
}

/* Workshop form */
.shub-workshop-form input, .shub-workshop-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d8e0e6; border-radius: 8px;
  font-family: inherit; font-size: 14px; margin-top: 6px;
}
.shub-workshop-form button {
  background: var(--shub-navy); color: #fff; border: none; padding: 12px 24px;
  border-radius: 8px; font-weight: 600; font-size: 14.5px; cursor: pointer;
}
.shub-workshop-form button:hover { background: #033355; }

.shub-login-gate { text-align: center; padding: 40px 0; }
.shub-login-btn {
  display: inline-block; background: var(--shub-navy); color: #fff !important;
  padding: 10px 22px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.shub-form-notice {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.shub-form-notice.success { background: #eaf6ee; border: 1px solid #a8d8b9; color: #1e5631; }
.shub-form-notice.error { background: #fdf3ea; border: 1px solid var(--shub-accent-gold); color: #7a5b12; }
.shub-ip-notice {
  background: #fdf3ea;
  border: 1px solid var(--shub-accent-gold);
  color: #7a5b12;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0 24px;
  font-size: 13.5px;
  line-height: 1.5;
}

/* bbPress forum styling to match dashboard */
.shub-main-inner .bbp-breadcrumb { display: none; }
.shub-main-inner div.bbp-forum-content,
.shub-main-inner div.bbp-topic-content,
.shub-main-inner div.bbp-reply-content { color: var(--shub-text); }
.shub-main-inner ul.forums,
.shub-main-inner ul.bbp-forums,
.shub-main-inner ul.bbp-topics,
.shub-main-inner ul.bbp-replies {
  border: none;
  background: transparent;
}
.shub-main-inner li.bbp-header {
  background: var(--shub-navy) !important;
  color: #fff;
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  padding: 12px 16px !important;
}
.shub-main-inner li.bbp-header ul.forum-titles li,
.shub-main-inner li.bbp-header ul.bbp-topics-list li {
  color: #fff !important;
}
.shub-main-inner li.bbp-body li.bbp-forum-info,
.shub-main-inner li.bbp-body li.bbp-topic-title,
.shub-main-inner li.bbp-body { padding: 4px 0; }
.shub-main-inner li.bbp-forum,
.shub-main-inner li.bbp-topic {
  background: var(--shub-bg);
  border-radius: 10px;
  margin: 8px 0;
  padding: 14px 16px !important;
  border: none !important;
}
.shub-main-inner a.bbp-forum-title,
.shub-main-inner a.bbp-topic-permalink {
  color: var(--shub-navy);
  font-weight: 600;
  text-decoration: none;
}
.shub-main-inner #bbpress-forums fieldset.bbp-form {
  background: var(--shub-bg);
  border: none;
  border-radius: 10px;
  padding: 16px;
}
.shub-main-inner #bbpress-forums button.button,
.shub-main-inner #bbpress-forums input[type="submit"] {
  background: var(--shub-navy);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.shub-main-inner #bbpress-forums textarea,
.shub-main-inner #bbpress-forums input[type="text"] {
  width: 100%;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
}
.shub-main-inner .bbp-template-notice,
.shub-main-inner .bbp-template-notice.info {
  background: #eef4f8;
  border: 1px solid var(--shub-lightblue);
  color: var(--shub-navy);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 10px 0;
}
.shub-main-inner .bbp-template-notice.error {
  background: #fdf3ea;
  border: 1px solid var(--shub-accent-gold);
  color: #7a5b12;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 10px 0;
}
.shub-main-inner fieldset.bbp-form legend {
  font-weight: 600;
  color: var(--shub-navy);
  padding: 0 0 10px;
}
.shub-main-inner fieldset.bbp-form label {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--shub-text-muted);
  display: block;
  margin: 12px 0 4px;
}
.shub-main-inner .bbp-forum-form-tags-input,
.shub-main-inner .tagsdiv input[type="text"] {
  width: 100%;
}
.shub-main-inner .search-form input[type="text"] {
  border: 1px solid #d8e0e6;
  border-radius: 8px 0 0 8px;
  padding: 10px 12px;
}
.shub-main-inner .search-form input[type="submit"] {
  background: var(--shub-navy);
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

/* Mobile topbar + toggle (checkbox hack, no JS needed) */
.shub-nav-toggle-input { display: none; }
.shub-mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--shub-navy);
  color: #fff;
  padding: 14px 20px;
  font-weight: 600;
  cursor: pointer;
}
.shub-hamburger { font-size: 20px; }

@media (max-width: 900px) {
  .shub-app {
    flex-direction: column;
  }
  .shub-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 240px;
  }
  .shub-nav-toggle-input:checked ~ .shub-app .shub-sidebar {
    transform: translateX(0);
  }
  .shub-main {
    margin-left: 0;
    width: 100%;
    padding: 0 16px 32px;
  }
  .shub-main-inner { padding: 28px 20px; border-radius: 0 0 16px 16px; }
  .shub-mobile-topbar {
    display: flex;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
  }
}
