.wp-instagram-photo-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    text-align: inherit;
    font: inherit;
    color: inherit;
}

.wp-instagram-photo-trigger:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.wp-instagram-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.wp-instagram-lightbox[hidden] {
    display: none !important;
}

body.wp-instagram-lightbox-open {
    overflow: hidden;
}

.wp-instagram-lightbox__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.35);
    cursor: zoom-out;
}

.wp-instagram-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wp-instagram-lightbox__close:hover,
.wp-instagram-lightbox__close:focus-visible {
    background: rgba(0, 0, 0, 0.65);
    outline: none;
}

.wp-instagram-lightbox__stage {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 64px 24px 32px;
    box-sizing: border-box;
    pointer-events: none;
}

.wp-instagram-lightbox__layout {
    display: flex;
    align-items: stretch;
    width: min(96vw, 1180px);
    max-height: calc(100vh - 96px);
    pointer-events: auto;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.wp-instagram-lightbox__layout.is-media-only {
    width: auto;
    max-width: min(96vw, 1180px);
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.wp-instagram-lightbox__caption-panel {
    display: flex;
    flex-direction: column;
    flex: 0 0 360px;
    width: 360px;
    max-height: calc(100vh - 96px);
    padding: 24px 24px 20px;
    box-sizing: border-box;
    overflow: hidden;
    border-left: 1px solid #eee;
    background: #fff;
}

.wp-instagram-lightbox__caption-panel[hidden] {
    display: none !important;
}

.wp-instagram-lightbox__caption-text {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    color: #111;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
    word-break: break-word;
}

.wp-instagram-lightbox__caption-text:empty {
    display: none;
}

.wp-instagram-lightbox__title,
.wp-instagram-lightbox__subtitle {
    flex: 0 0 auto;
}

.wp-instagram-lightbox__title[hidden],
.wp-instagram-lightbox__subtitle[hidden] {
    display: none !important;
}

.wp-instagram-lightbox__title {
    margin: 0 0 8px;
    color: #111;
    font-size: 14px;
    letter-spacing: 0.12em;
    font-weight: 400;
    line-height: 1.5;
}

.wp-instagram-lightbox__subtitle {
    margin: 0 0 12px;
    color: #9ca3af;
    font-size: 10px;
    letter-spacing: 0.08em;
    line-height: 1.5;
}

.wp-instagram-lightbox__caption-text:not(:empty) {
    margin-top: 0;
}

.wp-instagram-lightbox__title:not([hidden]) + .wp-instagram-lightbox__subtitle:not([hidden]) {
    margin-top: -4px;
}

.wp-instagram-lightbox__subtitle:not([hidden]) + .wp-instagram-lightbox__caption-text:not(:empty),
.wp-instagram-lightbox__title:not([hidden]) + .wp-instagram-lightbox__caption-text:not(:empty) {
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.wp-instagram-lightbox__caption-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    margin-top: 12px;
    padding: 8px 18px;
    border: 1px solid #111;
    border-radius: 0;
    background: #fff;
    color: #111;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wp-instagram-lightbox__caption-toggle:hover,
.wp-instagram-lightbox__caption-toggle:focus-visible {
    background: #111;
    border-color: #111;
    color: #fff;
    outline: none;
}

.wp-instagram-lightbox__caption-toggle[hidden] {
    display: none !important;
}

.wp-instagram-lightbox__media {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 240px;
    background: #000;
    position: relative;
}

.wp-instagram-lightbox__layout.is-media-only .wp-instagram-lightbox__media {
    background: transparent;
}

.wp-instagram-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.wp-instagram-lightbox__layout:not(.is-media-only) .wp-instagram-lightbox__image {
    max-height: calc(100vh - 96px);
}

.wp-instagram-lightbox__image.is-clickable {
    cursor: pointer;
}

.wp-instagram-lightbox__video {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    width: auto;
    height: auto;
    background: #000;
}

.wp-instagram-lightbox__video[hidden] {
    display: none !important;
}

.wp-instagram-lightbox__image[hidden] {
    display: none !important;
}

.wp-instagram-lightbox__layout:not(.is-media-only) .wp-instagram-lightbox__video {
    max-height: calc(100vh - 96px);
}

.wp-instagram-lightbox__play {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.wp-instagram-lightbox__play[hidden] {
    display: none !important;
}

.wp-instagram-lightbox__play .wp-instagram-play-badge__icon {
    width: 72px;
    height: 72px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.wp-instagram-lightbox__play:hover .wp-instagram-play-badge__icon,
.wp-instagram-lightbox__play:focus-visible .wp-instagram-play-badge__icon {
    transform: scale(1.06);
    background: rgba(0, 0, 0, 0.72);
}

.wp-instagram-lightbox__play:focus-visible {
    outline: none;
}

.wp-instagram-lightbox__play:focus-visible .wp-instagram-play-badge__icon {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.wp-instagram-lightbox__hint {
    display: block;
    flex: 0 0 auto;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    color: #385898;
    font-size: 12px;
    line-height: 1.5;
    text-decoration: none;
    word-break: break-all;
    pointer-events: auto;
}

.wp-instagram-lightbox__hint:hover,
.wp-instagram-lightbox__hint:focus-visible {
    text-decoration: underline;
    outline: none;
}

.wp-instagram-lightbox__hint[hidden] {
    display: none !important;
}

@media (max-width: 767px) {
    .wp-instagram-lightbox__close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 26px;
    }

    .wp-instagram-lightbox__caption-toggle {
        padding: 7px 14px;
        font-size: 10px;
    }

    .wp-instagram-lightbox__stage {
        align-items: flex-start;
        justify-content: center;
        padding: 56px 12px 16px;
        overflow: hidden;
    }

    .wp-instagram-lightbox__layout {
        flex-direction: column;
        width: min(96vw, 640px);
        max-height: calc(100vh - 72px);
    }

    .wp-instagram-lightbox__layout.is-mobile-scrollable {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .wp-instagram-lightbox__caption-panel {
        flex: 0 0 auto;
        width: 100%;
        max-height: none;
        padding: 16px;
        overflow: visible;
        border-left: 0;
        border-top: 1px solid #eee;
    }

    .wp-instagram-lightbox__media {
        flex: 0 0 auto;
        min-height: 0;
        background: #000;
    }

    .wp-instagram-lightbox__layout.is-media-only {
        width: 100%;
    }

    .wp-instagram-lightbox__layout.is-media-only .wp-instagram-lightbox__media {
        background: #000;
    }

    .wp-instagram-lightbox__image {
        width: 100%;
        max-height: min(62vh, calc(100vh - 220px));
    }

    .wp-instagram-lightbox__layout.is-mobile-expanded .wp-instagram-lightbox__image {
        max-height: none;
    }

    .wp-instagram-lightbox__caption-text {
        overflow: visible;
    }

    .wp-instagram-lightbox__caption-text.is-collapsed {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .wp-instagram-lightbox__caption-text.is-expanded {
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
    }
}

@media (min-width: 768px) {
    .wp-instagram-lightbox__caption-toggle {
        display: none !important;
    }

    .wp-instagram-lightbox__caption-text.is-collapsed,
    .wp-instagram-lightbox__caption-text.is-expanded {
        display: block;
        overflow-y: auto;
        -webkit-line-clamp: unset;
    }
}
