/*
 * サイト表示専用CSS。
 * Instagram風表示の見た目を変える場合は、原則このファイルだけを編集する。
 * v1.0.10: 画像軽量化対応 / iPhone Safari gallery表示対策。
 */
.wsgbm-instagram-feed{
  --wsgbm-border:#dbdbdb;
  --wsgbm-text:#0f0f0f;
  --wsgbm-muted:#737373;
  width:min(90vw,1120px);
  max-width:90vw;
  margin-inline:auto;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,360px));
  justify-content:center;
  gap:16px;
}
.wsgbm-instagram-feed--empty{display:block;color:#737373}
.wsgbm-instagram-card{
  width:100%;
  max-width:360px;
  aspect-ratio:2 / 3;
  min-height:0;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid var(--wsgbm-border);
  border-radius:10px;
  overflow:hidden;
  color:var(--wsgbm-text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
.wsgbm-instagram-card a{color:inherit;text-decoration:none}
.wsgbm-instagram-card__header{display:flex;align-items:center;gap:10px;padding:10px 12px;min-height:54px;flex:0 0 auto}
.wsgbm-instagram-card__avatar{width:34px;height:34px;flex:0 0 34px;border-radius:50%;object-fit:cover;background:#e9e9e9}
.wsgbm-instagram-card__identity{display:flex;flex-direction:column;line-height:1.2;font-size:13px;min-width:0}
.wsgbm-instagram-card__identity small{margin-top:3px;color:var(--wsgbm-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wsgbm-instagram-card__more{margin-left:auto;letter-spacing:2px;font-weight:700}
.wsgbm-instagram-card__media-wrap{position:relative;flex:0 0 auto;background:#f2f2f2;overflow:hidden}
.wsgbm-instagram-card__count{position:absolute;z-index:2;right:10px;top:10px;padding:4px 8px;border-radius:999px;background:rgba(0,0,0,.62);color:#fff;font-size:11px}
.wsgbm-instagram-card__carousel{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
.wsgbm-instagram-card__carousel::-webkit-scrollbar{display:none}
.wsgbm-instagram-card__slide{display:block;min-width:100%;aspect-ratio:1 / 1;scroll-snap-align:start;background:#f4f4f4}
.wsgbm-instagram-card__slide img,.wsgbm-instagram-card__slide video{display:block;width:100%;height:100%;object-fit:cover}
.wsgbm-instagram-card__actions{display:flex;gap:13px;align-items:center;padding:8px 12px 4px;font-size:22px;line-height:1;flex:0 0 auto}
.wsgbm-instagram-card__bookmark{margin-left:auto}
.wsgbm-instagram-card__body{padding:4px 12px 12px;font-size:13px;line-height:1.55;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.wsgbm-instagram-card__body::-webkit-scrollbar{width:5px}
.wsgbm-instagram-card__body::-webkit-scrollbar-thumb{background:#c7c7c7;border-radius:999px}
.wsgbm-instagram-card__body strong{font-weight:700}
.wsgbm-instagram-card__caption{overflow-wrap:anywhere}
.wsgbm-instagram-card__link{display:inline-block;margin-top:8px;color:#737373!important;font-weight:600}
.wsgbm-instagram-card__body time{display:block;margin-top:8px;color:#8e8e8e;font-size:10px}

/* 3枚が無理なく入らない幅では2列 */
@media (max-width:980px){
  .wsgbm-instagram-feed{
    width:min(90vw,736px);
    grid-template-columns:repeat(2,minmax(0,360px));
  }
}

/* スマホ: 1列、カード幅80vw・最大360px、表示は先頭2件 */
@media (max-width:640px){
  .wsgbm-instagram-feed{
    width:100%;
    max-width:100%;
    grid-template-columns:1fr;
    gap:16px;
  }
  .wsgbm-instagram-card{
    width:80vw;
    max-width:360px;
  }
  .wsgbm-instagram-feed--grid .wsgbm-instagram-card:nth-child(n+3){display:none}
}

/* 横スライダー表示: [wsgbm_instagram_feed ... view="slider"] */
.wsgbm-instagram-slider-wrap{position:relative;width:min(90vw,1120px);max-width:90vw;margin-inline:auto}
.wsgbm-instagram-slider-wrap .wsgbm-instagram-feed--slider{width:100%;max-width:100%;margin-inline:0}
.wsgbm-instagram-feed--slider{display:flex;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.wsgbm-instagram-feed--slider::-webkit-scrollbar{display:none}
.wsgbm-instagram-feed--slider .wsgbm-instagram-card{flex:0 0 calc((100% - 32px) / 3);max-width:none;scroll-snap-align:start;margin:0}
.wsgbm-slider-nav{position:absolute;top:50%;z-index:20;width:42px;height:42px;transform:translateY(-50%);border:1px solid rgba(0,0,0,.10);border-radius:50%;background:rgba(255,255,255,.96);box-shadow:0 4px 14px rgba(0,0,0,.14);color:#222;font-size:24px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .18s ease,transform .18s ease,box-shadow .18s ease}
.wsgbm-slider-nav:hover:not(:disabled){transform:translateY(-50%) scale(1.04);box-shadow:0 6px 18px rgba(0,0,0,.18)}
.wsgbm-slider-nav--prev{left:-18px}.wsgbm-slider-nav--next{right:-18px}.wsgbm-slider-nav:disabled{opacity:.22;cursor:default;box-shadow:none}
@media (max-width:980px){.wsgbm-instagram-slider-wrap{width:min(90vw,736px)}.wsgbm-instagram-feed--slider .wsgbm-instagram-card{flex-basis:calc((100% - 16px) / 2)}}
@media (max-width:640px){.wsgbm-instagram-slider-wrap{width:90vw;max-width:90vw}.wsgbm-instagram-feed--slider{gap:12px}.wsgbm-instagram-feed--slider .wsgbm-instagram-card{flex-basis:100%;width:100%;max-width:none}.wsgbm-slider-nav{display:none}}

/* ギャラリー表示: [wsgbm_instagram_feed ... view="gallery"] */
.wsgbm-instagram-feed--gallery{grid-template-columns:repeat(3,minmax(0,360px))}
.wsgbm-instagram-feed--gallery .wsgbm-instagram-card{cursor:pointer}
.wsgbm-gallery-modal{position:fixed;inset:0;z-index:999999;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.72)}
.wsgbm-gallery-modal.is-open{display:flex}
.wsgbm-gallery-modal__panel{position:relative;width:min(92vw,520px);max-height:92vh;overflow:auto;border-radius:14px;background:#fff;box-shadow:0 18px 60px rgba(0,0,0,.35)}
.wsgbm-gallery-modal__close{position:absolute;top:10px;right:10px;z-index:2;width:36px;height:36px;border:0;border-radius:50%;background:rgba(255,255,255,.95);box-shadow:0 2px 10px rgba(0,0,0,.15);color:#222;font-size:24px;line-height:1;cursor:pointer}
.wsgbm-gallery-modal__media{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;background:#eee}
.wsgbm-gallery-modal__video{display:none}
.wsgbm-gallery-modal__body{padding:18px}
.wsgbm-gallery-modal__caption{margin:0 0 14px;color:#222;font-size:14px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.wsgbm-gallery-modal__date{margin-bottom:14px;color:#777;font-size:12px}
.wsgbm-gallery-modal__link{display:block;width:100%;padding:12px 14px;border-radius:8px;background:#111;color:#fff!important;text-align:center;text-decoration:none!important;font-weight:700}
@media (max-width:980px){.wsgbm-instagram-feed--gallery{width:min(90vw,736px);grid-template-columns:repeat(2,minmax(0,360px))}}
@media (max-width:640px){
  .wsgbm-instagram-feed--gallery{width:94%;max-width:94%;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card:nth-child(n){display:block}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card{width:100%;max-width:none;aspect-ratio:1/1;min-height:0;border:0;border-radius:0;box-shadow:none;background:transparent;overflow:hidden}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__header,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__actions,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__body,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__count{display:none}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__media-wrap{width:100%;height:100%;flex:1 1 auto}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__carousel{width:100%;height:100%;overflow:hidden}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide{min-width:100%;width:100%;height:100%;aspect-ratio:1/1;pointer-events:none}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide:not(:first-child){display:none}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide img,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide video{width:100%;height:100%;object-fit:cover}
  .wsgbm-gallery-modal{padding:14px}.wsgbm-gallery-modal__panel{width:min(94vw,460px);border-radius:12px}
}



/* v1.0.9: SP slider ScrollHint */
@media (max-width:640px){
  .wsgbm-instagram-slider-wrap .scroll-hint-icon-wrap{
    z-index:30;
  }
  .wsgbm-instagram-slider-wrap .scroll-hint-text{
    font-size:12px;
    white-space:nowrap;
  }
  .wsgbm-gallery-modal__caption br{
    display:block;
  }
}


/* v1.0.10: iPhone Safari gallery表示安定化 */
@media (max-width:640px){
  .wsgbm-instagram-feed--gallery{display:grid!important;width:94%!important;max-width:94%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;align-items:start}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card:nth-child(n){display:block!important}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card{display:block!important;width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;aspect-ratio:auto!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;overflow:hidden!important}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__header,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__actions,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__body,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__count{display:none!important}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__media-wrap{display:block!important;position:relative!important;width:100%!important;height:auto!important;min-height:0!important;flex:none!important;overflow:hidden!important}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__carousel{display:block!important;width:100%!important;height:auto!important;overflow:hidden!important}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide{display:block!important;width:100%!important;min-width:100%!important;height:auto!important;aspect-ratio:auto!important;pointer-events:none;background:#f2f2f2}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide:not(:first-child){display:none!important}
  .wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide img,.wsgbm-instagram-feed--gallery .wsgbm-instagram-card__slide video{display:block!important;width:100%!important;height:auto!important;aspect-ratio:1/1!important;object-fit:cover!important}
  .wsgbm-gallery-modal__caption{white-space:pre-wrap!important}
}
