/* Instagram タイムライン カスタムスタイル */

/* Instagram埋め込み用の高さ調整 */
.twitter-grid {
    grid-template-rows: auto !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* レスポンシブ時の高さ制限も解除 */
@media(min-width:62rem) {
    .twitter-grid {
        grid-template-rows: auto !important;
    }
}

.twitter-grid .twitter-container {
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    align-self: start !important;
}

.twitter-grid .twitter-container blockquote.instagram-media {
    width: 100% !important;
    max-width: 400px !important;
    min-width: 280px !important;
    margin: 0 auto !important;
    height: auto !important;
    min-height: auto !important;
    transform: scale(0.8) !important;
    transform-origin: top center;
}

/* PC表示時のサイズ調整 */
@media (min-width: 769px) {
    .twitter-grid .twitter-container blockquote.instagram-media {
        max-width: 400px !important;
        transform: scale(0.8) !important;
    }
}

/* Instagram埋め込みのiframeも高さを自動に */
.twitter-grid .twitter-container iframe {
    height: auto !important;
    min-height: 600px !important;
    max-height: none !important;
}

.instagram-timeline-custom {
    background-color: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.instagram-item {
    border-bottom: 1px solid #efefef;
    padding: 16px 0;
    margin-bottom: 16px;
}

.instagram-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.instagram-media {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fafafa;
}

.instagram-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.instagram-video {
    width: 100%;
    height: auto;
    display: block;
}

.instagram-caption {
    font-size: 14px;
    line-height: 1.5;
    color: #262626;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.instagram-caption a {
    color: #00376b;
    text-decoration: none;
    font-weight: 600;
}

.instagram-caption a:hover {
    text-decoration: underline;
}

.instagram-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8e8e8e;
}

.instagram-date {
    font-weight: 400;
}

.instagram-link {
    color: #00376b;
    text-decoration: none;
    font-weight: 600;
}

.instagram-link:hover {
    text-decoration: underline;
}

.instagram-follow {
    text-align: center;
    padding: 16px 0 0 0;
    border-top: 1px solid #efefef;
    margin-top: 16px;
}

.follow-button {
    display: inline-block;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.follow-button:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #fff !important;
}

.instagram-fallback {
    background-color: #fafafa;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 40px 16px;
    text-align: center;
    color: #8e8e8e;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* スマホ時の中央寄せ */
    .twitter-grid {
        justify-items: center !important;
        text-align: center !important;
    }
    
    .twitter-grid .twitter-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .twitter-grid .twitter-container blockquote.instagram-media {
        margin: 0 auto !important;
        text-align: center !important;
        max-width: 100% !important;
        min-width: 280px !important;
        transform: scale(0.9);
        transform-origin: top center;
    }
    
    .instagram-timeline-custom {
        padding: 12px;
        margin: 0 8px;
    }
    
    .instagram-item {
        padding: 12px 0;
        margin-bottom: 12px;
    }
    
    .instagram-caption {
        font-size: 13px;
    }
    
    .instagram-meta {
        font-size: 11px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
