#first-section {
  padding-top: 176px;
}

.section-template h1::before,
.section-template h2::before {
  display: block;
  width: 42px;
  height: 4px;
  margin-bottom: 18px;
  background: var(--rhu-purple);
  content: "";
}

.section-template-blue h1::before,
.section-template-blue h2::before {
  background: var(--white);
}

#rhuAcmLogo {
  width: min(100%, 230px);
  max-height: none;
}

#acmLogo {
  width: min(100%, 260px);
}

#rhuPhotos {
  width: min(100%, 430px);
}

#social-media-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

#social-media-container a {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

#social-media-container a:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

#social-media-container img {
  width: 21px;
  height: 21px;
  margin: 0;
  object-fit: contain;
}

#board-members-container {
  grid-column: 1 / -1;
  width: 100%;
}

#board-members-container > h2 {
  text-align: left;
}

#semester-dropdown {
  margin: 0 0 44px;
}

#semester-dropdown > button {
  min-width: 190px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white) !important;
  color: var(--ink) !important;
  font-weight: 700;
  text-align: left;
}

#semester-dropdown > button:hover,
#semester-dropdown > button:focus {
  border-color: var(--acm-blue);
  box-shadow: none;
}

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.dropdown-menu li {
  cursor: pointer;
}

.board-members-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 46px 30px;
}

.board-members-grid > a {
  color: var(--ink);
  text-decoration: none;
}

.member {
  display: flex;
  width: 100%;
  max-width: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--acm-blue);
  background: var(--white);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease;
}

.member:hover,
.member:focus-visible {
  border-color: var(--acm-blue);
  transform: translateY(-3px);
}

.member:focus-visible {
  outline: 3px solid rgba(0, 155, 222, 0.25);
  outline-offset: 3px;
}

.member-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  object-fit: cover !important;
  object-position: center top;
}

.member-photo:hover {
  box-shadow: none;
}

.member-name {
  align-items: flex-start;
  color: var(--ink);
  font-size: 1rem !important;
  font-weight: 700;
  text-align: left;
}

.titles {
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

#bylaws-section {
  grid-column: 1 / -1;
  max-width: 800px;
}

#paragraph-bylaws {
  max-width: 720px;
  margin-bottom: 30px;
}

.member-profile-modal .modal-dialog {
  width: min(920px, calc(100% - 32px));
  max-width: 920px;
  margin-right: auto;
  margin-left: auto;
}

.member-profile-modal .modal-content {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid var(--rhu-purple);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(19, 31, 45, 0.24);
}

.member-profile-modal .member-modal-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 0;
  padding: 0;
}

.member-modal-photo-wrap {
  min-height: 460px;
  background: #e9f5fb;
}

.member-modal-photo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
}

.member-modal-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 58px 52px 48px;
}

.member-modal-role {
  margin: 0 0 12px;
  color: var(--acm-blue-dark, #006f9f);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-modal-details h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.08;
}

.member-modal-description {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;
}

.member-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.member-modal-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--acm-blue);
  border-radius: 3px;
  font-size: 0.94rem;
  font-weight: 750;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.member-modal-email {
  background: var(--acm-blue);
  color: var(--white);
}

.member-modal-email:hover,
.member-modal-email:focus-visible {
  border-color: var(--acm-blue-dark, #006f9f);
  background: var(--acm-blue-dark, #006f9f);
  color: var(--white);
}

.member-modal-linkedin {
  background: var(--white);
  color: var(--acm-blue-dark, #006f9f);
}

.member-modal-linkedin:hover,
.member-modal-linkedin:focus-visible {
  background: #e9f5fb;
  color: var(--acm-blue-dark, #006f9f);
}

.member-modal-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(19, 31, 45, 0.14);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
}

.member-modal-close:hover,
.member-modal-close:focus-visible {
  border-color: var(--acm-blue);
  color: var(--acm-blue-dark, #006f9f);
}

.member-modal-close svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.modal-backdrop.show {
  opacity: 0.58;
}

.member-modal-action[hidden],
.member-modal-description[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .member-profile-modal .modal-dialog {
    width: calc(100% - 20px);
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .member-profile-modal .modal-content {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .member-profile-modal .member-modal-layout {
    grid-template-columns: 1fr;
  }

  .member-modal-photo-wrap,
  .member-modal-photo-wrap img {
    min-height: 0;
    max-height: 250px;
    aspect-ratio: 4 / 3;
  }

  .member-modal-photo-wrap img {
    object-position: center top;
  }

  .member-modal-details {
    padding: 32px 24px 28px;
  }

  .member-modal-actions {
    flex-direction: column;
    margin-top: 26px;
  }

  .member-modal-action {
    width: 100%;
  }

  .member-modal-close {
    top: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member,
  .member-modal-action {
    transition: none;
  }
}

.close {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
}

@media (max-width: 820px) {
  #first-section {
    padding-top: 124px;
  }

  .board-members-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .board-members-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  #semester-dropdown,
  #semester-dropdown > button {
    width: 100%;
  }
}
