@charset "utf-8";
/* =========================================================
   作品紹介（2026-11 作り直し）
   一覧：同じ大きさの枠に作品を収め、作家名・作品名を常に表示
   拡大：<dialog> で表示。前へ／次へ・スワイプ・矢印キー対応
   ========================================================= */

.gallery-area {
	--g-accent: #802341;      /* サイトの基本色 */
	--g-accent-pale: #F8F1F3;
	--g-thumb-bg: #F3EDE1;    /* 作品の枠の背景（掛軸の余白が目立たない色） */
	--g-cols: 2;              /* 一覧の列数（スマホ） */
	--g-gap: 14px;
	/* 分類ボタンの帯で隠れないよう、見出しへ移動したときの余白 */
	scroll-margin-top: 80px;
}
@media (min-width: 600px) { .gallery-area { --g-cols: 3; --g-gap: 18px; } }
@media (min-width: 900px) { .gallery-area { --g-cols: 4; --g-gap: 22px; } }

/* 共通CSS（basic.css）の body { overflow-x: hidden } があると、下の「画面上部に残る」が効かない。
   このページだけ clip（はみ出しは同じように隠れる）に替える。対応していない古いブラウザでは帯が残らないだけ */
html body { overflow-x: clip; } /* このCSSは basic.css より先に読まれるので、html body で優先させる */

/* ---------- 分類ボタン（スクロールしても画面上部に残る） ---------- */
.gallery-filter {
	position: sticky;
	top: 0;
	z-index: 50;
	margin: 2rem -2rem 0;
	padding: 15px 2rem;
	background: rgba(255, 251, 240, .96);
}
.gallery-filter[hidden] { display: none; }
/* ボタンが並ぶ部分（入りきらない分は横にスクロール）。
   画面右上に固定の MENU ボタン（右端から約70px）の手前で止める */
.gallery-filter-scroll {
	display: flex;
	gap: 8px;
	position: relative;
	margin-right: max(0px, calc(80px - (100vw - 100%) / 2));
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.gallery-filter-scroll::-webkit-scrollbar { display: none; }
/* まだ右に続きがあるときは、右端を薄くして「続きがある」と分かるように */
.gallery-filter-scroll.has-more {
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}
.gallery-filter.is-stuck { box-shadow: 0 6px 10px -8px rgba(0, 0, 0, .25); }

.gallery-filter button {
	flex: none;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--g-accent);
	border-radius: 100vh;
	background: #fff;
	color: var(--g-accent);
	font: inherit;
	font-size: .9rem;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.gallery-filter button .count { margin-left: .3em; font-size: .8em; opacity: .75; }
.gallery-filter button[aria-pressed="true"] { background: var(--g-accent); color: #fff; }
@media (hover: hover) {
	.gallery-filter button:hover { background: var(--g-accent-pale); }
	.gallery-filter button[aria-pressed="true"]:hover { background: var(--g-accent); }
}
@media (max-width: 767px) {
	.gallery-filter { margin-left: -1.5rem; margin-right: -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ---------- 分類の見出し ---------- */
.gallery-cat { margin-top: 2.5rem; scroll-margin-top: 80px; }
.gallery-cat[hidden] { display: none; }
.gallery-cat-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	margin: 0 0 1.2rem;
	padding-bottom: .7rem;
	border-bottom: 1px solid #e3dccd;
	font-size: 1.4rem;
	font-weight: normal;
	letter-spacing: .1em;
}
.gallery-cat-title span { font-size: .8rem; color: #888; letter-spacing: .12em; }

/* ---------- 一覧 ---------- */
.gallery-list {
	display: grid;
	grid-template-columns: repeat(var(--g-cols), minmax(0, 1fr));
	gap: calc(var(--g-gap) * 1.4) var(--g-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}
.work { margin: 0; scroll-margin-top: 90px; }

.work-open {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.work-thumb {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	padding: 8%;
	margin-bottom: .6rem;
	border-radius: 4px;
	background: var(--g-thumb-bg);
	overflow: hidden;
	transition: box-shadow .3s ease;
}
.work-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform .5s ease;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18));
}
@media (hover: hover) {
	.work-open:hover .work-thumb { box-shadow: 0 8px 18px rgba(0, 0, 0, .12); }
	.work-open:hover .work-thumb img { transform: scale(1.04); }
	.work-open:hover .work-title { color: var(--g-accent); }
}
.work-open:focus-visible { outline: 3px solid var(--g-accent); outline-offset: 4px; border-radius: 4px; }

/* 「解説あり」の印（解説がある作品に gallery2026.js が付ける） */
.work.has-desc .work-thumb::after {
	content: "解説あり";
	position: absolute;
	right: 6px;
	bottom: 6px;
	padding: 2px 8px;
	border-radius: 100vh;
	background: rgba(128, 35, 65, .88);
	color: #fff;
	font-size: .7rem;
	letter-spacing: .05em;
}

.work-badge {
	align-self: flex-start;
	margin-bottom: .3rem;
	padding: 1px 8px;
	border: 1px solid var(--g-accent);
	border-radius: 3px;
	color: var(--g-accent);
	font-size: .72rem;
	line-height: 1.6;
}
.work-artist { display: block; font-size: .78rem; color: #777; line-height: 1.5; }
.work-title {
	display: block;
	font-size: .95rem;
	line-height: 1.5;
	transition: color .2s;
}
@media (max-width: 599px) {
	.work-title { font-size: .88rem; }
}

/* =========================================================
   拡大画面
   ========================================================= */
.work-viewer {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(20, 16, 14, .96);
	color: #fff;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.work-viewer::backdrop { background: rgba(0, 0, 0, .6); }
.work-viewer[open] { animation: viewer-in .3s ease; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }

.viewer-bar {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 8px 8px 20px;
	background: rgba(20, 16, 14, .85);
}
.viewer-count { margin: 0; font-size: .85rem; color: #bbb; letter-spacing: .08em; }
.viewer-close {
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 2.2rem;
	line-height: 1;
	cursor: pointer;
}
.viewer-close:hover, .viewer-close:focus-visible { background: rgba(255, 255, 255, .12); }

.viewer-body {
	display: flex;
	flex-direction: column;
	max-width: 1300px;
	margin: 0 auto;
}
.viewer-figure {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 12px;
	touch-action: pan-y; /* 横のスワイプは前へ／次へに使う */
}
.viewer-img {
	display: block;
	max-width: 100%;
	max-height: 68vh;
	max-height: 68svh;
	object-fit: contain;
	box-shadow: 0 0 30px rgba(0, 0, 0, .6);
	transition: opacity .25s ease;
}
.viewer-img.is-loading { opacity: 0; }

.viewer-nav {
	position: absolute;
	top: 50%;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 2rem;
	line-height: 44px;
	cursor: pointer;
	transition: background-color .2s;
}
.viewer-nav:hover, .viewer-nav:focus-visible { background: rgba(128, 35, 65, .9); }
.viewer-prev { left: 4px; }
.viewer-next { right: 4px; }
.viewer-nav[hidden] { display: none; }

.viewer-info {
	padding: 20px 20px 40px;
	font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
	line-height: 1.8;
	letter-spacing: .04em;
}
.viewer-info .v-cat { margin: 0 0 .4rem; font-family: sans-serif; font-size: .75rem; color: #aaa; letter-spacing: .12em; }
.viewer-info .v-badge {
	display: inline-block;
	margin: 0 0 .5rem;
	padding: 1px 10px;
	border: 1px solid #e8b4c4;
	border-radius: 3px;
	color: #f2c9d6;
	font-family: sans-serif;
	font-size: .75rem;
}
.viewer-info .v-title { margin: 0 0 .3rem; font-size: 1.45rem; font-weight: normal; line-height: 1.5; }
.viewer-info .v-artist { margin: 0; font-size: 1rem; }
.viewer-info .v-artist-en { margin: 0; font-family: sans-serif; font-size: .8rem; color: #bbb; letter-spacing: .08em; }
.viewer-info .v-meta { margin: .6rem 0 0; font-size: .88rem; color: #ccc; }
.viewer-info .v-desc {
	margin-top: 1.2rem;
	padding-top: 1.2rem;
	border-top: 1px solid rgba(255, 255, 255, .2);
	font-size: .93rem;
}
.viewer-info .v-desc p { margin: 0 0 .9em; line-height: 1.95; }
.viewer-info .v-nodesc { margin-top: 1.2rem; font-size: .8rem; color: #999; font-family: sans-serif; }

/* パソコン：画像を左、解説を右に並べる */
@media (min-width: 900px) {
	.viewer-body {
		flex-direction: row;
		align-items: flex-start;
		min-height: calc(100vh - 64px);
	}
	.viewer-figure {
		flex: 1 1 auto;
		min-width: 0;
		height: calc(100vh - 64px);
		padding: 0 70px 24px;
		position: sticky;
		top: 64px;
	}
	.viewer-img { max-height: 100%; }
	.viewer-prev { left: 10px; }
	.viewer-next { right: 10px; }
	.viewer-info {
		flex: 0 0 360px;
		padding: 10px 32px 40px 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.work-viewer[open] { animation: none; }
	.work-thumb img, .viewer-img { transition: none; }
}
