/* ======================================================================
    BILA RPA / 公式 Instagram の案内画像
    01 共通 / 02 見出し / 03 コース別ギャラリー / 04 相談への導線
    05 画像の拡大表示 / 06 レスポンシブ / 07 動き・印刷

    画像内の文字まで読めるよう、画像は元の縦横比で表示します。
    ギャラリーのスタイルは #instagram の中に限定しています。
    ====================================================================== */

/* 01. 共通 -------------------------------------------------------------- */

#instagram.bi-gallery {
    --bi-navy: #0b1d36;
    --bi-ink: #10213a;
    --bi-muted: #53687d;
    --bi-cyan: #16c7e8;
    --bi-deep-cyan: #057c9c;
    --bi-lime: #b9f227;
    --bi-line: #d6e1ea;
    position: relative;
    padding: 74px 0 48px;
    color: var(--bi-ink);
    background: linear-gradient(180deg, #f4f7fa 0%, #ffffff 100%);
    font-size: 18px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    scroll-margin-top: 20px;
}

#instagram > .container {
    width: min(1180px, calc(100% - 48px));
}

#instagram [hidden] {
    display: none !important;
}

#instagram :is(a, button):focus-visible {
    outline: 3px solid var(--bi-deep-cyan);
    outline-offset: 4px;
}

#instagram :is(button, a) {
    -webkit-tap-highlight-color: transparent;
}

/* 02. 公式アカウントと見出し -------------------------------------------- */

#instagram .bi-gallery__heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 28px 36px;
    margin-bottom: 34px;
}

#instagram .bi-gallery__heading > div {
    min-width: 0;
}

#instagram .bi-gallery__kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--bi-deep-cyan);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.5;
}

#instagram .bi-gallery__icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

#instagram #bi-gallery-title {
    margin: 0 0 18px;
    color: var(--bi-navy);
    font-size: clamp(30px, 3.15vw, 44px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.5;
}

#instagram .bi-gallery__lead {
    max-width: 750px;
    margin: 0;
    color: var(--bi-muted);
    font-size: 18px;
    line-height: 1.85;
}

#instagram .bi-gallery__profile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 246px;
    min-height: 91px;
    padding: 15px 22px;
    border: 1px solid #c7d6e3;
    border-radius: 18px;
    color: var(--bi-navy);
    background: #ffffff;
    box-shadow: 0 8px 24px rgb(11 29 54 / 4%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#instagram .bi-gallery__profile:hover {
    border-color: var(--bi-deep-cyan);
    box-shadow: 0 10px 26px rgb(11 29 54 / 9%);
}

#instagram .bi-gallery__handle {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.4;
}

#instagram .bi-gallery__profile > span:last-child {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

/* 03. 2 コース × 2 枚。元画像全体を表示 ------------------------------- */

#instagram .bi-gallery__groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

#instagram .bi-series {
    min-width: 0;
    padding: 22px 18px 18px;
    border: 1px solid var(--bi-line);
    border-top: 4px solid var(--bi-cyan);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 14px 38px rgb(11 29 54 / 5%);
}

#instagram .bi-series--logistics {
    border-top-color: var(--bi-lime);
}

#instagram .bi-series__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 14px;
    min-height: 91px;
    margin-bottom: 19px;
}

#instagram .bi-series__heading > div {
    min-width: 0;
}

#instagram .bi-series__eyebrow {
    margin: 0 0 5px;
    color: var(--bi-deep-cyan);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.45;
}

#instagram .bi-series__heading h3 {
    margin: 0;
    color: var(--bi-navy);
    font-size: clamp(22px, 2.1vw, 27px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.45;
}

#instagram .bi-series__heading h3 > span {
    display: inline-block;
    font-size: 0.74em;
    letter-spacing: -0.015em;
    white-space: nowrap;
}

#instagram .bi-series__grade {
    flex-shrink: 0;
    margin: 0;
    padding: 4px 10px;
    border-radius: 8px;
    color: #22556e;
    background: #eaf6fa;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.65;
}

#instagram .bi-series--logistics .bi-series__grade {
    color: #365716;
    background: #f0f7e4;
}

#instagram .bi-series__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#instagram .bi-card {
    min-width: 0;
    margin: 0;
    border: 1px solid #dce5ec;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

#instagram .bi-card__image-link {
    display: block;
    color: #ffffff;
    background: var(--bi-navy);
    text-decoration: none;
}

#instagram .bi-card__image-link:focus-visible {
    outline-offset: -4px;
    outline-color: var(--bi-lime);
}

#instagram .bi-card__image-link > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1122 / 1402;
    object-fit: contain;
    object-position: center;
}

#instagram .bi-card__zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 6px 10px;
    border-top: 1px solid #29415d;
    color: #e5f1fa;
    background: var(--bi-navy);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    transition: color 0.2s ease, background 0.2s ease;
}

#instagram .bi-card__zoom > span:first-child {
    font-size: 21px;
    font-weight: 400;
    line-height: 1;
}

#instagram .bi-card__image-link:hover .bi-card__zoom {
    color: var(--bi-navy);
    background: var(--bi-lime);
}

#instagram .bi-card__caption {
    padding: 15px 14px 16px;
}

#instagram .bi-card__number {
    color: var(--bi-deep-cyan);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.5;
}

#instagram .bi-card__caption h4 {
    margin: 5px 0 7px;
    color: var(--bi-navy);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.55;
}

#instagram .bi-card__caption p {
    margin: 0;
    color: var(--bi-muted);
    font-size: 16px;
    line-height: 1.7;
}

/* 04. 写真から体験・ご相談へ -------------------------------------------- */

#instagram .bi-gallery__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 28px;
    margin-top: 28px;
    padding: 24px 26px;
    border: 1px solid #dce7ee;
    border-radius: 22px;
    background: #f4f8fa;
}

#instagram .bi-gallery__footer > div {
    min-width: 0;
}

#instagram .bi-gallery__footer-title {
    margin: 0 0 5px;
    color: var(--bi-navy);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.7;
}

#instagram .bi-gallery__note {
    margin: 0;
    color: var(--bi-muted);
    font-size: 16px;
    line-height: 1.8;
}

#instagram .bi-gallery__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#instagram .bi-gallery__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.65;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#instagram .bi-gallery__button--primary {
    color: var(--bi-navy);
    background: var(--bi-lime);
}

#instagram .bi-gallery__button--primary:hover {
    background: #c9fa50;
}

#instagram .bi-gallery__button--secondary {
    border-color: #b7c9d8;
    color: var(--bi-navy);
    background: #ffffff;
}

#instagram .bi-gallery__button--secondary:hover {
    border-color: var(--bi-deep-cyan);
    background: #eaf7fb;
}

/* 05. 画像の拡大表示。操作部と画像を同じ画面内に配置 --------------------- */

#instagram .bi-viewer {
    width: min(980px, calc(100% - 32px));
    max-width: none;
    height: min(90vh, 1000px);
    height: min(90dvh, 1000px);
    max-height: none;
    margin: auto;
    padding: 0;
    border: 1px solid #cedae5;
    border-radius: 22px;
    color: var(--bi-ink);
    background: #ffffff;
    box-shadow: 0 24px 90px rgb(0 0 0 / 36%);
    overflow: hidden;
}

#instagram .bi-viewer:not([open]) {
    display: none;
}

#instagram .bi-viewer[open] {
    display: block;
}

#instagram .bi-viewer::backdrop {
    background: rgb(3 14 30 / 84%);
    backdrop-filter: blur(4px);
}

#instagram .bi-viewer__shell {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

#instagram .bi-viewer__header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bi-line);
    background: #ffffff;
}

#instagram .bi-viewer__header h3 {
    min-width: 0;
    margin: 0;
    color: var(--bi-navy);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.6;
}

#instagram .bi-viewer__close {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #becdda;
    border-radius: 50%;
    color: var(--bi-navy);
    background: #f1f6f9;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#instagram .bi-viewer__close:hover {
    border-color: var(--bi-navy);
    background: #e1edf4;
}

#instagram .bi-viewer__stage {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    background: #061728;
    overflow: hidden;
}

#instagram .bi-viewer__stage img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

#instagram #bi-viewer-error {
    max-width: 540px;
    margin: 0;
    padding: 24px;
    color: #e6f1f8;
    font-size: 17px;
    line-height: 1.85;
    text-align: center;
}

#instagram .bi-viewer__footer {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 14px 20px;
    border-top: 1px solid var(--bi-line);
    background: #ffffff;
}

#instagram .bi-viewer__navigation {
    display: grid;
    grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#instagram .bi-viewer__nav {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #bdcddb;
    border-radius: 10px;
    color: var(--bi-navy);
    background: #f4f8fa;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
}

#instagram .bi-viewer__nav:hover:not(:disabled) {
    border-color: var(--bi-deep-cyan);
    background: #e7f6fb;
}

#instagram .bi-viewer__nav:disabled {
    color: #778a9a;
    background: #f3f5f7;
    opacity: 0.65;
    cursor: default;
}

#instagram #bi-viewer-count {
    min-width: 42px;
    color: var(--bi-muted);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
}

#instagram .bi-viewer__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
}

#instagram .bi-viewer__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--bi-deep-cyan);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

body.bi-viewer-open {
    overflow: hidden;
    overscroll-behavior: none;
}

/* 06. タブレット・スマートフォン -------------------------------------- */

@media (max-width: 1050px) {
    #instagram .bi-gallery__heading {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 22px;
    }

    #instagram .bi-gallery__profile {
        width: fit-content;
        min-width: 246px;
    }

    #instagram .bi-gallery__footer {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    #instagram .bi-series {
        padding-inline: 15px;
    }
}

@media (max-width: 760px) {
    #instagram.bi-gallery {
        padding: 54px 0 34px;
    }

    #instagram > .container {
        width: calc(100% - 32px);
    }

    #instagram .bi-gallery__heading {
        margin-bottom: 26px;
    }

    #instagram .bi-gallery__kicker {
        font-size: 15px;
        letter-spacing: 0.065em;
    }

    #instagram .bi-gallery__icon {
        width: 28px;
        height: 28px;
    }

    #instagram #bi-gallery-title {
        margin-bottom: 15px;
        font-size: clamp(29px, 5.6vw, 37px);
        line-height: 1.55;
    }

    #instagram .bi-gallery__lead {
        font-size: 17px;
    }

    #instagram .bi-gallery__profile {
        min-height: 80px;
        padding: 13px 19px;
    }

    #instagram .bi-gallery__groups {
        grid-template-columns: minmax(0, 1fr);
        gap: 23px;
    }

    #instagram .bi-series {
        padding: 20px 16px 16px;
        border-radius: 21px;
    }

    #instagram .bi-series__heading {
        min-height: 0;
        margin-bottom: 17px;
    }

    #instagram .bi-series__heading h3 {
        font-size: 25px;
    }

    #instagram .bi-gallery__footer {
        margin-top: 22px;
        padding: 22px;
        border-radius: 20px;
    }

    #instagram .bi-viewer {
        width: calc(100% - 24px);
        height: 94vh;
        height: 94dvh;
        border-radius: 17px;
    }

    #instagram .bi-viewer__header {
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }

    #instagram .bi-viewer__header h3 {
        font-size: 18px;
    }

    #instagram .bi-viewer__stage {
        padding: 6px;
    }

    #instagram .bi-viewer__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        padding: 10px 14px 12px;
    }

    #instagram .bi-viewer__navigation {
        width: min(360px, 100%);
        margin-inline: auto;
    }

    #instagram .bi-viewer__links {
        justify-content: center;
        gap: 0 15px;
    }
}

@media (max-width: 480px) {
    #instagram .bi-gallery__profile {
        width: 100%;
        min-width: 0;
    }

    #instagram .bi-series {
        padding: 18px 12px 12px;
    }

    #instagram .bi-series__heading {
        align-items: flex-start;
        gap: 9px;
    }

    #instagram .bi-series__heading h3 {
        font-size: 23px;
    }

    #instagram .bi-series__grade {
        padding: 3px 8px;
    }

    #instagram .bi-series__grid {
        gap: 10px;
    }

    #instagram .bi-card {
        border-radius: 11px;
    }

    #instagram .bi-card__caption {
        padding: 12px 10px 14px;
    }

    #instagram .bi-card__caption h4 {
        font-size: 16px;
    }

    #instagram .bi-card__caption p {
        font-size: 15px;
        line-height: 1.75;
    }

    #instagram .bi-gallery__footer {
        padding: 20px 16px;
    }

    #instagram .bi-gallery__footer-title {
        font-size: 18px;
    }

    #instagram .bi-gallery__actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    #instagram .bi-gallery__button {
        width: 100%;
        min-height: 52px;
    }

    #instagram .bi-viewer__links {
        gap: 0 12px;
    }

    #instagram .bi-viewer__links a {
        font-size: 16px;
    }
}

/* 横向きなど画面の高さが短い場合も、画像領域を確保します。 */
@media (max-height: 550px) and (min-width: 761px) {
    #instagram .bi-viewer {
        height: 96vh;
        height: 96dvh;
    }

    #instagram .bi-viewer__header {
        padding-block: 8px;
    }

    #instagram .bi-viewer__footer {
        padding-block: 8px;
    }
}

/* 07. 動き・印刷 -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    #instagram *,
    #instagram *::before,
    #instagram *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

@media print {
    #instagram.bi-gallery {
        padding: 20pt 0;
        background: #ffffff;
    }

    #instagram > .container {
        width: 100%;
    }

    #instagram .bi-gallery__heading {
        display: block;
    }

    #instagram .bi-gallery__profile,
    #instagram .bi-card__zoom,
    #instagram .bi-gallery__actions,
    #instagram .bi-viewer {
        display: none !important;
    }

    #instagram .bi-series,
    #instagram .bi-card {
        box-shadow: none;
        break-inside: avoid;
    }
}

/* 外部リンクの矢印をフォントに依存せず表示します。 */
#instagram .bi-external-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -2px;
}

#instagram .bi-viewer__header h3 {
    text-wrap: balance;
}
