/* ============ Shared app-page primitives (directory/connections/jobs/feed/profile/settings) ============ */

/* Same fix as the voting system's own styles.css: several rules below
   set `display` explicitly (.hub-list, .hub-people-grid, etc.), which
   as author styles beat the browser's low-priority default
   `[hidden]{display:none}`. Without this, toggling the `hidden`
   attribute on anything carrying one of those classes silently does
   nothing — the element stays visible. This one rule fixes the whole
   class of bug everywhere, not just per-component. */
[hidden] { display: none !important; }

/* Applied by hub-common.js's document-level image error handler — a
   failed <img> load (deleted Blob, corrupt file, dead URL) swaps to a
   neutral placeholder instead of the browser's broken-image icon. */
.hub-img-broken { object-fit: contain !important; padding: 12%; box-sizing: border-box; background: var(--surface-sunken); }

.hub-main { max-width: 1180px; margin: 0 auto; padding: 32px 20px 80px; }

/* Page-top banner with a real photo background + dark scrim */
.hub-banner {
  position: relative;
  overflow: hidden;
  padding: 44px 0;
  background: var(--black);
}
.hub-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.hub-banner::after {
  content: "";
  position: absolute; inset: 0;
  /* Same reasoning as .eh-hero-slide::after — a flat wash under the
     diagonal so a bright stock photo can't push the scrim below a
     readable contrast floor the way a single diagonal gradient can. */
  background:
    linear-gradient(100deg, rgba(10,10,10,0.94) 22%, rgba(10,10,10,0.68) 65%, rgba(10,10,10,0.4) 100%),
    rgba(10,10,10,0.15);
}
/* z-index matters here, not just position:relative — ::after (the dark
   gradient scrim) is generated as the last child of .hub-banner, so
   without an explicit stacking order it paints on top of this content
   instead of behind it, dimming the heading/text underneath its own
   overlay. Confirmed by pixel inspection, not just computed styles: the
   text's own color/opacity reported correctly as white/1 while still
   rendering washed out, which only makes sense if something else was
   compositing on top of it. Same z-index:1 pattern .eh-hero-content
   already uses correctly for the identical situation on the landing hero. */
.hub-banner-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hub-banner .eh-eyebrow { color: var(--green-500, #34c471); }
.hub-banner h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
  margin: 8px 0 0;
}
.hub-banner p { margin: 6px 0 0; color: rgba(255,255,255,0.7); font-size: 14.5px; max-width: 56ch; }

/* Avatar: photo, or initials fallback */
.hub-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red-600), var(--green-600));
  color: #fff; font-family: var(--font-display); font-weight: 800;
}
.hub-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hub-avatar.sz-sm { width: 36px; height: 36px; font-size: 13px; }
.hub-avatar.sz-md { width: 52px; height: 52px; font-size: 17px; }
.hub-avatar.sz-lg { width: 96px; height: 96px; font-size: 30px; border: 4px solid var(--surface); }
.hub-avatar.sz-xl { width: 136px; height: 136px; font-size: 42px; border: 5px solid var(--surface); }

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.hub-tag {
  display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--ink);
  border: 1px solid var(--border);
}
.hub-tag.removable { gap: 7px; padding-right: 8px; }
.hub-tag .rm { cursor: pointer; color: var(--ink-muted); font-weight: 700; line-height: 1; }
.hub-tag .rm:hover { color: var(--red-600); }
.hub-tag .edit { cursor: pointer; color: var(--ink-muted); font-size: 11px; line-height: 1; }
.hub-tag .edit:hover { color: var(--red-600); }
.hub-tag.is-editing { padding: 4px 6px 4px 10px; gap: 6px; }
/* font-size: 16px is deliberate, not a default — anything smaller
   triggers Safari/Chrome's auto-zoom-on-focus on phones, a bug this
   codebase already ran into and fixed everywhere else once before. */
.pf-skill-edit-input {
  font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--red-600); border-radius: 999px;
  padding: 3px 10px; outline: none; width: 130px; min-width: 0;
}
.hub-tag .edit.is-save { color: var(--green-600); font-size: 13px; }
.hub-tag .edit.is-save:hover { color: var(--green-700); }

.hub-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-muted);
  font-size: 14.5px;
}
.hub-empty .big {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%;
  background: var(--surface-sunken); font-size: 28px;
}

/* A spinner, not static "Loading…" text — text alone gives no sense
   that anything is actually happening versus having silently stalled. */
.hub-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; color: var(--ink-muted); font-size: 14.5px; }
.hub-loading::before {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--surface-sunken); border-top-color: var(--red-600);
  animation: hub-spin 0.7s linear infinite;
}
@keyframes hub-spin { to { transform: rotate(360deg); } }

/* Directory / suggestions card grid */
.hub-people-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .hub-people-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .hub-people-grid { grid-template-columns: repeat(3, 1fr); } }

.hub-person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.hub-person-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--red-600); }
.hub-person-card .hub-avatar { margin: 0 auto; }
.hub-person-card h3 { margin: 12px 0 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.hub-person-card .role { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-muted); }
.hub-person-card .badge-row { margin: 8px 0 0; display: flex; justify-content: center; }
.dir-action-wrap { margin-top: 14px; }
.dir-action-btn { padding: 8px 20px; font-size: 13px; }
.dir-action-btn.is-disabled { pointer-events: none; opacity: 0.65; }

.hub-verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--green-600);
  background: var(--green-100); padding: 3px 9px; border-radius: 999px;
}

/* Filter bar */
.hub-filterbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 24px;
}
.hub-filterbar input[type="text"], .hub-filterbar select {
  font-family: var(--font-body); font-size: 16px;
  padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--ink); outline: none;
}
.hub-filterbar input[type="text"] { flex: 1; min-width: 200px; }
.hub-filterbar input:focus, .hub-filterbar select:focus { border-color: var(--red-600); box-shadow: 0 0 0 3px var(--red-100); }

/* Feed / list items */
.hub-list { display: flex; flex-direction: column; gap: 12px; }
.hub-feed-item { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.hub-feed-item:last-child { border-bottom: none; }
.hub-feed-item p { margin: 0; font-size: 14px; color: var(--ink); }
.hub-feed-item time { font-size: 12px; color: var(--ink-muted); }

.hub-req-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.hub-req-row:last-child { border-bottom: none; }
.hub-req-info { flex: 1; min-width: 0; }
.hub-req-info h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.hub-req-info p { margin: 2px 0 0; font-size: 13px; color: var(--ink-muted); }
.hub-req-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hub-btn-sm { padding: 8px 16px; font-size: 13px; }

/* Job cards */
.hub-job-card { padding: 22px; }
.hub-job-card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.hub-job-card .meta { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-muted); }
.hub-job-card .desc { margin: 12px 0 0; font-size: 14.5px; color: var(--ink); line-height: 1.6; }
.hub-job-card .foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hub-job-card .posted-by { font-size: 12px; color: var(--ink-muted); }

/* Tab pills */
.hub-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.hub-tab {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 10px 4px; margin-right: 20px;
  font-size: 14px; font-weight: 600; color: var(--ink-muted);
  border-bottom: 2px solid transparent; cursor: pointer; background: none; border-left: none; border-right: none; border-top: none;
}
.hub-tab.is-active { color: var(--ink); border-bottom-color: var(--red-600); }

/* ============ Full-screen media viewer (images) — shared by feed + profile ============ */
.hub-lightbox {
  position: fixed; inset: 0; z-index: 500; background: rgba(6, 8, 10, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.hub-lightbox-stage { max-width: 92vw; max-height: 82vh; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.hub-lightbox-media { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 6px; cursor: zoom-in; transition: transform 0.2s var(--ease); user-select: none; }
.hub-lightbox-media.is-zoomed { transform: scale(1.9); cursor: zoom-out; }
.hub-lightbox-close, .hub-lightbox-nav {
  position: absolute; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2;
}
.hub-lightbox-close:hover, .hub-lightbox-nav:hover { background: rgba(255, 255, 255, 0.26); }
.hub-lightbox-close { top: 16px; right: 18px; width: 42px; height: 42px; font-size: 24px; line-height: 1; }
.hub-lightbox-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 18px; }
.hub-lightbox-nav.prev { left: 16px; }
.hub-lightbox-nav.next { right: 16px; }
.hub-lightbox-download {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.14); color: #fff; padding: 9px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 700; text-decoration: none; z-index: 2;
}
.hub-lightbox-download:hover { background: rgba(255, 255, 255, 0.26); }
.hub-lightbox-counter { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.75); font-size: 12.5px; font-weight: 600; }
@media (max-width: 640px) {
  .hub-lightbox-nav { width: 38px; height: 38px; }
}

/* ============ Generic small modal (reactors list, etc.) ============ */
.hub-modal-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(10, 10, 10, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.hub-modal { background: var(--surface); border-radius: 14px; max-width: 380px; width: 100%; max-height: 78vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.hub-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.hub-modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.hub-modal-close { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-muted); }
.hub-modal-body { overflow-y: auto; padding: 8px 14px 14px; }
.hub-modal-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.hub-modal-row .name { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.hub-modal-row .emoji { font-size: 17px; }

/* Custom confirm dialog (window.confirm replacement) — see H.confirm in
   hub-common.js. Reuses .hub-modal-overlay for the backdrop, its own
   card styling on top since this is a centered prompt, not a form. */
.hub-confirm {
  background: var(--surface); border-radius: 16px; max-width: 360px; width: 100%;
  padding: 26px 24px 22px; text-align: center; box-shadow: var(--shadow-lg);
  animation: hub-confirm-in 0.18s var(--ease);
}
@keyframes hub-confirm-in {
  from { opacity: 0; transform: scale(0.94) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.hub-confirm-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; margin-bottom: 14px;
  background: var(--green-100); color: var(--green-600);
}
.hub-confirm-icon.is-danger { background: var(--red-100); color: var(--red-600); }
.hub-confirm-title { margin: 0 0 8px; font-size: 17px; font-weight: 800; color: var(--ink); font-family: var(--font-display); }
.hub-confirm-message { margin: 0; font-size: 14px; color: var(--ink-muted); line-height: 1.55; white-space: pre-line; }
.hub-confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.hub-confirm-actions .eh-btn { flex: 1; }

/* Edit-field popup (H.editField) — same overlay/card as the confirm
   dialog above, plus a labeled input. Sized deliberately larger than
   the rest of the app's controls: this dialog is the one place every
   member (not just tech-comfortable ones) has to read a label, type
   into a field, and hit the right button with confidence — 16px+ text
   and 48px+ touch targets throughout, not just where mobile-zoom
   prevention already forced 16px on inputs elsewhere. */
.hub-editfield { text-align: left; max-width: 400px; }
.hub-editfield .hub-confirm-icon { margin: 0 auto 14px; }
.hub-editfield .hub-confirm-title { text-align: center; font-size: 19px; }
.hub-editfield-label { display: block; margin: 18px 0 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.hub-editfield-input {
  width: 100%; font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 13px 16px; outline: none; min-height: 48px; box-sizing: border-box;
}
.hub-editfield-input:focus { border-color: var(--red-600); box-shadow: 0 0 0 3px var(--red-100); }
.hub-editfield-btn { min-height: 50px; font-size: 15px; }
.eh-btn-save {
  background: var(--green-600); color: #fff;
  box-shadow: 0 10px 26px -8px rgba(0, 122, 61, 0.5);
}
.eh-btn-save:hover { background: var(--green-700); transform: translateY(-2px); }
@media (max-width: 480px) {
  /* Fills most of the screen on a phone rather than sitting as a small
     centered card, per the same "large and unambiguous" brief.
     width:100%, not calc(100% - Npx) — .hub-modal-overlay already
     reserves 20px of padding on each side, so a further subtraction
     here double-counted that margin. */
  .hub-editfield { max-width: none; width: 100%; }
}

/* App-shell footer (app-footer.js) — every logged-in page ended with a
   bare </main> before this and no way to reach a privacy policy, terms,
   or a contact address from inside the product itself. */
.app-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.app-footer-row {
  max-width: 1180px; margin: 0 auto; padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
}
.app-footer-copy { font-size: 12px; color: var(--ink-muted); max-width: 56ch; }
.app-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.app-footer-links a { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); text-decoration: none; }
.app-footer-links a:hover { color: var(--red-600); text-decoration: underline; }
@media (max-width: 859px) {
  /* The fixed bottom tab bar already claims this space. */
  .app-footer-row { padding-bottom: 20px; }
}

/* Label/value list — moved here from profile.css since settings.html
   uses the exact same "row" markup for its account details but never
   loaded profile.css, so it rendered as unstyled run-on text with no
   visual separation between label and value at all. */
.pf-contact-list { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pf-contact-list .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.pf-contact-list dt { color: var(--ink-muted); font-weight: 600; }
.pf-contact-list dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.pf-contact-list dd a { color: var(--red-600); }
