/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
member modal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

.member-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: 24px;
  margin: 0;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.member-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.member-modal__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
}

.member-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 980px);
  max-height: min(920px, calc(100dvh - 48px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 40px 36px 36px;
  background: #eaeaea;
  border-radius: 29px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
  box-sizing: border-box;
}

.member-modal__sr-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.member-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #555;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.member-modal__panel:not([hidden]) {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow: visible;
}

.member-modal__card {
  background: #fff;
  border-radius: 20px;
  overflow: visible;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

/* Upper: left text / right photo */
.member-modal__card--profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  grid-template-areas: "info photo";
  align-items: stretch;
}

.member-modal__info {
  grid-area: info;
  padding: 36px 32px 36px 40px;
  box-sizing: border-box;
}

.member-modal__role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: #777;
}

.member-modal__role::before,
.member-modal__career-title::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: url("../img/st-arrow.svg") no-repeat center / contain;
}

.member-modal__names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 16px;
  margin-top: 12px;
}

.member-modal__name {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  font-weight: 700;
  color: #222;
}

.member-modal__name-en {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: #999;
  letter-spacing: 0.04em;
}

.member-modal__text {
  margin-top: 20px;
  font-size: 14px;
  line-height: 2;
  font-weight: 600;
  color: #555;
}

.member-modal__text p {
  margin: 0;
}

.member-modal__photo {
  grid-area: photo;
  margin: 0;
  min-height: 280px;
  background: #cfcfcf;
  overflow: hidden;
  border-radius: 0 20px 20px 0;
}

.member-modal__photo.is-placeholder {
  background: #cfcfcf;
}

.member-modal__photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lower: career */
.member-modal__card--career {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 28px 36px;
  box-sizing: border-box;
}

.member-modal__career-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  color: #222;
}

.member-modal__career-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-modal__career-list li {
  position: relative;
  padding-left: 1em;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 600;
  color: #555;
}

.member-modal__career-list li::before {
  content: "・";
  position: absolute;
  left: 0;
  top: 0;
}

body.is-member-modal-open {
  overflow: hidden;
}

@media screen and (max-width: 768px) {
  .member-modal {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: center;
  }

  .member-modal__dialog {
    width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 44px 14px 16px;
    border-radius: 18px;
  }

  .member-modal__close {
    top: 6px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .member-modal__panel:not([hidden]) {
    gap: 14px;
  }

  /* Upper: photo on top, intro below */
  .member-modal__card--profile {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-areas: none;
  }

  .member-modal__photo {
    order: 0;
    grid-area: auto;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    max-height: min(320px, 42vh);
    border-radius: 20px 20px 0 0;
  }

  .member-modal__photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .member-modal__info {
    order: 1;
    grid-area: auto;
    padding: 20px 16px 22px;
  }

  .member-modal__names {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 10px;
  }

  .member-modal__name {
    font-size: 22px;
  }

  .member-modal__name-en {
    font-size: 13px;
  }

  .member-modal__text {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.9;
  }

  /* Lower: force single column */
  .member-modal__card--career {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 12px;
    padding: 18px 16px 20px;
  }

  .member-modal__career-title {
    font-size: 16px;
  }

  .member-modal__career-list {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 8px;
  }

  .member-modal__career-list li {
    font-size: 13px;
    line-height: 1.7;
  }
}
