/* --- スライダー外枠 --- */
.slider-wrapper {
    position: relative;
    margin: 0 auto;
    --img-fit: cover;
    --bg-color: #eee;
}

/* --- スライダー本体 --- */
.slider-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    width: 100%;
    border-radius: 12px;
    background: var(--bg-color);
    cursor: pointer;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

/* --- 画像アイテム --- */
.slide-item {
    flex: 0 0 100%; /* JSで上書きされます */
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}

.slide-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: var(--img-fit);
}

/* --- ボタン共通 --- */
.slider-btn {
    position: absolute;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover { background: rgba(0, 0, 0, 0.8); }

.prev, .next {
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
}
.prev { left: 10px; }
.next { right: 10px; }

.fs-btn {
    top: 15px;
    right: 15px;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 1.2rem;
}

.close-btn {
    top: 15px;
    right: 15px;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 1.5rem;
    z-index: 100;
}

.status-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    pointer-events: none;
    z-index: 20;
}

.fade-anim { animation: fadeInOut 1s forwards; }
@keyframes fadeInOut {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* --- 全画面表示補正 --- */
.slider-wrapper:fullscreen,
.slider-wrapper:-webkit-full-screen,
.slider-wrapper.ios-fullscreen {
    background-color: black !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.slider-wrapper.ios-fullscreen {
    position: fixed;
    top: 0; left: 0; z-index: 9999;
}

.slider-wrapper:fullscreen .slider-container,
.slider-wrapper.ios-fullscreen .slider-container {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    aspect-ratio: unset !important; /* JSのアスペクト比を無効化 */
    background: black !important;
    border-radius: 0 !important;
}

.slider-wrapper:fullscreen .slide-item,
.slider-wrapper.ios-fullscreen .slide-item {
    /* 全画面時は1枚ずつ表示するか、configに合わせて計算し直すため width はJSに従う */
    height: 100vh !important;
}

.slider-wrapper:fullscreen .slide-item img,
.slider-wrapper.ios-fullscreen .slide-item img {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

.slider-wrapper:fullscreen .fs-btn { display: none !important; }
.slider-wrapper:fullscreen .close-btn { display: none !important; }
.slider-wrapper.ios-fullscreen .close-btn { display: block !important; }

