/* ==========================================================
   Instagram フィードの見た目
   クラス名（ig-feed__… / ig-modal__…）は見た目専用。自由に変えてよい
   ========================================================== */

.ig-feed {
  --ig-accent: #005c2f;  /* ボタンなどの差し色。サイトの色に合わせて変える */
  --ig-text: #333;
  max-width: 1400px;
  margin: 50px auto 0;
  color: var(--ig-text);
}
.ig-feed [hidden] { display: none !important; }

/* ---- 見出し ---- */
.ig-feed__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 30px;
}
.ig-feed__icon { width: 36px; height: 36px; }
.ig-feed__title { margin: 0; font-size: 32px; font-weight: normal; line-height: 1.2; }
.ig-feed__account { color: inherit; font-size: 16px; }

/* ---- 一覧 ---- */
.ig-feed__list {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
}
.ig-feed__list > li {
  flex: 1;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}
.ig-feed__list > li:before {
  display: none;
}
.ig-feed__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 211 / 280;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  transition: 0.2s;
}
body.d .ig-feed__item:hover {
  transform: scale(1.08);
}
.ig-feed__item img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: 0.2s;
}
body.d .ig-feed__item:hover img {
  opacity: 0.2;
}
.ig-feed__excerpt {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  transition: opacity .2s;
}
.ig-feed__item:hover img { opacity: .25; }
.ig-feed__item:hover .ig-feed__excerpt { opacity: 1; }

/* 複数枚の投稿のマーク（JSが is-album を付ける） */
.ig-feed__item.is-album::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 9px;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 3px 3px 0 rgba(255, 255, 255, .5);
}
/* 動画のマーク（JSが is-video を付ける） */
.ig-feed__item.is-video::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
}

@media (max-width: 736px) {
  .ig-feed { margin: 30px 0; }
  .ig-feed__head { margin-bottom: 20px; }
  .ig-feed__title { font-size: 26px; }
  .ig-feed__list { flex-wrap: wrap; gap: 15px; }  /* スマホの列数 */
  .ig-feed__list > li {
    flex: none;
    width: calc(50% - 7.5px);
  }
  .ig-feed__list > :nth-child(n+5) { display: none; }  /* スマホは4件まで */
  .ig-feed__excerpt { display: none; }
}

/* ---- ポップアップ ---- */
.ig-modal {
  width: min(800px, calc(100% - 12px));
  max-width: none;
  max-height: calc(100% - 60px);
  padding: 0;
  border: 0;
  overflow: visible;
  color: var(--ig-text);
}
.ig-modal::backdrop { background: rgba(0, 0, 0, .8); }
.ig-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.ig-modal__inner { display: flex; height: 480px; background: #fff; }
.ig-modal__media {
  position: relative;
  flex: 0 0 60%;
  overflow: hidden;
  background: #000;
}
.ig-modal__track { display: flex; height: 100%; transition: transform .3s; }
.ig-modal__track > * {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ig-modal__nav {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  padding: 0;
  border: 0;
  background: var(--ig-accent);
  cursor: pointer;
}
.ig-modal__nav::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}
.ig-modal__nav--prev { left: 0; }
.ig-modal__nav--prev::after { transform: translate(-30%, -50%) rotate(-135deg); }
.ig-modal__nav--next { right: 0; }
.ig-modal__nav--next::after { transform: translate(-70%, -50%) rotate(45deg); }
.ig-modal__dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.ig-modal__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}
.ig-modal__dots span.is-active { background: var(--ig-accent); }
.ig-modal__body { flex: 1; padding: 15px; overflow-y: auto; }
.ig-modal__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
}
.ig-modal__user img { width: 32px; height: 32px; }
.ig-modal__user img:not([src]) { display: none; }
.ig-modal__date { margin: 8px 0 12px; color: #888; font-size: 12px; }
.ig-modal__caption { margin: 0 0 1em; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.ig-modal__link { margin: 0; text-align: right;}
.ig-modal__link a { 
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
}
.ig-modal__link a:before { 
  content: '';
  width: 20px;
  height: 20px;
  background: url(../../img/icon/instagram.png) no-repeat left center;
  background-size: auto 100%;
}
.ig-modal a:hover { opacity: .6; }

@media (max-width: 736px) {
  .ig-modal__inner { flex-direction: column; height: auto; max-height: calc(100vh - 90px); }
  .ig-modal__media { flex: none; aspect-ratio: 1 / 1; }
  .ig-modal__body { padding: 15px 15px 30px; }
}
