/*
 * AnsPress (Q&A) 用の最小スタイル。swell_child/anspress/ のテンプレートが使う nk-ap-* だけ。
 * 旧 Liquid Magazine が同梱していた Bootstrap 4 の row / col-* / d-none / modal / collapse の代わり。
 * AnsPress 本体の CSS (main.css) と APPEP の CSS はそのまま効く前提で、足りない分だけ足す。
 * SWELL は .post_content の h2 / h3 に装飾 (背景・帯・::before) を付けるので、一覧の見出しはリセットする。
 */

/* ---- 共通 ---------------------------------------------------------- */
.nk-ap .nk-ap-date {
	margin-left: .6em;
	color: #666;
	font-size: .85em;
}

.nk-ap .nk-ap-pending {
	color: #c0392b;
	font-size: .85em;
}

/* 画面に出さない見出し (SWELL 以外のテーマで h1 / h2 を残すときだけ使われる) */
.nk-ap .not-actually-visible-content {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.nk-ap blockquote.no-style-blockquote,
.nk-ap blockquote.twitter-tweet {
	margin: 1em auto;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

.nk-ap blockquote.no-style-blockquote::before,
.nk-ap blockquote.no-style-blockquote::after {
	content: none;
}

/* ---- 質問ページ ----------------------------------------------------- */
.nk-ap .nk-ap-eyecatch {
	height: var(--nk-ap-eyecatch-h, 100px);
	margin: 20px 0;
	overflow: hidden;
}

.nk-ap .nk-ap-eyecatch a {
	display: block;
	height: 100%;
}

.nk-ap .nk-ap-eyecatch__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.nk-ap .nk-ap-extras {
	margin-top: 1em;
}

.nk-ap .nk-ap-pochipp {
	margin: 1em 0;
}

.nk-ap .nk-ap-ref {
	margin: 1em 0;
}

.nk-ap .nk-ap-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 1em 0;
	padding: 0;
	list-style: none;
}

.nk-ap .nk-ap-attachments__item {
	flex: 1 1 calc(50% - 4px);
	min-width: 0;
	margin: 0;
	padding: 0;
	text-align: center;
}

.nk-ap .nk-ap-attachments__item.-wide {
	flex-basis: 100%;
}

.nk-ap .nk-ap-attachments__item::before {
	content: none;
}

.nk-ap .nk-ap-attachments__img {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: 300px;
	margin: 0 auto;
	padding: 4px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	object-fit: contain;
}

.nk-ap .nk-ap-attachments__item.-wide .nk-ap-attachments__img {
	max-height: 400px;
}

/* 回答 */
.nk-ap .nk-ap-answers-label {
	margin: 1.5em 0 .5em;
	padding: 0;
	border: 0;
	background: none;
	font-size: 1.15em;
}

.nk-ap .nk-ap-answers-label::before,
.nk-ap .nk-ap-answers-label::after {
	content: none;
}

.nk-ap .nk-ap-toc {
	margin: 0 0 1em;
	padding: .5em .8em;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
}

.nk-ap .nk-ap-toc summary {
	cursor: pointer;
	font-size: .95em;
}

.nk-ap .nk-ap-toc ul {
	margin: .5em 0 0;
	padding-left: 1.2em;
}

/* 関連質問の見出し (h2) */
.nk-ap .nk-ap-related__title {
	margin: 2em 0 .6em;
	padding: 0;
	border: 0;
	background: none;
	font-size: 1.15em;
}

.nk-ap .nk-ap-related__title::before,
.nk-ap .nk-ap-related__title::after {
	content: none;
}

/* ---- 質問一覧 (1 列) ------------------------------------------------ */
.nk-ap-list .nk-ap-item {
	margin: 0 0 .8em;
}

.nk-ap-list .nk-ap-item__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}

/* 旧: 画像と件数は 992px 以上だけ (d-none d-lg-block) */
.nk-ap-list .nk-ap-item__thumb,
.nk-ap-list .nk-ap-item__counts {
	display: none;
}

@media (min-width: 992px) {
	.nk-ap-list .nk-ap-item__inner {
		grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) minmax(0, 1fr);
	}

	.nk-ap-list .nk-ap-item__thumb,
	.nk-ap-list .nk-ap-item__counts {
		display: block;
	}
}

.nk-ap-list .nk-ap-thumb {
	display: block;
	height: var(--nk-ap-thumb-h, 133px);
	overflow: hidden;
}

.nk-ap-list .nk-ap-thumb__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* 一覧の題名: SWELL の見出し装飾を消し、行数を --nk-ap-title-rows (既定 2) で切る */
/* 追加CSSの :is(.post_content) h2 装飾(白文字・紺帯)と APPEP の #anspress h2{line-height:1} に勝つため body 付き + !important */
body .post_content h2.nk-ap-q-title,
.post_content h2.nk-ap-q-title,
.post_content .nk-ap-q-title,
.nk-ap-q-title {
	display: -webkit-box !important;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--nk-ap-title-rows, 2);
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: none !important;
	color: #333 !important;
	font-size: 1.1em !important;
	font-weight: 500;
	line-height: 1.3 !important;
	line-break: loose;
	word-break: break-word;
}

.post_content .nk-ap-q-title::before,
.post_content .nk-ap-q-title::after,
.nk-ap-q-title::before,
.nk-ap-q-title::after {
	content: none;
	display: none;
}

.nk-ap-q-title.-related {
	font-size: 1em !important;
}

.nk-ap-list .ap-display-question-meta {
	margin-top: 4px;
	padding-bottom: 6px;
	border-bottom: 1px solid #d3d3d3;
	color: #666;
}

/* ---- タグのページ ---------------------------------------------------- */
.nk-ap .nk-ap-tagimage {
	height: var(--nk-ap-tagimage-h, 100px);
	margin: 0 0 1em;
	overflow: hidden;
}

.nk-ap .nk-ap-tagimage a {
	display: block;
	height: 100%;
}

.nk-ap .nk-ap-tagimage__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
