<!-- Instagram -->
<link rel="stylesheet" href="css/instafeed.css" type="text/css">
<script type="text/javascript" src="js/instafeed.min.js"></script>
<!-- instafeed 2020 -->
    <script>
    $(window).load(function () {
//facebook-jsonを取得して表示
    var count = 0;
    var limit = 8; //表示件数
    var text = '';
    var data;
    var graph_api = 'https://graph.facebook.com/v9.0/';
    var accessToken = 'EAAFVhqZCQ0SkBAAQSdh5dQe63rFYk6oS3J9073oFuotQZB386ILqWdSboCWUhZCYiJVZA2ZBOQQJRdI0Q64G1WzhfmgIEkI0XZBJaPV5qgZB0oOEk7xCoxbP5Cb7Daf5Wg0LgPgvDkbIcfV83lsK43bZCRnELqun7oRfht8SeEdkrwZDZD'; // アクセストークン
    var businessID = '17841402780506665'; //グラフAPIエクスプローラで取得したinstagram_business_accountのID
    var fields = 'media{caption,media_url,permalink,timestamp,username}';
    var url = graph_api + businessID + '?fields=' + fields + "&access_token=" + accessToken;
    $.ajax({
        url: url
    })
    .done(function(res) {
        data = res.media;
        limit = 10;
        count = 0;
        $.each(data, function(index, val) {
            $.each(val, function(i, elem) {
                if (elem.media_url && count < limit) {
                    text1 = '<li><a href="'+elem.permalink+'" target="_blank">';
                    text2 = '<img src="'+elem.media_url+'">';
                    text3 = '</a></li>';
                    count ++;
                    text = text + text1 + text2 + text3;
                }
            });
        });
        $('#instafeed').html(text);
    })
    .fail(function(jqXHR, status) {
        $('#instafeed').html('<li>読み込みに失敗しました。</li>');
    })
});
</script>a img {
-webkit-transition: opacity 0.5s ease-out;
	-moz-transition: opacity 0.5s ease-out;
	-ms-transition: opacity 0.5s ease-out;
}@charset 'UTF-8';

#instagram {
	width: 100%;
	padding-top: 1em;
}

.main_inst {
	max-width: 825px;
	/*margin-right: auto;
	margin-left: auto;*/
}

#instafeed {
	overflow: hidden;
	-js-display: flex;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	-webkit-box-pack: justify;
	-ms-flex-pack: justify;
	-webkit-justify-content: space-between;
	justify-content: space-between;
}

#instafeed li{
	background-color: #000;
	width: 23%;
	line-height: 0;
    margin-bottom: 1.5em;
    /*正方形維持
    max-height: 205px;
    overflow: hidden;
    */
    position: relative;
}
/*正方形維持*/

#instafeed li:before{
  content: "";
  display: block;
  padding-top: 100%;
}

#instafeed img{
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  object-fit: cover;
}

/*
#instafeed li img {
	width: 100%;
	height: auto;
}
*/

#instafeed li a{
    -webkit-transition: opacity 0.5s ease-out;
	-moz-transition: opacity 0.5s ease-out;
	-ms-transition: opacity 0.5s ease-out;
}

#instafeed li a:hover{
	filter: alpha(opacity=60);
	-moz-opacity: 0.6;
	opacity: 0.6;
}


@media only screen and (min-width:1px) and (max-width:738px){

#instafeed li{
	width: 32%;
	/*margin-bottom: 2%;*/
}

}

@media only screen and (min-width:1px) and (max-width:480px){

#instafeed li{
	width: 48%;
	/*margin-bottom: 2%;*/
}

}

