/* ===================================
   TOP Instagram
=================================== */

/* 白枠全体 */
.instagram-box {
  box-sizing: border-box !important;
  width: calc(100vw - 100px) !important;
  max-width: none !important;

  /* 右寄せを維持したまま左へ広げる */
  margin-left: calc(100% - 100vw + 100px) !important;
  margin-right: 0 !important;

  padding: 110px 50px !important;
}

/* 縦見出し＋投稿部分 */
.instagram-layout {
  display: flex;
  align-items: flex-start;
  gap: 60px;
}

/* INSTAGRAM見出し */
.instagram-heading {
  flex-shrink: 0;
  margin: 0;
}

/* 2つのアカウント */
.instagram-content {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 50px;
  width: auto;
  min-width: 0;
}

/* アカウントごとの枠 */
.instagram-account {
  min-width: 0;
  padding: 25px 20px 22px;
  background: rgba(248, 251, 247, 0.95);
  border-top: 3px solid #95cf88;
  box-shadow: 0 8px 24px rgba(50, 80, 50, 0.08);
}

/* アカウント名 */
.instagram-account-name {
  position: relative;
  margin: 0 0 22px;
  padding-bottom: 13px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.instagram-account-name::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 32px;
  height: 1px;
  background: #95cf88;
  transform: translateX(-50%);
}

.instagram-account-name a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.instagram-account-name a:hover {
  color: #67a962;
}

/* 投稿一覧 */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

/* 画像・動画共通 */
.instagram-item {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 0;
  background: #eee;
  cursor: pointer;
}

.instagram-item img,
.instagram-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
}

.instagram-item:hover img,
.instagram-item:hover video {
  transform: scale(1.06);
  opacity: 0.82;
}

/* 動画の再生マーク */
.instagram-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 50px;
  height: 50px;
  padding-left: 4px;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Instagramリンクボタン */
.instagram-profile-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  width: fit-content;
  min-width: 190px;
  margin: 22px auto 0;
  padding: 12px 24px;
  color: #50774d;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  background: #fff;
  border: 1px #79b970;
  border-radius: 50px;
  transition:
    color 0.3s ease,
    background 0.3s ease;
}

.instagram-profile-button span {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.instagram-profile-button:hover {
  color: #fff;
  background: solid #95cf88;
}

.instagram-profile-button:hover span {
  transform: translate(3px, -3px);
}

/* ===================================
   拡大表示
=================================== */

.instagram-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 40px;
  background: rgba(0, 0, 0, 0.88);
}

.instagram-modal.is-open {
  display: flex;
}

.instagram-modal-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(900px, 100%);
  height: min(85vh, 900px);
}

.instagram-modal-image,
.instagram-modal-video {
  display: none;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  background: #000;
}

.instagram-modal-image.is-active,
.instagram-modal-video.is-active {
  display: block;
}

.instagram-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  z-index: 1;
  padding: 0;
  color: #fff;
  font-size: 48px;
  line-height: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ===================================
   タブレット
=================================== */

@media screen and (max-width: 1024px) {
  .instagram-box {
    width: calc(100vw - 40px) !important;
    margin-left: calc(100% - 100vw + 40px) !important;
    padding: 80px 30px !important;
  }

  .instagram-layout {
    display: block;
  }

  .instagram-heading {
    margin-bottom: 40px;
    text-align: center;
    writing-mode: horizontal-tb;
  }

  .instagram-content {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .instagram-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===================================
   スマートフォン
=================================== */

@media screen and (max-width: 600px) {
  .instagram-box {
    width: calc(100vw - 15px) !important;
    margin-left: calc(100% - 100vw + 15px) !important;
    padding: 50px 15px !important;
  }

  .instagram-heading {
    margin-bottom: 30px;
  }

  .instagram-content {
    gap: 40px;
  }

  .instagram-account {
    padding: 20px 12px;
  }

  .instagram-account-name {
    margin-bottom: 16px;
    font-size: 14px;
  }

  .instagram-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .instagram-play {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }

  .instagram-profile-button {
    min-width: 170px;
    padding: 11px 20px;
  }

  .instagram-modal {
    padding: 20px;
  }

  .instagram-modal-close {
    top: 12px;
    right: 15px;
    font-size: 42px;
  }
}
/* セクション全体 */
.home-blog {
  position: relative;
  isolation: isolate;
}

/* 白い面を右端まで表示 */
.home-blog::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 70px;
  right: 0;
  bottom: 70px;
  left: 100px;
  background: #fff;
}

/* 投稿内容を白背景より前へ出す */
.home-blog .instagram-box {
  position: relative !important;
  z-index: 1;
  width: auto !important;
  margin: 0 !important;
  padding: 130px 50px !important;
  background: transparent !important;
}

/* 前の疑似要素を停止 */
.instagram-box::after {
  display: none !important;
}

@media screen and (max-width: 600px) {
  .home-blog::after {
    top: 30px;
    right: 0;
    bottom: 30px;
    left: 15px;
  }

  .home-blog .instagram-box {
    padding: 60px 15px !important;
  }
}
/* ===================================
   Instagram内側の位置調整
=================================== */

.instagram-layout {
  position: relative;
  display: block;
}

/* 縦見出しを左側へ配置 */
.instagram-heading {
  position: absolute;
  top: 50%;
  left: -90px;
  margin: 0;
  translate: 0 -50%;
}

/* 写真部分を中央に配置 */
.instagram-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

/* アカウント部分 */
.instagram-account {
  box-sizing: border-box;
  width: 100%;
}

/* タブレット・スマホ */
@media screen and (max-width: 1024px) {
  .instagram-heading {
    position: static;
    margin-bottom: 40px;
    text-align: center;
    translate: none;
    writing-mode: horizontal-tb;
  }

  .instagram-content {
    grid-template-columns: 1fr;
    max-width: 700px;
  }
}

.instagram-profile-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  min-width: 210px;
  margin: 25px auto 0;
  padding: 13px 25px;
  color: #568052;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  background: #fff;
  border: 1px solid #95cf88;
  border-radius: 50px;
  transition: 0.3s ease;
}

.instagram-profile-button span {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.instagram-profile-button:hover {
  color: #fff;
  background: #79b970;
}

.instagram-profile-button:hover span {
  transform: translate(3px, -3px);
}

/* PC・タブレットは2アカウントを横並び */
@media screen and (min-width: 768px) {
  .instagram-content {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 40px !important;
    max-width: 1120px;
    margin: 0 auto;
  }
}

/* スマホだけ縦並び */
@media screen and (max-width: 767px) {
  .instagram-content {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
}

/* ===================================
   Instagram最終位置調整
=================================== */

/* 写真ブロック全体 */
.instagram-content {
  width: calc(100% + 80px) !important;
  max-width: 1220px !important;
  margin: 0 auto !important;
  transform: translateX(-30px);
}

/* INSTAGRAMを白枠の左上へ */
.instagram-layout {
  position: relative;
}

.instagram-heading {
  position: absolute !important;
  top: -70px !important;
  left: -190px !important;
  margin: 0 !important;
  translate: none !important;
}

/* アカウント全体の背景を解除 */
.instagram-account {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* アカウント名部分 */
.instagram-account-name {
  box-sizing: border-box;
  margin: 0 !important;
  padding: 22px 15px 18px !important;
  background: rgba(248, 251, 247, 0.96);
  border-top: 3px solid #95cf88;
}

/* 写真6枚の部分だけ薄緑の枠にする */
.instagram-grid {
  box-sizing: border-box;
  padding: 0 20px 22px;
  background: rgba(248, 251, 247, 0.96);
  box-shadow: 0 10px 25px rgba(50, 80, 50, 0.08);
}

/* ボタンを写真枠の外へ */
.instagram-profile-button {
  margin: 25px auto 0 !important;
}

/* タブレット・スマホ */
@media screen and (max-width: 1024px) {
  .instagram-content {
    width: 100% !important;
    max-width: 760px !important;
    transform: none;
  }

  .instagram-heading {
    position: static !important;
    margin-bottom: 35px !important;
    text-align: left;
    translate: none !important;
    writing-mode: horizontal-tb;
  }
}

/* 薄緑枠内のアカウント名を非表示 */
.instagram-account-name {
  display: none !important;
}

/* 写真部分を大きくして中央へ */
@media screen and (min-width: 768px) {
  .instagram-content {
    width: calc(100% + 80px) !important;
    max-width: 1200px !important;
    margin-right: 0 !important;
    margin-left: -90px !important;
    gap: 40px !important;
  }

  /* INSTAGRAMを白枠の左上へ */
   .instagram-heading {
    top: -100px !important;
    left: -190px !important;
    translate: none !important;
  }
}

/* 写真部分だけ薄緑の枠にする */
.instagram-account {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.instagram-grid {
  padding: 25px 20px 20px !important;
  background: rgba(248, 251, 247, 0.95);
  border-top: 3px solid #95cf88;
  box-shadow: 0 8px 24px rgba(50, 80, 50, 0.08);
}

/* ボタンを枠から離して下げる */
.instagram-profile-button {
  margin-top: 35px !important;
}

@media screen and (max-width: 767px) {
  .instagram-content {
    width: 100% !important;
    margin: 0 !important;
  }

  .instagram-grid {
    padding: 15px 10px !important;
  }

  .instagram-heading {
    position: static !important;
    margin-bottom: 30px !important;
    translate: none !important;
  }
}

/* 写真ブロックを少し右へ */
@media screen and (min-width: 768px) {
  .instagram-content {
    transform: translateX(-0.5px) !important;
  }
}

/* ボタンをもう少し下へ */
.instagram-profile-button {
  margin-top: 80px !important;
}

/* Instagramセクションの縦余白を画面サイズに左右されないようにする */
.home-blog {
  height: auto !important;
  min-height: 0 !important;
  padding: 70px 0 !important;
}

.home-blog .instagram-box {
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}

/* ボタン下の余白を抑える */
.instagram-profile-button {
  margin-bottom: 0 !important;
}

/* ===================================
   Instagram：赤枠サイズに合わせる
=================================== */

@media screen and (min-width: 1025px) {

  .instagram-content {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: calc(100% - 20px) !important;
    max-width: 1530px !important;
    margin: 0 auto !important;
    gap: 55px !important;
    transform: none !important;
  }

  .instagram-account {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  /* 大きい赤枠の範囲 */
  .instagram-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-content: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    height: 535px !important;
    margin: 0 !important;
    padding: 55px 30px 30px !important;
    gap: 10px !important;
  }

  .instagram-item {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
  }

  /* 下の小さい赤枠の範囲 */
  .instagram-profile-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 250px !important;
    min-height: 68px !important;
    margin: 45px auto 0 !important;
  }
}

/* 白い背景だけ少しコンパクトにする */
@media screen and (min-width: 1025px) {
  .home-blog::after {
    top: 85px !important;
    right: 0 !important;
    bottom: 85px !important;
    left: 130px !important;
  }
}

/* 白背景を最初の広さに戻す */
@media screen and (min-width: 1025px) {
  .home-blog::after {
    top: 70px !important;
    right: 0 !important;
    bottom: 70px !important;
    left: 100px !important;
  }
}

/* ================================= retirement? */
@media screen and (max-width: 600px) {

  /* セクション外側の余白 */
  .home-blog {
    height: auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 30px !important;
    padding-bottom: 30px !important;
  }

  /* 白背景 */
  .home-blog::after {
    top: 20px !important;
    right: 0 !important;
    bottom: 20px !important;
    left: 15px !important;
  }

  /* 白背景内の余白 */
  .home-blog .instagram-box {
    padding: 45px 15px !important;
  }

  /* INSTAGRAM見出し下 */
  .instagram-heading {
    margin-bottom: 25px !important;
  }

  /* 2アカウント間 */
  .instagram-content {
    gap: 45px !important;
  }

  /* 各投稿枠 */
  .instagram-account {
    min-height: 0 !important;
    padding: 0 !important;
  }

  /* 写真とボタンの間 */
  .instagram-profile-button {
    margin-top: 30px !important;
  }
}
