/*
 * 公開・管理共通：画像ギャラリー／サムネイル／モーダル表示用スタイルシート。
 */
/* =========================================
   KuraPost Image UI (Common CSS)
   - 公開 / 管理 共通
   - ギャラリー + サムネ + モーダル
========================================= */

/* -------------------------
   ギャラリー全体
------------------------- */
.kurapost-gallery {
    margin: 8px 0;
    max-width: 520px;
  }
  
  .kurapost-gallery__frame {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  /* メイン画像 */
  .kurapost-gallery__mainimg {
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
    border-radius: 10px;
    cursor: zoom-in;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
  }
  
  /* コメント */
  .kurapost-gallery__comment {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    word-break: break-word;
  }
  
  /* -------------------------
     サムネ
  ------------------------- */
  .kurapost-gallery__thumbs {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
  }
  
  .kurapost-gallery__thumb {
    width: 74px;
    height: 56px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    flex: 0 0 auto;
  }
  
  .kurapost-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .kurapost-gallery__thumb.is-active {
    outline: 2px solid rgba(0, 120, 255, 0.8);
    outline-offset: 1px;
  }
  
  /* -------------------------
     左右矢印（サムネ窓切替）
  ------------------------- */
  .kurapost-gallery__nav {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 30px;
    text-align: center;
    padding: 0;
    user-select: none;
  }
  
  .kurapost-gallery__nav:hover {
    background: rgba(0, 0, 0, 0.04);
  }
  
  .kurapost-gallery__nav:active {
    transform: translateY(1px);
  }
  
  /* -------------------------
     モーダル（共通）
  ------------------------- */
  .kurapost-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
  }
  
  .kurapost-modal.is-open {
    display: block;
  }
  
  /* 背景 */
  .kurapost-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
  }
  
  /* 中身 */
  .kurapost-modal__inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(94vw, 980px);
    max-height: 92vh;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.45);
  }
  
  /* 閉じる */
  .kurapost-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #fff;
    cursor: pointer;
    font-size: 26px;
    line-height: 38px;
    padding: 0;
  }
  
  .kurapost-modal__close:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  
  /* モーダル内左右矢印 */
  .kurapost-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    font-size: 28px;
    line-height: 42px;
    text-align: center;
    padding: 0;
    user-select: none;
  }
  
  .kurapost-modal__nav:hover {
    background: rgba(255, 255, 255, 1);
  }
  
  .kurapost-modal__nav--prev {
    left: 10px;
  }
  
  .kurapost-modal__nav--next {
    right: 10px;
  }
  
  /* 本体 */
  .kurapost-modal__body {
    padding: 18px 18px 16px;
    max-height: 92vh;
    overflow: auto;
  }
  
  .kurapost-modal__img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    cursor: zoom-out;
  }
  
  /* コメント */
  .kurapost-modal__comment {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
  }
  
  /* -------------------------
     レスポンシブ
  ------------------------- */
  @media (max-width: 520px) {
    .kurapost-gallery {
      max-width: 100%;
    }
  
    .kurapost-gallery__thumb {
      width: 64px;
      height: 48px;
    }
  
    .kurapost-gallery__nav {
      width: 30px;
      height: 30px;
      font-size: 20px;
      line-height: 26px;
    }
  
    .kurapost-modal__body {
      padding: 12px 12px 10px;
    }
  
    .kurapost-modal__close {
      width: 36px;
      height: 36px;
      font-size: 24px;
      line-height: 34px;
    }
  
    .kurapost-modal__nav {
      width: 40px;
      height: 40px;
      font-size: 26px;
      line-height: 38px;
    }
  }
  