/* ======================================================
   Project フィルター：共通（PC基準）
====================================================== */

/* サブカテゴリーボタン（3列） */
.prof-filter-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 800px;
  margin: 0 auto 20px;
}

/* ボタン共通 */
.prof-filter-btn {
  display: block;
  background: #6ab5bf;
  color: #fff;
  padding: 10px 18px;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* hover */
.prof-filter-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* 通常ボタン hover */
.prof-filter-btn:not(.all):hover {
  background: #fff;
  color: #6ab5bf;
}

/* active */
.prof-filter-btn.active {
  opacity: 0.7;
}

/* Project のすべて（PC） */
.prof-filter-buttons-all {
  max-width: 800px;
  margin: 0 auto 35px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.prof-filter-btn.all {
  grid-column: 2 / 3;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  padding: 10px 18px;
  background: #fff;
  color: #6ab5bf;
  border: 1px solid #6ab5bf;
  box-sizing: border-box;
}

.prof-filter-btn.all:hover {
  background: #6ab5bf;
  color: #fff;
}

/* ======================================================
   Project 一覧カード（PC）
====================================================== */

.prof-filter-cards {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.prof-item {
  border-top: 1.5px solid #6ab5bf;
  padding-top: 20px;
}

.prof-subcat {
  display: inline-block;
  width: 256px;
  background: #6ab5bf;
  color: #fff;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

.prof-card-row {
  display: flex;
  gap: 25px;
  padding-bottom: 35px;
}

.prof-left img {
  width: 256px;
  height: 200px;
  object-fit: cover;
  border: 1px solid #ddd;
}

.prof-right {
  flex: 1;
}

.prof-title {
  font-size: 20px !important;
  font-weight: 700;
  margin: 0;
  text-align: left !important;
}

.prof-line {
  width: 50px;
  height: 3px;
  background: #000;
  margin: 12px 0 15px;
}

.prof-excerpt {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.prof-external {
  text-align: right;
}

.prof-external a {
  color: #000;
  font-weight: 600;
  text-decoration: underline;
}

.prof-empty-gap {
  height: 3em;
}

/* 一覧背景 */
#prof-filter-result {
  background: rgba(255, 255, 255, 0.8);
  padding: 50px;
}

/* ======================================================
   Project：サブカテゴリー（アコーディオン共通）
====================================================== */

.prof-subcat-accordion {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative; /* ★ absolute配置の基準 */
}

.prof-subcat-toggle {
  display: none; /* PCでは非表示 */
}

/* ======================================================
   ▼ スマホ（〜768px）
====================================================== */
@media (max-width: 768px) {

  /* -------- トグル -------- */
  .prof-subcat-toggle {
    display: flex;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 12px;
    padding: 12px 16px;
    border: 1px solid #6ab5bf;
    background: #fff;
    color: #6ab5bf;
    font-size: 15px;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  /* -------- アコーディオン本体（下に重ねて開く） -------- */
  .prof-subcat-list {
  position: relative;   /* ← static でもOK */
  width: 100%;
  max-width: 360px;
  margin: 0 auto 20px;

  max-height: 420px;    /* ← vhは使わない */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background: #fff;
}

  /* -------- フィルターボタン -------- */
  .prof-filter-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
  }

  .prof-filter-btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 12px 16px;
    font-size: 15px;
    touch-action: manipulation;
  }

  /* Project のすべて（SP） */
  .prof-filter-buttons-all {
    width: 100%;
    max-width: 360px;
    margin: 15px auto 0;
    display: block;
  }

  .prof-filter-btn.all {
    width: 100%;
    max-width: none;
    margin: 0 auto;
  }

  /* -------- カード -------- */
  .prof-card-row {
    flex-direction: column;
    gap: 5px;
    padding-bottom: 10px;
  }

  .prof-subcat {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }

  .prof-left img {
    width: 100%;
    height: auto;
  }

  .prof-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .prof-excerpt {
    font-size: 15px;
    line-height: 1.7;
  }

  .prof-external {
    text-align: right;
    margin-top: 10px;
  }

  #prof-filter-result {
    padding: 25px 15px;
  }

  .prof-filter-cards {
    gap: 20px;
  }
}

/* ======================================================
   PC：選択中カテゴリを反転表示
====================================================== */
@media (min-width: 769px) {

  .prof-filter-btn.active-filter:not(.all),
  .prof-filter-btn.active:not(.all) {
    background: #fff;
    color: #6ab5bf;
    border: 1px solid #6ab5bf;
    box-shadow: none;
    transform: none;
  }

}
