/**
 * ジャーナル系サイト共有レイアウト（サイト間は並列。特定ドメインの「子」ではない）
 * body: .journal-layout-page + .site-{ディレクトリ名}（例: .site-meme） / ラッパー: .journal-layout-shell / 内側: .container
 * 検索フォーム: .journal-search-form（見た目）+ 任意で .meme-search-form などサイト別フック
 * 正本は本ファイル。静的サイトは journal-shared から、ごくたまはテーマ同梱をフォールバック可。
 */

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	word-wrap: normal;
	border: 0;
}

:root {
	--bg-color: #fcfcfc;
	--container-bg: #ffffff;
	--text-color: #1a1a1a;
	--border-color: #eeeeee;
	--nav-bg: #ffffff;
	--nav-chip-border: rgba(0, 0, 0, 0.09);
	--nav-chip-font-size: 0.61rem;
	--journal-prose-font-size: 0.75rem;
	--journal-prose-line-height: 1.65;
	--journal-prose-color: #444;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg-color: #121212;
		--container-bg: #1e1e1e;
		--text-color: #e0e0e0;
		--border-color: #333333;
		--nav-bg: #2d2d2d;
		--nav-chip-border: rgba(255, 255, 255, 0.14);
		--journal-prose-color: var(--text-color);
	}
}

body.journal-layout-page {
	background-color: var(--bg-color);
	color: var(--text-color);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	margin: 0;
	padding: 15px;
	line-height: var(--journal-prose-line-height);
	transition: background-color 0.3s, color 0.3s;
}

/* --- 白箱 + ナビ（SpermEgg .container 以下） --- */
.journal-layout-shell .container {
	max-width: 600px;
	margin: 0 auto;
	background: var(--container-bg);
	padding: 25px 25px 28px;
	box-shadow: 0 1px 15px rgba(0, 0, 0, 0.05);
	border-radius: 8px;
}

.journal-layout-shell .site-header {
	color: #d63384;
	font-size: 1.75rem;
	text-align: center;
	font-weight: 700;
	letter-spacing: 0.07em;
	line-height: 1.25;
	margin: 0 0 10px;
}

.journal-layout-shell .nav-container {
	text-align: center;
	margin: 0 0 6px;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 6px;
}

.journal-layout-shell .nav-menu {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: nowrap;
	gap: 4px;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.journal-layout-shell .nav-menu a {
	flex: 0 0 auto;
	box-sizing: border-box;
	background: var(--nav-bg);
	color: var(--text-color);
	text-decoration: none;
	padding: 4px 9px;
	border-radius: 5px;
	font-size: var(--nav-chip-font-size);
	font-weight: 500;
	line-height: 1.25;
	border: 1px solid var(--nav-chip-border);
	text-align: center;
	white-space: nowrap;
}

.journal-layout-shell .nav-menu a:hover {
	background: #f8f0ff;
	color: #8a2be2;
	border-color: rgba(138, 43, 226, 0.25);
}

@media (prefers-color-scheme: dark) {
	.journal-layout-shell .nav-menu a:hover {
		background: #3d2a4d;
		color: #e9d5ff;
		border-color: rgba(233, 213, 255, 0.22);
	}
}

@media screen and (max-width: 400px) {
	:root {
		--nav-chip-font-size: 0.61rem;
	}

	.journal-layout-shell .site-header {
		font-size: 1.4rem;
		letter-spacing: 0.065em;
		margin-bottom: 8px;
	}

	.journal-layout-shell .nav-container {
		margin-bottom: 4px;
		padding-bottom: 5px;
	}

	.journal-layout-shell .nav-menu {
		gap: 3px;
		justify-content: flex-start;
	}

	.journal-layout-shell .nav-menu a {
		padding: 3px 6px;
		border-radius: 4px;
	}

	body.journal-layout-page {
		padding: 10px;
	}

	.journal-layout-shell .container {
		padding: 14px 14px 18px;
	}

	.journal-layout-shell .portal-footer__link {
		padding: 3px 6px;
		border-radius: 4px;
	}
}

/* 検索フォーム（一覧ページ） */
.journal-layout-shell .journal-search-wrap {
	text-align: center;
	margin-bottom: 20px;
}

.journal-layout-shell .journal-search-form {
	text-align: center;
	font-size: 0;
	margin: 0;
	padding: 0;
	width: 100%;
	box-sizing: border-box;
}

.journal-layout-shell .journal-search-form input[type="text"],
.journal-layout-shell .journal-search-form input[type="search"],
.journal-layout-shell .journal-search-form button[type="submit"] {
	font-size: var(--nav-chip-font-size);
	font-weight: 500;
	line-height: 1.25;
}

.journal-layout-shell .journal-search-form input[type="text"],
.journal-layout-shell .journal-search-form input[type="search"] {
	-webkit-appearance: none;
	appearance: none;
	display: inline-block;
	margin: 0;
	background: var(--container-bg);
	color: var(--text-color);
	border: 1px solid var(--nav-chip-border);
	border-radius: 25px;
	padding: 4px 12px;
	width: 70%;
	max-width: 400px;
	min-width: 0;
	height: auto;
	box-sizing: border-box;
	vertical-align: middle;
}

.journal-layout-shell .journal-search-form input[type="search"]::-webkit-search-cancel-button,
.journal-layout-shell .journal-search-form input[type="search"]::-webkit-search-decoration {
	-webkit-appearance: none;
}

.journal-layout-shell .journal-search-form button[type="submit"] {
	background: #666;
	border: none;
	color: #fff;
	padding: 4px 12px;
	border-radius: 25px;
	cursor: pointer;
	margin: 0;
	height: auto;
	box-sizing: border-box;
	vertical-align: middle;
}

.journal-layout-shell .journal-search-form button[type="submit"]:hover {
	background: #444;
}

/* 一覧テーブル（.article-table）— WP global table から隔離 */
.journal-layout-shell .article-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
	background: transparent;
	box-shadow: none;
	border: none;
	outline: none;
}

.journal-layout-shell .article-table thead,
.journal-layout-shell .article-table tbody,
.journal-layout-shell .article-table tr {
	background: transparent;
}

.journal-layout-shell .article-table th,
.journal-layout-shell .article-table td {
	border-left: none;
	border-right: none;
	border-top: none;
	background: transparent;
	background-color: transparent;
}

.journal-layout-shell .article-table th {
	font-size: 0.8rem;
	color: #666;
	padding: 8px 5px;
	border-bottom: 2px solid #eee;
	text-align: left;
	font-weight: inherit;
	text-transform: none;
}

.journal-layout-shell .article-table td {
	padding: 3px 5px;
	border-bottom: 1px solid #f2f2f2;
	vertical-align: middle;
	line-height: 1.4;
}

.journal-layout-shell .article-table .article-title {
	display: inline-block;
	line-height: 1.4;
	text-decoration: none;
	color: #6f42c1;
	font-size: var(--journal-prose-font-size);
	font-weight: 500;
}

.journal-layout-shell .article-table .article-title:hover {
	text-decoration: underline;
	color: #d166ff;
}

.journal-layout-shell .article-table .meta-text {
	font-size: 0.75rem;
	color: #999;
	white-space: nowrap;
}

.journal-layout-shell .journal-empty-cell {
	text-align: center;
	padding: 30px;
	color: #999;
}

/* ページ送り */
.journal-layout-shell .pagination {
	margin-top: 12px;
	text-align: center;
	display: flex;
	justify-content: center;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.journal-layout-shell .page-btn {
	box-sizing: border-box;
	width: 45px;
	height: 28px;
	padding: 0;
	margin: 0;
	border: 1px solid #ddd;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	text-decoration: none;
	color: #6f42c1;
	font-size: 0.8rem;
	font-weight: bold;
	background: transparent;
}

.journal-layout-shell .page-btn:hover {
	border-color: #d166ff;
	color: #8a2be2;
}

.journal-layout-shell .page-info {
	font-size: 0.9rem;
	color: #888;
}

.journal-layout-shell .page-input {
	box-sizing: border-box;
	width: 45px;
	text-align: center;
	padding: 4px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.9rem;
	color: #6f42c1;
	font-weight: bold;
	background: var(--container-bg);
	-moz-appearance: textfield;
	appearance: textfield;
}

.journal-layout-shell .page-input::-webkit-outer-spin-button,
.journal-layout-shell .page-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.journal-layout-shell .page-jump-form {
	display: flex;
	align-items: center;
	gap: 5px;
	margin: 0;
}

.journal-layout-shell .page-submit-hidden {
	display: none;
}

/* --- 単一記事・議論・フォーム（詳細・コメント） --- */
.journal-layout-shell .article-container {
	margin-bottom: 50px;
	padding-top: 10px;
}

.journal-layout-shell .article-meta-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.journal-layout-shell .article-no {
	color: #d63384;
	font-weight: bold;
	font-size: 0.95rem;
	margin: 0;
	flex: 0 0 auto;
}

.journal-layout-shell .article-back-btn {
	flex: 0 0 auto;
	display: inline-block;
	box-sizing: border-box;
	font-size: 0.61rem;
	line-height: 1.25;
	font-weight: 500;
	color: var(--text-color);
	text-decoration: none;
	padding: 4px 9px;
	border-radius: 5px;
	border: 1px solid var(--nav-chip-border, rgba(0, 0, 0, 0.09));
	background: var(--nav-bg);
	white-space: nowrap;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.journal-layout-shell .article-back-btn:hover {
	background: #f8f0ff;
	color: #8a2be2;
	border-color: rgba(138, 43, 226, 0.25);
}

.journal-layout-shell .article-container h1.article-title {
	font-size: 1.35rem;
	color: var(--text-color);
	margin-bottom: 12px;
	font-weight: bold;
	line-height: 1.35;
}

.journal-layout-shell .article-meta {
	font-size: 0.8rem;
	color: #888;
	margin-bottom: 25px;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 12px;
}

.journal-layout-shell .article-meta a {
	color: #e91e8c;
	font-weight: 600;
	text-decoration: none;
}

.journal-layout-shell .article-meta a:hover {
	text-decoration: underline;
}

.journal-layout-shell .article-content {
	font-size: var(--journal-prose-font-size);
	color: var(--journal-prose-color);
	line-height: var(--journal-prose-line-height);
	margin-bottom: 40px;
	word-break: break-word;
	overflow-wrap: break-word;
}

.journal-layout-shell .comment-section {
	margin-top: 40px;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid var(--border-color);
}

.journal-layout-shell .comment-header {
	font-size: 1.15rem;
	font-weight: bold;
	margin-bottom: 20px;
	color: #6f42c1;
	border-left: 5px solid #6f42c1;
	padding-left: 15px;
}

.journal-layout-shell .comment-item {
	background: rgba(0, 0, 0, 0.02);
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 15px;
	border: 1px solid var(--border-color);
}

.journal-layout-shell .comment-meta {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	color: #888;
	margin-bottom: 8px;
	flex-wrap: wrap;
	gap: 6px;
}

.journal-layout-shell .comment-meta .comment-author {
	font-weight: bold;
}

.journal-layout-shell .comment-section .comment-content {
	font-size: var(--journal-prose-font-size);
	color: var(--journal-prose-color);
	line-height: var(--journal-prose-line-height);
}

.journal-layout-shell .comment-empty,
.journal-layout-shell .gk-no-comments {
	color: #999;
	text-align: center;
	font-size: var(--journal-prose-font-size);
	line-height: var(--journal-prose-line-height);
	margin: 0;
}

.journal-layout-shell .gk-comments-closed {
	color: #999;
	text-align: center;
	margin: 0;
	font-size: var(--journal-prose-font-size);
	line-height: var(--journal-prose-line-height);
}

.journal-layout-shell .form-box {
	margin-top: 50px;
	padding: 20px;
	border-top: 2px solid var(--border-color);
}

.journal-layout-shell .journal-form-field {
	margin-bottom: 15px;
}

.journal-layout-shell .form-actions {
	text-align: right;
}

.journal-layout-shell .input-field,
.journal-layout-shell .textarea-field {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	box-sizing: border-box;
	background: var(--container-bg);
	color: var(--text-color);
	font-family: inherit;
	font-size: var(--journal-prose-font-size);
	line-height: var(--journal-prose-line-height);
}

.journal-layout-shell .textarea-field {
	min-height: 120px;
	height: 120px;
	resize: vertical;
}

.journal-layout-shell .form-label {
	display: block;
	font-size: var(--journal-prose-font-size);
	font-weight: bold;
	color: var(--journal-prose-color);
	margin-bottom: 5px;
}

.journal-layout-shell .submit-btn {
	background: #6f42c1;
	color: #fff;
	border: none;
	padding: 10px 25px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: bold;
	font-family: inherit;
}

.journal-layout-shell .exam-notice-box {
	background: #fff5f5;
	border: 1px solid #feb2b2;
	color: #c53030;
	padding: 15px;
	border-radius: 6px;
	text-align: center;
	font-size: var(--journal-prose-font-size);
	line-height: var(--journal-prose-line-height);
}

.journal-layout-shell .exam-notice-link,
.journal-layout-shell .gk-exam-link {
	color: #c53030;
	font-weight: bold;
}

.journal-layout-shell .gk-comment-form .comment-form-comment label,
.journal-layout-shell .gk-comment-form .comment-form-author label,
.journal-layout-shell .gk-comment-form .comment-form-email label,
.journal-layout-shell .gk-comment-form .comment-form-url label {
	display: block;
	font-size: var(--journal-prose-font-size);
	font-weight: bold;
	margin-bottom: 6px;
}

.journal-layout-shell .gk-comment-form input[type="text"],
.journal-layout-shell .gk-comment-form input[type="email"],
.journal-layout-shell .gk-comment-form input[type="url"],
.journal-layout-shell .gk-comment-form textarea {
	width: 100%;
	max-width: 100%;
	padding: 10px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	box-sizing: border-box;
	background: var(--container-bg);
	color: var(--text-color);
	font-family: inherit;
	font-size: var(--journal-prose-font-size);
	line-height: var(--journal-prose-line-height);
}

.journal-layout-shell .gk-comment-form textarea {
	min-height: 120px;
	resize: vertical;
}

.journal-layout-shell .gk-comment-form input[type="submit"],
.journal-layout-shell .gk-submit-btn {
	background: #6f42c1;
	color: #fff;
	border: none;
	padding: 10px 25px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: bold;
	font-family: inherit;
}

/* ごくたま comment-exam.php（シェル内・スタンドアロン） */
.journal-layout-shell .gk-exam-wrap {
	max-width: 520px;
	margin: 1.5rem auto;
	text-align: center;
}

.journal-layout-shell .gk-exam-wrap h2 {
	color: #d63384;
	margin-bottom: 1rem;
	font-size: 1.25rem;
}

.journal-layout-shell .gk-exam-intro {
	font-size: 0.9rem;
	line-height: var(--journal-prose-line-height);
	color: var(--text-color);
	margin-bottom: 1rem;
}

.journal-layout-shell .gk-exam-msg {
	padding: 15px;
	margin-bottom: 20px;
	border-radius: 8px;
	background: #fff5f5;
	color: #c53030;
	border: 1px solid #feb2b2;
}

.journal-layout-shell .gk-exam-form input[type="text"] {
	padding: 12px;
	width: 200px;
	border: 1px solid var(--border-color);
	border-radius: 5px;
	text-align: center;
	background: var(--container-bg);
	color: var(--text-color);
	font-family: inherit;
}

.journal-layout-shell .gk-exam-form button[type="submit"] {
	padding: 12px 28px;
	background: #6f42c1;
	color: #fff;
	border: none;
	border-radius: 5px;
	font-weight: bold;
	cursor: pointer;
	margin-top: 12px;
}

.journal-layout-shell .gk-exam-reset {
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--border-color);
}

.journal-layout-shell .gk-exam-reset button[type="submit"] {
	font-size: 0.75rem;
	background: #666;
	color: #fff;
	border: none;
	padding: 8px 15px;
	border-radius: 4px;
	cursor: pointer;
}

/* フッター（ポータル戻り） */
.journal-layout-shell .portal-footer {
	margin-top: 1.75rem;
	padding: 1.4rem 0.5rem 0.35rem;
	border-top: 1px solid var(--border-color);
	text-align: center;
}

.journal-layout-shell .portal-footer__link {
	display: inline-block;
	box-sizing: border-box;
	padding: 2px 5px;
	font-size: var(--nav-chip-font-size);
	font-weight: 500;
	line-height: 1.25;
	color: #555;
	text-decoration: none;
	border: 1px solid rgba(214, 51, 132, 0.42);
	border-radius: 5px;
	background: var(--nav-bg);
	transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	white-space: nowrap;
}

.journal-layout-shell .portal-footer__link:hover {
	color: #d63384;
	border-color: #d63384;
	background: #fff8fa;
	box-shadow: 0 2px 8px rgba(214, 51, 132, 0.12);
}

/* 読みブロック */
.journal-layout-shell .journal-prose {
	font-size: var(--journal-prose-font-size);
	line-height: var(--journal-prose-line-height);
	color: var(--journal-prose-color);
}

.journal-layout-shell .journal-prose p {
	margin: 0 0 0.85em;
}

.journal-layout-shell .journal-prose p:last-child {
	margin-bottom: 0;
}

.journal-layout-shell .journal-prose ul {
	margin: 0 0 0.85em 1.2em;
	padding: 0;
}

@media (prefers-color-scheme: dark) {
	.journal-layout-shell .article-table th {
		color: #aaa;
		border-bottom-color: #444;
	}

	.journal-layout-shell .article-table td {
		border-bottom-color: #333;
	}

	.journal-layout-shell .page-btn {
		border-color: #444;
		color: #c4b5fd;
	}

	.journal-layout-shell .page-input {
		border-color: #444;
		color: #c4b5fd;
	}

	.journal-layout-shell .article-table .article-title {
		color: #c4b5fd;
	}

	.journal-layout-shell .article-table .article-title:hover {
		color: #e9d5ff;
	}

	.journal-layout-shell .portal-footer__link {
		color: var(--text-color);
	}

	.journal-layout-shell .portal-footer__link:hover {
		background: rgba(214, 51, 132, 0.14);
	}

	.journal-layout-shell .article-back-btn:hover {
		background: #3d2a4d;
		color: #e9d5ff;
		border-color: rgba(233, 213, 255, 0.22);
	}
}

.journal-layout-shell .home-button-wrap {
	text-align: center;
	margin-top: 2.5rem;
	margin-bottom: 0.5rem;
}

.journal-layout-shell .home-button {
	display: inline-block;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 28px;
	border: 1px solid #6f42c1;
	border-radius: 6px;
	background: #fff;
	color: #6f42c1;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	text-align: center;
}

.journal-layout-shell .home-button:hover,
.journal-layout-shell .home-button:active {
	background: #6f42c1;
	color: #fff;
	border-color: #6f42c1;
}
