/**
 * ABCom ダウンロードページ（archive-abcom_download.php）用スタイル
 *
 * functions.php の abcom_downloads_enqueue_assets で当ページのみ enqueue する。
 * 既存の custom.css / style.css / dist/output.css には手を入れず、
 * `ablp-dl-` プレフィックスで非干渉に追加する。
 * デザインは購入者専用ページ（abcom-owner.css）に準拠：
 * 白地／カード #e5e5e5／見出し左右の赤縦バー／ボタン #707070 → hover #000000。
 */

/* 購入者ページと同様、当ページのみ地を白に戻す（共通bodyの #e5e5e5 を上書き）。 */
body { background-color: #ffffff !important; }

.ablp-dl {
	background-color: #fff;
	color: #000000;
	padding-top: 8rem; /* 固定ヘッダー分の余白 */
	padding-bottom: 6rem;
}

@media (min-width: 768px) {
	.ablp-dl {
		padding-top: 9rem;
		padding-bottom: 8rem;
	}
}

.ablp-dl-inner {
	width: min(100%, 75rem);
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* 見出し：ブランドレッドの縦バーで挟む（LP/購入者ページのタイトル流儀） */
.ablp-dl-head {
	text-align: center;
	margin-bottom: 3rem;
}

.ablp-dl-title {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	font-size: 1.75rem;
	font-weight: 900;
	line-height: 1.3;
}

@media (min-width: 768px) {
	.ablp-dl-title {
		font-size: 2.5rem;
	}
}

.ablp-dl-title::before,
.ablp-dl-title::after {
	content: "";
	flex: 0 0 6px;
	width: 6px;
	height: 2.25rem;
	background: #e60028;
}

.ablp-dl-lead {
	margin-top: 1.5rem;
	font-size: 0.95rem;
	line-height: 1.9;
	color: #707070;
}

.ablp-dl-lead p + p {
	margin-top: 0.25rem;
}

@media (min-width: 768px) {
	.ablp-dl-lead {
		font-size: 1.0625rem;
	}
}

.ablp-dl-empty {
	text-align: center;
	color: #707070;
	font-size: 0.95rem;
}

/* カテゴリ（大分類）：短い赤アンダーライン */
.ablp-dl-cat + .ablp-dl-cat {
	margin-top: 3.5rem;
}

/* 見出し行：SP=縦積み / PC=見出しとフォルダ導線を左右に置く */
.ablp-dl-cat-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
}

@media (min-width: 768px) {
	.ablp-dl-cat-head {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 1.5rem;
	}
}

.ablp-dl-cat-title {
	font-size: 1.25rem;
	font-weight: 900;
	line-height: 1.4;
}

@media (min-width: 768px) {
	.ablp-dl-cat-title {
		font-size: 1.5rem;
	}
}

.ablp-dl-cat-title::after {
	content: "";
	display: block;
	width: 2.5rem;
	height: 3px;
	margin-top: 0.75rem;
	background: #e60028;
}

.ablp-dl-cat-desc {
	margin-top: 1rem;
	font-size: 0.875rem;
	line-height: 1.9;
	color: #707070;
}

/* フォルダを開く（中抜き）。各行のダウンロード（塗り）と役割を分ける。 */
.ablp-dl-folder-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
	padding: 0.6rem 1.25rem;
	border-radius: 9999px;
	border: 1px solid #707070;
	background: #fff;
	color: #707070;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.ablp-dl-folder-btn:hover {
	color: #000000;
	border-color: #000000;
}

.ablp-dl-folder-btn svg {
	width: 0.875rem;
	height: 0.875rem;
	flex: 0 0 auto;
}

/* 一覧：PC=1行1件 / SP=カード積み上げ */
.ablp-dl-list {
	margin-top: 1.5rem;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

.ablp-dl-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
	background: #e5e5e5;
	border-radius: 0.5rem;
	padding: 1.5rem;
}

@media (min-width: 768px) {
	.ablp-dl-item {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 2rem;
		padding: 1.5rem 1.75rem;
	}
}

.ablp-dl-item-body {
	min-width: 0;
}

.ablp-dl-item-title {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.5;
	color: #000000;
}

.ablp-dl-item-desc {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.8;
	color: #707070;
}

/* グレーのピルボタン（購入者ページの .ablp-owner-btn 準拠） */
.ablp-dl-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.9rem 1.5rem;
	border-radius: 9999px;
	background: #707070;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
	.ablp-dl-btn {
		flex: 0 0 auto;
		width: auto;
		min-width: 10rem;
	}
}

.ablp-dl-btn:hover {
	background: #000000;
	color: #fff;
}

/* -------------------------------------------------------------------------
   同意モーダル（ページ入場時・PR-3）
   同意するまで閲覧できないよう、背景のスクロールを止める。
   ------------------------------------------------------------------------- */

/* 同意前は一覧を隠す。JS が同意後に data 属性を外して表示する。
   JS が無効・実行前でも一覧が見えないよう、既定を「隠す」側にしている。 */
.ablp-dl-body[data-ablp-dl-gated] {
	display: none;
}

.ablp-dl-modal-open {
	overflow: hidden;
}

.ablp-dl-consent {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(0, 0, 0, 0.6);
}

.ablp-dl-consent[hidden] {
	display: none;
}

.ablp-dl-consent-inner {
	width: min(100%, 34rem);
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 0.75rem;
	padding: 2rem 1.75rem;
}

@media (min-width: 768px) {
	.ablp-dl-consent-inner {
		padding: 2.25rem 2.5rem;
	}
}

.ablp-dl-consent-title {
	font-size: 1.25rem;
	font-weight: 900;
	line-height: 1.4;
	color: #000000;
}

@media (min-width: 768px) {
	.ablp-dl-consent-title {
		font-size: 1.5rem;
	}
}

.ablp-dl-consent-title::after {
	content: "";
	display: block;
	width: 2.5rem;
	height: 3px;
	margin-top: 0.75rem;
	background: #e60028;
}

.ablp-dl-consent-body {
	margin-top: 1.5rem;
	font-size: 0.9rem;
	line-height: 1.9;
	color: #707070;
}

.ablp-dl-consent-body p + p {
	margin-top: 0.75rem;
}

.ablp-dl-consent-link {
	color: #e60028;
	font-weight: 700;
	text-decoration: underline;
}

.ablp-dl-consent-actions {
	margin-top: 2rem;
	display: flex;
	flex-direction: column-reverse;
	gap: 0.75rem;
}

@media (min-width: 768px) {
	.ablp-dl-consent-actions {
		flex-direction: row;
		justify-content: flex-end;
		gap: 1rem;
	}
}

.ablp-dl-consent-agree,
.ablp-dl-consent-decline {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.9rem 1.75rem;
	border-radius: 9999px;
	font-size: 0.95rem;
	font-weight: 700;
	font-family: inherit;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* 進む＝塗り（購入者ページのボタン流儀） */
.ablp-dl-consent-agree {
	background: #707070;
	color: #fff;
	border: 1px solid #707070;
}

.ablp-dl-consent-agree:hover {
	background: #000000;
	border-color: #000000;
}

/* 戻る＝中抜き */
.ablp-dl-consent-decline {
	background: #fff;
	color: #707070;
	border: 1px solid #707070;
}

.ablp-dl-consent-decline:hover {
	color: #000000;
	border-color: #000000;
}
