.sap-directory,
.sap-profile,
.sap-edit-form,
.sap-card {
  box-sizing: border-box;
}

.sap-directory *,
.sap-profile *,
.sap-edit-form *,
.sap-card * {
  box-sizing: border-box;
}

.sap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.sap-columns-1 .sap-grid { grid-template-columns: 1fr; }
.sap-columns-2 .sap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sap-columns-3 .sap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sap-columns-4 .sap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sap-search-form {
  display: flex;
  gap: 10px;
  margin: 0 0 24px;
}

.sap-search-form input[type="search"] {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid #e5e0ef;
  border-radius: 999px;
}

.sap-search-form button,
.sap-button,
.sap-edit-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #242233;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.sap-card {
  display: flex;
  gap: 16px;
  height: 100%;
  padding: 18px;
  border: 1px solid #eee7f5;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8fb 0%, #f8f4ff 100%);
  box-shadow: 0 10px 30px rgba(36, 34, 51, 0.06);
}

.sap-avatar-link {
  flex: 0 0 112px !important;
  width: 112px !important;
  height: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  display: block !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
  line-height: 0 !important;
}

.sap-avatar,
.sap-avatar-large,
.sap-author-avatar-img,
.sap-profile-avatar img,
.sap-avatar-link img {
  display: block !important;
  border-radius: 9999px !important;
  object-fit: cover !important;
  object-position: center center !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  float: none !important;
}

.sap-avatar,
.sap-avatar-link img {
  width: 112px !important;
  height: 112px !important;
  min-width: 112px !important;
  min-height: 112px !important;
  max-width: 112px !important;
  max-height: 112px !important;
}

.sap-profile-avatar {
  width: 180px !important;
  height: 180px !important;
  min-width: 180px !important;
  min-height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
  display: block !important;
  line-height: 0 !important;
  justify-self: center;
}

.sap-avatar-large,
.sap-profile-avatar img,
.sap-profile-avatar .avatar,
.sap-profile-avatar .sap-author-avatar-img {
  width: 180px !important;
  height: 180px !important;
  min-width: 180px !important;
  min-height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
}

.sap-card-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  line-height: 1.2;
}

.sap-card-title a,
.sap-post-item h3 a {
  color: #242233;
  text-decoration: none;
}

.sap-job-title,
.sap-profile-job,
.sap-profile-location,
.sap-post-count {
  margin: 0 0 8px;
  color: #6d6478;
}

.sap-card-bio {
  margin: 8px 0 14px;
  color: #393445;
}

.sap-profile {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 18px;
}

.sap-profile-header {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff5fa 0%, #f3edff 50%, #fff8e8 100%);
  border: 1px solid #efe5f5;
}

.sap-profile h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

.sap-eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 800;
  color: #8b5c7e;
}

.sap-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.sap-social-links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid #eadff2;
  color: #242233;
  text-decoration: none;
  font-weight: 700;
}

.sap-profile-section {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid #f0e8f6;
  border-radius: 20px;
  background: #fff;
}

.sap-profile-section h2 {
  margin-top: 0;
}

.sap-post-list {
  display: grid;
  gap: 18px;
}

.sap-post-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sap-post-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
}

.sap-post-item h3 {
  margin: 0 0 6px;
}

.sap-post-item time {
  display: block;
  margin-bottom: 8px;
  color: #6d6478;
  font-size: .9rem;
}

.sap-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.sap-pagination a {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #e9e1f3;
  text-decoration: none;
  color: #242233;
}

.sap-pagination a.is-active {
  background: #242233;
  color: #fff;
}

.sap-edit-form {
  max-width: 760px;
  padding: 24px;
  border: 1px solid #eee7f5;
  border-radius: 18px;
  background: #fff;
}

.sap-edit-form p {
  margin: 0 0 18px;
}

.sap-edit-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.sap-edit-form input,
.sap-edit-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e0ef;
  border-radius: 12px;
}

.sap-edit-form small {
  display: block;
  margin-top: 6px;
  color: #6d6478;
}

.sap-alert,
.sap-notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #f2dfaf;
}

.sap-alert-success {
  background: #f0fff7;
  border-color: #b8edcf;
}

.sap-alert-error {
  background: #fff2f2;
  border-color: #f1c2c2;
}

@media (max-width: 860px) {
  .sap-grid,
  .sap-columns-2 .sap-grid,
  .sap-columns-3 .sap-grid,
  .sap-columns-4 .sap-grid {
    grid-template-columns: 1fr;
  }

  .sap-profile-header,
  .sap-post-item {
    grid-template-columns: 1fr;
  }

  .sap-profile-avatar {
    margin: 0 auto;
  }

  .sap-card {
    flex-direction: column;
  }
}


/* v1.6 hard circular avatar frame: uses a square background frame so theme image rules cannot squash it into an oval. */
.sap-profile .sap-profile-avatar,
.sap-profile .sap-profile-avatar .sap-avatar-frame,
.sap-card .sap-avatar-link,
.sap-card .sap-avatar-frame {
  border-radius: 9999px !important;
  overflow: hidden !important;
  transform: none !important;
}

.sap-avatar-frame {
  display: block !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  clip-path: circle(50% at 50% 50%) !important;
  flex: none !important;
  float: none !important;
  line-height: 0 !important;
}

.sap-profile-avatar,
.sap-profile-avatar .sap-avatar-frame.sap-avatar-large {
  width: 180px !important;
  height: 180px !important;
  min-width: 180px !important;
  min-height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
  aspect-ratio: 1 / 1 !important;
}

.sap-avatar-link,
.sap-avatar-link .sap-avatar-frame.sap-avatar {
  width: 112px !important;
  height: 112px !important;
  min-width: 112px !important;
  min-height: 112px !important;
  max-width: 112px !important;
  max-height: 112px !important;
  aspect-ratio: 1 / 1 !important;
}

/* v1.8: harden circular author images against theme/PostX/Customify avatar styling */
.sap-avatar-frame {
  border-radius: 50% !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  overflow: hidden !important;
  clip-path: circle(50% at 50% 50%) !important;
  aspect-ratio: 1 / 1 !important;
}

body.author img.avatar,
body.author .avatar img,
body.author .author-avatar img,
body.author .author-image img,
body.author .author-profile img.avatar,
body.author .author-info img.avatar,
body.author .author-box img.avatar,
body.author .page-header img.avatar,
body.author .archive-header img.avatar,
.wp-block-post-author__avatar img,
.post-author img.avatar,
.entry-author img.avatar,
.author-bio img.avatar,
.author-box img.avatar,
.saboxplugin-wrap img.avatar,
.ppress-author-avatar img,
.profilepress-author-avatar img {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  min-height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center center !important;
  overflow: hidden !important;
}

/* v1.9: single-post byline avatars and ProfilePress/WordPress avatar output */
.sap-global-avatar,
img.avatar,
img.avatar.photo,
.avatar.photo,
.entry-meta img.avatar,
.post-meta img.avatar,
.byline img.avatar,
.author.vcard img.avatar,
.posted-by img.avatar,
.post-author img.avatar,
.post-author-meta img.avatar,
.author-meta img.avatar,
.wp-block-post-author__avatar img,
.wp-block-post-author img.avatar,
.single-post .entry-header img.avatar,
.single-post .post-meta img.avatar,
.single-post .byline img.avatar,
.single-post .author img.avatar,
.single-post .avatar img,
.ast-author-avatar img,
.author-avatar img,
.author-image img,
.saboxplugin-wrap img.avatar,
.ppress-author-avatar img,
.profilepress-author-avatar img {
  border-radius: 9999px !important;
  object-fit: cover !important;
  object-position: center center !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  flex: none !important;
  transform: none !important;
}

img.avatar,
img.avatar.photo,
.single-post .entry-header img.avatar,
.single-post .post-meta img.avatar,
.single-post .byline img.avatar,
.single-post .author img.avatar {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
}

.sap-post-author-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid #eee7f5;
  color: #5f5a68;
  font-size: 0.95rem;
  line-height: 1.5;
}

.sap-post-author-links a {
  color: #5f5a68 !important;
  text-decoration: none !important;
  font-weight: 700;
}

.sap-post-author-links a:hover,
.sap-post-author-links a:focus {
  color: #242233 !important;
  text-decoration: underline !important;
}

.sap-author-link-separator {
  color: #aaa2b4;
}

.sap-author-box {
  margin: 32px 0;
  padding: 0;
  box-sizing: border-box;
}

.sap-author-box-title {
  margin: 0 0 22px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  color: #111;
}

.sap-author-box-inner {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sap-author-box-avatar .sap-avatar-frame,
.sap-avatar-frame.sap-avatar-author-box {
  width: 140px !important;
  height: 140px !important;
  min-width: 140px !important;
  min-height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  border-radius: 9999px !important;
  clip-path: circle(50% at 50% 50%) !important;
  background-position: center center !important;
  background-size: cover !important;
}

.sap-author-box-bio {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #111;
}

.sap-author-box-bio p {
  margin: 0 0 1em;
}

.sap-author-box .sap-post-author-links {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media (max-width: 640px) {
  .sap-author-box-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* v2.1: keep the top/single-post byline avatar round, but keep the bottom author-box avatar square. */
.sap-global-avatar {
  display: inline-block !important;
  vertical-align: middle !important;
  margin-right: 10px !important;
}

.single-post .entry-meta .sap-global-avatar,
.single-post .post-meta .sap-global-avatar,
.single-post .byline .sap-global-avatar,
.single-post .author.vcard .sap-global-avatar,
.single-post .posted-by .sap-global-avatar,
.single-post .post-author-meta .sap-global-avatar,
.single-post .author-meta .sap-global-avatar,
.single-post .entry-header .sap-global-avatar,
.wp-block-post-author__avatar .sap-global-avatar,
.post-author .sap-global-avatar,
.single-post .entry-meta img.avatar,
.single-post .post-meta img.avatar,
.single-post .byline img.avatar,
.single-post .author.vcard img.avatar,
.single-post .posted-by img.avatar,
.single-post .post-author-meta img.avatar,
.single-post .author-meta img.avatar,
.single-post .entry-header img.avatar,
.wp-block-post-author__avatar img.avatar,
.post-author img.avatar {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  border-radius: 9999px !important;
  clip-path: circle(50% at 50% 50%) !important;
  object-fit: cover !important;
  object-position: center center !important;
  margin-right: 10px !important;
}

.sap-author-box-avatar .sap-avatar-frame,
.sap-avatar-frame.sap-avatar-author-box,
.author-bio .sap-global-avatar,
.author-box .sap-global-avatar,
.saboxplugin-wrap .sap-global-avatar {
  width: 140px !important;
  height: 140px !important;
  min-width: 140px !important;
  min-height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  border-radius: 0 !important;
  clip-path: none !important;
}

.sap-author-box-avatar img.avatar,
.author-bio img.avatar,
.author-box img.avatar,
.saboxplugin-wrap img.avatar {
  width: 140px !important;
  height: 140px !important;
  min-width: 140px !important;
  min-height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  border-radius: 0 !important;
  clip-path: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}
