/* ============================================================
 * WORK 一覧（高さを揃えないグリッド）
 * ============================================================ */
.work_grid {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.work_grid .work_col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
/* JS読み込み前・無効時は通常の並び */
.work_grid:not(.is-ready) {
	flex-wrap: wrap;
}
.work_grid:not(.is-ready) > .work_item {
	width: calc((100% - 40px) / 3);
}

.work_item {
	margin: 0;
	list-style: none;
}
.work_open {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: #eee;
	cursor: pointer;
}
.work_open img,
.work_viewer img {
	position: static;
	display: block;
	width: 100%;
	height: auto;
}
.work_count {
	position: absolute;
	top: 6px;
	left: 6px;
	min-width: 30px;
	padding: 3px 6px;
	background: #000;
	color: #fff;
	font-family: "Helvetica 55 Roman", "Helvetica Neue", Arial, sans-serif;
	font-size: 10px;
	line-height: 1.4;
	letter-spacing: 0.05em;
	text-align: center;
}

@media (max-width: 749px) {
	.work_list {
		padding-bottom: 20px;
	}
	.work_grid,
	.work_grid .work_col {
		gap: 10px;
	}
	.work_grid:not(.is-ready) > .work_item {
		width: calc((100% - 10px) / 2);
	}
}

/* ============================================================
 * 作品表示（オーバーレイ）
 * ============================================================ */
.work_viewer {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba(20, 20, 20, 0.94);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.work_viewer[hidden] {
	display: none;
}
.work_viewer_body {
	width: min(720px, calc(100% - 200px));
	margin: 0 auto;
	padding: 60px 0;
}
.work_viewer_body img + img {
	margin-top: 8px;
}

/* 左上の× */
.work_viewer_close {
	position: fixed;
	top: 16px;
	left: 16px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.work_viewer_close::before,
.work_viewer_close::after,
.ic_close::before,
.ic_close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	background: #fff;
}
.work_viewer_close::before,
.ic_close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}
.work_viewer_close::after,
.ic_close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

/* 右側の縦並びボタン */
.work_viewer_nav {
	position: fixed;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	background: #000;
}
.work_viewer_nav button {
	position: relative;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.work_viewer_nav button[disabled] {
	opacity: 0.3;
	cursor: default;
}
.work_viewer_nav span {
	position: absolute;
	inset: 0;
}
.ic_close::before,
.ic_close::after {
	width: 14px;
}
.ic_prev::before,
.ic_next::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border-top: 2px solid #fff;
	border-left: 2px solid #fff;
}
.ic_prev::before {
	transform: translate(-30%, -50%) rotate(-45deg);
}
.ic_next::before {
	transform: translate(-70%, -50%) rotate(135deg);
}

html.is-viewer-open,
html.is-viewer-open body {
	overflow: hidden;
}

@media (max-width: 749px) {
	.work_viewer_body {
		width: calc(100% - 24px);
		padding: 64px 0 80px;
	}
	.work_viewer_nav {
		top: auto;
		bottom: 0;
		left: 0;
		transform: none;
		flex-direction: row;
		justify-content: center;
	}
	.work_viewer_nav button {
		width: 52px;
		height: 44px;
	}
	.work_viewer_nav button[data-action="close"] {
		display: none;
	}
}

/* ログイン中（管理バー表示時）の位置調整 */
.admin-bar .work_viewer_close {
	top: 48px;
}
@media screen and (max-width: 782px) {
	.admin-bar .work_viewer_close {
		top: 62px;
	}
}
