/* ==========================================================================
   Simple Lightbox（@sandragon965 版）
   内山田画廊の simple-lightbox.css をベースに、サイトカラー（#675a43）と
   明朝体キャプションに合わせて調整。js/simple-lightbox.js と対で使う。
   スワイプでの前後移動に対応し、モバイルではほぼフルスクリーンで表示する。
   ========================================================================== */

.slb-overlay {
   position: fixed;
   inset: 0;
   z-index: 9999;
   display: flex;
   align-items: center;
   justify-content: center;
   background: rgba(22, 19, 14, 0.95);   /* 黒に茶色をわずかに混ぜる */
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.25s ease, visibility 0.25s;
   touch-action: none;
}

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

body.slb-lock {
   overflow: hidden;
}

.slb-figure {
   position: relative;
   display: flex;
   flex-direction: column;
   align-items: center;
   max-width: 94vw;
   max-height: 92vh;
   will-change: transform;
}

.slb-img-wrap {
   display: flex;
   align-items: center;
   justify-content: center;
   max-width: 94vw;
   max-height: 80vh;
}

.slb-image {
   max-width: 94vw;
   max-height: 80vh;
   width: auto;
   height: auto;
   object-fit: contain;
   border-radius: 2px;
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
   opacity: 0;
   transform: scale(0.98);
   transition: opacity 0.3s ease, transform 0.3s ease;
   user-select: none;
   -webkit-user-drag: none;
}

.slb-image.is-loaded {
   opacity: 1;
   transform: none;
}

.slb-caption {
   max-width: 90vw;
   margin-top: 14px;
   padding: 0 10px;
   color: #f2ede4;
   font-family: "游明朝", "Yu Mincho", "YuMincho", "ヒラギノ明朝 Pro W3", "Hiragino Mincho Pro", serif;
   font-size: 0.95rem;
   line-height: 1.6;
   letter-spacing: 0.12em;
   text-align: center;
}

.slb-counter {
   margin-top: 4px;
   color: #a99f8d;
   font-size: 0.75rem;
   letter-spacing: 0.2em;
}

/* ボタン共通 */
.slb-btn {
   position: fixed;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 46px;
   height: 46px;
   border: 1px solid rgba(242, 237, 228, 0.15);
   border-radius: 50%;
   background: rgba(103, 90, 67, 0.35);
   color: #f2ede4;
   font-size: 1.4rem;
   line-height: 1;
   cursor: pointer;
   -webkit-tap-highlight-color: transparent;
   transition: background 0.2s ease, border-color 0.2s ease;
}

.slb-btn:hover,
.slb-btn:focus-visible {
   border-color: rgba(242, 237, 228, 0.4);
   background: rgba(103, 90, 67, 0.75);
}

.slb-btn:focus-visible {
   outline: 2px solid #f2ede4;
   outline-offset: 2px;
}

.slb-close {
   top: 14px;
   right: 14px;
   z-index: 2;
   width: auto;
   height: auto;
   min-width: 46px;
   padding: 10px 20px 10px 14px;
   border-radius: 999px;
   gap: 8px;
   font-size: 1rem;
}

.slb-close-icon {
   font-size: 1.7rem;
   line-height: 1;
}

.slb-close-label {
   font-size: 0.9rem;
   letter-spacing: 0.1em;
   text-transform: lowercase;
}

.slb-prev {
   top: 50%;
   left: 12px;
   transform: translateY(-50%);
}

.slb-next {
   top: 50%;
   right: 12px;
   transform: translateY(-50%);
}

/* ========= モバイル最適化 ========= */
@media screen and (max-width: 720px) {
   .slb-figure {
      max-width: 100vw;
      max-height: 100vh;
   }

   .slb-img-wrap {
      max-width: 100vw;
      max-height: 78vh;
   }

   .slb-image {
      max-width: 100vw;
      max-height: 78vh;
      border-radius: 0;
      box-shadow: none;
   }

   /* 矢印はスワイプ操作に譲り、誤タップを防ぐため非表示 */
   .slb-prev,
   .slb-next {
      display: none;
   }

   .slb-close {
      top: max(10px, env(safe-area-inset-top));
      right: max(10px, env(safe-area-inset-right));
      padding: 12px 22px 12px 16px;
      background: rgba(22, 19, 14, 0.7);
      font-size: 1.05rem;
   }

   .slb-close-icon {
      font-size: 1.9rem;
   }

   .slb-caption {
      font-size: 0.85rem;
   }
}

@media (prefers-reduced-motion: reduce) {
   .slb-overlay,
   .slb-image {
      transition: none;
   }
}
