/* =========================
   全体
========================= */

.instagram-feed-wrapper {
    width: 100%;
    margin: 0 auto;
}

.instagram-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 10px 10px 30px 10px;
}

/* =========================
   プロフィール
========================= */

.instagram-feed-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.instagram-feed-profile-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.instagram-feed-profile-image {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 58px;
    height: 58px;
    padding: 3px;
    overflow: hidden;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #feda75,
            #fa7e1e,
            #d62976,
            #962fbf,
            #4f5bd5
        );
}

.instagram-feed-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: 50%;
}

.instagram-feed-profile-image-placeholder {
    color: #fff;
    font-size: 30px;
    font-weight: 700;
}

.instagram-feed-profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.instagram-feed-profile-label {
    margin-bottom: 3px;
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

.instagram-feed-profile-text strong {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instagram-feed-follow-button {
    flex: 0 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    border-radius: 999px;
    background:
        linear-gradient(
            135deg,
            #833ab4,
            #fd1d1d,
            #fcb045
        );
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.instagram-feed-follow-button:hover {
    color: #fff;
    opacity: 0.88;
    transform: translateY(-2px);
}

/* =========================
   投稿カード
========================= */

.instagram-feed-item {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.06);
}

.instagram-feed-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f3f3;
}

.instagram-feed-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.instagram-feed-media img,
.instagram-feed-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instagram-feed-body {
    padding: 17px 18px 18px;
}

.instagram-feed-caption {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.instagram-feed-caption a {
    color: inherit;
    text-decoration: underline;
}

.instagram-feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.instagram-feed-date {
    color: #999;
    font-size: 12px;
    line-height: 1.5;
}

.instagram-feed-view-link {
    color: #555;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

.instagram-feed-view-link::after {
    margin-left: 4px;
    content: "↗";
}

.instagram-feed-view-link:hover {
    text-decoration: underline;
}

/* =========================
   カルーセル
========================= */

.instagram-feed-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.instagram-feed-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.instagram-feed-carousel-track::-webkit-scrollbar {
    display: none;
}

.instagram-feed-carousel-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
}

.instagram-feed-carousel-item img,
.instagram-feed-carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instagram-feed-carousel-button {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #222;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transform: translateY(-50%);
}

.instagram-feed-carousel-prev {
    left: 10px;
}

.instagram-feed-carousel-next {
    right: 10px;
}

.instagram-feed-carousel-dots {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.instagram-feed-carousel-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    cursor: pointer;
}

.instagram-feed-carousel-dot.is-active {
    background: #fff;
    transform: scale(1.25);
}

/* =========================
   メッセージ
========================= */

.instagram-feed-error {
    padding: 15px;
    color: #b32d2e;
    border: 1px solid #f0b8b8;
    border-radius: 8px;
    background: #fff5f5;
}

.instagram-feed-empty {
    color: #777;
    text-align: center;
}

/* =========================
   タブレット
========================= */

@media screen and (max-width: 900px) {

    .instagram-feed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

/* =========================
   スマホ
========================= */

@media screen and (max-width: 767px) {

    .instagram-feed-profile {
        gap: 12px;
        margin-bottom: 22px;
        padding: 15px;
    }

    .instagram-feed-profile-image {
        width: 50px;
        height: 50px;
    }

    .instagram-feed-profile-text strong {
        font-size: 14px;
    }

    .instagram-feed-follow-button {
        min-height: 40px;
        padding: 9px 13px;
        font-size: 12px;
    }

    .instagram-feed {
        display: flex;
        gap: 16px;
        padding: 0 6vw 12px;
        margin-bottom: 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .instagram-feed::-webkit-scrollbar {
        display: none;
    }

    .instagram-feed-item {
        flex: 0 0 82vw;
        max-width: 340px;
        scroll-snap-align: center;
    }

    .instagram-feed-carousel-button {
        width: 32px;
        height: 32px;
    }
}

@media screen and (max-width: 420px) {

    .instagram-feed-profile-label {
        display: none;
    }

    .instagram-feed-follow-button {
        padding-right: 11px;
        padding-left: 11px;
    }
}