/* Gallery Def Lightbox Styles */

.production-lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 10000; display: flex; align-items: center; justify-content: center; animation: lightboxFadeIn 0.3s ease; }

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content-wrapper { position: relative; max-width: 90%; max-height: 90%; }

.lightbox-main-image { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity 0.2s ease; display: block; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); }

.lightbox-close-btn { position: absolute; top: -60px; right: 0; background: none; border: none; color: #fff; font-size: 60px; padding: 0; cursor: pointer; transition: all 0.3s ease; line-height: 1; min-width: 48px; display: flex; align-items: center; justify-content: center; }
.lightbox-close-btn:hover { background: none; transform: scale(1.1); }
.lightbox-close-btn:active { transform: scale(0.95); }

.lightbox-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none; color: #fff; font-size: 60px; padding: 15px 20px; cursor: pointer; transition: all 0.3s ease; line-height: 1; min-width: 60px; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.lightbox-nav-btn:hover { background: none; transform: translateY(-50%) scale(1.1); }
.lightbox-nav-btn:active { transform: translateY(-50%) scale(0.95); }
.lightbox-nav-prev { left: -80px; }
.lightbox-nav-next { right: -80px; }

.lightbox-counter { position: absolute; top: -60px; left: 0; color: white; background: rgba(0, 0, 0, 0.8); padding: 10px 16px; border-radius: 25px; font-size: 14px; font-weight: 500; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); white-space: nowrap; }

.gallery_def img { cursor: pointer; transition: transform 0.3s ease, opacity 0.3s ease; }
.gallery_def img:hover { transform: scale(1.05); opacity: 0.9; }

.lightbox-close-btn:focus,
.lightbox-nav-btn:focus { outline: 3px solid #007cba; outline-offset: 2px; }

/* タブレット（1024px以下） */
@media (max-width: 1024px) {
    .lightbox-nav-prev { left: -70px; }
    .lightbox-nav-next { right: -70px; }
    .lightbox-nav-btn { font-size: 28px; padding: 12px 16px; min-width: 54px; min-height: 54px; }
    .lightbox-close-btn { top: -50px; font-size: 22px; padding: 9px 13px; min-width: 44px; min-height: 44px; }
    .lightbox-counter { top: -50px; }
}

/* スマートフォン（768px以下） */
@media (max-width: 768px) {
    .lightbox-content-wrapper { max-width: 95%; max-height: 85%; }
    .lightbox-main-image { max-height: 70vh; }
    .lightbox-nav-prev { left: 20px; }
    .lightbox-nav-next { right: 20px; }
    .lightbox-nav-btn { font-size: 24px; padding: 10px 14px; min-width: 48px; min-height: 48px; background: rgba(255, 255, 255, 0.95); }
    .lightbox-close-btn { top: 20px; right: 20px; font-size: 20px; padding: 8px 12px; min-width: 40px; min-height: 40px; background: rgba(255, 255, 255, 0.95); }
    .lightbox-counter { top: 20px; left: 20px; font-size: 12px; padding: 8px 14px; background: rgba(0, 0, 0, 0.9); }
}

/* 小さなスマートフォン（480px以下） */
@media (max-width: 480px) {
    .lightbox-content-wrapper { max-width: 98%; max-height: 80%; }
    .lightbox-main-image { max-height: 65vh; }
    .lightbox-nav-prev { left: 15px; }
    .lightbox-nav-next { right: 15px; }
    .lightbox-nav-btn { font-size: 20px; padding: 8px 12px; min-width: 44px; min-height: 44px; }
    .lightbox-close-btn { top: 15px; right: 15px; font-size: 18px; padding: 7px 11px; min-width: 36px; min-height: 36px; }
    .lightbox-counter { top: 15px; left: 15px; font-size: 11px; padding: 6px 12px; }
}

/* 横向きスマートフォン対応 */
@media (max-width: 768px) and (orientation: landscape) {
    .lightbox-content-wrapper { max-height: 90%; }
    .lightbox-main-image { max-height: 80vh; }
    .lightbox-nav-prev { left: 10px; }
    .lightbox-nav-next { right: 10px; }
    .lightbox-close-btn { top: 10px; right: 10px; }
    .lightbox-counter { top: 10px; left: 10px; }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .lightbox-counter { background: rgba(0, 0, 0, 0.9); color: #ffffff; }
}