/* =========================================================================
   Profile — my member record: photo, directory listing form, privacy, account.
   ========================================================================= */

.profile-card { padding: var(--s-5); }

/* ------------------------------------------------------------- banners */

.profile-banner {
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
}
.profile-banner-title {
  margin: 0 0 var(--s-2);
  font-size: 1rem;
  color: var(--navy);
}
.profile-banner-body {
  margin: 0;
  color: var(--ink-2);
  font-size: .9rem;
  line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  .profile-banner-title { color: var(--ink); }
}

.profile-banner-warn {
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
}
.profile-banner-warn .profile-banner-title { color: #a51f1f; }
@media (prefers-color-scheme: dark) {
  .profile-banner-warn .profile-banner-title { color: #ff9a9a; }
}

/* ---------------------------------------------------------- photo card */

.profile-photo-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
}

.profile-avatar { flex: 0 0 auto; }
.profile-avatar .avatar { box-shadow: var(--sh-1); }

.profile-photo-body { flex: 1 1 auto; min-width: 0; }
.profile-photo-body .card-sub { margin-bottom: var(--s-3); }

.profile-photo-actions { margin-bottom: var(--s-2); }
.profile-photo-actions .btn { flex: 0 0 auto; }

.profile-photo-status { margin: 0; min-height: 1.1em; }

@media (max-width: 420px) {
  .profile-photo-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-photo-actions { justify-content: center; }
}

/* ----------------------------------------------------------- edit form */

.profile-form { margin: 0; }
.profile-form .field:last-of-type { margin-bottom: var(--s-4); }
.profile-form .btn.block { margin-top: var(--s-2); }

.profile-bio-count { align-self: flex-end; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- privacy */

.profile-toggle {
  align-items: flex-start;
  cursor: pointer;
  gap: var(--s-3);
}

.profile-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-toggle-label { font-weight: 600; font-size: .95rem; }

.profile-toggle-hint {
  color: var(--muted);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* An accessible checkbox that reads as a switch. */
input.profile-switch {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 50px;
  min-width: 50px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  transition: background .16s ease, border-color .16s ease;
}
input.profile-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: var(--sh-1);
  transition: transform .16s ease;
}
input.profile-switch:checked {
  background: var(--navy);
  border-color: var(--navy);
}
input.profile-switch:checked::after { transform: translateX(20px); }

.profile-privacy-note { margin: var(--s-3) 0 0; }

/* ------------------------------------------------------------- account */

.profile-account {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--s-4);
}

.profile-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.profile-account-row:last-child { border-bottom: 0; }

.profile-account-label {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}

.profile-account-value {
  min-width: 0;
  font-size: .92rem;
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-account-actions .btn { flex: 1 1 140px; }

.profile-foot {
  margin: var(--s-4) 0 0;
  text-align: center;
  line-height: 1.5;
}

@media (min-width: 620px) {
  .profile-account-actions .btn { flex: 0 0 auto; min-width: 150px; }
}

