/* 全体の基本設定 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: #fffdf5;
  /* 優しい薄い黄色 */
  color: #333;
  line-height: 1.8;
}

/* コンテンツ幅を中央に固定 */
body>main,
div,
form,
textarea,
input,
button,
footer {
  width: auto;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
}

/* 見出し */
h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

/* 説明文 */
p {
  margin: 0 0 16px 0;
  font-size: 15px;
}

/* テキストエリア */
textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  resize: vertical;
  background: white;
  box-sizing: border-box;
}

/* タイトル欄は1行にする */
.title-field {
  width: 80%;
  max-width: 480px;
  margin: 0 auto 16px auto;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
}

/* メール入力欄 */
input[type="email"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  box-sizing: border-box;
}

/* ボタン */
button {
  width: 100%;
  background: #000;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 12px;
  transition: 0.2s;
  align-items: center;
}

button:hover {
  background: #333;
}

button:active {
  transform: scale(0.97);
}

/* 注意書きボックス */
.notice-box {
  width: 80%;
  background: #f7f7f7;
  border: 1px dashed #ccc;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 16px;
}

/* フッター */
footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

footer {
  position: sticky;
  bottom: 0;
  left: 0;
  width: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  /* 2026年らしい磨りガラス感 */
  border-top: 1px solid #ddd;
  padding: 10px 0 20px 0;
  text-align: center;
  /* これでPCでも中央に寄ります */
  z-index: 9999;
  /* 他の要素より必ず上に */
}

/* スマホでボタンが消える・押しにくい対策 */
.footer-action {
  display: block;
  width: auto;
  margin-bottom: 10px;
}

.btn-post-idea {
  display: inline-block;
  /* text-align:centerを効かせるために必要 */
  background: #333;
  color: #fff !important;
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  /* スマホで指が届きやすいサイズ感 */
  min-width: 200px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-post-idea:hover {
  background: #000;
  transform: translateY(-2px);
}

.footer-title {
  font-weight: bold;
  color: #d9534f;
  /* 少し警告・主張の色（赤系）にすると「タダではない」が刺さる */
  margin: 5px 0;
  font-size: 0.9rem;
}

.copy {
  font-size: 0.8rem;
  margin: 3px 0;
}

.copy a {
  margin: 0 5px;
  color: #666;
  text-decoration: none;
}

/* --- ポップアップ --- */
/* 背景（オーバーレイ）：真っ黒をやめて、薄い水色の透過にする */
#modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(225, 245, 254, 0.7);
  /* 薄い水色の半透明 */
  z-index: 1000;
}

/* ポップアップ本体：ここを水色にする */
/* 背景：画面全体を覆う。body直下ならこれで完璧に全画面になります */
#modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  /* 背景は透明にして、ポップアップ本体で水色を設定 */
  z-index: 9999;
  /* 他の要素より絶対上にくるように */
}

/* ポップアップ本体 */
#modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 90%;
  max-width: 600px;
  max-height: 80vh;

  background: #f0f8ff;
  /* 薄い水色 */
  border: 2px solid #add8e6;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

#popup-body {
  width: auto;
  overflow-y: auto;
  flex-grow: 1;
  padding: 30px;
  /* 余白をたっぷり（後で調整してください） */
  line-height: 1.8;
  color: #333;
}

/* 投稿カードのデザイン */
.post {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  width: auto;
}

.post-header {
  width: auto;
}

.post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.post h3 {
  margin: 0;
  /* タイトル行で制御するため0に */
  font-size: 20px;
  color: #1a1a1a;
  flex-grow: 1;
}

.post-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px 0;
}

.btn-delete-post {
  background: #ffebee !important;
  color: #c62828 !important;
  border: 1px solid #ffcdd2 !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  margin: 0 !important;
  font-weight: normal !important;
  flex-shrink: 0;
  width: auto !important;
}

.post small {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.post-content {
  font-size: 15px;
  color: #444;
  margin-bottom: 16px;
  width: auto;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #666;
}

.tags-list span {
  background: #fdf2d0;
  padding: 2px 8px;
  border-radius: 4px;
  color: #8a6d3b;
}

/* 閉じるボタン：黒背景・白文字に復活 */
.modal-header {
  width: auto;
  flex-shrink: 0;
  text-align: center;
  padding: 20px;
  background: #e1f5fe;
  border-top: 1px solid #add8e6;
}

#close-popup {
  background: #333;
  /* 黒ボタン */
  color: #fff;
  /* 白文字 */
  padding: 10px 30px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
}

#close-popup:hover {
  background: #000;
  /* マウスを乗せたら真っ黒に */
}

/* ハニーポットフィールド（人間に見えないように隠す） */
.hp-field {
  display: none !important;
  visibility: hidden;
  color: #fff;
  border: none;
}

/* AIの独り言セクション */
.ai-soliloquy {
  width: auto;
  margin-top: 20px;
  background: #f0f4f8;
  border-radius: 12px;
  padding: 0px 54px 0px 24px;
  /* 上 右 下 左 の順 */
  border-left: 4px solid #2196f3;
  box-sizing: border-box;
  /* パディングを幅の中に含める設定 */
  overflow-wrap: break-word;
  /* 長い単語やURLを強制的に折り返す */
  word-break: break-all;
  /* どこでもいいから端に来たら折る */
  text-align: justify;
  /* 右端を揃えると、パディングが綺麗に見える */
}

.ai-title {
  font-weight: bold;
  font-size: 14px;
  color: #1976d2;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-content {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}

/* index.php の最新投稿ボックスの幅調整 */
.latest-box {
  padding: 0 !important;
  max-width: 600px;
  margin: 0 auto;
}

.latest-box .post {
  margin-left: 0px;
  margin-right: 0px;
}

/* --- つかいたい モーダル --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 30px;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  position: relative;
  box-sizing: border-box;
}

.close-modal {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  margin-bottom: 12px;
}