/* ============================================================================
 * Ambitious Top Blocks - フロント表示スタイル（フロント側の見た目はこのファイルで完結）
 *
 * ▼ 目次（このファイル内を検索して移動）
 *   [COMMON]    共通：セクション枠 / 見出し（eyebrow・title・lead）
 *   [ENTRANCE]  入り口バナー（塗りつぶしカード）  ショートコード [top_service_banners]
 *   [OUTLINE]   アウトラインカード共通          [legal_solutions] / [related_services]
 *   [LEGAL]     リーガルソリューション（赤・内部リンク・› アイコン）
 *   [RELATED]   関連サービス・専門サイト（紺・外部リンク・⧉ アイコン）
 *   [LIBRARY]   ライブラリー（タブ切替・画像グリッド・下部リンク）
 *   [RESPONSIVE] レスポンシブ（ブレークポイント 880px / 600px）
 *
 * ▼ 主要トークン（色などはここを直せば全体に効く）
 *   リーガル赤   : #8D1414
 *   関連紺       : #1a2a5e
 *   入り口バナー : CSS変数 --atb-bg / --atb-text / --atb-accent（既定は [ENTRANCE]。
 *                 管理画面のカラーピッカー値が指定時はそれが優先される）
 *   末尾アイコン : .atb-card-more::after の content（› = \203A / ⧉ = \29C9）
 *
 * ※ 管理画面の見た目は assets/admin/admin.css 側（このファイルではない）。
 * ========================================================================== */

 /* [header] === WEB相談つきヘッダー（#main_contact / #main_contact_sp）======
  * header.php が test_top でのみ #main_contact を出力する。PCは右寄せ表示、
  * #main_contact_sp は PC で非表示・モバイルのトグルメニュー内で表示する。
  * アイコンは images/headers/icon_tell.svg（電話）/ icon_mail.svg（メール・白塗り）。
  * 両アイコンともテーマ側 images/headers/ に要設置（未設置だと404で出ない）。 */
#main_contact,
#main_contact_sp {
	display: flex;
	align-items: center;
	float: right;
	width: 328px;
}
#main_contact_sp {
	display: none;
}
.contact_tel {
	width: 50%;
	height: 48px;
	border: 2px solid #8D1414;
	position: relative;
	font-weight: 600;
	border-bottom-left-radius: 5px;
	border-top-left-radius: 5px;
	background: #fff;
	padding: 14px 16px 10px 40px;
	box-sizing: border-box;
}
.contact_tel a,
.contact_tel a:hover {
	color: #8D1414;
	text-decoration: none !important;
}
.btn_form {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: calc(328px / 2);
	height: 48px;
	border: none;
	border-radius: 0;
	border-bottom-right-radius: 5px;
	border-top-right-radius: 5px;
	background: #8D1414;
	color: #fff !important;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none !important;
	white-space: nowrap;
	padding: 12px 16px !important;
	box-sizing: border-box;
}
/* WEB相談はナビ内(#main_contact_sp)にも置かれ、テーマのナビ用リンク色に
   上書きされやすい。全状態を !important で確実に白＋下線なしにする。 */
.btn_form:link,
.btn_form:visited,
.btn_form:hover,
.btn_form:active,
.btn_form:focus {
	color: #fff !important;
	text-decoration: none !important;
}
.contact_tel::before {
	content: "";
	width: 16px;
	height: 16px;
	position: absolute;
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
	background: url("/wordpress/wp-content/themes/ambitious/images/headers/icon_tell.svg") no-repeat center / contain;
}
/* WEB相談ボタンのメールアイコン。SVGが白塗り(fill #fff)なので赤地にそのまま白で出る。
   flexアイテムとして文字の左に並べ、gap で離す（文字と重ならない）。 */
.btn_form::before {
	content: "";
	flex: none;
	width: 18px;
	height: 14px;
	background: url("/wordpress/wp-content/themes/ambitious/images/headers/icon_mail.svg") no-repeat center / contain;
}

/* ヘッダー連絡先：モバイルは #main_contact を隠し、トグルメニュー内に #main_contact_sp を表示 */
@media screen and (max-width: 767px) {
	#main_contact {
		display: none;
	}
	.main-navigation.toggled-on #main_contact_sp {
		display: flex;
		float: none;
		width: 328px;
		max-width: 92%;
		margin: 24px auto;
	}
	/* 電話・ボタンの枠を均等50%に。ボタンはその枠いっぱい(100%)に伸ばす。
	   ※ .btn_form を 50% にすると親(.contact_form)基準で潰れるため、枠側を50%にする。 */
	.main-navigation.toggled-on #main_contact_sp .contact_tel {
		width: 50%;
		white-space: nowrap;
	}
	.main-navigation.toggled-on #main_contact_sp .contact_form {
		width: 50%;
	}
	.main-navigation.toggled-on #main_contact_sp .btn_form {
		width: 100%;
	}
}

/* [COMMON] -------------------------------------------------------------- */
.atb-section {
	width: 100%;
	max-width: 1000px;
	margin: 0 auto 60px;
	padding: 0 16px;
	box-sizing: border-box;
}

/* 共通：見出し */
.atb-head {
	text-align: center;
	margin-bottom: 32px;
}
.atb-eyebrow {
	font-size: 12px;
	letter-spacing: .18em;
	color: #888;
	margin: 0 0 6px;
}
.atb-title {
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 14px;
	color: #222;
}
.atb-lead {
	font-size: 15px;
	line-height: 1.8;
	color: #555;
	margin: 0 auto;
}

/* [ENTRANCE] === 入り口バナー（塗りつぶしカード）[top_service_banners] ======= */
.atb-entrance {
	--atb-bg: #8D1414;
	--atb-text: #fff;
	--atb-accent: #fff;
}
.atb-entrance-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
}
.atb-entrance-card {
	flex: 1;
	min-width: 280px;
	display: block;
	text-decoration: none;
	text-align: center;
	background-color: var(--atb-bg);
	color: var(--atb-text);
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 25px 12px 20px;
	position: relative;
	overflow: hidden;
	box-shadow: 0 2px 5px rgba(0,0,0,.1);
	transition: all .3s ease;
}
.atb-entrance-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 5px;
	background-color: var(--atb-accent);
}
.atb-entrance-card:hover {
	opacity: .9;
	box-shadow: 0 5px 15px rgba(0,0,0,.2);
	transform: translateY(-2px);
}
.atb-entrance-title {
	display: block;
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 10px;
	color: var(--atb-text);
}
.atb-entrance-desc {
	display: block;
	font-size: 13px;
	line-height: 1.6;
	opacity: .92;
	color: var(--atb-text);
}

/* [OUTLINE] === アウトラインカード共通（リーガル / 関連サービス）============= */
.atb-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}
.atb-card-link {
	display: block;
	text-decoration: none !important;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 10px;
	padding: 16px 16px 32px 16px;
	box-shadow: 0 0 6px rgba(0,0,0,.16);
	transition: all .5s ease;
	position: relative;
	width: 300px;
	height: 167px;
}
a.atb-card-link:hover {
	transform: translateY(-10px);
	border-color: #ac0404;
}
.atb-card-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 10px;
	line-height: 1.5;
}
.atb-card-desc {
	font-size: 12px;
	line-height: 1.5;
	color: #000;
}
.atb-card-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	position: absolute;
	right: 16px;
	bottom: 16px;
}
.atb-card-more::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: -3px;
	width: 100%;
	height: 1px;
	background: currentColor;
	transition: all .5s ease;
	transform: translateY(0);
	opacity: 1;
}
a.atb-card-link:hover .atb-card-more::before {
	opacity: 0;
}
/* リンク末尾のアイコンは CSS のみで定義（内部=›／外部=⧉）。差し替えはここで完結。 */
.atb-card-more::after {
	font-size: 36px;
	font-weight: 200;
	line-height: 0.7;
	margin-bottom: 4px;
}

/* [LEGAL] リーガルソリューション：赤系・内部リンク（›） */
.atb-legal .atb-card-title { color: #8D1414; }
.atb-legal .atb-card-more { color: #8D1414; }
.atb-legal .atb-card-more::after { content: "\203A"; } /* › */
.atb-legal .atb-card-link.is-highlight { border: 2px solid #8D1414; }

/* [RELATED] 関連サービス：紺系・外部リンク（⧉） */
.atb-related .atb-card-link:hover {
	border-color: #1a2a5e;
}
.atb-related .atb-card-title {
	color: #1a2a5e;
}
.atb-related .atb-card-more {
	color: #1a2a5e;
}
.atb-related .atb-card-more::after {
	content: "";
	background-image: url("/wordpress/wp-content/themes/ambitious/images/icon_link.svg");
	background-repeat: no-repeat;
	background-size: contain;
	width: 13px;
	height: 13px;
}
.atb-related .atb-card-link.is-highlight {
	border: 2px solid #1a2a5e;
}

/* [LIBRARY] === ライブラリー（タブ切替バナー画像）[library_banners] ========= */
.atb-tabs-nav {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	border-bottom: 1px solid #e2e2e2;
	margin-bottom: 28px;
}
.atb-tab {
	flex: 1;
	background: none !important;
	border: none;
	cursor: pointer;
	font-size: 16px;
	color: #000;
	padding: 10px 5px;
	border-bottom: 2px solid transparent !important;
	transition: color .2s ease, border-color .2s ease;

}
.atb-tab:hover {
	color: #333;
 }
.atb-tab.is-active {
	color: #8D1414;
	border-bottom-color: #8D1414 !important;
	font-weight: 700;
}

.atb-lib-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px 24px;
}
.atb-lib-card {
	display: block;
	text-decoration: none;
	color: inherit;
	width: 300px;
}
.atb-lib-card.is-hidden {
	display: none;
}
.atb-lib-thumb {
	display: block;
	border: 1px solid #e6e6e6;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0,0,0,.06);
	transition: box-shadow .25s ease, transform .25s ease;
}
.atb-lib-thumb img {
	width: 100%;
	height: auto;
	display: block;
}
a.atb-lib-card:hover .atb-lib-thumb {
	box-shadow: 0 8px 18px rgba(0,0,0,.14);
	transform: translateY(-3px);
}
.atb-lib-title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	margin: 12px 0 6px;
	line-height: 1.5;
}
.atb-lib-desc {
	display: block;
	font-size: 12px;
	line-height: 1.7;
	color: #777;
}

.atb-foot {
	text-align: center;
	margin-top: 36px;
}
.atb-foot a {
	display: inline-block;
	font-size: 14px;
	color: #8D1414;
	text-decoration: none;
	border: 1px solid #8D1414;
	border-radius: 999px;
	padding: 10px 36px;
	transition: all .2s ease;
}
.atb-foot a:hover {
	background: #8D1414;
	color: #fff;
}

/* [RESPONSIVE] === レスポンシブ（ブレークポイント 880px / 600px / 360px）=====
 * 設計方針（スマホで縦長になりすぎない）:
 *   ・カードはスマホでも 2 列を維持（1 列にしない）。
 *   ・カードの固定 width/height を解除し、セル幅に追従＋高さ自動でコンパクト化。
 *   ・gap・セクション余白・フォントを段階的に圧縮。
 *   ・極狭幅（〜360px）では文字主体カードのみ 1 列に逃がす（画像カードは 2 列維持）。
 * ------------------------------------------------------------------------- */
@media screen and (max-width: 880px) {
	.atb-cards, .atb-lib-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 600px) {
	/* セクション間の余白・見出しを圧縮 */
	.atb-section { margin-bottom: 36px; padding: 0 12px; }
	.atb-head { margin-bottom: 20px; }
	.atb-title { font-size: 21px; }
	.atb-lead { font-size: 13px; line-height: 1.7; }

	/* カードは 2 列のまま、隙間を詰める */
	.atb-cards { gap: 12px; }
	.atb-lib-grid { gap: 22px 12px; }

	/* アウトラインカード：固定サイズを解除しセル幅に追従＋高さ自動 */
	.atb-card-link {
		width: auto;
		height: auto;
		min-height: 128px;
		padding: 12px 12px 28px;
		border-radius: 8px;
	}
	.atb-card-title { font-size: 13px; margin-bottom: 6px; }
	.atb-card-desc  { font-size: 11px; line-height: 1.45; }
	.atb-card-more  { right: 10px; bottom: 10px; font-size: 12px; }
	.atb-card-more::after { font-size: 26px; }

	/* ライブラリー画像カード：セル幅に追従 */
	.atb-lib-card { width: auto; }
	.atb-lib-title { font-size: 13px; margin: 8px 0 4px; }
	.atb-lib-desc  { font-size: 11px; line-height: 1.5; }

	/* 入り口バナー：2 列 */
	.atb-entrance-grid { gap: 12px; }
	.atb-entrance-card { flex: 1 1 calc(50% - 6px); min-width: 0; padding: 18px 8px 14px; }
	.atb-entrance-title { font-size: 15px; margin-bottom: 6px; }
	.atb-entrance-desc  { font-size: 12px; }

	/* タブ */
	.atb-tabs-nav { gap: 16px; }
	.atb-tab { font-size: 13px; }
}

@media screen and (max-width: 360px) {
	/* 文字主体のアウトラインカードのみ 1 列へ（画像カードは 2 列維持） */
	.atb-cards { grid-template-columns: 1fr; }
	.atb-card-link { min-height: 0; }
	.atb-entrance-card { flex-basis: 100%; }
}
