/* All rules are scoped under #sd-embed so this can live directly on a
   Squarespace page (or any other site) without leaking styles onto the
   rest of the page, and without being affected by the host page's own
   global resets. */

#sd-embed {
  --ink: hsl(232, 80%, 18%);
  --porcelain: #FFFFFF;
  --ghost: #F1F2F6;
  --card: #FFFFFF;
  --gold: hsl(232, 80%, 18%);
  --sage: hsl(232, 40%, 40%);
  --line: #D8DBE0;
  --muted: #6B7078;

  --font-display: "Hypatia Sans Pro", "Myriad Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Hypatia Sans Pro", "Myriad Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Hypatia Sans Pro", "Myriad Pro", -apple-system, BlinkMacSystemFont, sans-serif;

  margin: 0;
  padding: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#sd-embed, #sd-embed * { box-sizing: border-box; }

#sd-embed #app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Header */
#sd-embed .dir-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

#sd-embed #org-name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(26px, 4vw, 38px);
  margin: 0;
  letter-spacing: -0.01em;
}

#sd-embed .search-wrap { flex: 1 1 260px; max-width: 340px; }

#sd-embed #search {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
}
#sd-embed #search:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* Rolodex department tabs — the signature element */
#sd-embed .dept-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}

#sd-embed .tab {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--line);
  border-radius: 3px 3px 0 0;
  padding: 8px 14px 6px;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

#sd-embed .tab:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

#sd-embed .tab.active {
  color: var(--ink);
  border-bottom: 3px solid var(--gold);
  background: var(--card);
  font-weight: 700;
}

/* Directory grid */
#sd-embed .directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

#sd-embed .state-msg {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

#sd-embed .empty-msg {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
}

#sd-embed .staff-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#sd-embed .staff-photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

#sd-embed .staff-photo-banner {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#sd-embed .staff-photo-banner.placeholder {
  background: var(--ghost);
}

#sd-embed .staff-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Circular avatar styles — used by the bio modal (the card now uses the
   square banner photo above instead). */
#sd-embed .staff-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ghost);
  border: 1px solid var(--line);
}

#sd-embed .staff-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--sage);
}

#sd-embed .staff-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0;
}

#sd-embed .staff-title {
  font-size: 13px;
  color: var(--muted);
  margin: -6px 0 0;
}

#sd-embed .staff-dept-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
  width: fit-content;
  padding: 2px 8px;
  border: 1px solid var(--sage);
  border-radius: 20px;
}

#sd-embed .staff-contact {
  font-size: 12.5px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 2px;
}

#sd-embed .staff-contact a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
#sd-embed .staff-contact a:hover { border-bottom-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  #sd-embed .tab { transition: none; }
}

/* Read more / bio */
#sd-embed .read-more-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  color: var(--gold);
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: fit-content;
  margin-top: 2px;
}
#sd-embed .read-more-btn:hover { text-decoration: underline; }

#sd-embed .staff-card.has-bio { cursor: default; }

/* Bio modal */
#sd-embed .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 36, 43, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

#sd-embed .modal-overlay[hidden] {
  display: none;
}

#sd-embed .modal-card {
  background: var(--card);
  border-radius: 6px;
  padding: 32px 28px 28px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sd-embed .modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
#sd-embed .modal-close:hover { color: var(--ink); }

#sd-embed .modal-photo {
  width: 76px;
  height: 76px;
  font-size: 26px;
}

#sd-embed .modal-bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin-top: 6px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  white-space: pre-line;
}
