/* notes.css — the notes: lists, sections, pages.
   nest-design.net V5 · theme nest-design-v5

   探究ノートの一覧・区画・記事の見た目。 */
/*
 * 探究ノート　カテゴリー別アーカイブ用スタイル（骨組み）
 * 見た目の作り込みはフェーズ5（デザイン適用）で行うため、ここでは最小限の
 * 読みやすさ（余白・区切り線・文字サイズ）だけを整える。
 * .notes-archive 配下にスコープし、テーマ本体のスタイルとの衝突を避ける。
 */
.notes-archive {
	--na-ink: rgba(0, 0, 0, 0.8);
	--na-gray: rgba(0, 0, 0, 0.5);
	--na-hairline: rgba(0, 0, 0, 0.25);
	--na-side-line: rgba(0, 0, 0, 0.08);   /* 枠の縦線。Works と同じ濃さ */

	max-width: 645px;
	margin: 0 auto;
	padding: 0 20px 56px;
	position: relative;   /* 欄外の縦線（::before/::after）の基準 */
	color: var(--na-ink);
}
/* 検索結果は一覧と違って末尾にページ送りや注記が無いので、
   箱の下余白 56px がそのまま空白として見えていた。最後の個票の下も
   個票どうしの間隔（個票の padding 20px → 線）と同じにする */
.search-results .notes-archive {
	padding-bottom: 0;
}
/* 縦線は箱の外側 18px（箱の外法 685 + 35 ═ 芯々 720 ═ トップの枠）。箱と中身は触らない。PC だけ */
@media (min-width: 641px), (hover: hover) and (pointer: fine) {
	.notes-archive::before,
	.notes-archive::after,
	.notes-single::before,
	.notes-single::after {
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		width: 1px;
		background: var(--na-side-line);
		pointer-events: none;
	}
	.notes-archive::before,
	.notes-single::before { left: -18px; }
	.notes-archive::after,
	.notes-single::after { right: -18px; }
}

.notes-archive .na-header {
	padding: 22px 0 15px;   /* 下線をヘッダー下線から 78px → 画面上端から 180（60 の倍数）。About と同じ */
	border-bottom: 1px solid var(--na-hairline);
}
/* カテゴリーページはパンくず下線→NOTE が一覧（ヘッダー下線→NOTE 18px）より 4px 広かった。body.category だけ上パディング 22→18 に。パンくず下線の位置は不動 */
.notes-archive .na-eyebrow {
	font-size: 11px;
	letter-spacing: 0.12em;
	color: var(--na-gray);
}
.notes-archive .na-header h1 {
	font-weight: 800;
	font-size: 21px;
	color: var(--na-ink);
	margin: 4px 0 0;
	/* 検索中に「すべての記事」へワンクリックで戻れるよう、
	   H1クリックで検索解除できるようにしたためカーソルをポインターに。 */
	cursor: pointer;
}

/* スマホ表示は元の22pxを維持 */
@media (max-width: 640px) and (hover: none), (max-width: 640px) and (pointer: coarse) {
	.notes-archive .na-header h1 {
		font-size: 21px;
	}
}
.notes-archive .na-lead {
	margin-top: 10px;
	font-size: 12.5px;
	color: var(--na-gray);
	line-height: 1.8;
}

.notes-archive .na-count {
	font-size: 12px;
	color: var(--na-gray);
	letter-spacing: 0.05em;
}
/*
 * 探究ノートの一覧（複数ページ）の検索窓。仕事実績集の検索窓（works.css の .wa-search-box）と同じ考え方・同じ動き。
 * こちらは「日」グリッドが無く .na-count が1行のブロックなので、position: absolute の位置合わせは要らない。
 * .na-count を flex にし、文字（.na-count-text）は左、検索窓（.na-search-box）は margin-left: auto で右端に置く。
 * こうすれば検索窓が伸びても、親（.notes-archive、max-width 645px）の右端を越えない。
 */
.notes-archive .na-count-text.is-search-hidden {
	visibility: hidden;
}
.notes-archive .na-search-box {
	display: flex;
	align-items: center;
	cursor: pointer;
	margin-left: auto;
	padding: 4px 0;
}
.notes-archive .na-search-box .na-search-icon {
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	margin-right: 6px;
	color: var(--na-gray);
	pointer-events: none;
	transition: color 0.15s ease;
}
.notes-archive .na-search-box .na-search-icon svg {
	display: block;
}
.notes-archive .na-search-box:hover .na-search-icon {
	color: var(--na-ink);
}
.notes-archive .na-search-box input {
	flex: 0 0 auto;
	width: 0;
	min-width: 0;
	box-sizing: content-box;
	padding: 0;
	margin: 0;
	font-family: "Noto Sans JP", sans-serif;
	font-size: 12px;
	color: var(--na-ink);
	background: transparent;
	border: none;
	border-radius: 0;
	outline: none;
	cursor: pointer;
	transition: width 0.1s ease;
}
.notes-archive .na-search-box.is-active input {
	cursor: text;
}
.notes-archive .na-search-box .na-search-count {
	flex: 0 0 auto;
	margin-left: 6px;
	font-size: 12px;
	color: var(--na-gray);
	white-space: nowrap;
	display: none;
}

/*
 * 一覧の上端・下端も写真から 20px にする。
 * リスト自身が持っていた上4px・下8pxを外す。これで
 *   件数欄の下罫線 → 一番上の投稿の写真の上端 ＝ 20px
 *   一番下の投稿の写真の下端 → ページ送りの上罫線 ＝ 20px
 * （行の padding 20px がそのまま端にも出る形。途中の行と同じ寸法になる） */
.notes-archive .na-list {
	padding: 0;
}
/*
 * 検索結果ページで一番上に来る帯（例：事務所案内）は、直前が.na-header（padding-top 4px分の
 * 余白あり）になるため、2番目以降の帯（前の要素の直後、余白0）よりラベルまでの間隔が4px広くなり、
 * 「事務所案内」だけ上下間隔が違って見えていた。帯が一番上に来る場合はこの
 * padding-topを打ち消して、どの帯が一番上に来ても常に同じ間隔になるようにする。
 */
.na-list:has(> .na-group-divider:first-child) {
	padding-top: 0;
}
/*
 * アイキャッチの上・下・左を 20px に揃える（作品一覧と同じ規則）。
 * 左はもともと20px。上下が18pxで外れていた。
 * align-items: stretch なのでサムネイルは文字段と同じ高さに伸び、上下の空き＝padding そのもの。
 * 18px は 18×1.8＝32.4 と割り切れず、行によって丸めが割れる。20px なら 36 でどの行も同じ。
 */
.notes-archive .na-item {
	display: flex;
	gap: 14px;
	align-items: stretch;
	padding: 20px 0;
	border-bottom: 1px solid var(--na-hairline);
}
.notes-archive .na-item:last-child {
	border-bottom: none;
}
/* 一覧の左にサムネイル（アイキャッチ）を出す（文字だけでは記事の雰囲気がつかみにくい）。
   アイキャッチの無い記事は同じ大きさの薄いプレースホルダーにして、並びをそろえる。 */
.notes-archive .na-item-thumb {
	flex: 0 0 100px;
	width: 100px;
	/* PC・スマホとも 100×100 の正方形に固定。
	   もとは PC だけ align-items: stretch に追従して本文欄と同じ高さ（106.5px）になっていた。
	   写真の大きさを画面幅で変えない。行の中身は 100px（＝写真）で決まり、
	   上下の空きは padding の 20px がそのまま出る。 */
	align-self: flex-start;
	height: 100px;
	position: relative;
	overflow: hidden;
	background: rgba(127, 127, 127, 0.15);
	display: block;
}
.notes-archive .na-item-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.notes-archive .na-item-thumb-empty {
	background: rgba(127, 127, 127, 0.08);
}
.notes-archive .na-item-body {
	flex: 1;
	min-width: 0;
}

.notes-archive .na-item-title {
	display: -webkit-box;
	font-weight: 700;
	font-size: 16px;
	color: var(--na-ink);
	text-decoration: underline;
	text-decoration-color: rgba(0, 0, 0, 0.35);
	line-height: 1.5;
	/* .na-item-textの固定高さ計算はタイトル最大2行を
	 * 前提にしているため、万一2行を超える長さでも2行までで確実に収める。 */
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/*
 * 検索結果ページ専用。事務所案内の個票で「どの部門の該当か」を明示するラベル
 * （例：資格・専門）。工事実績集のwa-item-tagと同系統のベンガラ色にして、通常のna-item-titleとは
 * 見た目上も役割が違う（タイトルではなく部門タグ）ことが分かるようにしている。
 */
.na-item-dept {
	display: inline-block;
	font-weight: 700;
	font-size: 12.5px;
	color: var(--na-bengara);
	text-decoration: underline;
	text-decoration-color: rgba(156, 74, 52, 0.4);
	letter-spacing: 0.02em;
}
.notes-archive .na-item-date {
	margin-top: 8px;
	font-size: 11.5px;
	color: var(--na-gray);
}
.na-item-cat {
	margin-left: 8px;
	color: var(--na-bengara);
	font-weight: 400;
}
.notes-archive .na-item-excerpt {
	margin-top: 8px;
	/* 本文を15pxにしたのに合わせて 13px→14px。
	   1行の高さが 23.4px→25.2px になるので、下の .na-item-text の高さも直す。 */
	font-size: 14px;
	line-height: 1.8;
	color: var(--na-ink);
	opacity: 0.85;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* タイトル＋説明文（.na-item-text）の高さを「タイトル最大2行＋説明1行」に固定し、overflow: hidden で切る。
 タイトルが1行なら残り（説明2行分）が説明に使われ、2行なら説明は1行。余った高さを説明文が埋める。
 JS で後から判定する方式は、一覧が一瞬見えなくなるので使わない。CSS だけなので、PC・スマホ・画面幅によらず同じに効く（PC で幅を縮めても3行のまま）。
 高さの内訳：タイトル最大2行（line-height 1.5 × 16px × 2 ＝ 48px）＋説明1行（line-height 1.8 × 13px ＝ 23.4px）＝ 71.4px。 */
.notes-archive .na-item-text {
	/* 説明文の margin-top 8px が高さに入っていなかったため、タイトル 1 行のとき説明文 2 行目の下が 7px 切れていた。
	   48（タイトル2行）＋ 8（余白）＋ 23.4（説明1行）＝ 79.4。タイトル1行なら 24＋8＋46.8＝78.8 で収まる */
	/* 説明文を14pxにしたため計算し直し。
	   タイトル2行：48 ＋ 余白8 ＋ 説明1行25.2 ＝ 81.2
	   タイトル1行：24 ＋ 余白8 ＋ 説明2行50.4 ＝ 82.4 ← 大きい方に合わせる
	   （タイトル2行のときは1.2px余るが、そこは行の上の余白なので文字は見えない） */
	height: 82.4px;
	overflow: hidden;
}

/*
 * 写真の上端・下端に「文字の字面」を合わせる。
 *
 * 行送り（line-height）は文字の上下に余りを均等に持つので、箱の上端に文字を置いても
 * 字面はその分だけ下がって見える。実測値：
 *   タイトル1行目 … 箱の上から字面の上まで 4.50px
 *   日付 … 字面の下から箱の底まで 2.72px
 * この2つを負のマージンで削ると本文欄が 106.49px → 99.27px になり、
 * 字面の範囲が写真（100px）とほぼ一致する。
 *
 * 効果は3つ：
 *   ・タイトルが写真の上ラインより下がって見えるのが直る
 *   ・スマホで日付が写真の下端からはみ出していたのが収まる
 *   ・スマホの行の中身が 100px ちょうどになり、写真の上下の空きが 20/20 で揃う
 *
 * 数値は「タイトル 16px / 行送り 24px、日付 11.5px / 行送り 16.1px」に対する実測値。
 * 文字サイズか行送りを変えたら測り直すこと。
 */
.notes-archive .na-item-text {
	margin-top: -4.5px;
}
.notes-archive .na-item-date {
	margin-bottom: -2.72px;
}

/* 検索結果ページの WORKS / NOTE グループ見出し区切り */
.na-group-divider {
	padding: 14px 0 10px;
	border-bottom: 1px solid var(--na-hairline);
}
.na-group-divider-label {
	display: block;
	font-weight: 700;
	font-size: 16px;
	color: var(--na-ink);
	text-decoration: underline;
	text-decoration-color: rgba(0, 0, 0, 0.35);
	line-height: 1.5;
}

/* 検索結果ページの該当箇所ハイライト（タイトル・抜粋・仕事実績集メタ項目で共通使用）。
 * 検索結果ページ以外（実物の各アーカイブ／個別ページ）では検索語が渡らないため出現しない。 */
/* <mark> の背景の縦の大きさを、場所によらずそろえるため line-height を固定する。
 仕事実績集（Noto Sans JP を明示）と探究ノート（テーマ既定の書体）では、書体の上下の余白（アセント／ディセント）が違う。 */
/* さらに display: inline-block にする。インラインの要素の背景の高さは line-height ではなく書体の行送りで決まるので、line-height だけではそろわない（特に works）。
 inline-block なら mark が自分の行の箱を持ち、指定した line-height がそのまま高さになる。 */
mark.search-hit {
	background: rgba(156, 74, 52, 0.18);
	color: inherit;
	padding: 0 1px;
	display: inline-block;
	line-height: 1.15;
	border-radius: 2px;
	font-weight: inherit;
}

/* ダークモードのハイライト：ベンガラ（rgba(156, 74, 52)）は黒に近い地では見えないので、明るいテラコッタ（#C97C5D、.notes-single のダーク配色と同系統）にし、不透明度を 0.5 まで上げる。角丸は付けない。
 */
@media (prefers-color-scheme: dark) {
	mark.search-hit {
		background: rgba(201, 124, 93, 0.5);
		border-radius: 0;
	}
}

.notes-archive .na-empty {
	padding: 40px 0;
	color: var(--na-gray);
	font-size: 13px;
	text-align: center;
}

.notes-archive .na-pagination {
	/* 一番下の投稿の写真からこの上罫線までを 20px にするため 12px → 0。 */
	margin-top: 0;
	padding-top: 20px;
	border-top: 1px solid var(--na-hairline);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: 13px;
}
.notes-archive .na-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	color: var(--na-ink);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.notes-archive .na-pagination .page-numbers.current {
	border-bottom: 1px solid var(--na-ink);
	font-weight: 700;
}
.notes-archive .na-pagination a.page-numbers:hover {
	border-bottom: 1px solid var(--na-gray);
}
.notes-archive .na-pagination .prev.page-numbers,
.notes-archive .na-pagination .next.page-numbers {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: "Noto Sans JP", sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	min-width: 0;
	height: 28px;
	padding: 0;
	border-bottom: none !important;
}
.notes-archive .na-pagination .next.page-numbers {
	margin-left: auto;
}
.notes-archive .na-pagination-arrow {
	font-weight: 400;
	color: var(--na-gray);
}

/**
 * ダークモード（探究ノート）。
 * 事務所案内・仕事実績集と同じ考え方を、こちらの --na-ink / --na-gray / --na-hairline にも当てる。
 * .notes-archive 自体は背景色を持たない（body の背景をそのまま使う）ので、文字色と線の色の変数だけを上書きすればよい。
 */
/* いまは端末の条件を付けず、OS のダークモードの設定だけで効く（PC でも）。 */
@media (prefers-color-scheme: dark) {
	.notes-archive {
		--na-ink: rgba(255, 255, 255, 0.85);
		--na-gray: rgba(255, 255, 255, 0.55);
		--na-hairline: rgba(255, 255, 255, 0.3);
	--na-side-line: rgba(255, 255, 255, 0.08);
	}
	.notes-archive .na-item-title {
		text-decoration-color: rgba(255, 255, 255, 0.6);
	}
}

/*
 * 探究ノート　個別ページ（single.php相当）用スタイル。
 * 仕事実績集の single-works.php／works.css（.works-single）と同じ構成・
 * 意匠（パンくず／アイキャッチ／ヘッダー（カテゴリー・タイトル）／本文／
 * Back）を .notes-single にスコープして移植し、デザインの一貫性を保つ。
 */
.notes-single {
	--na-kinari: #FFFFFF;
	--na-ink: rgba(0, 0, 0, 0.8);
	--na-gray: rgba(0, 0, 0, 0.5);
	--na-hairline: rgba(0, 0, 0, 0.25);
	--na-bengara: #9C4A34;

	color-scheme: light;
	background: var(--na-kinari);
	font-family: inherit;   /* Webフォント廃止。本文と同じシステムフォント */
	color: var(--na-ink);
	--na-side-line: rgba(0, 0, 0, 0.08);
	max-width: 645px;
	margin: 0 auto;
	padding: 0 20px 56px;
	position: relative;   /* 欄外の縦線の基準（線は一覧と同じ ::before/::after） */
}
@media (max-width: 640px) and (hover: none), (max-width: 640px) and (pointer: coarse) {
	.notes-single {
		border-left: none;
		border-right: none;
	}
}

.notes-single .ns-header {
	padding: 40px 0 4px;
}
.notes-single .ns-title {
	font-family: "Noto Sans JP", sans-serif;
	font-weight: 800;
	font-size: 21px;
	color: var(--na-ink);
	line-height: 1.5;
	margin: 0;
	letter-spacing: 0.02em;
}
.notes-single .ns-meta {
	font-size: 11.5px;
	color: var(--na-gray);
}
.notes-single .ns-meta-bottom {
	/* ★探究ノート共通の決まり：本文の一番下からこの下線（border-top）までは、いつも 40px。
	   40px は .ns-content の padding-bottom（下の .ns-content を参照）でまとめて取る。最後の要素の種類によらない。
	   .ns-content > *:last-child の margin-bottom に頼ると、本文がクラシックブロックの裸のテキストで終わる記事（琵琶湖セカンドハウスなど）で、末尾の文と下線がくっつく。
	   ここの margin-top は 0 のまま（マイナスに戻さない）。 */
	margin-top: 0;
	padding-top: 16px;
	border-top: 1px solid var(--na-hairline);
	display: flex;
	align-items: baseline;
	justify-content: space-between;
}
.notes-single .ns-meta-date {
	text-align: right;
}
.notes-single .ns-meta-bottom .na-item-cat {
	margin-left: 8px;
	color: var(--na-gray);
	font-weight: 400;
}

.notes-single .ns-content {
	/* padding-bottom 40px = 本文末尾から下線（.ns-meta-bottomのborder-top）
	   までの余白。要素／裸テキストいずれで終わっても常に40pxになる
	   （詳細は .ns-meta-bottom 側のコメント参照）。 */
	padding: 18px 0 40px;
	/* 作品ページの本文に合わせて14px→15px（1行あたり約45字）。
	   戻す場合はここを14pxにするだけ。 */
	font-size: 15px;
	line-height: 1.9;
	color: var(--na-ink);
}
.notes-single .ns-content a {
	text-decoration-color: rgba(0, 0, 0, 0.35);
}
.notes-single .ns-content p {
	margin: 0 0 1.4em;
}
.notes-single .ns-content img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--na-hairline);
}
.notes-single .ns-content figure {
	margin: 1.6em 0;
}
.notes-single .ns-content .wp-block-columns figure {
	margin: 0;
}
.notes-single .ns-content .wp-block-columns figcaption {
	display: none;
}
.notes-single .ns-content .wp-block-columns:not(:last-child) {
	margin-bottom: 10px;
}
.notes-single .ns-content .wp-block-gallery {
	gap: 10px !important;
}
.notes-single .ns-content .wp-block-gallery,
.notes-single .ns-content .wp-block-gallery .wp-block-image {
	align-items: flex-start !important;
}
.notes-single .ns-content .wp-block-gallery .wp-block-image img {
	width: auto !important;
	height: auto !important;
	aspect-ratio: auto !important;
	object-fit: unset !important;
	max-width: 100% !important;
}
.notes-single .ns-content .wp-block-gallery .wp-block-image img {
	content-visibility: visible !important;
	contain-intrinsic-size: auto !important;
	contain: none !important;
}
.notes-single .ns-content .wp-block-gallery .wp-block-image figcaption {
	display: none;
}
.notes-single .ns-content .wp-block-gallery:not(:last-child) {
	margin-bottom: 10px;
}
.notes-single .ns-content figcaption {
	text-align: center;
	margin-top: 6px;
}
.notes-single .ns-content h2,
.notes-single .ns-content h3 {
	font-family: "Noto Sans JP", sans-serif;
	color: var(--na-ink);
	font-weight: 700;
	margin: 1.6em 0 0.8em;
}

/* 個別投稿下部のBack/Nextナビゲーション（同カテゴリー内のみ、1段）。
   従来の.ns-back（探究ノートトップへの固定リンクのみ）から置き換え。
   見出しラベル（.ns-nav-scope）は削除。現在位置の数字（.ns-nav-count）
   はback/nextに挟まれた形でセンタリングするため、.ns-nav-rowを3列グリッド
   （back＝左端／数字＝中央／next＝右端）にしている。 */
.notes-single .ns-nav-group {
	padding: 24px 0 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.notes-single .ns-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: "Noto Sans JP", sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	color: var(--na-ink);
	text-decoration: none;
}
.notes-single .ns-nav-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
}
.notes-single .ns-nav-prev,
.notes-single .ns-nav-next {
	/* 一覧側(.na-pagination)と同じ原因（隣接する.ns-nav-countは
	   フォント未指定＝body継承なのに対し、ここだけNoto Sans JPを明示
	   指定していたため内部メトリクスの差で上下にズレて見えていた）。
	   フォント指定を外し、数字側と揃える。 */
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	color: var(--na-ink);
	text-decoration: none;
}
.notes-single .ns-nav-prev {
	justify-self: start;
}
.notes-single .ns-nav-next {
	justify-self: end;
}
.notes-single .ns-nav-arrow {
	font-weight: 400;
	color: var(--na-gray);
}
.notes-single .ns-nav-count {
	font-size: 12px;
	color: var(--na-gray);
	font-variant-numeric: tabular-nums;
	justify-self: center;
}
.notes-single .ns-nav-prev.is-disabled,
.notes-single .ns-nav-next.is-disabled {
	color: var(--na-gray);
	opacity: 0.4;
}

/* いまは端末の条件を付けず、OS のダークモードの設定だけで効く（PC でも）。 */
@media (prefers-color-scheme: dark) {
	.notes-single {
		--na-kinari: #191919;
		--na-ink: rgba(255, 255, 255, 0.85);
		--na-gray: rgba(255, 255, 255, 0.55);
		--na-hairline: rgba(255, 255, 255, 0.3);
		--na-side-line: rgba(255, 255, 255, 0.08);
		--na-bengara: #C97C5D;

		color-scheme: dark;
	}
	.notes-single .ns-content a {
		text-decoration-color: rgba(255, 255, 255, 0.6);
	}
}


/* WordPressコア標準のギャラリーキャプション用ぼかし背景(::before, backdrop-filter:blur)を無効化。
   figcaptionを非表示にしても、この疑似要素は別物のため写真下部にぼかしが残っていた。 */
.notes-single .ns-content .wp-block-gallery.has-nested-images figure.wp-block-image::before {
	display: none !important;
	content: none !important;
	backdrop-filter: none !important;
}

/*
 * スマホでは、タイトルが1行でも2行でも下の説明文・日付の開始位置が
 * 揃うように、タイトル欄の高さを常に2行分確保する。2行にまたがるような
 * 文章的なタイトルはそれだけで意味が通ることが多いため、説明文は1行に短縮する
 * （イメージのみで説明文が空の投稿も、高さだけは同じ分を確保する）。
 */
/* ここは (hover: none) and (pointer: coarse) を付けず、幅の条件だけにする。
 * iOS Safari などでは読み込み直後に hover / pointer の判定が一瞬ゆれ、このブロック全体（説明文のクランプ・サムネイルの高さなど）が外れてから掛かり直す。
 * それが揺れに見えた（Safari・Firefox で説明文の後半が一瞬消える）。画面の幅は読み込み直後から安定している。 */
@media (max-width: 640px) and (hover: none), (max-width: 640px) and (pointer: coarse) {
	.notes-archive .na-item-title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	/* 事務所案内（about）の個票にはタイトル要素(.na-item-title)が無く、
	 * 行数バランスを取る対象が無いため、このクランプ短縮はNOTE個票（タイトルあり）
	 * のみに適用し、事務所案内個票（.na-item-text-only）は除外して2行のまま維持する
	 * （実機スマホで1行に省略されてしまう不具合）。 */
	/* PHP側（category.php／functions.php）でタイトル
	 * 文字数に応じて説明文の長さ自体を決めるようにしたため、幅による
	 * 出し分けは不要になった。na-item-excerptは常時表示のまま、上限として
	 * line-clamp: 2を維持する（実際の文字数はPHP側で1〜2行に収まるよう
	 * 短くしているため、通常はこのclampが視覚的に効くことはない）。 */
	/* この指定は基本ルールへ移した（PC も 100×100 にしたため）。 */
}

/* 構造の線（見出し下・件数下・送り番号の上、個別はパンくず下と末尾メタの上）を枠の縦線の手前まで伸ばす。
   Works と同じ考え：梁（構造）は壁まで、棚板（記事間の線）は本文幅。箱の余白 20 ＋ 外側 17 ＝ 37px 張り出し、同じだけ内側に戻す。
   各要素の基本ルール（padding の一括指定）より後に置く必要があるのでファイル末尾。PC だけ */
@media (min-width: 641px), (hover: hover) and (pointer: fine) {
	/* Works と同じく本文を 20〜700 に（箱の余白 20 → 左 2・右 3）。写真（100px）の右端が格子線 120 に乗る。
	   構造の線は 1〜720、文字は 20 始まり。箱（685）は触らない。スマホは従来通り */
	.notes-archive,
	.notes-single {
		padding-left: 2px;
		padding-right: 3px;
	}
	.notes-archive .na-header,
	.notes-archive .na-count,
	.notes-archive .na-pagination,
	.notes-single .ns-meta-bottom {
		margin-left: -19px;
		margin-right: -20px;
		padding-left: 19px;
		padding-right: 20px;
	}
}

/* PCで狭めたときの探究ノート一覧: 上の640px以下の規則はスマホ専用、PCは常にフル幅の組み方。
   721px未満では段の左右を18px（文字は20px）に保ち、段の幅だけ画面に合わせる。文字の大きさはそのまま（実績集と同じ）。 */
/* 幅の区切り（721px）を使わず、どの幅でも同じ式にする（区切りの瞬間の引っかかり防止）。見た目は同じ */
@media (hover: hover) and (pointer: fine) {
  .notes-archive { max-width: none !important; width: min(680px, calc(100% - 41px)) !important; margin-left: auto !important; margin-right: auto !important; }
  .notes-single { max-width: none !important; width: min(680px, calc(100% - 41px)) !important; margin-left: auto !important; margin-right: auto !important; }
}
/* スマホで「す。」だけが次の行に落ちないよう、行の長さをそろえる */
.notes-single .ns-content figcaption { text-wrap: balance; word-break: auto-phrase; }
@media (prefers-color-scheme: dark) {
}
/* 題名（H1）の上下の空きを、文字の見た目で 上50px・下50px にそろえる。もとは上 約46・下 約56（h2始まり）／約35（段落始まり） */
.notes-single .ns-header { padding-top: 43.5px; }
.notes-single .ns-content { padding-top: 32.9px; }
.notes-single .ns-content > :first-child { margin-top: 0; }
.notes-single .ns-content > h2:first-child,
.notes-single .ns-content > h3:first-child { margin-top: 6.5px; }
/* 写真を拡大した時の後ろの幕を、仕事集の個票と同じ白95%（夜は黒95%）に。もとは 90%（note-lightbox.css）。1枚だけの時の不透明の幕（ws-lightbox-solo-mode）はそのまま */
html .ws-lightbox__scrim { background: rgba(255, 255, 255, 0.95); }
@media (prefers-color-scheme: dark) {
	html .ws-lightbox__scrim { background: rgba(25, 25, 25, 0.95); }
}
/* 拡大した写真のまわりを、仕事集と同じく白い光でふんわり囲む（写真から 62px は白のまま、その先 60px でぼかす）。下の本文の字が写真のすぐそばに透けないように。仕事集は works.css の 0 0 60px 60px。ノートは note-lightbox.css の影で上書きされていたので、ここで戻す */
html .ws-lightbox__img { box-shadow: 0 0 60px 60px #fff; }
html .ws-lightbox__img.ws-transparent-image, html .ws-lightbox__img.ws-cutout { box-shadow: none; }
@media (prefers-color-scheme: dark) {
	html .ws-lightbox__img { box-shadow: 0 0 60px 60px #191919; }
	html .ws-lightbox__img.ws-diagram-image, html .ws-lightbox__img.ws-transparent-image, html .ws-lightbox__img.ws-cutout { box-shadow: none; }
}

/* 同上：塗りつぶし 30px＋ぼかし 60px（spread 60px） */

/*
 * スマホでは箇条書きの字下げを浅く。仕事集の個票（works.css）と同じ形。
 * 既定の 40px ずつ → 1.3em（約20px）ずつ。PC はこれまでどおり 40px
 */
@media (max-width: 640px) {
	.notes-single .ns-content ul,
	.notes-single .ns-content ol {
		padding-left: 1.3em;
	}
}

/*
 * 探究ノートの図面もダークモードで反転する（仕事集の個票 works.css の ws-diagram-image と同じ形）。
 * 例：ワンルーム 21753 の高低机と角丸棚の図面。
 * 図面の画像ブロックに ws-diagram-image のクラスを付けたものだけが対象。写真には付けない。
 * 拡大（ライトボックス）は note-lightbox.js がこのクラスを見て、style.css の反転を掛ける。
 */
.notes-single .ws-diagram-image img {
	-webkit-touch-callout: none;
}
@media (prefers-color-scheme: dark) {
	.notes-single .ws-diagram-image img {
		filter: invert(1) hue-rotate(180deg);
		mix-blend-mode: screen;
	}
}

/* 写真の下の説明（figcaption）も本文と同じ大きさ・濃さにする。
   仕事実績集は説明をすべて本文と同じ 15px の真ん中寄せにしていて、ノートの図面の上の説明（15px）とも大きさがそろっていなかったため */
.notes-single .ns-content figcaption {
	font-size: 15px;
	color: inherit;
}

/* 2枚並べ（カラム）の写真の間もギャラリーと同じ 10px に（WordPress 既定は 19.2px だった） */
.notes-single .ns-content .wp-block-columns {
	gap: 10px !important;
}

/* V3 の書き方（片側に 300〜330px の写真を寄せ、反対側に文章）をノートの決まりにする。
   探究ノートの写真は説明のためのものが多く、大きくする必要も拡大する必要もない。
   nd-side-photo＝横寄せ写真（実物の幅のまま、引き伸ばさない）。nd-plain-figure＝拡大しない図や写真（真ん中）。
   どちらも wp-block-image ではないので note-lightbox.js の拡大の対象にならない。
   スマホは横寄せをやめ、実物の幅のまま真ん中に置いて、文章はその下に続ける（細い列に押し込まれないように） */
.notes-single .ns-content .nd-side-photo {
	float: right;
	max-width: 330px;
	margin: 6px 0 16px 24px;
}
.notes-single .ns-content .nd-side-photo.is-left {
	float: left;
	margin: 6px 24px 16px 0;
}
.notes-single .ns-content .nd-side-photo img,
.notes-single .ns-content .nd-plain-figure img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
}
.notes-single .ns-content .nd-plain-figure {
	clear: both;
	margin: 1.6em 0;
}
.notes-single .ns-content .nd-plain-figure img {
	margin: 0 auto;
}
.notes-single .ns-meta-bottom {
	clear: both;
}
@media (min-width: 641px) {
	.notes-single .ns-content > .nd-side-photo,
	.notes-single .ns-content > .nd-side-photo.is-left {
		margin-bottom: 20px;
	}
}
@media (max-width: 640px) {
	.notes-single .ns-content .nd-side-photo,
	.notes-single .ns-content .nd-side-photo.is-left {
		float: none;
		margin: 0 auto 1.4em;
	}
	.notes-single .ns-content .nd-side-photo img {
		margin: 0 auto;
	}
}

/* スマホでは横寄せ写真を文字の幅いっぱいに。
   これから横寄せの写真は 800px を目安に作る。パソコンは今のまま横に寄せて 330 まで */
@media (max-width: 640px) {
	.notes-single .ns-content .nd-side-photo,
	.notes-single .ns-content .nd-side-photo.is-left {
		max-width: none;
		width: 100%;
	}
	.notes-single .ns-content .nd-side-photo img {
		width: 100%;
	}
}

/* ノート一覧の 100×100 の写真にも枠を。太さ・濃さは仕事実績集の一覧（.wa-item-photo::after、1px・--side-line 0.08）と同じ */
.notes-archive .na-item-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
	pointer-events: none;
	z-index: 2;
}
@media (prefers-color-scheme: dark) {
	.notes-archive .na-item-thumb::after { border-color: rgba(255, 255, 255, 0.08); }
}

/* 町並みなどの写真は 3 列の正方形で並べる（nd-grid3）。左右は本文と同じ 20px、写真の間は 10px。
   作品集（719px・間 1px）とは違うノートの並べ方。表示は正方形に切って見せ、押すと元の形で大きくなって説明（alt）が出る */
.notes-single .ns-content .nd-grid3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 1.6em 0;
}
.notes-single .ns-content .nd-grid3 figure {
	margin: 0;
}
.notes-single .ns-content .nd-grid3 img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	box-sizing: border-box; /* 細い枠の分で写真の間が 8px に縮まないように */
}
.notes-single .ns-content .nd-grid3 figcaption {
	display: none;
}

/* iPhone では 3 列の写真が小さく、間 10px が目立つ → スマホだけ写真の間を 6px に（3 列のまま） */
@media (max-width: 640px) {
	.notes-single .ns-content .nd-grid3 {
		gap: 6px;
	}
}

/* ノート本文の写真・図の枠が濃い（本文の罫線と同じ 0.25 だった）→ 一覧の写真の枠と同じ 0.08 に（夜は白 0.08） */
.notes-single .ns-content img {
	border-color: rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
	.notes-single .ns-content img { border-color: rgba(255, 255, 255, 0.08); }
}

/* 2 列の正方形（nd-grid2）：写真 4 枚などを 2 列に。下に短い説明を付ける（説明は本文と同じ大きさ）。間は 10px、スマホは 6px。押すと元の形で大きくなる */
.notes-single .ns-content .nd-grid2 {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px 10px;
	margin: 1.6em 0;
}
.notes-single .ns-content .nd-grid2 figure {
	margin: 0;
}
.notes-single .ns-content .nd-grid2 img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	box-sizing: border-box;
}
@media (max-width: 640px) {
	.notes-single .ns-content .nd-grid2 {
		gap: 12px 6px;
	}
}

/* 図面の2列（nd-grid2 nd-plans）：スマホ（640px 以下）は1列にして幅いっぱい。PC は2列のまま。sizes は functions.php で 100vw */
@media (max-width: 640px) {
	.notes-single .ns-content .nd-grid2.nd-plans {
		grid-template-columns: 1fr;
		gap: 20px 0;
	}
}

/* 4 列（nd-grid4）：手順の写真など 4 枚を横一列に（縦長は切らない）。下に短い説明。スマホは 2 列。押すと大きくなる */
.notes-single .ns-content .nd-grid4 {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px 10px;
	margin: 1.6em 0;
	align-items: start;
}
.notes-single .ns-content .nd-grid4 figure {
	margin: 0;
}
.notes-single .ns-content .nd-grid4 img {
	display: block;
	width: 100%;
	height: auto;
	box-sizing: border-box;
}
.notes-single .ns-content .nd-grid4 figcaption {
	line-height: 1.5; /* 説明の大きさは本文と同じ 15px（規則） */
}
@media (max-width: 640px) {
	.notes-single .ns-content .nd-grid4 {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px 6px;
	}
}

/* ノートの写真の間は「パソコン 10px、スマホ 6px」に統一。2枚並べ（カラム）とギャラリーもスマホは 6px に */
@media (max-width: 640px) {
	.notes-single .ns-content .wp-block-columns,
	.notes-single .ns-content .wp-block-gallery {
		gap: 6px !important;
	}
	.notes-single .ns-content .wp-block-columns:not(:last-child),
	.notes-single .ns-content .wp-block-gallery:not(:last-child) {
		margin-bottom: 6px;
	}
}

/* 4 列の正方形（nd-grid4 is-square）：町並みの写真 8 枚など、3 列で割り切れないとき。説明は付けず、押すと元の形で大きくなり説明（alt）が出る。スマホは 2 列（nd-grid4 の決まりのまま） */
.notes-single .ns-content .nd-grid4.is-square {
	gap: 10px;
}
.notes-single .ns-content .nd-grid4.is-square img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
@media (max-width: 640px) {
	.notes-single .ns-content .nd-grid4.is-square {
		gap: 6px;
	}
}

/* 2 枚並べ・押しても大きくしない・下に説明（nd-pair）：写真がきれいでなく拡大しない方がよいもの（長屋の耐震診断の傷んだ室内など）。figure に wp-block-image を付けないので拡大しない（note-lightbox.js の対象外）。間は 10px、スマホは 6px */
.notes-single .ns-content .nd-pair {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px 10px;
	margin: 1.6em 0;
}
.notes-single .ns-content .nd-pair figure {
	margin: 0;
}
.notes-single .ns-content .nd-pair img {
	display: block;
	width: 100%;
	height: auto;
	box-sizing: border-box;
}
.notes-single .ns-content .nd-pair figcaption {
	line-height: 1.5;
}
@media (max-width: 640px) {
	.notes-single .ns-content .nd-pair {
		gap: 12px 6px;
	}
}

/* 写真が上・文が下のとき（琵琶湖高島市の休憩所）：写真の説明から本文までの間が、本文から下の線までの間（40px）より広く見えたので狭める。説明の下 15px＋写真の下 12px＝27px */
.notes-single .ns-content figure.wp-block-image:has(+ p) {
	margin-bottom: 12px;
}

/* 2 列で元の形のまま（nd-grid2 is-natural）：縦長の工事写真など、正方形に切ると大事なところが切れるもの（配筋〜コンクリート壁打ち上がり）。押すと大きくなる、下に説明 */
.notes-single .ns-content .nd-grid2.is-natural img {
	aspect-ratio: auto;
	object-fit: initial;
}

/* 拡大できる写真のカーソルを「＋」にそろえる。前は一部が指（pointer）になっていた。拡大しない nd-pair・nd-side-photo・nd-plain-figure は wp-block-image ではないので対象外 */
.notes-single .ns-content figure.wp-block-image img,
.notes-single .ns-content .wp-block-gallery img {
	cursor: zoom-in;
}


/*
   横寄せ写真（nd-side-photo）とその文章を nd-text-first で囲むと、スマホでは文章が先、写真が後になる。
   パソコンは今まで通り右に寄せて文章を回り込ませる。囲まないときは今まで通り（スマホでは写真が先） */
@media (max-width: 640px) {
	.notes-single .ns-content .nd-text-first {
		display: flex;
		flex-direction: column;
	}
	.notes-single .ns-content .nd-text-first > .nd-side-photo {
		order: 2;
		margin: 0 0 1.4em;
	}
}


/* 続き物（シリーズ）の目次（nd-series）。functions.php が本文の最後に出す。
   上に細い線、シリーズ名（全○回）、回の一覧（日付の古い順）。今読んでいる回は太字でリンクなし。文字は本文より少し小さい 14px */
.notes-single .nd-series {
	clear: both;
	margin: 2.4em 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--na-hairline);
	font-size: 14px;
	line-height: 1.7;
}
.notes-single .nd-series-title {
	font-weight: 700;
}
.notes-single .nd-series li {
	margin: 3px 0;
}
.notes-single .nd-series-date {
	color: var(--na-gray);
}


/* 仕事集の個票は 最後の写真の下 → 下の線 が 45px（ギャラリーの下 24＋1、本文の下 8、線の上 12）。
   ノートは写真の並び（nd-grid2/3/4 など）の下の余白 1.6em（24px）が本文の下 40px に足されて 64px になる。
   最後の要素の下の余白は 0 にそろえ（探究ノート共通の決まり、上の★）、写真や図で終わるときだけ本文の下を 45px にする。文で終わるときはこれまでどおり 40px */
.notes-single .ns-content > *:last-child {
	margin-bottom: 0 !important;
}
.notes-single .ns-content:has(> :is(figure, .wp-block-image, .wp-block-gallery, .wp-block-columns, .nd-grid2, .nd-grid3, .nd-grid4, .nd-pair, .nd-plain-figure):last-child) {
	padding-bottom: 45px;
}
/* 同じく：続き物の目次（nd-series）の上も、写真の下 → 目次の線 が 45px（すぐ前の要素の下の余白は 0）。
   目次の見出しと一覧の間が空きすぎていた（本文の段落の下余白 1.4em が効いていた）ので 6px に */
.notes-single .ns-content > *:has(+ .nd-series) {
	margin-bottom: 0 !important;
}
.notes-single .ns-content .nd-series {
	margin-top: 45px;
}
.notes-single .ns-content p.nd-series-title {
	margin: 0 0 6px;
}


/* 目次を仕事集の個票の「探究ノート」欄（works.css .ws-note-list）と同じ並びに。
   題名は左（長いときは1行で…）、日付は右にそろえる（数字の幅をそろえ、1桁の月・日は functions.php で数字1つ分の空白を入れる）。番号の「1. 2.」は出さない */
.notes-single .ns-content .nd-series ul {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 4px 1em;
	margin: 0;
	padding: 0;
	list-style: none;
}
.notes-single .ns-content .nd-series li {
	display: contents;
}
.notes-single .ns-content .nd-series .nd-series-name {
	grid-column: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.notes-single .ns-content .nd-series .nd-series-date {
	margin-left: 0;
	font-size: inherit;
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}


/* 目次の一覧（各回の題名）を見出しより 1 文字分（1em）右へ（はじめ 2 文字分→「ズラしすぎ、1文字へ」）。日付は右端のまま */
.notes-single .ns-content .nd-series ul {
	padding-left: 1em;
}


/* 続き物の2段目（functions.php nd_series_line）。
   一覧では題名の下に「▸ シリーズ名 n/全数」を小さく赤茶色で。続き物の記事だけ説明を1行にして高さをそろえる（題名1行＋2段目＋説明1行）。
   記事のページでは題名の上に同じものを出す */
.notes-archive .na-item-series {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	line-height: 1.6;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.notes-archive .na-item-text:has(.na-item-series) .na-item-excerpt {
	-webkit-line-clamp: 1 !important;
	min-height: 0 !important;
}
@media (prefers-color-scheme: dark) {
}


/* 2段目は案 D（現場名だけ・薄いグレー・12.5px）。一覧も記事の上も同じ。赤茶は使わない */
.notes-archive .na-item-series,
.notes-single .ns-series {
	color: rgba(0, 0, 0, 0.38);
}
@media (prefers-color-scheme: dark) {
	.notes-archive .na-item-series,
	.notes-single .ns-series {
		color: rgba(255, 255, 255, 0.45);
	}
}


/* 目次の今の回も灰色に（太さはほかの回と同じ、下線なし）。サイトの決まり＝今いるところは灰色で押せない */
.notes-single .nd-series li.is-current .nd-series-name {
	font-weight: inherit;
	color: var(--na-gray);
}

/* 12px・昼は黒の50%・夜は白の55%（本文と同じ 15px・同じ濃さの指定を上書き）。戻すときはこの塊を消すだけ。仕事実績集（works.css）は別 */
.notes-single .ns-content figcaption {
	font-size: 12px;
	color: rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
	.notes-single .ns-content figcaption {
		color: rgba(255, 255, 255, .55);
	}
}

/* 写真1枚だけの nd-grid2（片写真・左寄せ・拡大なし、205 文化財マネージャー）は、PC では左の列に半分の幅、スマホ（640px 以下）では他の投稿と同じく幅いっぱい */
@media (max-width: 640px) {
	.notes-single .ns-content .nd-grid2 > figure:only-child {
		grid-column: 1 / -1;
	}
}

/* 一覧の 100px に夜用（<picture>、functions.php の nd_note_thumb_dark_source）。picture は箱を作らず、中の img に今までの指定が効くように */
.notes-archive .na-item-thumb picture { display: contents; }

/* 図面の figure に nd-drawing を付けると枠を消す */
.notes-single .ns-content figure.nd-drawing img { border: 0; }

/* 図の上に置く説明（仕事実績集の ws-cap-above・ws-gap-top と同じ考え）。
   説明の下 0 → 次の図の上 24px（他の個票の「説明文→写真 24px」とそろえる）。前が図のときは nd-gap-top で説明の上 40px。図の画像の上の白い余白は中身の 12px 手前まで切る */
.notes-single .ns-content p.nd-cap-above { margin-bottom: 0; }
.notes-single .ns-content p.nd-cap-above + figure { margin-top: 24px; }
.notes-single .ns-content p.nd-gap-top { margin-top: 40px; }


/*
 * 本文にそういう言葉があるノートだけ、題名の下に「2011年」。2段目の現場名（.ns-series）と同じ灰色・12.5px。functions.php の nd_note_year_line() */
.notes-single .ns-year {
	margin: 4px 0 0;
	font-size: 12.5px;
	line-height: 1.6;
	letter-spacing: 0.02em;
	color: rgba(0, 0, 0, 0.38);
}
@media (prefers-color-scheme: dark) {
	.notes-single .ns-year { color: rgba(255, 255, 255, 0.45); }
}

/* 片写真を右の列に置くときは nd-grid2 に is-right。PC だけ（スマホは上の :only-child で幅いっぱいのまま） */
@media (min-width: 641px) {
	.notes-single .ns-content .nd-grid2.is-right > figure:only-child {
		grid-column: 2;
	}
}

/* 横寄せ写真（nd-side-photo）の方が文章より長いとき、下の back・new まで回り込まないように、nd-text-first に is-clear を足すと箱の中で回り込みを終える（PC だけ。スマホは上の flex のまま）。他のノートは今まで通り */
@media (min-width: 641px) {
	.notes-single .ns-content .nd-text-first.is-clear {
		display: flow-root;
	}
	/* 箱の中で終えると写真の下の 16px が残るので、ここでは 0（他のノートと同じく本文の終わり→下の線 40px） */
	.notes-single .ns-content .nd-text-first.is-clear > .nd-side-photo {
		margin-bottom: 0;
	}
}

/* 雑誌のページなど縦長を 3 枚横に並べるとき（nd-grid3 is-natural）。正方形に切らず元の形のまま、上でそろえる。押すと大きくなる */
.notes-single .ns-content .nd-grid3.is-natural {
	align-items: start;
}
.notes-single .ns-content .nd-grid3.is-natural img {
	aspect-ratio: auto;
	object-fit: initial;
}

/*
   nd-text-first に is-cols を付けると、PC は文章（nd-side-text）と横寄せ写真を2列に分け、文章を写真の下に回り込ませない。スマホは今まで通り文章が先、写真が後 */
@media (min-width: 641px) {
	.notes-single .ns-content .nd-text-first.is-cols {
		display: flex;
		flex-direction: row-reverse;
		align-items: flex-start;
		gap: 24px;
		margin: 0 0 1.6em;
	}
	.notes-single .ns-content .nd-text-first.is-cols > .nd-side-photo {
		float: none;
		flex: 0 0 auto;
		margin: 6px 0 0;
	}
	.notes-single .ns-content .nd-text-first.is-cols > .nd-side-text {
		flex: 1 1 auto;
		min-width: 0;
	}
	.notes-single .ns-content .nd-text-first.is-cols > .nd-side-text > :first-child { margin-top: 0; }
	.notes-single .ns-content .nd-text-first.is-cols > .nd-side-text > :last-child { margin-bottom: 0; }
}

/* 右の列に写真を2枚縦に積む（nd-side-photo is-stack の中に figure を並べる）。左の文は続けて流れるので、写真の高さで文の間が空かない */
.notes-single .ns-content .nd-text-first.is-cols > .nd-side-photo.is-stack > figure + figure,
.notes-single .ns-content .nd-side-photo.is-stack > figure + figure {
	margin-top: 10px;
}

/* 縦と横を並べた段で、背の低い写真を下でそろえる（キャプションの線がそろう） */
.notes-single .ns-content .nd-grid2.is-natural.is-bottom {
	align-items: end;
}

/* 本文の後の注（※注1・※注2）や「参考：」をまとめる囲み。上に細い線、文字 13px、本文の色を薄くした灰色（夜も同じ考え方） */
.notes-single .ns-content .nd-notes {
	margin: 2.2em 0 1.6em;
	padding-top: 1.2em;
	border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	font-size: 13px;
	line-height: 1.85;
	color: color-mix(in srgb, currentColor 62%, transparent);
}
.notes-single .ns-content .nd-notes p {
	margin: 0 0 .8em;
	font-size: inherit;
	color: inherit;
}
.notes-single .ns-content .nd-notes p:last-child {
	margin-bottom: 0;
}

/* シリーズの一文は目次の番号の頭（ul の字下げ 14px）にそろえ、13px のグレー（日付・今の回と同じ濃さ） */
.notes-single .ns-content .nd-series .nd-series-lead,.nd-series .nd-series-lead{margin:0 0 15px;padding-left:11px;font-size:13px;line-height:1.7;color:var(--na-gray,rgba(0,0,0,.5))}
/* PC は「（全n回）」のあとに 10px 空けて同じ行に続ける（一塊・字の下でそろえる）。スマホは見出しの下の行（番号の頭から 3px 左） */
@media (min-width: 641px){ .nd-series .nd-series-title:has(+ .nd-series-lead){display:inline} .notes-single .ns-content .nd-series .nd-series-lead,.nd-series .nd-series-lead{display:inline-block;vertical-align:baseline;margin:0 0 0 10px;padding-left:0} /* 一文はひとまとめ：入りきらないときは途中で折らず、一文ごと次の行へ */ }

/* 見出し（と一文）から目次の 1. までの間を、PC・スマホ、一文のあり・なしで同じ 15px にそろえる（10px→15px） */
.notes-single .ns-content .nd-series .nd-series-title + ul{margin-top:15px}
@media (min-width: 641px){ .notes-single .ns-content .nd-series .nd-series-lead + ul{margin-top:11px} }

/* 拡大させない写真（囲みに nd-nolb）は虫めがねのカーソルを出さない。note-lightbox.js も nd-nolb の中の写真を拾わない */
.notes-single .ns-content .nd-nolb img,.nd-nolb img{cursor:default !important}

/* 片写真（1枚）の figure の上の余白 24px を消し、写真の上を文の1行目の字の頭（6px）にそろえる */
.notes-single .ns-content .nd-text-first.is-cols > .nd-side-photo > figure{margin:0}

/* 目次の番号は別の span（リンクなし）、右寄せで点の位置をそろえる */
.notes-single .ns-content .nd-series .nd-series-no{display:inline-block;min-width:1.75em;margin-right:.4em;text-align:right;color:var(--na-ink,rgba(0,0,0,.8));font-variant-numeric:tabular-nums}
.notes-single .ns-content .nd-series li.is-current .nd-series-no{color:inherit}


/* スマホで、シリーズの目次は「1.」の頭を一文「ひとつの…」の頭（見出しから11px）にそろえる（左へ15px）。一文のないシリーズも同じ位置 */
@media (max-width: 640px){ .notes-single .ns-content .nd-series ul{padding-left:0;margin-left:-1px} }


/* 【関連記事】【関連仕事】の箇条書きの字の頭を、シリーズ目次の題名の頭（番号の後ろ）にそろえる。PC 見出しから 44.1px、スマホ 29.1px */
.notes-single .ns-content ul.wp-block-list.nd-related-list{padding-left:44.1px}
@media (max-width: 640px){ .notes-single .ns-content ul.wp-block-list.nd-related-list{padding-left:29.1px} }

/* 続き物で題名が2行になったら、シリーズ名を題名の2行目の後ろに続けて置き、入りきらない分は「…」。説明は1行（functions.php の wp_footer の nd-series-inline が位置と幅を決める） */
.notes-archive .na-item-text { position: relative; }
.notes-archive .na-item-text.is-series-inline .na-item-series { position: absolute; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 続き物の題名の「リノベ」は PC だけ「リノベーション」（functions.php の nd-renov-pc が「ーション」を .nd-pc-only で足す） */
.nd-pc-only { display: none; }
@media (min-width: 641px) { .nd-pc-only { display: inline; } }

/* 3列の正方形でも写真ごとに説明を出す（nd-grid3 has-cap） */
.notes-single .ns-content .nd-grid3.has-cap { align-items: start; }
.notes-single .ns-content .nd-grid3.has-cap figcaption { display: block; line-height: 1.5; margin-top: 5px; }

/* 横寄せ写真を3分の1に（nd-text-first is-cols の nd-side-photo に is-third）。PC だけ。スマホは今まで通り幅いっぱい */
@media (min-width: 641px) {
	.notes-single .ns-content .nd-text-first.is-cols > .nd-side-photo.is-third {
		flex: 0 0 32%;
		max-width: 32%;
	}
}

/* 写真や図のすぐ後の見出し（区切り）は上を広く。続く図の境目（改装前と改装後など）が分かるように。見出しに nd-gap-top を付けると上 56px（ふつうは 27px） */
.notes-single .ns-content h2.nd-gap-top {
	margin-top: 56px;
}

/* ==========================================================
   ノートの英訳（English）
   英訳のできたノートだけ、本文の一番最後に「詳細」ブロック（.nd-note-en）を置く。
   閉じているときは右端に小さく English だけ。下の線のすぐ上に、日付（暮らしと美）と同じ 11.5px・灰色で沈める
   （線から字までの空きは、線の下の日付と同じ約 20px）。
   押すと英訳が開く。lang="en" は functions.php（nd-english）で付く
   ========================================================== */
.notes-single .nd-note-en {margin: 40px 0 0 !important;}
/* 閉じているときは、本文の下の余白（40px）に食い込ませて線に寄せる。最後の子の margin 0 の決まりより強くするため details まで書く */
.notes-single .ns-content > details.nd-note-en:not([open]) {margin-bottom: -30px !important;}
.notes-single .nd-note-en > summary {display: block; list-style: none; cursor: pointer; text-align: right; font-size: 11.5px; line-height: 16.1px; font-weight: 400; color: var(--na-gray); text-decoration: none;}
.notes-single .nd-note-en > summary::-webkit-details-marker {display: none;}
.notes-single .nd-note-en > summary::marker {content: "";}
@media (hover: hover) {
  .notes-single .nd-note-en > summary:hover {text-decoration: underline; text-underline-offset: 3px;}
}
.notes-single .nd-note-en[open] > summary {margin-bottom: 20px;}
.notes-single .nd-note-en > .nd-note-en-title {padding-top: 20px; border-top: 1px solid var(--na-hairline);}


/* ---------- 探究ノートの一覧の3つの区画（.na-cats） ----------
   題名（.na-header）のすぐ下。耐震と構造・設計と現場・暮らしと美の3つ。仕事実績集も同じ形（works.css の .wa-cats）。
   幅と左右は下の件数の行（.na-count）と同じ。高さも件数の行と同じ 40（PC を 60 にするかは Mac で見て決める）。
   今いる区画は太字＋下に線（2px）、ほかは薄く。件数は出さない。押すとそのカテゴリー、今いる区画を押すと全体へ */
.notes-archive .na-cats{display:grid;grid-template-columns:repeat(3,1fr);margin:0 -20px 0 -19px;border-bottom:1px solid var(--na-hairline);}
.notes-archive .na-cats a{position:relative;display:flex;align-items:center;justify-content:center;height:39px;/* 下の線 1px と合わせて 40＝件数の行と同じ */
  font-size:14px;letter-spacing:.06em;line-height:1;color:inherit;text-decoration:none;white-space:nowrap;}
.notes-archive .na-cats a.is-on{font-weight:600;}
.notes-archive .na-cats a.is-on::after{position:absolute;left:0;right:0;bottom:-1px;height:2px;background:currentColor;}
.notes-archive .na-cats:has(.is-on) a:not(.is-on){color:var(--na-gray);}

/* B案：区切りの縦線を、上のグローバルナビと同じ「字の高さの短い線」に（1px×16.5px、濃さ 0.3）。
   上から下までの線だと表のマスに見えて分断されるので、横一文字の帯にする。
   今いる区画の下線（2px）も、マスの幅いっぱいではなく字の幅だけ（span に付ける）。下の線の上に重ねる */
.notes-archive .na-cats a + a{border-left:0;}
.notes-archive .na-cats a + a::before{content:"";position:absolute;left:0;top:50%;width:1px;height:16.5px;transform:translateY(-50%);background:#111;opacity:.3;}
@media (prefers-color-scheme: dark){ .notes-archive .na-cats a + a::before{background:#fff;} }
.notes-archive .na-cats a.is-on::after{content:none;}
.notes-archive .na-cats a span{position:relative;}
.notes-archive .na-cats a.is-on span::after{position:absolute;left:0;right:0;bottom:-13.5px;height:2px;background:currentColor;}

/* 今いる区画の下線はなし。太字だけで示す */
.notes-archive .na-cats a.is-on span::after{content:none;}


/* カテゴリーのページの題名「探究ノート」はリンク（押すと全体へ）。見た目は題名のまま */
.notes-archive #na-heading .na-heading-link{color:inherit;text-decoration:none;}
@media (hover:hover){ .notes-archive #na-heading .na-heading-link:hover{opacity:.65;} }

/* ノートの題名の上の札（カテゴリー）。仕事の作品の札（.ws-eyebrow：11px・行の高さ 15.4px・下 6px）と同じ大きさ・位置。色は薄い灰色 */
.notes-single .ns-eyebrow{width:max-content;margin:0 0 6px;font-size:11px;line-height:15.4px;letter-spacing:.02em;color:var(--na-gray);text-decoration:none;}
@media (hover:hover){ .notes-single .ns-eyebrow:hover{text-decoration:underline;} }

/* 件数の行をなくし、虫眼鏡を題名の行の右端へ（A 案。帯が2本で重かった）。
   件数（すべての記事 165件・耐震と構造 26件）は出さない。区画で件数を出さないのと同じ理由。
   HTML はそのまま（検索の JS が .na-count の中の要素を使うので）、.na-count を題名の行の右端に浮かせる。
   虫眼鏡の右端は今までと同じ（.notes-archive の右から 3px）、上下は題名（h1）の真ん中 */
.notes-archive .na-count{position:absolute;top:40px;right:3px;margin:0;padding:0;border:0;width:auto;height:26px;display:flex;align-items:center;z-index:2;}
.notes-archive .na-count .na-count-text{display:none;}

/* カテゴリーのページの題名の上の余白をトップと同じ 22px に（パンくずがあった頃は 18px）。
   ページを移っても題名・虫眼鏡・区画の位置が動かない */
body .notes-archive > .na-header:first-child{padding-top:22px;}

/* 区画にカーソルを重ねても薄くしない。薄い字（今いない区画）がさらに薄くなり、なぞるたびに点滅して見える。
   上のグローバルナビと同じく、細い下線が出るだけ（1px、濃さ .35、字から 4px）。
   今いる区画（太字）は、重ねても何も変えない */
@media (hover:hover){
  .notes-archive .na-cats a:hover{opacity:1;text-decoration:underline;text-decoration-color:rgba(0,0,0,.35);}
  .notes-archive .na-cats a.is-on:hover{text-decoration:none;}
}
@media (hover:hover) and (prefers-color-scheme: dark){ .notes-archive .na-cats a:hover{text-decoration-color:rgba(255,255,255,.4);} }

/* ---------- 今いる区画の＋と、その区画のシリーズの一覧 ----------
   ＋は今いる区画の名前の右にだけ出る（functions.php）。線の細さと開き方は事務所案内の開け閉めと同じ（12px の線 2 本、開くと ×）。
   置き場は区画の升の真ん中から、名前の幅の半分（字数 × 1.06em の半分）だけ右。名前の右端から＋まで PC 12px。
   スマホは升が狭く＋が画面の端に寄るので、間を 6px に詰め、名前と＋をひとまとまりにして升の真ん中へ（名前を 9px 左へ）。
   ＋は印で、押すのは今いる区画の升全体（functions.php） */
.notes-archive .na-cats{position:relative;}
.notes-archive .nd-sr-btn{position:absolute;grid-row:1;top:50%;left:50%;width:32px;height:32px;margin:-16px 0 0 calc(var(--nd-sr-len,5) * .53em + 2px);font-size:14px;pointer-events:none;}
/* 升は始まりと終わりの両方で決める（終わりを書かないと、帯の右端までの広さになり、左と真ん中の区画で＋がずれる） */
.notes-archive .nd-sr-btn.is-c1{grid-column:1 / 2;}
.notes-archive .nd-sr-btn.is-c2{grid-column:2 / 3;}
.notes-archive .nd-sr-btn.is-c3{grid-column:3 / 4;}
.notes-archive .nd-sr-btn::before,
.notes-archive .nd-sr-btn::after{content:"";position:absolute;top:50%;left:10px;width:12px;height:1px;margin-top:-.5px;background:currentColor;opacity:.75;transition:transform .3s ease;}
.notes-archive .nd-sr-btn::after{transform:rotate(90deg);}
.notes-archive .nd-sr-btn.is-open::before{transform:rotate(45deg);}
.notes-archive .nd-sr-btn.is-open::after{transform:rotate(-45deg);}
@media (max-width:640px){
  .notes-archive .nd-sr-btn{margin-left:calc(var(--nd-sr-len,5) * .53em - 11px);}
  .notes-archive .na-cats:has(.nd-sr-btn) a.is-on span{left:-9px;}
  .notes-archive .nd-sr-btn::before,
  .notes-archive .nd-sr-btn::after{left:8px;}
}
/* スマホで区画のページを開いたとき、名前が 9px 左へ寄るのを 0.5 秒かけて動かし、＋はその間に浮かび上がらせる（ページを開くたびに一度だけ）。動きを減らす設定の人には動かさない */
@keyframes nd-sr-slide{from{left:0;}to{left:-9px;}}
@keyframes nd-sr-fade{from{opacity:0;}to{opacity:1;}}
@media (max-width:640px) and (prefers-reduced-motion:no-preference){
  .notes-archive .na-cats:has(.nd-sr-btn) a.is-on span{animation:nd-sr-slide .5s ease both;}
  .notes-archive .nd-sr-btn{animation:nd-sr-fade .5s ease both;}
}
/* 開いた中身。PC もスマホも 1 行に 1 つ。閉じているときは見えない所のリンクに指やキーが届かないよう visibility も切る */
.notes-archive .nd-sr-panel{overflow:hidden;max-height:0;visibility:hidden;transition:max-height .35s ease,visibility 0s linear .35s;}
.notes-archive .nd-sr-panel.is-open{visibility:visible;transition:max-height .35s ease;}
.notes-archive .nd-sr-panel ul{margin:0;padding:10px 0 14px;list-style:none;border-bottom:1px solid var(--na-hairline);}
.notes-archive .nd-sr-panel li{border-top:1px solid var(--na-hairline);}
/* 一番上の行には上の線を引かない（すぐ上の帯の線と二重になる） */
.notes-archive .nd-sr-panel li:first-child{border-top:0;}
/* 名前と回数を 1 行に。回数は右端で縦にそろえる（行ごとの線で、どの行の回数か追える） */
.notes-archive .nd-sr-panel a{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:10px;padding:10px 0;font-size:14px;line-height:1.6;color:inherit;text-decoration:none;}
.notes-archive .nd-sr-name{display:contents;}
/* まとまり（建築歴訪など）は、親の行を一回り大きい太字に。その下の子の行（中のシリーズ）は 1 字下げ、線も下げた位置から引く */
.notes-archive .nd-sr-panel li.is-parent a{font-size:16px;font-weight:600;letter-spacing:.04em;}
.notes-archive .nd-sr-panel li.is-parent .nd-sr-n{font-weight:400;letter-spacing:0;}
.notes-archive .nd-sr-panel li.is-child{border-top:0;}
.notes-archive .nd-sr-panel li.is-child a{margin-left:1em;padding:8px 0;border-top:1px solid var(--na-hairline);}
.notes-archive .nd-sr-n{font-size:12px;color:var(--na-gray);}
@media (hover:hover){ .notes-archive .nd-sr-panel a:hover{opacity:.6;} }

/* ---------- まとまりの一覧ページ（建築歴訪など） ----------
   行は探究ノートの一覧と同じ。シリーズごとの見出し（目次と同じ「名前（全n回）」）の下に並べる。
   どのシリーズにも属さないノートは、最後に線で区切って置く */
.notes-archive .nd-collection-h{margin:40px 0 0;padding:0 0 10px;border-bottom:1px solid currentColor;font-size:17px;font-weight:700;letter-spacing:.04em;line-height:1.5;}
.notes-archive .nd-collection-group:first-child .nd-collection-h{margin-top:28px;}
.notes-archive .nd-collection-h span{margin-left:2px;font-size:13px;font-weight:400;letter-spacing:0;color:var(--na-gray);}
/* ＋の中の子の行から飛んできたとき、見出しが上の固定の帯（高さ 71px）に隠れないように */
.notes-archive .nd-collection-group{scroll-margin-top:90px;}
.notes-archive .nd-collection-group.is-loose{margin-top:44px;border-top:1px solid var(--na-hairline);}

/* 続き物の名前を札の後ろに並べる。
   「耐震と構造 ｜ 保育園のブロック塀 災害復旧」の1行＋題名の2段に。区切りはグローバルナビ・区画と同じ短い縦線（濃さ .3）。
   続き物の名前は札と同じ 11px・灰色。札の下の 6px はそのまま */
.notes-single .ns-eyebrow{display:inline-block;vertical-align:baseline;}
.notes-single .ns-eyebrow + .ns-series{display:inline;margin:0;font-size:11px;line-height:15.4px;letter-spacing:.02em;color:var(--na-gray);}
.notes-single .ns-eyebrow + .ns-series::before{content:"";display:inline-block;width:1px;height:.95em;margin:0 .75em 0 .45em;/* 左は札との間の空白1字分を差し引く */vertical-align:-.1em;background:currentColor;opacity:.6;}

/* スマホ（指で触る端末）で、題名の段の下の線（＝区画の帯の上の線）が帯より短かった（iPhone）。
   PC は題名の段も帯も左右にはみ出して同じ長さ。スマホは題名の段だけはみ出さない決まり（上の 641px 以上の塊）のため。
   字の位置は動かさず、線だけを帯と同じ長さ（左 -19px・右 -20px）にのばす */
@media (max-width: 640px) and (hover: none), (max-width: 640px) and (pointer: coarse) {
  .notes-archive .na-header{ position: relative; border-bottom-color: transparent; } /* 元の短い線は透明に（重なって濃く見えた） */
  .notes-archive .na-header::after{ content: ""; position: absolute; left: -19px; right: -20px; bottom: -1px; border-bottom: 1px solid var(--na-hairline); }
}
