/**
 * Project - Post Card
 * 投稿カード・一覧（case / news / aio-lab / post 共通）
 * 使用: template-parts/case-card.php, news-card.php, aio-lab-card.php, post-card.php
 */

.p-caseHeadingWrapper {
  margin-bottom: 46px;
}

/* テーブル風：各 li に全面 border を付け、隣接する辺を nth-child で除去して 1px に見せる
 * ※ 親に border-top/left を持たせる方式は親が 100% 幅のため最終行が不完全な場合に上線が突き抜ける */
.p-caseList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  margin: 40px 0 0 0;
  padding: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  @media (max-width: 1024px) {
    grid-template-columns: repeat(2, 1fr);
  }
  @media (max-width: 767px) {
    grid-template-columns: 1fr;
  }
}

.p-caseList > li {
  border: 1px solid var(--color-border-black);
  min-width: 0;
}

/* 3列: 2列目以降の left・2行目以降の top を除去 */
@media (min-width: 1025px) {
  .p-caseList > li:not(:nth-child(3n + 1)) {
    border-left: none;
  }
  .p-caseList > li:nth-child(n + 4) {
    border-top: none;
  }
}

/* 2列: 2列目の left・2行目以降の top を除去 */
@media (min-width: 768px) and (max-width: 1024px) {
  .p-caseList > li:not(:nth-child(2n + 1)) {
    border-left: none;
  }
  .p-caseList > li:nth-child(n + 3) {
    border-top: none;
  }
}

/* 1列: 2件目以降の top を除去 */
@media (max-width: 767px) {
  .p-caseList > li:not(:first-child) {
    border-top: none;
  }
}

.p-caseCard {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: var(--color-bg-white);
  border: none;
  position: relative;
  cursor: pointer;
  overflow-wrap: anywhere;

  &.--hasYellowObject {
    &::before {
      content: "";
      display: inline-block;
      width: 20px;
      height: 20px;
      background-color: #ebb700;
      clip-path: polygon(0 0, 100% 0, 100% 100%);
      position: absolute;
      top: 0;
      right: 0;
    }
  }
}
.p-caseCardFigure {
  margin: 0;
  min-width: 0;

  img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
  }
}
.p-caseCardBody {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.p-caseCardTags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}
.p-caseCardTitle {
  margin: 0 0 0.5rem;
  min-height: 2.8em;
  min-width: 0;
  display: flex;
  align-items: center;
}
.p-caseCardTitle__inner {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.p-caseCardText {
  margin: 0;
  flex: 1;
  min-height: 0;
  font-size: 0.875rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(1.8em * 3); /* line-height × 行数でクランプを確実に */
  margin-bottom: 0.75rem;
}
.p-caseCardFooter {
  margin-top: auto;
}
.p-caseCardLink {
  font-weight: 700;
  line-height: 1;
  padding-block: 0.5rem;
  padding-right: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;

  /* 矢印アイコン */
  &::before {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("../../../images/icon_arrow_right_black.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    order: 1;
  }

  /* カード全体をリンク範囲にする stretched link */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
  }
}

/* member用 */
/* ==============================
  メンバー一覧カード
============================== */

.p-memberCard {
  height: 100%;
}

.p-memberCard__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background-color: var(--color-bg-white);
  transition: opacity 0.2s ease;
}

.p-memberCard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 0 0;
}

.p-memberCard__profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

.p-memberCard__link:hover {
  opacity: 0.8;
}

.p-memberCard__figure {
  margin: 0;
}

.p-memberCard__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: none;
  border-radius: 0;
}

.p-memberCard__body {
  padding: 12px 0 0;
}

.p-memberCard__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.p-memberCard__tag {
  color: #767676;
  font-size: 0.75rem;
  line-height: 1.5;
}

.p-memberCard__profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.p-memberCard__profileText {
  min-width: 0;
}

.p-memberCard__position {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  color: #6e5600;
}

.p-memberCard__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
}

.p-memberCard__title::before,
.p-memberCard__title::after {
  content: none;
  display: none;
}

.p-memberCard__nameEn {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.p-memberCard__arrow {
  flex-shrink: 0;
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  rotate: 45deg;
}

.p-memberArchiveList {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-memberArchiveList__item {
  min-width: 0;
  padding: 1rem 1.5rem;
  background: #fff;
  border-radius: 8px;
}
@media screen and (max-width: 1199px) {
  .p-memberArchiveList {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 767px) {
  .p-memberArchiveSection {
    padding-block: 80px 96px;
    padding-inline: 0;
  }
  .p-memberArchiveList {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .p-memberArchiveList__item {
    padding: 20px;
  }

  .p-memberCard__link {
    display: flex;
    flex-direction: row;
    align-items: start;
    gap: 18px;
  }

  .p-memberCard__figure {
    flex-shrink: 0;
    width: 36%;
    max-width: 140px;
    margin: 0;
  }

  .p-memberCard__figure img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .p-memberCard__body {
    flex: 1;
    min-width: 0;
    padding: 0;
  }

  .p-memberCard__tags {
    margin-bottom: 12px;
  }

  .p-memberCard__profile {
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding-top: 0;
  }

  .p-memberCard__profileText {
    min-width: 0;
  }

  .p-memberCard__title {
    display: block;
  }

  .p-memberCard__name {
    display: block;
  }

  .p-memberCard__nameEn {
    display: block;
    margin-top: 2px;
  }

  .p-memberCard__arrow {
    margin-left: auto;
  }
}
