:root {
	--mh-text: #1f2933;
	--mh-muted: #5f6b66;
	--mh-border: #e2e9e5;
	--mh-soft: #f4f8f5;
	--mh-green: #1f6b45;
	--mh-green-dark: #174c32;
	--mh-white: #ffffff;
}

.mh-works-index-page .widget-area,
.mh-work-single-page .widget-area,
.mh-works-index-page #right-sidebar,
.mh-work-single-page #right-sidebar,
.mh-works-index-page #left-sidebar,
.mh-work-single-page #left-sidebar {
	display: none;
}

.mh-works-index-page .site-content,
.mh-work-single-page .site-content {
	display: block;
}

.mh-works-index-page .content-area,
.mh-work-single-page .content-area,
.mh-works-index-page #primary,
.mh-work-single-page #primary {
	float: none;
	width: 100%;
	max-width: none;
	margin-right: 0;
	margin-left: 0;
}

.mh-works-index-page .site-main,
.mh-work-single-page .site-main {
	margin-right: 0;
	margin-left: 0;
}

.mh-work-single-page .entry-meta,
.mh-work-single-page .comments-area,
.mh-work-single-page .post-navigation {
	display: none;
}

.mh-work-single-page .entry-header {
	width: 100%;
	max-width: 900px;
	margin-right: auto;
	margin-left: auto;
}

/*
 * GeneratePressの投稿用2カラム幅を施工事例詳細だけ解除する。
 * 外枠を全幅化し、実際の読み物幅は900pxの内側要素で管理する。
 */
.mh-work-single-page #page,
.mh-work-single-page #content,
.mh-work-single-page #primary,
.mh-work-single-page #main,
.mh-work-single-page article.mh_work,
.mh-work-single-page article.mh_work > .inside-article,
.mh-work-single-page article.mh_work .entry-content {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
}

.mh-work-single-page #primary,
.mh-work-single-page #main,
.mh-work-single-page article.mh_work,
.mh-work-single-page article.mh_work > .inside-article,
.mh-work-single-page article.mh_work .entry-content {
	margin-right: 0 !important;
	margin-left: 0 !important;
}

.mh-work-single-page article.mh_work > .inside-article {
	padding-right: 24px !important;
	padding-left: 24px !important;
}

/*
 * GeneratePress compatibility fallback:
 * hide only the theme-generated featured image on a work detail page.
 * The plugin-owned image uses .mh-work-featured-image and remains visible.
 */
.mh-work-single-page .featured-image:not(.mh-work-featured-image),
.mh-work-single-page .post-image:not(.mh-work-featured-image),
.mh-work-single-page .page-header-image-single {
	display: none !important;
}

.mh-works-index,
.mh-works-latest,
.mh-work-detail {
	color: var(--mh-text);
}

.mh-works-intro {
	max-width: 760px;
	margin: 0 0 30px;
	color: var(--mh-muted);
	font-size: 1.05rem;
	line-height: 1.85;
}

.mh-works-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 0 30px;
}

.mh-works-filter {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 15px;
	border: 1px solid var(--mh-border);
	border-radius: 999px;
	background: var(--mh-white);
	color: var(--mh-text);
	font-size: 0.94rem;
	font-weight: 600;
	text-decoration: none;
}

.mh-works-filter:hover,
.mh-works-filter:focus,
.mh-works-filter.is-active {
	border-color: var(--mh-green);
	background: var(--mh-green);
	color: var(--mh-white);
}

.mh-works-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 26px;
}

.mh-work-card {
	overflow: hidden;
	margin: 0;
	border: 1px solid var(--mh-border);
	border-radius: 8px;
	background: var(--mh-white);
	box-shadow: 0 7px 24px rgba(31, 41, 51, 0.06);
}

.mh-work-card-image {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--mh-soft);
	text-decoration: none;
}

.mh-work-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.mh-work-card:hover .mh-work-card-image img {
	transform: scale(1.025);
}

.mh-work-card-placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--mh-muted);
	font-weight: 600;
}

.mh-work-card-body {
	padding: 21px 21px 23px;
}

.mh-work-card-type,
.mh-work-detail-type {
	display: inline-block;
	margin: 0 0 9px;
	padding: 4px 9px;
	border-radius: 4px;
	background: var(--mh-soft);
	color: var(--mh-green);
	font-size: 0.82rem;
	font-weight: 700;
}

.mh-work-card-title {
	margin: 0 0 10px;
	font-size: 1.2rem;
	line-height: 1.5;
}

.mh-work-card-title a {
	color: var(--mh-text);
	text-decoration: none;
}

.mh-work-card-title a:hover,
.mh-work-card-title a:focus {
	color: var(--mh-green);
}

.mh-work-card-meta {
	margin: 0 0 13px;
	color: var(--mh-muted);
	font-size: 0.88rem;
	line-height: 1.7;
}

.mh-work-card-meta span {
	margin: 0 5px;
	color: #a8b3ad;
}

.mh-work-card-summary {
	margin: 0 0 17px;
	color: var(--mh-muted);
	font-size: 0.94rem;
	line-height: 1.8;
}

.mh-work-card-link {
	margin: 0;
}

.mh-work-card-link a,
.mh-work-back a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 8px 16px;
	border: 1px solid var(--mh-green);
	border-radius: 5px;
	background: var(--mh-white);
	color: var(--mh-green);
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease;
}

.mh-work-card-link a:hover,
.mh-work-card-link a:focus,
.mh-work-back a:hover,
.mh-work-back a:focus {
	border-color: var(--mh-green-dark);
	background: var(--mh-soft);
	color: var(--mh-green-dark);
	text-decoration: none;
}

.mh-work-card-link a:focus-visible,
.mh-work-back a:focus-visible {
	outline: 3px solid rgba(31, 107, 69, 0.25);
	outline-offset: 2px;
}

.mh-works-more {
	margin: 30px 0 0;
	text-align: center;
}

.mh-works-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 12px 24px;
	border-radius: 5px;
	background: var(--mh-green);
	color: var(--mh-white) !important;
	font-weight: 700;
	text-decoration: none !important;
}

.mh-works-button:hover,
.mh-works-button:focus {
	background: var(--mh-green-dark);
	color: var(--mh-white) !important;
}

.mh-works-empty {
	padding: 28px;
	border: 1px solid var(--mh-border);
	background: var(--mh-soft);
	color: var(--mh-muted);
	text-align: center;
}

.mh-works-pagination {
	margin-top: 34px;
}

.mh-works-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 7px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mh-works-pagination a,
.mh-works-pagination span {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--mh-border);
	border-radius: 4px;
	background: var(--mh-white);
	color: var(--mh-text);
	text-decoration: none;
}

.mh-works-pagination .current,
.mh-works-pagination a:hover,
.mh-works-pagination a:focus {
	border-color: var(--mh-green);
	background: var(--mh-green);
	color: var(--mh-white);
}

.mh-work-detail {
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
}

/*
 * M247 site-design.css is loaded after this stylesheet and intentionally
 * resets dynamic-work margins. Restore the approved single-work reading
 * width here with a selector that is limited to this post type.
 */
body.mh-work-single-page.mh-site-design-dynamic-work .entry-header,
body.mh-work-single-page.mh-site-design-dynamic-work .mh-work-detail {
	box-sizing: border-box;
	width: 100%;
	max-width: 900px !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

body.mh-work-single-page.mh-site-design-dynamic-work .entry-header {
	margin-bottom: 32px !important;
}

.mh-work-featured-image {
	margin: 8px 0 38px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--mh-soft);
}

.mh-work-featured-image-element {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
}

.mh-work-detail-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	margin: 8px 0 42px;
	border: 1px solid var(--mh-border);
	background: var(--mh-white);
}

.mh-work-detail-meta > div {
	padding: 16px 18px;
	border-right: 1px solid var(--mh-border);
}

.mh-work-detail-meta > div:last-child {
	border-right: 0;
}

.mh-work-detail-meta dt {
	margin: 0 0 4px;
	color: var(--mh-muted);
	font-size: 0.82rem;
	font-weight: 600;
}

.mh-work-detail-meta dd {
	margin: 0;
	font-weight: 700;
}

.mh-work-section {
	margin: 0 0 48px;
}

.mh-work-section h2 {
	margin: 0 0 19px;
	padding: 0 0 11px;
	border-bottom: 2px solid var(--mh-green);
	color: var(--mh-text);
	font-size: 1.55rem;
	line-height: 1.45;
}

.mh-work-text,
.mh-work-text p,
.mh-work-quote blockquote,
.mh-work-quote blockquote p {
	color: var(--mh-text);
	font-size: 1rem;
	line-height: 2;
}

.mh-work-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.mh-work-gallery-count-1 {
	grid-template-columns: minmax(0, 1fr);
	width: 100%;
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
}

.mh-work-gallery-count-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mh-work-gallery figure {
	margin: 0;
}

.mh-work-gallery a {
	display: block;
	border-radius: 6px;
	overflow: hidden;
	background: var(--mh-soft);
}

.mh-work-gallery img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.mh-work-quote blockquote {
	margin: 0;
	padding: 25px 28px;
	border-left: 4px solid var(--mh-green);
	background: var(--mh-soft);
}

.mh-work-cta {
	margin: 56px 0 28px;
	padding: 34px;
	border-radius: 8px;
	background: var(--mh-soft);
	text-align: center;
}

.mh-work-cta h2 {
	margin: 0 0 12px;
	font-size: 1.45rem;
}

.mh-work-cta p {
	margin: 0 auto 18px;
	max-width: 650px;
	color: var(--mh-muted);
	line-height: 1.85;
}

.mh-work-cta p:last-child {
	margin-bottom: 0;
}

.mh-work-back {
	margin: 0;
	text-align: center;
}

.mh-adjacent-nav {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(170px, 220px) minmax(0, 1fr);
	align-items: stretch;
	gap: 16px;
	margin: 42px 0 0;
	padding-top: 30px;
	border-top: 1px solid var(--mh-border);
}

.mh-adjacent-nav__link,
.mh-adjacent-nav__index {
	box-sizing: border-box;
	min-width: 0;
	border: 1px solid var(--mh-border);
	border-radius: 6px;
	background: var(--mh-white);
	color: var(--mh-text);
	text-decoration: none;
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mh-adjacent-nav__link {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 92px;
	padding: 15px 17px;
}

.mh-adjacent-nav__link--next {
	text-align: right;
}

.mh-adjacent-nav__label {
	display: block;
	margin-bottom: 7px;
	color: var(--mh-green);
	font-size: 0.82rem;
	font-weight: 700;
}

.mh-adjacent-nav__title {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

.mh-adjacent-nav__index {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 13px 16px;
	color: var(--mh-green);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.45;
	text-align: center;
}

.mh-adjacent-nav__link:hover,
.mh-adjacent-nav__link:focus,
.mh-adjacent-nav__index:hover,
.mh-adjacent-nav__index:focus {
	border-color: var(--mh-green);
	background: var(--mh-soft);
	color: var(--mh-green-dark);
	text-decoration: none;
}

.mh-adjacent-nav__link:focus-visible,
.mh-adjacent-nav__index:focus-visible {
	outline: 3px solid rgba(31, 107, 69, 0.25);
	outline-offset: 2px;
}

@media (max-width: 900px) {
	.mh-works-grid,
	.mh-work-gallery-count-2,
	.mh-work-gallery-count-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.mh-work-single-page article.mh_work > .inside-article {
		padding-right: 16px !important;
		padding-left: 16px !important;
	}

	.mh-works-grid,
	.mh-work-gallery-count-2,
	.mh-work-gallery-count-3,
	.mh-work-detail-meta {
		grid-template-columns: 1fr;
	}

	.mh-work-detail-meta > div {
		border-right: 0;
		border-bottom: 1px solid var(--mh-border);
	}

	.mh-work-detail-meta > div:last-child {
		border-bottom: 0;
	}

	.mh-work-card-body {
		padding: 18px;
	}

	.mh-work-section {
		margin-bottom: 38px;
	}

	.mh-work-section h2 {
		font-size: 1.32rem;
	}

	.mh-work-cta {
		padding: 26px 20px;
	}

	.mh-adjacent-nav {
		grid-template-columns: 1fr;
		gap: 12px;
		margin-top: 34px;
		padding-top: 24px;
	}

	.mh-adjacent-nav__placeholder {
		display: none;
	}

	.mh-adjacent-nav__link,
	.mh-adjacent-nav__index {
		min-height: 0;
	}
}


@media (prefers-reduced-motion: reduce) {
	.mh-work-card-image img {
		transition: none;
	}

	.mh-work-card:hover .mh-work-card-image img {
		transform: none;
	}
}

.mh-work-lightbox-link {
	cursor: zoom-in;
}

.mh-work-featured-image .mh-work-lightbox-link {
	display: block;
}

body.mh-lightbox-open {
	overflow: hidden;
}

.mh-lightbox[hidden] {
	display: none;
}

.mh-lightbox {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(9, 16, 13, 0.92);
}

.mh-lightbox-dialog {
	width: min(100%, 1440px);
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	color: #ffffff;
}

.mh-lightbox-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

.mh-lightbox-title {
	margin: 0;
	color: #ffffff;
	font-size: 1rem;
	font-weight: 700;
}

.mh-lightbox-close,
.mh-lightbox-nav {
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.35);
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.mh-lightbox-close {
	min-height: 44px;
	padding: 8px 14px;
}

.mh-lightbox-stage {
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(88px, 120px) minmax(0, 1fr) minmax(88px, 120px);
	align-items: center;
	gap: 18px;
}

.mh-lightbox-figure {
	min-width: 0;
	min-height: 0;
	margin: 0;
	text-align: center;
}

.mh-lightbox-image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 190px);
	width: auto;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	background: #111111;
}

.mh-lightbox-caption,
.mh-lightbox-position {
	color: #ffffff;
	text-align: center;
}

.mh-lightbox-caption {
	margin-top: 10px;
	font-size: 0.95rem;
}

.mh-lightbox-position {
	margin: 10px 0 0;
	font-variant-numeric: tabular-nums;
}

.mh-lightbox-nav {
	min-height: 54px;
	padding: 10px;
	font-size: 2rem;
	line-height: 1;
}

.mh-lightbox-nav span {
	display: block;
	margin-top: 3px;
	font-size: 0.78rem;
}

.mh-lightbox-close:hover,
.mh-lightbox-close:focus,
.mh-lightbox-nav:hover:not(:disabled),
.mh-lightbox-nav:focus:not(:disabled) {
	border-color: #ffffff;
	background: #ffffff;
	color: #174c32;
	outline: 3px solid rgba(255, 255, 255, 0.35);
	outline-offset: 2px;
}

.mh-lightbox-nav:disabled {
	opacity: 0.3;
	cursor: default;
}

@media (max-width: 700px) {
	.mh-lightbox {
		padding: 10px;
	}

	.mh-lightbox-dialog {
		max-height: calc(100vh - 20px);
	}

	.mh-lightbox-stage {
		grid-template-columns: 52px minmax(0, 1fr) 52px;
		gap: 7px;
	}

	.mh-lightbox-nav {
		min-height: 48px;
		padding: 5px;
		font-size: 1.65rem;
	}

	.mh-lightbox-nav span {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.mh-lightbox-image {
		max-height: calc(100vh - 175px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mh-lightbox * {
		scroll-behavior: auto;
	}
}
