/* ============================================================
   events.css — shared styles for all pages in /events/
   ============================================================ */


/* ------------------------------------------------------------
   Events table column widths
   (life_events, profiles, contact)
   ------------------------------------------------------------ */
#tasks-table.events-table th.events-col-who,
#tasks-table.events-table td.events-col-who,
#tasks-table.events-table th.events-col-shared,
#tasks-table.events-table td.events-col-shared,
#tasks-table.events-table th.events-col-owner,
#tasks-table.events-table td.events-col-owner {
  width: 5em;
  max-width: 5em;
  box-sizing: border-box;
}

/* Profiles events table: row tint by type (Type column hidden on profiles only) */
#tasks-table.profiles-events-table tbody tr.profiles-events-row-life {
  background-color: #e3f2fd;
}
#tasks-table.profiles-events-table tbody tr.profiles-events-row-default {
  background-color: #fff;
}
#tasks-table.profiles-events-table.table-hover tbody tr.profiles-events-row-life:hover {
  background-color: #d4eafc;
}
#tasks-table.profiles-events-table.table-hover tbody tr.profiles-events-row-default:hover {
  background-color: #f8f9fa;
}

/* Profiles: Who column = wrapping avatar row (Shared / Owner hidden on profiles only) */
#tasks-table.profiles-events-table th.events-col-who,
#tasks-table.profiles-events-table td.events-col-who.profiles-events-who-cell {
  width: auto;
  max-width: none;
  min-width: 6rem;
  white-space: normal;
  vertical-align: middle;
}
#tasks-table.profiles-events-table .profiles-events-who-avatars {
  gap: 0.15rem 0;
  max-width: 100%;
}


/* ------------------------------------------------------------
   Profile page header
   (profiles, contact)
   ------------------------------------------------------------ */
.profile-page-header .profile-avatar-wrap {
  flex-shrink: 0;
}

.profile-page-header .profile-avatar-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
  background: #e9ecef;
}

.profile-page-header #profile-photo-edit-btn {
  bottom: -2px;
  right: -2px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  line-height: 1.2;
}

.profile-page-header .profile-name-row {
  gap: 0.35rem;
}

.profile-page-header #profile-name-edit-btn {
  color: #6c757d;
  line-height: 1;
  vertical-align: middle;
}

.profile-page-header #profile-name-edit-btn:hover,
.profile-page-header #profile-name-edit-btn:focus {
  color: #007bff;
}

/* Contact record page header (profiles.html) */
.contact-page-header .contact-avatar-wrap {
  flex-shrink: 0;
}

.contact-page-header .contact-avatar-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
  background: #e9ecef;
}

.contact-page-header #contact-photo-edit-btn {
  bottom: -2px;
  right: -2px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  line-height: 1.2;
}

.contact-page-header .contact-name-row {
  gap: 0.35rem;
}

.contact-page-header #contact-name-edit-btn {
  color: #6c757d;
  line-height: 1;
  vertical-align: middle;
}

.contact-page-header #contact-name-edit-btn:hover,
.contact-page-header #contact-name-edit-btn:focus {
  color: #007bff;
}

/* profiles.html — dense vertical layout (font sizes unchanged) */
main.contact-page-compact .contact-compact-line {
  margin-bottom: 0.1rem;
  line-height: 1.25;
}

main.contact-page-compact .contact-section-tight {
  padding-top: 0.35rem;
  margin-top: 0.35rem;
  scroll-margin-top: 0.5rem;
}

main.contact-page-compact #contact-section-notes {
  scroll-margin-top: 0.5rem;
}

main.contact-page-compact .contact-section-tight .alert {
  margin-bottom: 0.35rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

main.contact-page-compact #work-section-content p,
main.contact-page-compact #education-section-content p,
main.contact-page-compact #family-section-content p,
main.contact-page-compact #interests-section-content p {
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

main.contact-page-compact #work-section-content .small.mb-1,
main.contact-page-compact #education-section-content .small.mb-1,
main.contact-page-compact #family-section-content .small.mb-1,
main.contact-page-compact #interests-section-content .small.mb-1 {
  margin-bottom: 0.1rem !important;
  line-height: 1.25;
}

main.contact-page-compact #work-section-content h6 {
  margin-bottom: 0.2rem !important;
  margin-top: 0.35rem !important;
}

main.contact-page-compact #work-section-content h6:first-child {
  margin-top: 0 !important;
}

main.contact-page-compact #contact-section-pills .contact-section-btn {
  margin-bottom: 0.15rem;
}

main.contact-page-compact #my-notes-section-content p {
  margin-bottom: 0.25rem;
}


/* ------------------------------------------------------------
   Friends list
   ------------------------------------------------------------ */
#af-notes::placeholder {
  color: #868e96;
  opacity: 1;
}

#friends-tbody tr.friends-table-row {
  cursor: pointer;
}

#friends-tbody tr.friends-table-row button {
  cursor: pointer;
}


/* ------------------------------------------------------------
   Groups list
   ------------------------------------------------------------ */
.groups-col-actions {
  width: 220px;
}

.groups-col-admins {
  min-width: 200px;
  max-width: 360px;
}

img.groups-list-admin-avatar {
  width: 32px;
  height: 32px;
  object-fit: cover;
  vertical-align: middle;
}

#groups-tbody td.groups-col-admins-cell {
  vertical-align: middle;
}

#groups-tbody .groups-list-admin-chip {
  max-width: 100%;
}

#groups-tbody .groups-list-admin-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.groups-col-visibility {
  width: 110px;
}

#groups-tbody tr {
  cursor: pointer;
}

#groups-tbody td.groups-col-handle-cell,
#groups-tbody td.groups-col-visibility-cell {
  cursor: default;
}

#groups-tbody a.groups-list-group-link {
  cursor: pointer;
  font-weight: 500;
}

#groups-tbody a.groups-list-group-link:hover {
  text-decoration: underline;
}

#groups-tbody a.groups-list-admin-profile-link {
  color: inherit;
  text-decoration: none;
}

#groups-tbody a.groups-list-admin-profile-link:hover .groups-list-admin-name {
  text-decoration: underline;
}

#groups-tbody a.groups-list-admin-profile-link.text-primary {
  color: #007bff !important;
}

#cg-group-name[readonly] {
  background-color: #f8f9fa;
}

/* Section anchors: pills scroll here without hiding under sticky UI */
.profile-page-section {
  scroll-margin-top: 1rem;
}

#profile-section-notes,
#contact-section-notes {
  scroll-margin-top: 1rem;
}

/* profiles.html — reduce vertical gaps (main content only) */
main.profiles-page-tight .profile-page-section {
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  scroll-margin-top: 0.5rem;
}

main.profiles-page-tight #profile-section-notes {
  scroll-margin-top: 0.5rem;
}

main.profiles-page-tight .content {
  padding-top: 0.5rem;
}

main.profiles-page-tight .profile-page-header .text-muted.small {
  line-height: 1.35;
}

/* Friends / contact list — thumbnails from `contact_photos` bucket */
img.friends-list-contact-photo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  display: block;
  background: #e9ecef;
}

a.friends-name-link:hover .text-primary {
  text-decoration: underline !important;
}

/* profiles.html / contact_library.html — mutual group pill nav (member vs blind member) */
#contact-my-groups-pills a.contact-my-group-pill,
#profile-mutual-groups-pills a.contact-my-group-pill,
#friends-tbody a.contact-my-group-pill {
  border-radius: 2rem;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  line-height: 1.25;
  display: inline-block;
  text-decoration: none !important;
  border: 1px solid transparent;
}

#contact-my-groups-pills a.contact-my-group-pill--member {
  background: #e9ecef;
  color: #212529;
  border-color: #ced4da;
}

#contact-my-groups-pills a.contact-my-group-pill--member:hover,
#contact-my-groups-pills a.contact-my-group-pill--member:focus {
  background: #dee2e6;
  color: #121416;
}

#contact-my-groups-pills a.contact-my-group-pill--blind {
  background: #495057;
  color: #f8f9fa;
  border-color: #343a40;
}

#contact-my-groups-pills a.contact-my-group-pill--blind:hover,
#contact-my-groups-pills a.contact-my-group-pill--blind:focus {
  background: #343a40;
  color: #fff;
}

/* profiles.html + contact_library.html — blue pill when member/admin; light grey when blind member */
#profile-mutual-groups-pills a.contact-my-group-pill--member,
#friends-tbody a.contact-my-group-pill--member {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

#profile-mutual-groups-pills a.contact-my-group-pill--member:hover,
#profile-mutual-groups-pills a.contact-my-group-pill--member:focus,
#friends-tbody a.contact-my-group-pill--member:hover,
#friends-tbody a.contact-my-group-pill--member:focus {
  background: #0b5ed7;
  color: #fff;
  border-color: #0a58ca;
}

#profile-mutual-groups-pills a.contact-my-group-pill--blind,
#friends-tbody a.contact-my-group-pill--blind {
  background: #e9ecef;
  color: #6c757d;
  border-color: #dee2e6;
}

#profile-mutual-groups-pills a.contact-my-group-pill--blind:hover,
#profile-mutual-groups-pills a.contact-my-group-pill--blind:focus,
#friends-tbody a.contact-my-group-pill--blind:hover,
#friends-tbody a.contact-my-group-pill--blind:focus {
  background: #dee2e6;
  color: #495057;
  border-color: #ced4da;
}

/* life_events.html — row 1: pills; row 2: Event Date + Type + Who + Clear + Add */
.life-events-toolbar .life-events-who-filter {
  min-width: 0;
  flex: 1 1 10rem;
  max-width: 24rem;
}

.life-events-toolbar .life-events-who-input {
  min-width: 8rem;
  flex: 1 1 auto;
}
