#graduation {
  margin: .5rem auto .5rem auto;
}

.graduation__title__block h3 {
  text-align: center;
  font-size: 1.8rem;
  margin: 1.5rem auto;
  line-height: 1.5;
  position: relative;
  width: 100%;
  max-width: 15rem;
}

.graduation__title__block h3::before {
  content: "";
  width: 35px;
  height: 35px;
  background-image: url(../graduation/img/icon_parts/cong_badge_icon_big.png);
  background-position: center;
  background-size: 90%;
  background-repeat: no-repeat;
  position: absolute;
  left: 0;
  top: 0;
}

.graduation__title__block h3::after {
  content: "";
  width: 35px;
  height: 35px;
  background-image: url(../graduation/img/icon_parts/cong_badge_icon_big.png);
  background-position: center;
  background-size: 90%;
  background-repeat: no-repeat;
  position: absolute;
  right: 0;
  top: 0;
}


/* ▼ 3列グリッド */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card-grid a {
  /*border: solid 5px #ff8ecb;*/
  border-radius: 0px;
  /*box-shadow: 4px 4px 4px #999;*/
}

/* ▼ カード本体（背景画像を直接指定） */
.card-item {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 90%; /* アスペクト比を固定 */
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
}

/* ▼ オーバーレイ（最初は透明 & 下に隠れている） */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6); /* ここでカード全体を黒透過で覆う */
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ▼ テキストブロック（下→上にスライド） */
.card-content {
  position: absolute;
  bottom: -40%; /* 最初はカード外の下に隠す */
  left: 0;
  width: 100%;
  max-width: 12rem;
  padding: 1rem;
  transition: transform 0.4s ease-out, bottom 0.4s ease-out;
}

/* ▼ ホバー時：黒背景を表示 */
.card-item:hover .card-overlay {
  opacity: 1;
}

/* ▼ ホバー時：テキストを上にスライドアップ */
.card-item:hover .card-content {
  bottom: 50px;
}

/* ▼ PCホバーに対応しつつ、スマホでもタップ反応 */
.card-item:focus .card-overlay,
.card-item:focus .card-content {
  opacity: 1;
  bottom: 0;
}

.card-content h3 {
  text-align: center;
}

.card-content p {
  text-align: center;
}

/*中学生の部のホバー*/
/* ▼ カード本体（背景画像を直接指定） */
.card-item__jr-hight {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 90%; /* アスペクト比を固定 */
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
}

/* ▼ オーバーレイ（最初は透明 & 下に隠れている） */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6); /* ここでカード全体を黒透過で覆う */
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ▼ テキストブロック（下→上にスライド） */
.card-content__jr-hight {
  position: absolute;
  bottom: -40%; /* 最初はカード外の下に隠す */
  left: 0;
  width: 100%;
  max-width: 12rem;
  padding: 1rem;
  transition: transform 0.4s ease-out, bottom 0.4s ease-out;
}

/* ▼ ホバー時：黒背景を表示 */
.card-item__jr-hight:hover .card-overlay {
  opacity: 1;
}

/* ▼ ホバー時：テキストを上にスライドアップ */
.card-item__jr-hight:hover .card-content__jr-hight {
  bottom: 20px;
}

/* ▼ PCホバーに対応しつつ、スマホでもタップ反応 */
.card-item__jr-hight:focus .card-overlay,
.card-item__jr-hight:focus .card-content__jr-hight {
  opacity: 1;
  bottom: 0;
}

.card-content__jr-hight h3 {
  text-align: center;
}

.card-content__jr-hight p {
  text-align: center;
}

a:hover {
  color: #fff;
}

.school__area__space{
  margin: 2rem auto;
  width: 100%;
  height: 2rem;
}

/*
a:hover {
  color: #0CF;
}
*/

.btn__link__line {
  border: solid 1px #fff;
  padding: .3rem;
  text-align: center;
  margin: 1rem auto 0;
}

  .graduation__student__img__pc{
    display: block;
  }

  .graduation__student__img__sp{
    display: none;
  }

section#graduation h2 {
  font-size: 22px;
  margin-bottom: 1%;
  color: #036;
  text-shadow: 3px 3px 3px #ccc;
}

section#graduation h3.motto {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 20px;
}

.graduation__box {
  margin: 1.5rem auto;
}

.graduation__box__text{
  font-size: 1rem;
  font-weight: normal;
  border-bottom: 1px dotted #999;
  margin-bottom: 2rem;
  padding: 0 0 1rem 0;
}

section#graduation h2 span {
  font-size: 14px;
  font-weight: normal;
  color: #69F;
}

/* 卒業生個別メッセージページ */
.graduation__contents__flex{
  display: flex;
  gap: 15px;
  margin: 0 auto 1rem;
}

.graduation__contents__flex img {
  width: 100%;
  max-width: 33%;
  border-radius: 15px;
  height: 100%;
}

.graduation__message__text h4 {
  font-size: 1.25rem;
  border-left: solid 13px #da5682;
  text-indent: .6rem;
  line-height: 1.5;
  padding: .2rem 0 0 0;
  margin: 0 auto .5rem;
}

.graduation__message__title {
  display: flex;
  margin: 0 auto 1rem;
}

.graduation__message__title h5 {
  font-size: 1.5rem;
  text-indent: 1.4rem;
  line-height: 1.5;
}

.graduation__message__title span {
  font-size: 1.1rem;
  line-height: 2;
  padding: 0;
  font-weight: bold;
  display: flex;
}

.passed__name__line-height{
  line-height: 1.2!important;
}

.graduation__message__title span::before {
  content: "";
  display: inline-block;
  width: 25px;
  height: 25px;
  background-image: url(../graduation/img/icon_parts/cong_badge_icon_big.png);
  background-position: center;
  background-size: contain;
  margin: .3rem .5rem;
}

.graduation__message__pearent__box {
  width: 100%;
  margin: 2rem auto;
}

.graduation__message__pearent__title h5 {
  border-left: solid 10px #da5682;
  text-indent: .8rem;
  font-size: 1.2rem;
  margin: 0 auto .5rem;
}

.graduation__message__pearent__title p {
  padding: 0 1.5rem;
  margin: 0 auto 2rem;
}

.next__message__btn {
  width: 100%;
  max-width: 220px;
  margin: 3rem auto;
}

.next__message__btn__twin {
  width: 100%;
  max-width: 360px;
  margin: 3rem auto;
}

.next__message__btn img {
  width: 12rem;
}

.btn__box__flex {
  display: flex;
  gap: 3rem;
}

.next__message__btn__twin.btn__box__flex img {
  width: 100%;
}

.message__lead__red__bold{
  color: red;
  font-weight: bold;
}
/* --------------------------------------------------
  タブレット（1024px以下）・スマホ（768px以下）で、
  ホバー表示コンテンツをカード中央に配置する調整
-------------------------------------------------- */

/* タブレット以下：2列 & 中央配置 */
@media (max-width: 1024px) {
  /* ▼ レスポンシブ（タブレット：2列） */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .card-content {
    bottom: 50%;
    transform: translateY(50%);
    text-align: center;
    width: 100%;
  }

  /* ホバー時（タップ時）に中央固定のまま表示 */
  .card-item:hover .card-content,
  .card-item:focus .card-content {
    bottom: 50%;
    transform: translateY(50%);
  }
}

/* スマホ：完全1列 & 中央配置 */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 3fr;
    gap: 16px;
  }

  /* 黒背景を常に表示 */
  .card-overlay {
    opacity: 1;
  }

  .card-content {
    max-width: 18rem;
    bottom: 20%;
    transform: translate(-50%,-50%);
    text-align: center;
    padding: 1rem;
    color: #fff;
    top: 50%;
    left:50%;
  }

  .card-item:hover .card-content,
  .card-item:focus .card-content {
    bottom: 20%;
    transform: translate(-50%,-50%);
    left: 50%;
    right: 50%;
  }

    .card-item:hover .card-overlay,
  .card-item:focus .card-overlay {
    opacity: 1;
  }

  .card-content h3 {
    font-size: 1.5rem;
    line-height: 2;
  }

  .card-content p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .btn__link__line {
    font-size: 1.3rem;
  }

  /*.graduation__message__text h4{
    font-size: 1.2rem;
  }*/

  .next__message__btn {
    width: 100%;
    max-width: 210px;
    margin: 0 auto;
  }

  .graduation__contents__flex{
    display: block;
  }

  .graduation__contents__flex img {
    width: 100%;
    max-width: 480px;
    border-radius: 15px;
    height: 100%;
    margin: 2rem auto;
  }

  .graduation__student__img__pc{
    display: none;
  }

  .graduation__student__img__sp{
    display: block;
  }


  .graduation__message__text h4{
    font-size: 1.1rem;
  }


}

/* ▼ スマホ：1列 */
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-content {
    bottom: -10%;
  }

  .graduation__contents__flex{
    display: block;
  }

  .graduation__contents__flex img {
    width: 100%;
    max-width: 480px;
    border-radius: 15px;
    height: 100%;
    margin: 2rem auto;
  }

  .graduation__student__img__pc{
    display: none;
  }

  .graduation__student__img__sp{
    display: block;
  }


  .graduation__message__text h4{
    font-size: 1.05rem;
  }

  .card-content {
    max-width: 18rem;
    bottom: 0%;
    transform: translate(-50%,-50%);
    text-align: center;
    padding: 1rem;
    color: #fff;
    top: 50%;
    left:50%;
  }

  .card-item:hover .card-content,
  .card-item:focus .card-content {
    bottom: 0%;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
  }

  .graduation__message__title h5 {
    font-size: 1.15rem;
    text-indent: 0;
    line-height: 2;
  }

  .graduation__message__text p {
    font-size: 1rem;
  }

  .graduation__message__pearent__title p {
    padding: 0;
    font-size: 1rem;
  }

  .graduation__message__title span::before {
    margin: .3rem .2rem;
  }

  .graduation__message__title span{
    font-size: 1rem;
    letter-spacing: -.05rem;
  }

}

