/* ============================================================
   気づき投稿画面（定義書「気づき投稿機能」／修正依頼 No.0180）

   SNSに近い全画面の投稿画面にするため、
   サイトのヘッダーは出しません（上の帯の「キャンセル」で戻ります）。
   フッターと下部の固定メニューは index.php 側で出していません。
   ============================================================ */

/* サイトのヘッダーを隠す（この画面だけ） */
#header,
#header_div { display: none !important; }

.jp-wrap {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	background: #fff;
}

/* ---------- 上の帯 ---------- */
.jp-bar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	/* 線は画面いっぱいに引きつつ、中身は本文と同じ幅にそろえる。
	   広い画面で「キャンセル」と「投稿」だけが左右の端に離れて見えないように。 */
	padding: 12px max(16px, calc((100% - 720px) / 2));
	background: #fff;
	border-bottom: 1px solid #f1f5f9;
}
.jp-cancel {
	font-size: 15px;
	font-weight: 700;
	color: #334155;
	text-decoration: none;
	padding: 6px 2px;
}
.jp-cancel:hover { color: #0f172a; }
.jp-submit {
	min-width: 84px;
	padding: 10px 22px;
	border: 0;
	border-radius: 9999px;
	background: #f97316;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.jp-submit:disabled { background: #fed7aa; cursor: default; }
.jp-submit:not(:disabled):active { background: #ea580c; }

/* ---------- 中身 ---------- */
.jp-main {
	flex: 1 1 auto;
	padding: 16px;
	max-width: 720px;
	width: 100%;
	margin: 0 auto;
}

/* ---------- スポット ---------- */
.jp-spot {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	padding: 4px 0 10px;
}
.jp-spot-pin {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 9999px;
	background: #fff7ed;
	color: #f97316;
	display: flex;
	align-items: center;
	justify-content: center;
}
.jp-spot-body { min-width: 0; flex: 1 1 auto; }
.jp-spot-name {
	display: block;
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.jp-spot-sub {
	display: block;
	font-size: 12px;
	color: #94a3b8;
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.jp-spot-change {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	color: #f97316;
	border: 1px solid #fed7aa;
	border-radius: 9999px;
	padding: 4px 10px;
}
.jp-chevron { color: #94a3b8; font-weight: 400; }
.jp-spot-empty .jp-spot-name { color: #0f172a; }

/* ---------- 名前／匿名 ---------- */
.jp-who { position: relative; margin: 2px 0 14px 56px; }
.jp-who-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 9999px;
	background: #f8fafc;
	color: #475569;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}
.jp-who-icon { display: inline-flex; }
.jp-chevron-down { color: #94a3b8; }
.jp-who-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 30;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
	overflow: hidden;
	min-width: 200px;
}
.jp-who-menu button {
	display: block;
	width: 100%;
	text-align: left;
	padding: 11px 14px;
	border: 0;
	background: none;
	font-size: 13px;
	color: #334155;
	cursor: pointer;
}
.jp-who-menu button:hover { background: #f8fafc; }

/* ---------- ひとこと ---------- */
.jp-editor {
	position: relative;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px 14px 30px;
}
.jp-editor:focus-within { border-color: #fdba74; }
.jp-body {
	width: 100%;
	min-height: 170px;
	border: 0;
	outline: none;
	resize: none;
	font-size: 16px;   /* iOS で勝手に拡大されないよう 16px 以上にする */
	line-height: 1.7;
	color: #0f172a;
	background: transparent;
}
.jp-body::placeholder { color: #cbd5e1; }
.jp-count {
	position: absolute;
	right: 14px;
	bottom: 10px;
	font-size: 12px;
	color: #cbd5e1;
}
.jp-count.is-over { color: #dc2626; font-weight: 700; }

/* ---------- 写真 ---------- */
.jp-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.jp-photo {
	position: relative;
	width: 88px;
	height: 88px;
	border-radius: 12px;
	overflow: hidden;
	background: #f1f5f9;
}
.jp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jp-photo-del {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border: 0;
	border-radius: 9999px;
	background: rgba(15, 23, 42, .65);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}

/* ---------- 自分用メモ ---------- */
.jp-memo {
	position: relative;
	margin-top: 14px;
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
	padding: 12px 14px 30px;
	background: #f8fafc;
}
.jp-memo-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	font-weight: 700;
	color: #64748b;
	margin-bottom: 6px;
}
.jp-memo-close {
	border: 0;
	background: none;
	color: #94a3b8;
	font-size: 12px;
	cursor: pointer;
}
.jp-memo-input {
	width: 100%;
	min-height: 84px;
	border: 0;
	outline: none;
	resize: none;
	font-size: 16px;
	line-height: 1.6;
	color: #334155;
	background: transparent;
}
.jp-memo-input::placeholder { color: #cbd5e1; }

/* ---------- 案内・エラー ---------- */
.jp-hint  { margin-top: 12px; font-size: 12px; color: #94a3b8; }
.jp-error {
	margin-top: 10px;
	font-size: 13px;
	font-weight: 700;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 10px;
	padding: 10px 12px;
}

/* ---------- 下の3つのボタン ---------- */
.jp-tools {
	position: sticky;
	bottom: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid #f1f5f9;
	max-width: 720px;
	width: 100%;
	margin: 0 auto;
}
.jp-tool {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 14px 6px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	background: #fff;
	color: #f97316;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}
.jp-tool span { color: #334155; }
.jp-tool:active { background: #fff7ed; }
.jp-tool:disabled { opacity: .45; cursor: default; }

/* 送信中は画面を覆って、二重に押せないようにする */
.jp-sending { position: relative; pointer-events: none; opacity: .6; }

/* ============================================================
   広い画面（パソコン・タブレット）

   スマホでは、アプリのように画面の高さいっぱいを使い、
   下の3つのボタンを画面の下に貼り付けます。
   ただし広い画面で同じことをすると、入力欄とボタンのあいだに
   大きな余白ができてしまいます。
   そこで広い画面では、中身の高さのぶんだけにします。
   ============================================================ */
@media (min-width: 768px) {
	.jp-wrap {
		min-height: 0;
		padding-bottom: 32px;
	}
	.jp-main {
		flex: 0 0 auto;
		padding-bottom: 4px;
	}
	.jp-tools {
		position: static;
		border-top: 0;
		padding-top: 4px;
		padding-bottom: 0;
	}
	/* 入力欄は、書き始めるまで背を高くしない */
	.jp-body { min-height: 140px; }
}
