@charset "UTF-8";

/* ==== 汎用クラス ==== */
.d-iblock {
  display: inline-block;
}

.font-em {
  font-weight: 700;
}

/* ==== スポンサー全体 ==== */
.sponsor {
  margin-top: 100px;
  background-color: #fff;
  padding: 80px 0 120px;
}

.sponsor__inner {
  width: calc(100% - 40px);
  max-width: 1000px;
  margin: auto;
}

.sponsor-sec h2 {
  text-align: center;
}

.sponsor-sec p {
  margin-top: 20px;
  line-height: 2.5;
}

.sponsor-sec:first-of-type {
  padding: 0 100px;
}

.sponsor-sec:first-of-type h2 {
  margin-top: 20px;
}

.sponsor-sec:nth-of-type(2) {
  margin-top: 100px;
}

.sponsor-sec .icon {
  text-align: center;
}

.sponsor__wrap {
  margin-top: 40px;
}

/* ==== 画像・テキストの2列レイアウト ==== */
.sponsor__lists {
  display: grid;
  gap: 20px; /* 画像・テキスト間の余白 */
}

/* 大きいスポンサー用 */
.sponsor__lists.large-size {
  padding-bottom: 80px; /* ←PCでは広め */
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 常に2列維持 */
  border-bottom: 1px solid #aaa;
}

.sponsor__lists.large-size .sponsor__img img {
  height: 28vw;
  max-height: 300px;
}

/* 小さいスポンサー用 */
.sponsor__lists.small-size {
  margin-top: 80px;
  position: relative;
}

.sponsor__list {
  background: #fff;
  padding: 10px;
  box-sizing: border-box;
}

.sponsor__list a {
  display: block;
  height: 100%;
  transition: all 0.3s;
}

.sponsor__list a:hover {
  opacity: 0.7;
}

.sponsor__img {
  width: 100%;
}

.sponsor__img img {
  width: 100%;
  height: auto;
  object-fit: contain; 
}

/* ==== 企業名テキスト ==== */
.sponsor-name {
  text-align: left;         /* 左詰め */
  white-space: nowrap;      /* 改行させない */
  overflow: hidden;         /* はみ出した部分を隠す */
  text-overflow: ellipsis;  /* はみ出したら「…」にする */
  font-size: 24px;
  padding: 5px 0 0 0;       /* 上だけ少し余白 */
  line-height: 1.4;
  margin: 0;                /* デフォルトの<p>余白を削除 */
}

@media only screen and (min-width: 964px) {
  .sponsor__img img {
    max-width: 90%;     /* ← ここで画像を縮小 */
    max-height: 90%;
    object-fit: contain;
  }
}

/* ==== タブレット共通調整（列数は変えない） ==== */
@media only screen and (max-width: 963px) {
  .sponsor {
    margin-top: 40px;
    padding: 20px 0 40px;
  }

  .sponsor__inner {
    width: 95%; /* 余白を狭める */
  }

  .sponsor-sec:first-of-type {
    padding: 0;
  }

  .sponsor-sec:nth-of-type(2) {
    margin-top: 40px;
  }

  .sponsor-sec p {
    line-height: 2.2;
  }
}

/* ==== スマホ調整（幅767px以下でも2列のまま） ==== */
@media (max-width: 767px) {
  .sponsor__lists {
    gap: 5px; /* スマホはさらに余白狭める */
  }

  .sponsor__list {
    padding: 5px; /* スマホでは内側の余白も減らす */
  }

  .sponsor__inner {
    width: 98%; /* スマホではほぼ全幅 */
  }

  .sponsor-name {
    font-size: 13px; /* スマホは少し小さめ */
    padding: 2px 0 0 0; /* テキストの上の余白をさらに削る */
  }

  /* 区切り線との余白も狭める */
  .sponsor__lists.large-size {
    padding-bottom: 20px; /* ←スマホでは線の前の余白を狭める */
  }

  .sponsor__lists.small-size {
    margin-top: 20px; /* スマホでは上下余白も小さく */
  }
}
