/* ========================================
   たこやき 画像ライトボックス
======================================== */

.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 64px;
    background: rgba(0, 0, 0, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: zoom-out;
    -webkit-tap-highlight-color: transparent;
}

.lb-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* 画像まわり */
.lb-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.lb-overlay.is-open .lb-figure {
    transform: scale(1);
}

.lb-image {
    max-width: 100%;
    /* 上下のバー（閉じるボタン・ヒント）を避けた高さ */
    max-height: calc(100vh - 140px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lb-caption {
    color: #f0f0f0;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-align: center;
    max-width: 90vw;
}

/* ========================================
   横長バナー用：高さ基準で拡大し、横スワイプで読めるようにする
======================================== */
.lb-overlay--wide .lb-figure {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
}

.lb-overlay--wide .lb-image {
    max-width: none;
    width: auto;
    /* 画面高さの4割まで拡大（細かい文字も読めるサイズ） */
    height: 40vh;
    max-height: 40vh;
    flex-shrink: 0;
}

.lb-overlay--wide .lb-caption {
    position: sticky;
    left: 0;
}

/* 横スワイプできることを伝える */
.lb-overlay--wide .lb-hint::before {
    content: '← 横にスワイプで全体を確認　/　';
}

/* 閉じるボタン */
.lb-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.lb-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* 「画面をタップで戻る」 */
.lb-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    pointer-events: none;
    white-space: nowrap;
}

/* ========================================
   スマートフォン
======================================== */
@media (max-width: 768px) {
    .lb-overlay {
        padding: 52px 10px 56px;
    }

    .lb-image {
        max-height: calc(100vh - 120px);
        /* 縦長のメニュー画像でも読めるように、はみ出す分はスクロール可 */
        max-height: calc(100svh - 120px);
    }

    .lb-close {
        top: 8px;
        right: 8px;
        width: 44px;
        height: 44px;
    }

    .lb-caption {
        font-size: 0.78rem;
    }

    .lb-hint {
        bottom: 16px;
        font-size: 0.7rem;
    }
}

/* 動きを抑える設定に配慮 */
@media (prefers-reduced-motion: reduce) {
    .lb-overlay,
    .lb-figure {
        transition: none;
    }
}
