/* 写真オーバーレイのモバイル専用スタイル */

@media (max-width: 768px) {
  /* オーバーレイ全体 */
  .photo-detail-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: none !important;
    transition: none !important;
  }

  .photo-detail-overlay.show {
    opacity: 1;
    visibility: visible;
    transform: none !important;
    transition: none !important;
  }

  /* オーバーレイカード */
  .photo-detail-card {
    width: 95vw;
    max-width: 800px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 12px 12px 0 0;
    background-color: white;
    position: relative;
    transform: none !important;
  }

  /* カード本体 */
  .photo-detail-card .card {
    height: 100vh;
    max-height: 100vh;
    border: none;
    border-radius: 12px 12px 0 0;
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: none !important;
  }

  /* 写真表示エリア */
  .photo-detail-image-container {
    flex: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #000;
    height: 70vh;
    max-height: 70vh;
    border-radius: 12px 12px 0 0;
    transform: none !important;
  }

  /* 写真画像 */
  .photo-detail-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: none !important;
  }

  /* 3点メニュー */
  .photo-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
  }

  /* オーバーレイ内の全要素のアニメーション無効化 */
  .photo-detail-overlay *,
  .photo-detail-overlay *:active,
  .photo-detail-overlay *:hover,
  .photo-detail-overlay *:focus {
    transform: none !important;
    transition: none !important;
    animation: none !important;
    -webkit-transform: none !important;
    -webkit-transition: none !important;
    -webkit-animation: none !important;
  }

  /* 3点メニューのアニメーションも無効化 */
  .photo-actions {
    transition: none !important;
    -webkit-transition: none !important;
  }

  /* オーバーレイ内のボタン専用設定 */
  .photo-detail-overlay .btn,
  .photo-detail-overlay .btn:active,
  .photo-detail-overlay .btn:hover,
  .photo-detail-overlay .btn:focus {
    transform: none !important;
    -webkit-transform: none !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    cursor: pointer !important;
  }

  .photo-actions .btn {
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: none !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }

  .photo-actions .btn:active {
    background-color: rgba(0, 0, 0, 0.9);
    transform: none !important;
  }

  /* メモエリア内の3点メニュー */
  .custom-overlay-body .photo-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 15;
  }

  .custom-overlay-body .photo-actions .btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    font-size: 14px;
    transform: none !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }

  .custom-overlay-body .photo-actions .btn:hover {
    background-color: rgba(255, 255, 255, 1);
  }

  .custom-overlay-body .photo-actions .btn:active {
    background-color: rgba(240, 240, 240, 1);
    transform: none !important;
  }

  /* メモエリアの最適化 */
  .photo-detail-card .custom-overlay-body {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 0;
    min-height: 0;
    opacity: 0;
    transform: translateY(100%);
  }

  /* 折りたたみ状態 */
  .photo-detail-card .custom-overlay-body.collapsed {
    height: 0;
    min-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(100%);
  }

  /* 展開状態 */
  .photo-detail-card .custom-overlay-body:not(.collapsed) {
    height: auto;
    min-height: 30vh;
    opacity: 1;
    transform: translateY(0);
  }

  /* ボタンの表示/非表示切り替え */
  .photo-actions.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
  }

  .photo-actions:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }
}

@media (max-width: 576px) {
  .photo-actions {
    top: 12px;
    right: 12px;
  }

  .photo-actions .btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}
