/* =========================================
   電子黒板 UI（写真サムネ上のエディタ + コントロールパネル）
   ========================================= */

/* サムネ上の黒板canvas */
.photo-thumb {
  position: relative;
  cursor: grab;
}
.photo-thumb.editing {
  cursor: grabbing;
}
.thumb-board-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.thumb-board-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #c8521a;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: nwse-resize;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  touch-action: none;
}
.handle-nw, .handle-se { cursor: nwse-resize; }
.handle-ne, .handle-sw { cursor: nesw-resize; }

/* カメラ撮影のバッジ */
.photo-camera-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(200, 82, 26, 0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.03em;
}

/* 黒板コントロールパネル（写真フィールド内） */
.board-control {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 6px;
}
.board-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef0f3;
}
.board-control-title {
  font-size: 12px;
  font-weight: 700;
  color: #1a3a5c;
  letter-spacing: 0.04em;
}
.board-show-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #1c2530;
  cursor: pointer;
}
.board-show-toggle input { width: 14px; height: 14px; }

.board-work-row { margin-bottom: 10px; }
.board-work-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #5a6776;
  margin-bottom: 4px;
}
.board-work-modes {
  display: flex;
  gap: 10px;
  font-weight: 400;
}
.board-work-modes label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.board-work-modes input { width: 12px; height: 12px; }
.photo-work-content {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #8f9aa8;
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background: #fff;
}
.photo-work-content:disabled {
  background: #f4f5f7;
  color: #5a6776;
}
.board-work-auto-preview {
  font-size: 10px;
  color: #5a6776;
  margin-top: 4px;
  line-height: 1.4;
  white-space: pre-line;
}
.board-work-auto-preview span { color: #1a3a5c; font-weight: 600; }

.board-actions {
  display: flex;
  gap: 8px;
}
.board-action-btn {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  border: 1px solid #8f9aa8;
  background: #fff;
  color: #1c2530;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.board-action-btn.primary {
  background: #1a3a5c;
  color: #fff;
  border-color: #1a3a5c;
  font-weight: 600;
}
.board-action-btn:hover:not(.primary) { background: #f4f5f7; }
.board-action-btn.primary:hover { background: #0f2541; }

/* 写真追加ボタンを2分割 */
.photo-upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.photo-add-btn.primary {
  background: #c8521a;
}
.photo-add-btn.primary:hover { background: #a13e0c; }
.photo-add-btn.secondary {
  background: #1a3a5c;
}
.photo-add-btn.secondary:hover { background: #0f2541; }
.photo-add-btn .icon {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 480px) {
  .photo-upload { grid-template-columns: 1fr; }
  .board-actions { flex-direction: column; }
}

/* ============ サムネクリック可能を示すヒント ============ */
.photo-thumb img {
  cursor: zoom-in;
}

/* ============ 拡大プレビュー（Lightbox） ============ */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
.photo-lightbox.open {
  display: flex;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-close:active {
  background: rgba(255, 255, 255, 0.4);
}
