/**
 * 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;
	}
}

/* 資料請求への導線（案内文の下）。素材のダウンロード（グレー）と役割が違うので、
   LP の「お見積りはこちら」と同じブランドの赤の枠線ボタンにする。SP=幅いっぱい（最大 22rem）。 */
.ablp-dl-cta {
	margin-top: 1.75rem;
	display: flex;
	justify-content: center;
}

.ablp-dl-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 22rem;
	padding: 0.85rem 1.75rem;
	border: 2px solid #e60028;
	border-radius: 9999px;
	background: #fff;
	color: #e60028;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
	.ablp-dl-cta-btn {
		width: auto;
		min-width: 15rem;
	}
}

.ablp-dl-cta-btn:hover {
	background: #ffe9ed;
}

/* 右下の「製品デモ・トライアル」バナーを出すとき（PC）は、一覧の右を空けて
   「ダウンロード」「フォルダを開く」ボタンがバナーの下に入らないようにする（実運用者の依頼・2026-10）。
   バナー（赤いピル）は画面の右端から 1.5rem ＋ 幅 約 11.25rem（180px）≒ 13rem を占める（assets/abcom-chrome.css）。
   文言を「デモ受付中」から「デモ機を試す」に変えてピルが 1 文字（約 1rem）広がったので、12rem から 13rem にした（2026-10-27。
   1024〜約 1584px の画面で、一覧の右端とバナーの左端の間が 12px に詰まっていたのを、前と同じくらいの約 28px に戻す）。
   デモの上に「資料請求はこちら」のピル（197px・デモより 17px 広い）を積んだので、13rem から 14rem にした
   （2026-11-02。1280px の画面の実測で、一覧の右端と資料請求のピルの左端の間が 11px に詰まるのを約 27px にする）。
   一覧の右端（.ablp-dl-inner は最大 75rem で中央寄せ・左右の余白 1.5rem）が、バナーの左端より
   さらに 1.5rem 左に来るよう、足りない分だけ右に余白を足す。画面が十分広ければ 0 になる。
   見出しと案内文は中央寄せのまま（ページの上の方で、バナーとは重ならない）。 */
@media (min-width: 1024px) {
	.ablp-dl.has-trial-banner .ablp-dl-body {
		padding-right: max(0px, calc(14rem - (100vw - min(100vw, 75rem)) / 2));
	}
}

.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-lead-link）も、同意の画面のリンクと同じ見た目にする（2026-10-21）。 */
.ablp-dl-consent-link,
.ablp-dl-lead-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;
}
