/**
 * Works company section — Figma 221:3183
 * Profile + related works grid below post content.
 */

/* 本文末尾の区切り線ブロックと固定線が重ならないようにする */
.hds-shell--works .wp-block-post-content > .acf-block-divider:last-child:not(.hds-works-entry-divider),
.hds-shell--works .wp-block-post-content > .wp-block-acf-divider:last-child,
.hds-shell--works .entry-content > .acf-block-divider:last-child:not(.hds-works-entry-divider),
.hds-shell--works .entry-content > .wp-block-acf-divider:last-child,
.hds-shell--works .wp-block-post-content > .wp-block-acf-divider:has(+ .hds-works-entry-meta),
.hds-shell--works .wp-block-post-content > .wp-block-acf-divider:has(+ .hds-works-entry-divider),
.hds-shell--works .entry-content > .wp-block-acf-divider:has(+ .hds-works-entry-meta),
.hds-shell--works .entry-content > .wp-block-acf-divider:has(+ .hds-works-entry-divider),
.hds-shell--works .wp-block-post-content > .acf-block-divider:has(+ :is(p, .wp-block-paragraph):empty:last-child),
.hds-shell--works .wp-block-post-content > .wp-block-acf-divider:has(+ :is(p, .wp-block-paragraph):empty:last-child),
.hds-shell--works .entry-content > .acf-block-divider:has(+ :is(p, .wp-block-paragraph):empty:last-child),
.hds-shell--works .entry-content > .wp-block-acf-divider:has(+ :is(p, .wp-block-paragraph):empty:last-child) {
	display: none;
}

.hds-company-section {
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	padding: 0 0 60px;
	box-sizing: border-box;
}

.hds-company-section:has(+ .hds-company-section__divider) {
	padding-bottom: 0;
}

.hds-company-section + .hds-company-section {
	padding-top: 0;
}

.hds-company-section__divider {
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	box-sizing: border-box;
}

.hds-company-section__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.hds-company-section__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin: 0 0 24px;
}

.hds-company-section__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 213px;
	min-height: 80px;
	margin: 0 0 8px;
}

.hds-company-section__logo img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 160px;
	object-fit: contain;
}

.hds-company-section__brand {
	margin: 0 0 16px;
	color: #333333;
	font-family: "EB Garamond", "Noto Serif JP", serif;
	font-size: calc(42px * var(--hds-type-scale, 1));
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-align: center;
}

.hds-company-section__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	width: 100%;
	max-width: 568px;
	margin: 0 0 24px;
	color: #333333;
	font-family: "Noto Serif JP", serif;
	font-weight: 400;
	text-align: center;
}

.hds-company-section__name {
	margin: 0;
	font-size: calc(18px * var(--hds-type-scale, 1));
	line-height: 1.8;
}

.hds-company-section__desc {
	margin: 0;
	font-size: calc(16px * var(--hds-type-scale, 1));
	line-height: 2.1;
	text-align: justify;
	text-justify: inter-ideograph;
}

.hds-company-section__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hds-company-section__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 270px;
	max-width: 100%;
	padding: 10px 0;
	box-sizing: border-box;
	border-bottom: 1px solid #535353;
	color: #333333;
	font-family: "Noto Serif JP", serif;
	font-size: calc(15px * var(--hds-type-scale, 1));
	font-weight: 400;
	line-height: 1.8;
	text-decoration: none;
}

a.hds-company-section__link:hover,
a.hds-company-section__link:focus {
	color: #333333;
	opacity: 0.7;
}

.hds-company-section__link-icon {
	display: block;
	width: 17px;
	height: 17px;
	flex-shrink: 0;
}

.hds-company-works {
	width: 100%;
	padding: 40px 0 0;
	box-sizing: border-box;
}

.hds-company-works__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 26px 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hds-company-works__item {
	margin: 0;
	min-width: 0;
}

.hds-company-works__card {
	display: flex;
	flex-direction: column;
	gap: 9px;
	color: inherit;
	text-decoration: none;
}

.hds-company-works__card:hover .hds-company-works__title,
.hds-company-works__card:focus .hds-company-works__title {
	opacity: 0.7;
}

.hds-company-works__media {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background-color: transparent;
	border: 0;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hds-company-works__card:hover .hds-company-works__media,
.hds-company-works__card:focus .hds-company-works__media,
.hds-company-works__card:focus-within .hds-company-works__media {
	border-color: #fff;
	box-shadow: 0 0 0 1px #fff, 0 0 8px rgba(255, 255, 255, 0.75);
}

.hds-company-works__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.hds-company-works__media img.hds-works-card-logo {
	position: absolute;
	top: 50%;
	left: 50%;
	width: auto;
	height: auto;
	max-width: 62%;
	max-height: 58%;
	object-fit: contain;
	transform: translate(-50%, -50%);
}

.hds-company-works__fallback-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: #333333;
	font-family: "Noto Serif JP", "EB Garamond", serif;
	font-size: calc(14px * var(--hds-type-scale, 1));
	line-height: 1.8;
	letter-spacing: 0.12em;
}

.hds-company-works__title {
	margin: 0;
	color: #333333;
	font-family: "Noto Serif JP", serif;
	font-size: calc(14px * var(--hds-type-scale, 1));
	font-weight: 400;
	line-height: 1.4;
	word-break: break-word;
}

.hds-company-works__all {
	display: flex;
	justify-content: center;
	margin: 32px 0 0;
}

.hds-company-works__all a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4em;
	padding: 10px 30px;
	border-bottom: 1px solid #535353;
	color: #333333;
	font-family: "Noto Serif JP", serif;
	font-size: calc(15px * var(--hds-type-scale, 1));
	font-weight: 400;
	line-height: 1.8;
	text-decoration: none;
}

.hds-company-works__all a:hover,
.hds-company-works__all a:focus {
	opacity: 0.7;
}

@media screen and (max-width: 781px) {
	.hds-company-section {
		max-width: none;
		padding: 0 24px 40px;
	}

	.hds-company-section__logo {
		width: calc(213px * 0.9);
		min-height: 0;
	}

	.hds-company-section__logo img {
		max-height: calc(160px * 0.9);
	}

	.hds-company-section__links {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		width: calc(min(780px, 100vw - (var(--hds-content-gutter) * 2)) - 8px);
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	.hds-company-section__links > li {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		margin: 0;
	}

	.hds-company-section__link {
		width: 100%;
		gap: 6px;
		padding: 10px 4px;
		font-size: calc(14px * var(--hds-type-scale, 1));
	}

	.hds-company-section__desc {
		width: calc(min(780px, 100vw - (var(--hds-content-gutter) * 2)) - 8px);
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
		font-family: "Noto Serif JP", serif;
		font-size: calc(14px * var(--hds-type-scale, 1));
		font-weight: 400;
		line-height: 1.8;
		letter-spacing: 1.12px;
		color: #333333;
	}

	.hds-company-works {
		width: 100%;
		max-width: none;
		margin-left: 0;
		margin-right: 0;
		box-sizing: border-box;
	}

	.hds-company-works__list {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.hds-company-works__card {
		gap: 8px;
	}

	.hds-company-works__title {
		font-size: calc(13px * var(--hds-type-scale, 1));
		line-height: 1.8;
	}

	.hds-company-works__media {
		border-width: 0.5px;
	}

	.hds-company-works__fallback-label {
		font-size: calc(12px * var(--hds-type-scale, 1));
	}
}

/* PC: works main 内では左右レール揃え */
@media screen and (min-width: 782px) {
	.hds-shell--works .hds-company-section,
	.hds-shell--works .hds-company-section__divider,
	.hds-shell--works .hds-works-related {
		max-width: var(--hds-content-rail);
		margin-left: auto;
		margin-right: auto;
	}
}

/* Related works by category — above company section */
.hds-works-related {
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
}

.hds-works-related__divider {
	width: 100%;
}

.hds-works-related__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.hds-works-related__title {
	margin: 0 0 28px;
	color: #333333;
	font-family: "Noto Serif JP", "EB Garamond", serif;
	font-size: calc(18px * var(--hds-type-scale, 1));
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-align: center;
}

.hds-works-related__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 26px 36px;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hds-works-related__item {
	margin: 0;
	min-width: 0;
}

.hds-works-related__card {
	display: flex;
	flex-direction: column;
	gap: 9px;
	color: inherit;
	text-decoration: none;
}

.hds-works-related__card:hover .hds-works-related__card-title,
.hds-works-related__card:focus .hds-works-related__card-title {
	opacity: 0.7;
}

.hds-works-related__media {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background-color: transparent;
	border: 0;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hds-works-related__card:hover .hds-works-related__media,
.hds-works-related__card:focus .hds-works-related__media,
.hds-works-related__card:focus-within .hds-works-related__media {
	border-color: #fff;
	box-shadow: 0 0 0 1px #fff, 0 0 8px rgba(255, 255, 255, 0.75);
}

.hds-works-related__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.hds-works-related__media img.hds-works-card-logo {
	position: absolute;
	top: 50%;
	left: 50%;
	width: auto;
	height: auto;
	max-width: 62%;
	max-height: 58%;
	object-fit: contain;
	transform: translate(-50%, -50%);
}

.hds-works-related__card-title {
	margin: 0;
	color: #333333;
	font-family: "Noto Serif JP", serif;
	font-size: calc(14px * var(--hds-type-scale, 1));
	font-weight: 400;
	line-height: 1.4;
	word-break: break-word;
}

@media screen and (max-width: 781px) {
	.hds-works-related {
		max-width: none;
		padding: 0 24px;
	}

	.hds-works-related__title {
		margin-bottom: 24px;
		font-size: calc(16px * var(--hds-type-scale, 1));
	}

	.hds-works-related__list {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.hds-works-related__card {
		gap: 8px;
	}

	.hds-works-related__card-title {
		font-size: calc(13px * var(--hds-type-scale, 1));
		line-height: 1.8;
	}

	.hds-works-related__media {
		border-width: 0.5px;
	}
}
