/*
 * 「notes」見出しとフィルターを同じ行・同じ高さに並べる（ヘッダーのタイトル＋searchと同じ考え方）。
 * 3分割にして、見出しはページ中央、フィルターは右端に来るようにする。
 */
.notes-heading-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: calc(var(--gk-unit) * 2);
	padding-top: calc(var(--gk-unit) - 12px);
	padding-bottom: var(--gk-unit);
}

.notes-heading-row__title {
	grid-column: 2;
	justify-self: center;
	font-size: var(--gk-fs-base);
	font-weight: 500;
	letter-spacing: var(--gk-tracking);
}

/* カテゴリーで絞り込むフィルター */
.notes-filter {
	grid-column: 3;
	justify-self: end;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: var(--gk-unit);
}

.notes-filter__button {
	font-family: inherit;
	font-size: var(--gk-fs-base);
	letter-spacing: var(--gk-tracking);
	text-transform: lowercase;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	opacity: 0.5;
}

.notes-filter__button:hover {
	opacity: 1;
}

.notes-filter__button.is-active {
	opacity: 1;
	font-weight: 500;
}

/* exhibitionsのarchiveと同じ、カテゴリーに関係なく新しい順に埋まる4列グリッド */
.notes-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--gk-unit);
	align-items: start;
	margin-top: calc(var(--gk-unit) / 4);
}

.note-card {
	display: block;
}

.note-card.is-hidden {
	display: none;
}

.note-card:hover {
	font-weight: 400;
}

.note-card__category {
	display: block;
	font-size: var(--gk-fs-base);
	letter-spacing: var(--gk-tracking);
	text-align: center;
	margin-bottom: calc(var(--gk-unit) / 2);
}

/*
 * 一覧のサムネイルは、exhibitionsのcoming soonプレースホルダーと同じA判の縦横比の「枠」で
 * くるみ、中の画像はその枠いっぱいに切り抜いて表示する（object-fit: cover）。
 * imgタグに直接aspect-ratioを指定すると、画像自体のwidth/height属性が優先されて
 * 効かないことがあるため、枠を separate な要素にしている。
 */
.note-card__image-frame {
	display: block;
	width: 100%;
	aspect-ratio: 210 / 297;
	overflow: hidden;
}

.note-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/*
 * 1行だけだと、幅ぴったりに収まる長さの前で早々に省略されてしまうため、
 * 2行まで折り返してから省略記号を出す。
 */
.note-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	margin-top: calc(var(--gk-unit) / 2);
	text-align: center;
	overflow: hidden;
}

.note-card__date {
	display: block;
	font-weight: 500;
	letter-spacing: var(--gk-tracking);
	opacity: 0.6;
	margin-top: calc(var(--gk-unit) / 4);
	text-align: center;
}

@media (max-width: 1366px) {
	.notes-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.notes-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		/* デスクトップ用の余白（見出し行とグリッドの間隔を揃えるため）はモバイルでは不要 */
		margin-top: 0;
	}

	/*
	 * 見出しとフィルターを縦に分け、フィルターは折り返さず横スクロールできるようにする
	 * （ボタン数が多いと折り返して見出しの邪魔になっていたため）。
	 * 現在地はnavの下線だけで示すため、見出し文字自体は.page-heading同様に非表示にし、
	 * 詰まって見えないよう上の余白を持たせる。
	 */
	.notes-heading-row {
		grid-template-columns: 1fr;
		gap: calc(var(--gk-unit-mobile) / 2);
		/*
		 * 見出し文字を消した分、他ページと同じ余白にしたいところだが、
		 * ここにはフィルターの行が残っているため、上下の余白は最小限にして
		 * （フィルター行自体の高さで）他ページの見出し跡の余白とほぼ揃える。
		 */
		padding-top: 0;
		padding-bottom: 2px;
	}

	.notes-heading-row__title {
		display: none;
	}

	.notes-filter {
		grid-column: 1;
		justify-self: stretch;
		flex-wrap: nowrap;
		justify-content: center;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}

	.notes-filter__button {
		flex-shrink: 0;
	}
}
