/* Board Members module (mod_eventmanager_board) and the public profile page.
   Self-contained: no Bootstrap/UIkit/icon font needed; every colour is explicit. Defaults match the
   JL Revenue "member" style 3 (slate card, white text, outlined icon buttons). */

.em-board {
  --em-board-cols: 3;
  --em-board-per-row: var(--em-board-cols);
  --em-board-gap: 25px;
  --em-board-card: #2c3e50;
  --em-board-text: #ffffff;
  --em-board-icon: #4fc1e9;
  --em-board-photo-bg: #1f2d3a;
}

.em-board .em-board-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--em-board-gap);
}

.em-board .em-board-card {
  display: flex;
  flex: 0 1 calc((100% - (var(--em-board-per-row) - 1) * var(--em-board-gap)) / var(--em-board-per-row));
  /* Wraps to fewer per row in narrow positions (e.g. a sidebar) instead of squashing. */
  min-width: min(100%, 260px);
  overflow: hidden;
  background: var(--em-board-card);
  color: var(--em-board-text);
  text-align: center;
  transition: box-shadow .3s ease, transform .3s ease;
}

.em-board .em-board-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
  transform: translateY(-3px);
}

/* Photo beside the details (default) or above them */
.em-board-side .em-board-card {
  flex-direction: row;
}

.em-board-stacked .em-board-card {
  flex-direction: column;
}

.em-board .em-board-photo {
  position: relative;
  display: block;
  text-decoration: none;
  flex: 0 0 45%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--em-board-photo-bg);
}

.em-board-stacked .em-board-photo {
  flex-basis: auto;
  aspect-ratio: 1 / 1;
}

.em-board .em-board-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .5s ease;
}

.em-board .em-board-card:hover .em-board-photo img {
  transform: scale(1.06);
}

.em-board .em-board-initials,
.em-profile .em-profile-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: .05em;
  background: var(--em-board-photo-bg, #1f2d3a);
}

.em-board .em-board-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 20px 15px;
}

.em-board .em-board-name {
  margin: 0;
  color: var(--em-board-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.em-board .em-board-name a {
  color: var(--em-board-text);
  text-decoration: none;
}

.em-board .em-board-name a:hover,
.em-board .em-board-name a:focus {
  color: var(--em-board-icon);
}

.em-board .em-board-role {
  margin: 4px 0 0;
  color: var(--em-board-text);
  font-size: 14px;
  opacity: .6;
}

/* Contact icon buttons (shared with the profile page) */
.em-contact-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.em-contact-icons .em-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--em-board-icon, #4fc1e9);
  background: transparent;
  color: var(--em-board-text, #fff);
  text-decoration: none;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.em-contact-icons .em-contact-icon svg {
  width: 17px;
  height: 17px;
}

.em-contact-icons .em-contact-icon:hover,
.em-contact-icons .em-contact-icon:focus {
  background: var(--em-board-icon, #4fc1e9);
  color: #fff;
}

.em-contact-icons .em-contact-linkedin:hover,
.em-contact-icons .em-contact-linkedin:focus {
  border-color: #007bb6;
  background: #007bb6;
}

.em-board .em-board-empty {
  margin: 0;
  text-align: center;
}

.em-board .em-board-empty span {
  display: inline-block;
  padding: 14px 20px;
  border-radius: 4px;
  background: #fff;
  color: #333;
}

@media (max-width: 959px) {
  .em-board:not(.em-board-cols-1) {
    --em-board-per-row: 2;
  }
}

@media (max-width: 639px) {
  .em-board,
  .em-board:not(.em-board-cols-1) {
    --em-board-per-row: 1;
  }
}

/* ---------------------------------------------------------------- Profile page */

.em-profile {
  --em-board-icon: #4fc1e9;
  --em-board-text: #2c3e50;
  --em-board-photo-bg: #2c3e50;
  max-width: 1000px;
  margin: 0 auto;
  color: #333;
}

.em-profile .em-profile-back {
  margin: 0 0 20px;
}

.em-profile .em-profile-back a {
  color: #2c3e50;
  font-weight: 600;
  text-decoration: none;
}

.em-profile .em-profile-card {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding: 30px;
  border: 1px solid rgba(0, 0, 0, .1);
  background: #fff;
  color: #333;
}

.em-profile .em-profile-photo {
  flex: 0 0 280px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #2c3e50;
}

.em-profile .em-profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.em-profile .em-profile-body {
  flex: 1;
  min-width: 0;
}

.em-profile .em-profile-name {
  margin: 0;
  color: #1a1a1a;
  font-size: 2rem;
  line-height: 1.2;
  text-transform: none;
}

.em-profile .em-profile-role {
  margin: 6px 0 0;
  color: #4a6378;
  font-size: 1.15rem;
  font-weight: 600;
}

.em-profile .em-contact-icons {
  justify-content: flex-start;
}

.em-profile .em-contact-icons .em-contact-icon {
  color: #2c3e50;
}

.em-profile .em-contact-icons .em-contact-icon:hover,
.em-profile .em-contact-icons .em-contact-icon:focus {
  color: #fff;
}

.em-profile .em-profile-bio {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, .1);
  color: #333;
  line-height: 1.7;
}

.em-profile .em-profile-nobio {
  color: #777;
  font-style: italic;
}

@media (max-width: 767px) {
  .em-profile .em-profile-card {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
  }

  .em-profile .em-profile-photo {
    flex-basis: auto;
    width: 220px;
  }

  .em-profile .em-contact-icons {
    justify-content: center;
  }

  .em-profile .em-profile-bio {
    text-align: left;
  }
}
