.kurachi-gallery-page {
	--kg-text: #444;
	--kg-muted: #767676;
	--kg-line: #d6d6d6;
	--kg-soft: #f7f7f5;
	--kg-accent: #45aab8;
	color: var(--kg-text);
}

.kurachi-gallery-page .kg-lead {
	max-width: 760px;
	margin: 0 auto 44px;
	text-align: center;
	line-height: 2;
}

.kg-axis-tabs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 720px;
	margin: 0 auto 34px;
	border-top: 1px solid var(--kg-line);
	border-bottom: 1px solid var(--kg-line);
}

.kg-axis-tab,
.kg-category-card {
	font: inherit;
	color: var(--kg-text);
	background: transparent;
	border: 0;
	cursor: pointer;
}

.kg-axis-tab {
	position: relative;
	padding: 17px 12px 15px;
	font-size: 16px;
	letter-spacing: .08em;
}

.kg-axis-tab + .kg-axis-tab {
	border-left: 1px solid var(--kg-line);
}

.kg-axis-tab::after {
	position: absolute;
	right: 18%;
	bottom: -1px;
	left: 18%;
	height: 2px;
	background: transparent;
	content: "";
}

.kg-axis-tab.is-active {
	font-weight: 700;
}

.kg-axis-tab.is-active::after {
	background: var(--kg-accent);
}

.kg-axis-panel.kg-is-hidden,
.kg-gallery-panel.kg-is-hidden {
	display: none !important;
}

.kg-axis-heading {
	margin: 0 0 10px;
	text-align: center;
}

.kg-axis-description {
	max-width: 720px;
	margin: 0 auto 28px;
	text-align: center;
	color: var(--kg-muted);
}

.kg-category-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 42px;
}

.kg-category-card {
	min-height: 72px;
	padding: 13px 16px;
	border: 1px solid var(--kg-line);
	line-height: 1.55;
	transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.kg-category-card:hover,
.kg-category-card:focus-visible,
.kg-category-card.is-active {
	color: #222;
	border-color: #777;
	background: var(--kg-soft);
}

.kg-category-card.is-active {
	box-shadow: inset 0 -2px 0 var(--kg-accent);
}

.kg-gallery-panel > h2 {
	margin: 0 0 12px;
	text-align: center;
	font-size: 24px;
	font-weight: 500;
	letter-spacing: .06em;
}

.kg-gallery-count {
	margin: 0 0 26px;
	text-align: center;
	color: var(--kg-muted);
	font-size: 13px;
}

.kurachi-gallery-page .kg-gallery-grid.wp-block-gallery {
	display: grid !important;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: start;
	gap: 12px;
	margin: 0;
	padding: 0;
}

.kurachi-gallery-page .kg-gallery-grid > .wp-block-image {
	display: block;
	width: 100% !important;
	margin: 0 !important;
}

.kurachi-gallery-page .kg-gallery-grid img {
	display: block;
	width: 100%;
	height: auto;
	border: 0;
	cursor: zoom-in;
	transition: opacity .2s ease;
}

.kurachi-gallery-page .kg-gallery-grid img:hover,
.kurachi-gallery-page .kg-gallery-grid img:focus-visible {
	opacity: .82;
}

.kurachi-gallery-page .kg-gallery-grid figcaption {
	display: none;
}

.kurachi-gallery-page .kg-gallery-grid figure.wp-block-image:has(figcaption)::before {
	display: none;
}

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

.kg-lightbox {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 30px 76px;
	background: rgba(18, 18, 18, .93);
}

.kg-lightbox__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: min(1120px, 100%);
	max-height: calc(100vh - 60px);
}

.kg-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 60px);
	width: auto;
	height: auto;
	object-fit: contain;
}

.kg-lightbox__footer {
	position: fixed;
	left: 50%;
	bottom: 18px;
	display: flex;
	align-items: center;
	gap: 18px;
	z-index: 1;
	margin: 0;
	transform: translateX(-50%);
}

.kg-lightbox__case-link {
	display: inline-block;
	padding: 9px 20px;
	color: #fff;
	background: rgba(0,0,0,.58);
	border: 1px solid rgba(255,255,255,.86);
	box-shadow: 0 0 0 1px rgba(0,0,0,.95), 0 2px 10px rgba(0,0,0,.62);
	font-size: 14px;
	letter-spacing: .04em;
	text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.kg-lightbox__case-link:hover,
.kg-lightbox__case-link:focus-visible {
	color: #fff;
	background: rgba(255,255,255,.14);
}

.kg-lightbox__counter {
	color: #ddd;
	font-size: 13px;
	text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.kg-lightbox__close,
.kg-lightbox__previous,
.kg-lightbox__next {
	position: absolute;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #fff;
	background: rgba(0,0,0,.28);
	border: 1px solid rgba(255,255,255,.45);
	border-radius: 50%;
	font: 300 28px/1 sans-serif;
	cursor: pointer;
}

.kg-lightbox__previous,
.kg-lightbox__next {
	font-size: 0;
}

.kg-lightbox__previous::before,
.kg-lightbox__next::before {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	background-position: center;
	background-repeat: no-repeat;
	background-size: 18px 18px;
	content: "";
	transform: translate(-50%, -50%);
}

.kg-lightbox__previous::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 18l-6-6 6-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.kg-lightbox__next::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.kg-lightbox__close {
	top: 0;
	right: -58px;
}

.kg-lightbox__previous,
.kg-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.kg-lightbox__previous {
	left: -58px;
}

.kg-lightbox__next {
	right: -58px;
}

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

.kg-page-separator {
	margin: 64px auto 50px;
}

.kg-philosophy {
	max-width: 760px;
	margin: 0 auto;
	text-align: center;
}

@media screen and (max-width: 800px) {
	.kg-category-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kurachi-gallery-page .kg-gallery-grid.wp-block-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media screen and (max-width: 600px) {
	.kurachi-gallery-page .kg-lead {
		margin-bottom: 32px;
		text-align: left;
	}

	.kg-axis-tab {
		padding: 14px 8px 12px;
		font-size: 14px;
		letter-spacing: .02em;
	}

	.kg-category-cards {
		gap: 8px;
		margin-bottom: 32px;
	}

	.kg-category-card {
		min-height: 64px;
		padding: 10px;
		font-size: 13px;
	}

	.kg-gallery-panel > h2 {
		font-size: 20px;
	}

	.kurachi-gallery-page .kg-gallery-grid.wp-block-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.kg-lightbox {
		padding: 54px 14px 24px;
	}

	.kg-lightbox__dialog {
		max-height: calc(100vh - 78px);
	}

	.kg-lightbox__image {
		max-height: calc(100vh - 78px);
	}

	.kg-lightbox__close {
		position: fixed;
		top: max(14px, env(safe-area-inset-top));
		right: max(14px, env(safe-area-inset-right));
	}

	.kg-lightbox__previous {
		left: 6px;
	}

	.kg-lightbox__next {
		right: 6px;
	}

	.kg-lightbox__footer {
		bottom: max(14px, env(safe-area-inset-bottom));
		gap: 12px;
		width: max-content;
		max-width: calc(100vw - 28px);
	}
}
