/*!
 * MI Staff
 * Version: 0.1.24
 * License: GPL-2.0-or-later
 */

.mi-staff * { box-sizing: border-box; margin: 0; padding: 0; }
.mi-staff { font-weight: 400; color: #1a1a1a; width: 100%; }
.mi-staff-section { margin-bottom: 64px; width: 100%; }
.mi-staff-section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; width: 100%; }
.mi-staff-section-header::after { content: ''; flex: 1; height: 1px; background: #e5e5e5; }
.mi-staff-section-label { font-size: 15px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: #4a148c; padding: 5px 14px 4px; border-radius: 3px; white-space: nowrap; }
.mi-staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 20px; width: 100%; align-items: start; }
.mi-staff-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 16px 20px; border-radius: 12px; border: 1px solid #ebebeb; background: #fff; }
.mi-staff-avatar-wrap { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; margin-bottom: 14px; border: 3px solid #ede7f6; flex-shrink: 0; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.mi-staff-card:hover .mi-staff-avatar-wrap { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(74,20,140,0.15); }
.mi-staff-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.mi-staff-card-name { font-size: 16px; font-weight: 700; line-height: 1.25; color: #1a1a1a; height: 44px; display: flex; align-items: center; justify-content: center; width: 100%; overflow: hidden; }
.mi-staff-card-role { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #4a148c; line-height: 1.4; height: 52px; display: flex; align-items: center; justify-content: center; width: 100%; overflow: hidden; }
.mi-staff-card-location { font-size: 13px; font-weight: 500; color: #999; width: 100%; height: 22px; display: flex; align-items: center; justify-content: center; }
.mi-staff-divider { width: 28px; height: 2px; background: #ede7f6; border-radius: 2px; margin: 12px auto; flex-shrink: 0; }
.mi-staff-bio-wrap { width: 100%; position: relative; }
.mi-staff-card-bio { font-size: 13px; line-height: 1.65; color: #555; font-weight: 400; height: calc(13px * 1.65 * 11); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 11; -webkit-box-orient: vertical; }
@media (max-width: 600px) { .mi-staff-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 12px; } .mi-staff-avatar-wrap { width: 100px; height: 100px; } }

/* MODAL ─────────────────────────────────────────── */
.mi-staff-profile-btn {
  margin-top: 14px;
  background: none;
  border: 1px solid #4a148c;
  color: #4a148c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.mi-staff-profile-btn:hover { background: #4a148c; color: #fff; }

.mi-staff-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.mi-staff-modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.mi-staff-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 24px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 8px 14px;
}
.mi-staff-modal-close:hover {
  color: #1a1a1a;
}

.mi-staff-modal-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.mi-staff-modal-avatar-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid #ede7f6;
}
.mi-staff-modal-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.mi-staff-modal-meta { flex: 1; padding-top: 4px; }

.mi-staff-modal-name {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.mi-staff-modal-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a148c;
  margin-bottom: 6px;
}
.mi-staff-modal-location {
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}
.mi-staff-modal-years {
  font-size: 13px;
  font-weight: 600;
  color: #4a148c;
}

/*
 * Bio scroll wrapper (decision 24). modal.js emits one <p class="mi-staff-modal-bio">
 * per \n\n-separated paragraph inside this fixed-height container; CSS handles
 * overflow. The top divider border lives on the wrapper (one line, total) rather
 * than on the first paragraph — replaces the 0.1.15-era truncation + Read more
 * model that needed :first-of-type scoping.
 */
.mi-staff-modal-bio-scroll {
  max-height: 225px;
  overflow-y: auto;
  border-top: 1px solid #f0e6ff;
  padding-top: 18px;
  padding-right: 8px;
  margin-bottom: 24px;
}
.mi-staff-modal-bio {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 24px;
}

.mi-staff-modal-section {
  margin-bottom: 20px;
}
.mi-staff-modal-section:empty { display: none; }
.mi-staff-modal-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bbb;
  margin-bottom: 10px;
}
.mi-staff-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mi-staff-modal-tag {
  font-size: 12px;
  font-weight: 500;
  background: #f5f0ff;
  color: #4a148c;
  border-radius: 4px;
  padding: 4px 10px;
  line-height: 1.4;
}
.mi-staff-modal-tag.spec {
  background: #fff;
  border: 1px solid #e0d5f5;
  color: #555;
}

.mi-staff-modal-cta {
  display: block;
  text-align: center;
  background: #4a148c;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 24px;
  transition: background 0.15s;
  width: 100%;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.mi-staff-modal-cta:hover { background: #370d6c; color: #fff; }

@media (max-width: 500px) {
  .mi-staff-modal-card { padding: 24px 18px; }
  .mi-staff-modal-header { flex-direction: column; align-items: center; text-align: center; }
}

/* BLOG BLOCK ─────────────────────────────────────── */
/*
 * "✍ {first_name} writes for the Macros Inc blog | Read articles →"
 * callout in the modal. Replaces the original sample's inline-styled block
 * with class-driven CSS. Renders only when blog_author_url !== null.
 */
.mi-staff-blog-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f5f0ff;
  border-radius: 8px;
  margin-bottom: 20px;
}
.mi-staff-blog-block span {
  font-size: 13px;
  color: #555;
}
.mi-staff-blog-block a {
  font-size: 12px;
  font-weight: 700;
  color: #4a148c;
  text-decoration: none;
}

/* INQUIRY ───────────────────────────────────────── */
.mi-staff-inquiry-wrap { margin-top: 24px; }
.mi-staff-inquiry-form { border-top: 1px solid #f0e6ff; padding-top: 20px; margin-top: 0; }

/* INTRO ─────────────────────────────────────────── */
.mi-staff-intro {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 0 0 52px;
}
.mi-staff-intro-left { flex: 1; min-width: 0; }
.mi-staff-intro-headline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4a148c;
  margin: 0 0 14px;
  display: block;
}
.mi-staff-intro-title {
  font-size: 36px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.15;
  margin: 0 0 18px;
}
.mi-staff-intro-sub {
  font-size: 16px;
  line-height: 1.75;
  color: #666;
  margin: 0;
}
.mi-staff-intro-stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex-shrink: 0;
  padding-left: 48px;
  border-left: 1px solid #ede7f6;
}
.mi-staff-intro-stat-item { text-align: center; }
.mi-staff-intro-stat-item strong {
  display: block;
  font-size: 34px;
  font-weight: 800;
  color: #4a148c;
  line-height: 1;
  margin-bottom: 5px;
}
.mi-staff-intro-stat-item span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bbb;
}
@media (max-width: 640px) {
  .mi-staff-intro { flex-direction: column; align-items: center; text-align: center; gap: 32px; }
  .mi-staff-intro-stats { flex-direction: row; border-left: none; padding-left: 0; border-top: 1px solid #ede7f6; padding-top: 28px; width: 100%; justify-content: center; gap: 32px; }
}

/* INLINE COMPONENTS ───────────────────────────────── */
/*
 * [mi_staff_single] — inline link trigger that opens the modal. Lives inside
 * post body content, so we keep it visually link-y rather than button-y.
 * .mi-staff-single-disabled is the plain-text fallback when a referenced user
 * has _mi_staff_enabled=false; no link styling, just emphasis weight.
 *
 * [mi_staff_card] — the wrapper around a reused templates/card.php for inline
 * embeds. .mi-staff-card-wrap-single bounds the card width and centers it so
 * it doesn't span full content width like the grid cards do.
 */
.mi-staff-single {
  color: #4a148c;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.mi-staff-single:hover {
  color: #6a2db3;
}
.mi-staff-single-disabled {
  font-weight: 600;
  color: inherit;
}
.mi-staff-card-wrap-single {
  max-width: 320px;
  margin: 24px auto;
  display: block;
}

/* MODAL LOADING / ERROR STATES (0.1.21) ──────────── */
/*
 * Spinner shown inside the modal card while the REST fetch is inflight, and
 * an error card shown when the fetch fails for non-404 reasons. Both replace
 * the populated-card content via DOM swap in modal.js openModal().
 *
 * The screen-reader-only label is positioned off-screen rather than using
 * `clip` so it remains in the accessibility tree but takes no visual space.
 */
.mi-staff-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  min-height: 200px;
}
.mi-staff-spinner-circle {
  width: 40px;
  height: 40px;
  border: 3px solid #ede7f6;
  border-top-color: #4a148c;
  border-radius: 50%;
  animation: mi-staff-spin 0.8s linear infinite;
}
@keyframes mi-staff-spin {
  to { transform: rotate(360deg); }
}
.mi-staff-spinner-sr {
  position: absolute;
  left: -9999px;
}
.mi-staff-modal-error {
  padding: 40px 20px;
  text-align: center;
  color: #555;
}
