/* 08-announcements.css — お知らせ機能のオーバーレイ（2026-06-25） */

.announce-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; box-sizing: border-box; overflow-y: auto;
}
.announce-overlay.announce-hidden { display: none; }

.announce-sheet {
  width: 100%; max-width: 560px;
  background: var(--bg-base, #0D0D12);
  border: 1px solid var(--border-strong, #333);
  border-radius: 16px;
  padding: 16px 16px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.announce-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.announce-header h3 { margin: 0; font-size: 18px; color: var(--amber, #F5A623); }
.announce-close {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: #E2E8F0; font-size: 16px; cursor: pointer;
}

/* 作成フォーム（owner のみ表示） */
.announce-compose {
  background: rgba(245, 166, 35, 0.05);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: 12px; padding: 12px; margin-bottom: 16px;
}
.announce-input, .announce-textarea {
  width: 100%; box-sizing: border-box; margin-bottom: 10px;
  background: var(--bg-base, #0D0D12); color: #E2E8F0;
  border: 1px solid var(--border-subtle, #444); border-radius: 8px; padding: 10px 12px; font-size: 15px;
}
.announce-textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.announce-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.announce-imgbtn {
  display: inline-block; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: #E2E8F0; font-size: 14px;
}
.announce-imgname { font-size: 13px; color: #9aa; }
.announce-imgprev { width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; margin-bottom: 10px; background: #000; }
.announce-imgprev.announce-hidden { display: none; }
.announce-send {
  width: 100%; padding: 14px; border: none; border-radius: 10px;
  background: var(--amber, #F5A623); color: #1a1a12; font-size: 16px; font-weight: bold; cursor: pointer;
}
.announce-send:disabled { opacity: 0.5; }

/* 見る/作成 タブ切替（owner のみ表示） */
.announce-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.announce-tabs:empty { display: none; }
.announce-tab {
  flex: 1; padding: 10px; border: 1px solid var(--border-subtle, #444); border-radius: 10px;
  background: transparent; color: #9aa; font-size: 14px; font-weight: 700; cursor: pointer;
}
.announce-tab.active { background: var(--amber, #F5A623); color: #1a1a12; border-color: var(--amber, #F5A623); }

/* 新着お知らせ → ホームの 📢お知らせ ボタンが薄く点滅 */
.action-btn.announce-new {
  border-color: var(--amber, #F5A623);
  animation: announce-blink 1.3s infinite ease-in-out;
}
@keyframes announce-blink {
  0%, 100% { box-shadow: 0 0 0 rgba(245, 166, 35, 0); border-color: rgba(245, 166, 35, 0.45); }
  50%      { box-shadow: 0 0 14px rgba(245, 166, 35, 0.55); border-color: rgba(245, 166, 35, 0.95); }
}

/* お知らせ一覧 */
.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce-list.announce-hidden, #announce-compose.announce-hidden { display: none; }
.announce-empty { color: #889; text-align: center; padding: 24px 0; }
.announce-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, #333); border-radius: 12px; padding: 12px 14px;
}
.announce-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.announce-card-title { font-size: 17px; font-weight: 700; color: #F1F5F9; }
.announce-card-date { font-size: 12px; color: #788; flex-shrink: 0; }
.announce-card-body { font-size: 16px; color: #CBD5E1; line-height: 1.7; margin-bottom: 8px; white-space: pre-wrap; }
/* 画像はサムネ表示（タップで全画面） */
.announce-card-thumb {
  max-width: 140px; max-height: 110px; object-fit: cover;
  border-radius: 8px; background: #000; cursor: pointer;
  border: 1px solid var(--border-subtle, #444);
}

/* スワイプ削除構造（setupSwipeDelete 用） */
.announce-card-swipe { position: relative; overflow: hidden; border-radius: 12px; }
.announce-card-swipe__delete-layer {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
  padding-right: 22px; background: var(--danger, #FF4D4F); color: #fff; font-weight: 800; font-size: 15px;
  border-radius: 12px;
}
.announce-card-swipe__content {
  position: relative;
  background: var(--bg-card, #1a1a22);  /* 不透明＝削除レイヤーを隠す */
  will-change: transform;
  touch-action: pan-y;  /* 縦スクロールは許可・横スワイプはJSへ渡す＝途中で戻る現象を解消 */
}

/* 通知オフのスタッフへ「オンにしませんか？」案内バナー（下部ナビの上に浮かせる） */
.push-enable-banner {
  position: fixed; left: 12px; right: 12px; z-index: 9000;
  bottom: calc(var(--nav-height, 64px) + env(safe-area-inset-bottom) + 12px);
  display: flex; align-items: center; gap: 10px;
  background: var(--amber, #F5A623); color: #1a1a12;
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.push-enable-banner.push-hidden { display: none; }
.push-enable-text { flex: 1; font-size: 15px; font-weight: 700; line-height: 1.45; }
.push-enable-on { flex-shrink: 0; background: #1a1a12; color: #fff; border: none; border-radius: 8px; padding: 9px 14px; font-weight: 800; font-size: 13px; cursor: pointer; }
.push-enable-later { flex-shrink: 0; background: transparent; border: none; color: #1a1a12; font-size: 18px; cursor: pointer; padding: 0 4px; }

/* 全画面ライトボックス（ピンチ拡大） */
.announce-lightbox {
  position: fixed; inset: 0; z-index: 100002;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
.announce-lightbox.announce-hidden { display: none; }
.announce-lb-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; touch-action: none; }
.announce-lb-close {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 18px; cursor: pointer;
}
