/* ============================================================
   review.css — みんなの飛行情報(地点クチコミ)
   map.css のトークン(--ink/--accent 等)を参照する。
   ============================================================ */

/* ---- 閲覧シート(判定結果シートと同じ下部カード様式・上に被せる) ---- */
.dfm-review-sheet {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(max(env(safe-area-inset-bottom), 12px));
  z-index: 13;
  width: min(560px, calc(100vw - 20px));
  max-height: 72vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 18px 20px calc(max(env(safe-area-inset-bottom), 14px));
  box-shadow: var(--shadow);
  animation: dfm-in .16s ease-out;
}
.dfm-review-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none; border-radius: var(--r-pill);
  background: var(--bg); color: var(--ink-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dfm-review-close:hover { background: var(--line); }
.dfm-review-head { padding-right: 40px; }
.dfm-review-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.dfm-review-avg {
  margin-top: 4px;
  font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.dfm-review-avg small { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.dfm-review-stars { color: #F5A623; letter-spacing: .05em; }

/* ---- この地点の飛行制限(判定 API の要約) ---- */
.dfm-review-nofly { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.dfm-rn-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--c, #999) 6%, #FFF);
  border: 1px solid color-mix(in srgb, var(--c, #999) 16%, #FFF);
  border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  line-height: 1.45;
}
.dfm-rn-row.is-loading { color: var(--ink-3); font-weight: 500; background: var(--bg); border-color: var(--line); }
.dfm-rn-chip {
  flex-shrink: 0;
  font-size: 10.5px; font-weight: 700; color: var(--c, var(--ink-2));
  background: color-mix(in srgb, var(--c, var(--ink-2)) 10%, #fff);
  border-radius: var(--r-pill);
  padding: 3px 9px;
  white-space: nowrap;
}
.dfm-rn-text { min-width: 0; }

.dfm-review-spotlink {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface);
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; text-align: left;
  transition: background .12s;
}
.dfm-review-spotlink:hover { background: var(--bg); }
.dfm-review-spotlink span { flex-shrink: 0; color: var(--pop); font-weight: 700; }

.dfm-review-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
/* 1件ずつ独立したカードにして境界を明確にする */
.dfm-review-item {
  background: #FAFAFA;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 8px;
}
.dfm-review-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dfm-review-item-head .dfm-review-stars { font-size: 13px; }
.dfm-review-meta { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.dfm-review-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.dfm-review-tags span {
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  background: var(--bg); border-radius: var(--r-pill);
  padding: 3px 9px;
}
.dfm-review-body {
  margin-top: 7px;
  font-size: 13px; line-height: 1.65; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.dfm-review-photos { display: flex; gap: 6px; margin-top: 8px; }
.dfm-review-photos img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 10px; cursor: pointer;
  background: var(--bg);
}
.dfm-review-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.dfm-review-actions button {
  border: none; background: none;
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--ink-3);
  cursor: pointer; padding: 2px 4px;
}
.dfm-review-actions button:hover { color: var(--danger); }

.dfm-review-post-btn {
  display: block; width: 100%; height: 46px;
  margin-top: 12px;
  border: none; border-radius: var(--r-pill);
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.dfm-review-post-btn:hover { background: var(--accent-press); }
.dfm-review-note {
  margin-top: 10px;
  font-size: 10.5px; color: var(--ink-3); line-height: 1.6;
}

/* ---- 判定シート内の CTA 行 ---- */
.dfm-review-cta {
  display: block;
  width: calc(100% - 48px);
  margin: 10px 24px 0;
  padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface);
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
  cursor: pointer; text-align: center;
  transition: background .12s;
}
.dfm-review-cta:hover:not(:disabled) { background: var(--bg); }
.dfm-review-cta:disabled { color: var(--ink-3); cursor: default; }

/* ---- 投稿フォーム(モーダル) ---- */
.dfm-review-form-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(11, 34, 57, .38);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dfm-review-form {
  width: min(480px, 100%);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}
.dfm-rf-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 800; color: var(--ink);
  margin-bottom: 12px;
}
.dfm-rf-close {
  width: 30px; height: 30px;
  border: none; border-radius: var(--r-pill);
  background: var(--bg); color: var(--ink-2);
  font-size: 13px; cursor: pointer;
}
.dfm-rf-stars { display: flex; align-items: center; gap: 2px; margin-bottom: 12px; }
.dfm-rf-stars button {
  border: none; background: none;
  font-size: 30px; line-height: 1; color: #F5A623;
  cursor: pointer; padding: 2px;
}
.dfm-rf-stars #rfStarLabel { margin-left: 8px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.dfm-rf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dfm-rf-tags button {
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface);
  font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  padding: 6px 12px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.dfm-rf-tags button.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.dfm-review-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--r-input);
  padding: 10px 12px;
  font-family: inherit; font-size: 13px; line-height: 1.6; color: var(--ink);
  resize: vertical;
  outline: none;
}
.dfm-review-form textarea:focus { border-color: var(--ink); }
.dfm-rf-photos { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dfm-rf-photo-list { display: flex; gap: 8px; }
.dfm-rf-photo { position: relative; }
.dfm-rf-photo img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 10px; display: block;
}
.dfm-rf-photo button {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dfm-rf-photo-add {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border: 1.5px dashed var(--line-strong); border-radius: 10px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer; text-align: center;
}
.dfm-rf-photo-add:hover { border-color: var(--ink-2); }
.dfm-rf-spot, .dfm-rf-anon {
  display: flex; align-items: center; gap: 7px;
  margin-top: 11px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  cursor: pointer;
}
.dfm-rf-spot input, .dfm-rf-anon input { width: 15px; height: 15px; accent-color: var(--accent); }
.dfm-rf-note { margin-top: 10px; font-size: 10.5px; color: var(--ink-3); line-height: 1.6; }
.dfm-rf-submit {
  display: block; width: 100%; height: 48px;
  margin-top: 12px;
  border: none; border-radius: var(--r-pill);
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  transition: background .12s, opacity .12s;
}
.dfm-rf-submit:disabled { opacity: .45; cursor: default; }
.dfm-rf-submit:hover:not(:disabled) { background: var(--accent-press); }

/* ---- 写真ライトボックス ---- */
.dfm-review-lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .82);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  padding: 20px;
}
.dfm-review-lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
}

/* ドロスポッ!モード中は制限マップ用のクチコミ閲覧シートのみ隠す
   (投稿フォーム/ライトボックスはスポット詳細のクチコミ区からも使う) */
body.mode-spot .dfm-review-sheet { display: none !important; }

@media (max-width: 480px) {
  .dfm-review-sheet { max-height: 64vh; }
  .dfm-review-form-backdrop { align-items: flex-end; padding: 0; }
  .dfm-review-form {
    width: 100%; border-radius: var(--r-card) var(--r-card) 0 0;
    padding-bottom: calc(max(env(safe-area-inset-bottom), 16px));
  }
}

/* シート上部の地点住所(逆ジオコーディング) */
.dfm-review-place {
  margin-top: 3px;
  font-size: 12.5px; color: var(--ink-2); font-weight: 500;
}
