/* 專業團隊ページ専用スタイル */
.page-banner-image {
  object-position: top;
}

/* メインセクション */
.main-team {
  padding: 80px 0;
  background: #f8f9fa;
}

.main-team .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  /* gap: 40px; */
  margin-bottom: 40px;
}

.team-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.5s ease;
  opacity: 1;
  transform: translateY(0px);
  display: grid;
  /* 横3列 */
  grid-template-columns: 1fr 1fr 1fr;
  /* 縦4行 */
  grid-template-rows: 1fr 1fr 1fr 1fr;
  grid-template-areas:
    "A B B"
    "A C C"
    "A C C"
    "A C C";
  gap: 5px;
  height: 80vh;
  max-height: 500px;
}

.team-card:nth-child(2) {
  grid-template-areas:
    "B B A"
    "C C A"
    "C C A"
    "C C A";
}

.team-card.off {
  transform: translateY(30px);
  opacity: 0;
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.team-card-image {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: top;
  grid-area: A;
}

.content-name {
  grid-area: B;
  padding: 20px;
  padding-top: 15px;
  margin-bottom: -1.5rem;
}

.team-card:nth-child(2) .content-name {
  padding-right: 3rem;
}

.team-card-content {
  padding: 10px;
  overflow: auto;
  grid-area: C;
  border-top: solid 1px #7a7a7a;
  margin: 0 20px;
  margin-bottom: 10px;
}


.team-card h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e3c72;
  margin-bottom: 8px;
}

.team-card:nth-child(2) h3 {
  text-align: right;
}

.team-card .position {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 8px;
}

.team-card:nth-child(2) .position {
  text-align: right;
}

.team-card .english-name {
  font-size: 1rem;
  color: #888;
  font-style: italic;
  margin-bottom: 20px;
}

.team-card:nth-child(2) .english-name {
  text-align: right;
}

.team-card .section {
  margin-bottom: 20px;
}

.team-card .section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3c72;
  margin-bottom: 8px;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 4px;
}

.team-card .section p,
.team-card .section ul {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
}

.team-card .section ul {
  padding-left: 20px;
  margin: 0;
}

.team-card .section li {
  margin-bottom: 4px;
}

/* その他4人のセクション */
.other-team {
  padding: 60px 0 80px;
  background: white;
}

.other-team h2 {
  text-align: center;
  font-size: 2rem;
  color: #1e3c72;
  margin-bottom: 50px;
}

.other-team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.team-member {
  text-align: center;
  cursor: pointer;
  transition: all 0.5s ease;
  padding: 0 5px;
  padding-bottom: 10px;
  border-radius: 10px;
  overflow: hidden;
}

.team-member:hover {
  background: rgba(235, 235, 235, 0.7);
}

.team-member.off {
  opacity: 0;
  transform: translateY(20px);
}

.team-member:hover {
  transform: translateY(-5px);
}

.team-member-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  pointer-events: none;
}

.team-member:hover .team-member-image {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.team-member h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e3c72;
  margin-bottom: 5px;
  pointer-events: none;
}

.team-member .position {
  font-size: 0.95rem;
  color: #666;
  pointer-events: none;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: white;
  margin: 6vh auto;
  padding: 0;
  border-radius: 16px;
  width: 90vw;
  max-width: 1100px;
  height: 88vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 0 30px;
  height: 11%;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  display: block;
  width: 100%;
  height: 88%;
  padding: 10px 30px;
}

.modal-body img {
  height: 95%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  float: left;
  grid-area: A;
}

#modalDetails {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 1fr 4fr;
  grid-template-areas:
    "A B"
    "A C";
  gap: 0rem 2rem;
  height: 100%;
  overflow: hidden;
}

.member-name {
  grid-area: B;
}

.member-name h4 {
  font-size: 1.5rem;
  display: inline-block;
}

.member-name .position {
  display: inline-block;
  font-size: 1.1rem;
  color: #4b4b4b;
  margin-left: 5px;
  font-style: italic;
}

.member-name .english-name {
  display: block;
  font-size: 1rem;
  color: #7a7a7a;
  font-weight: bold;
  margin-bottom: 1.2rem;
}

.member-details {
  padding-right: 3rem;
  overflow-y: auto;
  grid-area: C;
}

.member-details .section {
  margin-bottom: 1rem;
}

.member-details .section h5 {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 5px;
  border-bottom: solid 2px #7a7a7a;
}

.member-details .section ul li {
  font-size: 1rem;
  line-height: 2.2rem;
}

.member-details .section ul li::before {
  content: '・';
}

.close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

.close:hover {
  color: #333;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .team-hero h1 {
    font-size: 2rem;
  }

  .team-hero p {
    font-size: 1rem;
  }

  .main-team-grid {
    gap: 30px;
    width: 80vw;
    max-width: 600px;
    margin: 0 auto;
  }

  .other-team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .team-card {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
      "A B"
      "C C";
    height: min(800px, 130vw);
    max-height: unset;
    padding-bottom: 10px;
  }

  .team-card:nth-child(2) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
      "B A"
      "C C";
  }

  .team-card-image {
    height: auto;
    max-height: 60vh;
    max-width: unset;
    width: 100%;
    object-position: left;
  }

  .content-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .team-card:nth-child(2) .content-name {
    padding-right: 0;
  }

  .team-card-content {
    padding-left: 0;
  }

  .team-card .section ul {
    padding-left: 10px;
  }

  .team-card .section li {
    line-height: 2rem;
  }

  .team-card h3 {
    font-size: 1.5rem;
  }

  .team-card:nth-child(2) h3,
  .team-card:nth-child(2) .position,
  .team-card:nth-child(2) .english-name {
    text-align: left;
  }

  #modalDetails {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "A B"
      "C C";
    overflow: auto;
    gap: 1rem;
  }

  .member-details {
    overflow-y: unset;
    height: fit-content;
  }

  .member-name {
    grid-area: B;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .member-name .position {
    margin-left: 0;
  }
}

@media (max-width: 480px) {

  .team-card {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 150vh;
  }

  .team-card-image {
    height: auto;
    max-height: unset;
    max-width: unset;
    width: unset;
  }

  .team-card h3,
  .team-card .position,
  .team-card .english-name {
    text-align: center;
  }

  .team-card:nth-child(2) h3,
  .team-card:nth-child(2) .position,
  .team-card:nth-child(2) .english-name {
    text-align: center;
  }

  .other-team-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 20px auto;
    width: 95%;
  }

  .modal-body img {
    width: 100%;
    float: none;
    margin-right: 0;
    margin-bottom: 20px;
  }
}