/* ==========================================================================
   Top
   トップページ固有のスタイル（front-page.php）
   デザイン幅: 1920px
   ========================================================================== */

/* 各セクションの下のボタン（c-button-wrap） */
.p-top-news__button,
.p-top-philosophy__button {
	margin-top: 30px;
}

/* --------------------------------------------------------------------------
   メインビジュアル
   -------------------------------------------------------------------------- */
.p-top-mv {
	position: relative;
	z-index: 0;
	display: flex;
	align-items: center;
	height: 660px;
	margin-top: calc(var(--header-height) * -1);
	overflow: hidden;
	background-color: var(--color-pale-orange);
}

/* 背景の装飾（Figma の bk-items を書き出したもの。2593 x 1423px）
   左の黄色い円まで入った素材のため、デザインの位置（デザイン幅の左端から -422px、セクションの上端から -595px）に置く */
.p-top-mv::before {
	content: "";
	position: absolute;
	top: -595px;
	left: calc(50% - 960px - 422px);
	z-index: -1;
	width: 2593px;
	height: 1423px;
	background: url("../../img/top/bg-mv.svg") left top / 2593px 1423px no-repeat;
	/* SP の縮小（--bg-scale）は、画面の中央・セクションの上端を軸にして、配置を保ったまま縮める */
	transform-origin: 1382px 595px;
	scale: var(--bg-scale);
}

/* SP はキャッチの箱と写真で大部分が隠れるため、模様を小さくして（0.3 倍）、
   下側の円や点の並びが写真の左右・箱の下に見えるように置く（画面の中央に模様の x 1350px、上から 160px） */
@media (max-width: 767px) {
	.p-top-mv::before {
		top: 160px;
		left: calc(50% - 405px); /* 1350px x 0.3 */
		transform-origin: 0 0;
		scale: 0.3;
	}
}

/* 下端の内側の影 */
.p-top-mv::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	box-shadow: inset 0 -13px 36px rgb(169 116 114 / 0.2);
	pointer-events: none;
}

.p-top-mv__body {
	display: flex;
	flex-direction: column;
	gap: 18px;
	width: calc(50% + 80px);
	padding: 20px 40px 40px max(40px, calc(50% - 660px));
	background-color: rgb(255 255 255 / 0.8);
	box-shadow: 10px 11px 28px rgb(139 36 33 / 0.08);
}

.p-top-mv__catch {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-family: var(--font-mincho);
	font-size: 3.875rem;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: 0.08em;
	color: var(--color-text);
	white-space: nowrap;
}

.p-top-mv__catch-line {
	display: flex;
	gap: 15px;
	align-items: flex-start;
}

/* 「生きた意思」（文字は SVG） */
.p-top-mv__catch-label {
	flex-shrink: 0;
	padding: 8px 36px 11px 40px;
	background-image: var(--gradient-red-navy);
}

.p-top-mv__catch-label img {
	width: 320px;
}

.p-top-mv__lead {
	font-size: 1.125rem;
	line-height: 1.56;
	letter-spacing: 0.15em;
	color: var(--color-text);
}

.p-top-mv__image {
	position: absolute;
	top: 124px;
	left: calc(50% + 192px);
	z-index: 1;
	width: 455px; /* 影を含む */
}

@media (max-width: 1279px) {
	.p-top-mv__catch {
		font-size: 3.25rem;
	}

	.p-top-mv__catch-label img {
		width: 270px;
	}

	.p-top-mv__lead br {
		display: none;
	}

	.p-top-mv__image {
		top: auto;
		bottom: 0;
		left: auto;
		right: 20px;
		width: 380px;
	}
}

@media (max-width: 1023px) {
	.p-top-mv {
		flex-direction: column;
		align-items: stretch;
		height: auto;
		padding-top: calc(var(--header-height) + 40px);
	}

	.p-top-mv__body {
		width: auto;
		margin: 0 var(--container-gutter);
		padding: 24px 20px;
	}

	.p-top-mv__image {
		position: relative;
		top: auto;
		right: auto;
		left: auto;
		width: 70%;
		max-width: 400px;
		margin: 24px auto 0;
	}
}

/* SP はキャッチの各行が 1 行に収まるよう、文字サイズを画面幅に合わせて縮める（最大 43px）。
   「生きた意思」の帯と画像も文字サイズ（em）に合わせて縮める（値は 43px のときの px ÷ 43） */
@media (max-width: 767px) {
	.p-top-mv__catch {
		gap: 6px;
		font-size: clamp(1.5rem, calc(11.6vw - 12px), 2.6875rem);
		letter-spacing: 0.06em;
	}

	.p-top-mv__catch-line {
		gap: 10px;
	}

	.p-top-mv__catch-label {
		padding: 0.14em 0.58em 0.19em 0.65em; /* 6px 25px 8px 28px */
	}

	.p-top-mv__catch-label img {
		width: 5.2em; /* 224px */
	}

	.p-top-mv__lead {
		font-size: 1rem;
		letter-spacing: 0.1em;
	}
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */
.p-top-news {
	padding-top: 40px;
	padding-bottom: 40px;
	background-color: var(--color-pale-white);
}

.p-top-news__columns {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	align-items: start;
	margin-top: 30px;
}

.p-top-news__tab {
	display: flex;
	gap: 5px;
	align-items: center;
	justify-content: center;
	padding: 8px 20px;
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.08em;
	color: var(--color-white);
	opacity: 0.8;
}

.p-top-news__tab-icon {
	flex-shrink: 0;
	width: 47px;
	height: 30px;
	background-color: currentColor;
	-webkit-mask: center / auto 30px no-repeat;
	mask: center / auto 30px no-repeat;
}

.p-top-news__column--seminar .p-top-news__tab {
	background-color: var(--color-red-dark);
}

.p-top-news__column--seminar .p-top-news__tab-icon {
	-webkit-mask-image: url("../../img/top/icon-news-seminar.svg");
	mask-image: url("../../img/top/icon-news-seminar.svg");
}

.p-top-news__column--writing .p-top-news__tab {
	background-color: var(--color-orange);
}

.p-top-news__column--writing .p-top-news__tab-icon {
	-webkit-mask-image: url("../../img/top/icon-news-writing.svg");
	mask-image: url("../../img/top/icon-news-writing.svg");
}

.p-top-news__column--blog .p-top-news__tab {
	background-color: var(--color-pink-red);
}

.p-top-news__column--blog .p-top-news__tab-icon {
	-webkit-mask-image: url("../../img/top/icon-news-blog.svg");
	mask-image: url("../../img/top/icon-news-blog.svg");
}

.p-top-news__column--media .p-top-news__tab {
	background-color: var(--color-grey-blue);
}

.p-top-news__column--media .p-top-news__tab-icon {
	-webkit-mask-image: url("../../img/top/icon-news-media.svg");
	mask-image: url("../../img/top/icon-news-media.svg");
}

.p-top-news__list {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.p-top-news__item {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	height: 90px;
	padding: 12px 16px;
	background-color: var(--color-white);
}

.p-top-news__date {
	flex-shrink: 0;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.79;
	letter-spacing: 0.02em;
	color: var(--color-dark-grey);
}

/* タイトルは 2 行で省略 */
.p-top-news__title {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 500;
	line-height: 1.69;
	letter-spacing: 0.1em;
	color: var(--color-text);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.p-top-news__empty {
	padding: 12px 16px;
	font-size: 0.875rem;
	color: var(--color-dark-grey);
	background-color: var(--color-white);
}

@media (max-width: 1279px) {
	.p-top-news__columns {
		grid-template-columns: repeat(2, 1fr);
		gap: 30px 20px;
	}

	/* 文字が小さくなる分、高さもタイトル 2 行分（+ 上下の余白）に合わせる。高さはどの項目も同じにそろえる */
	.p-top-news__item {
		height: calc(1rem * 1.69 * 2 + 24px);
	}
}

@media (max-width: 767px) {
	.p-top-news {
		padding-top: 24px;
		padding-bottom: 24px;
	}

	.p-top-news__columns {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.p-top-news__tab {
		font-size: 1.125rem;
	}

	/* SP は各カテゴリー 3 件まで表示する（PC は 5 件。記事は news-column.php で 5 件取得している） */
	.p-top-news__list > li:nth-child(n + 4) {
		display: none;
	}

	/* SP は日付とタイトルを縦に並べる */
	.p-top-news__item {
		flex-direction: column;
		gap: 2px;
		height: auto;
		min-height: 78px;
		padding-left: 20px;
		padding-right: 20px;
	}
}

/* --------------------------------------------------------------------------
   Business / Philosophy 共通の背景
   -------------------------------------------------------------------------- */
.p-top-bg {
	--bg-decoration-top: -142px; /* 背景の装飾（c-bg-decoration）の位置 */
	position: relative;
	z-index: 0;
	overflow: hidden;
	background-color: var(--color-white);
}

/* 上下の内側の影 */
.p-top-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 6px 36px rgb(118 47 47 / 0.2);
	mix-blend-mode: multiply;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Business
   -------------------------------------------------------------------------- */
.p-top-business {
	padding-top: 40px;
	padding-bottom: 40px;
}

.p-top-business__list {
	display: flex;
	flex-wrap: wrap;
	gap: 25px;
	justify-content: center;
	margin-top: 30px;
}

.p-top-business__list > li {
	width: 380px;
}

.p-top-business__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding-bottom: 20px;
	background-color: var(--color-white);
	box-shadow: 2px 4px 10px rgb(0 0 0 / 0.2);
}

.p-top-business__head {
	align-self: stretch;
	min-height: 230px;
	padding-top: 20px;
	padding-bottom: 17px;
	/* Figma は画像を 121% に拡大して下揃え（左右は中央） */
	background: url("../../img/top/bg-business-card.webp") center bottom / 121% 121% no-repeat;
}

/* 1 行・2 行どちらの見出しも 60px の枠の中で上下中央に置き、下の線の位置を揃える */
.p-top-business__title {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 69px;
	padding-bottom: 9px;
	padding-left: 24px;
	font-size: 1.5625rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.18em;
	color: var(--color-text);
	white-space: nowrap;
}

.p-top-business__initial {
	color: var(--color-red);
}

/* 見出し下の線 */
.p-top-business__title::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 230px;
	height: 1px;
	background-color: var(--color-pale-white);
}

.p-top-business__text {
	margin-top: 12px;
	padding-left: 24px;
	padding-right: 24px;
	font-weight: 350;
	line-height: 1.75;
	letter-spacing: 0.1em;
	color: var(--color-black);
}

.p-top-business__image {
	height: 200px;
	width: auto;
	object-fit: contain; /* カードより幅が広いとき（320px など）に縦横比を保つ */
}

/* 「詳しく見る」 */
.p-top-business__more {
	display: flex;
	align-items: center;
	justify-content: space-between;
	align-self: flex-end;
	width: 142px;
	margin-top: 30px;
	margin-right: 25px;
	padding-bottom: 7px;
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0.15em;
	color: var(--color-red);
	/* 下線（ホバー時に左から伸ばす） */
	background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
	transition: background-size var(--duration);
}

.p-top-business__more-text {
	transition: opacity var(--duration);
}

.p-top-business__more::after {
	content: "";
	width: 7px;
	height: 12px;
	margin-right: 4px;
	background-color: currentColor;
	-webkit-mask: url("../../img/common/icon-chevron.svg") center / contain no-repeat;
	mask: url("../../img/common/icon-chevron.svg") center / contain no-repeat;
	transition: translate var(--duration);
}

@media (any-hover: hover) {
	.p-top-business__more:hover {
		opacity: 1;
		background-size: 100% 1px;
	}

	.p-top-business__more:hover .p-top-business__more-text {
		opacity: 0.5;
	}

	.p-top-business__more:hover::after {
		translate: 5px 0;
	}
}

.p-top-business__more:focus-visible {
	background-size: 100% 1px;
}

.p-top-business__more:focus-visible .p-top-business__more-text {
	opacity: 0.5;
}

.p-top-business__more:focus-visible::after {
	translate: 5px 0;
}

/* ノートPC 幅は 3 枚を横に並べたまま縮める（TB は 2 枚 + 1 枚に戻す） */
@media (max-width: 1279px) {
	.p-top-business__list > li {
		width: calc((100% - 50px) / 3);
	}

	.p-top-business__title {
		padding-left: 20px;
		letter-spacing: 0.12em;
	}

	.p-top-business__text {
		padding-left: 20px;
		padding-right: 20px;
	}

	.p-top-business__text br {
		display: none;
	}
}

@media (max-width: 1023px) {
	.p-top-business__list > li {
		width: 380px;
	}
}

@media (max-width: 767px) {
	.p-top-business {
		padding-top: 24px;
		padding-bottom: 24px;
	}

	.p-top-business__list {
		gap: 24px;
	}

	.p-top-business__list > li {
		width: 100%;
	}

	.p-top-business__title {
		padding-left: 20px;
		font-size: 1.375rem;
		letter-spacing: 0.12em;
	}

	.p-top-business__text {
		padding-left: 20px;
		padding-right: 20px;
	}

	.p-top-business__text br {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Philosophy
   -------------------------------------------------------------------------- */
.p-top-philosophy {
	margin-top: 40px;
	padding-top: 40px;
	padding-bottom: 40px;
}

.p-top-philosophy__list {
	display: flex;
	flex-wrap: wrap;
	gap: 25px;
	justify-content: center;
	margin-top: 30px;
}

.p-top-philosophy__card {
	display: flex;
	flex-direction: column;
	width: 400px;
	filter: drop-shadow(2px 4px 10px rgb(0 0 0 / 0.2));
}

/* 見出しは c-number-heading */
.p-top-philosophy__title {
	justify-content: center;
	padding-left: 20px;
	padding-right: 20px;
	white-space: nowrap;
}

.p-top-philosophy__image {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	height: 260px;
	padding: 20px;
	overflow: hidden;
	background-color: var(--color-pale-orange);
}

.p-top-philosophy__img {
	flex-shrink: 0;
	width: 100%;
	height: auto;
}

.p-top-philosophy__card--01 .p-top-philosophy__image {
	align-items: center;
}

.p-top-philosophy__card--01 .p-top-philosophy__img {
	width: 300px;
}

.p-top-philosophy__text {
	flex-grow: 1;
	min-height: 255px;
	padding: 20px 40px;
	line-height: 1.75;
	letter-spacing: 0.02em;
	color: var(--color-black);
	background-color: var(--color-white);
}

/* ノートPC 幅は 3 枚を横に並べたまま縮める（TB は 2 枚 + 1 枚に戻す） */
@media (max-width: 1279px) {
	.p-top-philosophy__card {
		width: calc((100% - 50px) / 3);
	}

	.p-top-philosophy__title {
		gap: 10px;
		padding-left: 12px;
		padding-right: 12px;
		font-size: 1.25rem;
		letter-spacing: 0.1em;
	}

	.p-top-philosophy__image {
		height: auto;
		aspect-ratio: 400 / 260;
	}

	.p-top-philosophy__card--01 .p-top-philosophy__img {
		width: 75%;
	}

	.p-top-philosophy__text {
		min-height: 0;
		padding: 20px 24px 30px;
	}
}

@media (max-width: 1023px) {
	.p-top-philosophy__card {
		width: 400px;
	}
}

@media (max-width: 767px) {
	.p-top-philosophy {
		margin-top: 24px;
		padding-top: 24px;
		padding-bottom: 24px;
	}

	.p-top-philosophy__list {
		gap: 24px;
	}

	.p-top-philosophy__card {
		width: 100%;
	}

	.p-top-philosophy__title {
		gap: 10px;
		min-height: 60px;
		padding-left: 20px;
		padding-right: 20px;
		font-size: 1.125rem;
		letter-spacing: 0.1em;
	}

	.p-top-philosophy__image {
		height: auto;
		aspect-ratio: 400 / 260;
	}

	/* iOS 15 より前の Safari は aspect-ratio が効かないため、幅から高さを計算して指定する */
	@supports not (aspect-ratio: 1 / 1) {
		.p-top-philosophy__image {
			height: calc((100vw - var(--container-gutter) * 2) * 260 / 400);
		}
	}

	.p-top-philosophy__text {
		min-height: 0;
		padding: 20px 20px 24px;
	}
}
