/*
 * トップページ（[ntl_home_hero] / [ntl_home_tools]）。common.css の後に読む。
 * ファーストビューで使うので、描画中ではなく wp_enqueue_scripts で head に読む。
 *
 * 目立たせるのは属性ナビだけ。ほかは SWELL の見出しと共通部品にまかせる。
 * コンテナクエリのしきい値は px（SWELL は画面幅で html の font-size を変える）。
 */

/* ---------- ファーストビュー ---------- */

.ntl-home-hero {
	container-type: inline-size;
	container-name: ntlhero;
	margin: 0 0 2.5rem;
}

.ntl-home-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.75rem;
	align-items: end;
}

.post_content .ntl-home-hero p,
.ntl-home-hero p {
	margin: 0;
}

/* キャラは平らな墨の地に立たせ、足元を一本の罫で受ける。
   グラデーションで飾らない（絵が主役で、地はその台）。 */
.ntl-home-hero__visual {
	grid-column: 1 / -1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 0;
	aspect-ratio: 16 / 6;
	overflow: hidden;
	background: var(--ntl-text);
}

.ntl-home-hero__visual img {
	display: block;
	width: 22%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	object-position: 50% 100%;
}

.post_content .ntl-home-hero p.ntl-home-hero__title,
.ntl-home-hero p.ntl-home-hero__title {
	font-family: var(--ntl-display);
	font-size: 1.7rem;
	font-weight: 600;
	line-height: 1.55;
	letter-spacing: 0.04em;
	color: var(--ntl-text);
}

/* 句の途中で折り返さない */
.ntl-home-hero__title > span {
	display: inline-block;
}

.post_content .ntl-home-hero p.ntl-home-hero__note,
.ntl-home-hero p.ntl-home-hero__note {
	margin-top: 0.9rem;
	font-size: 0.85rem;
	line-height: 1.9;
	color: var(--ntl-muted);
}

.ntl-home-hero__note .ntl-num {
	font-size: 1.25em;
	color: var(--ntl-text);
}

/* 検索 */
.ntl-home-search {
	margin-top: 1.5rem;
}

.ntl-home-search__label {
	display: block;
	margin-bottom: 0.45rem;
	font-size: 0.78rem;
	color: var(--ntl-muted);
}

.ntl-home-search__row {
	display: flex;
	max-width: 26rem;
}

.ntl-home-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 2.9rem;
	padding: 0 0.85rem;
	border: 1px solid var(--ntl-text);
	border-right: 0;
	border-radius: 2px 0 0 2px;
	background: #fff;
	font-size: 16px; /* iOS がフォーカス時に拡大しない大きさ */
	color: var(--ntl-text);
	box-sizing: border-box;
}

.ntl-home-search__button,
.post_content button.ntl-home-search__button {
	all: unset;
	box-sizing: border-box;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	height: 2.9rem;
	padding: 0 1.3rem;
	border-radius: 0 2px 2px 0;
	background: var(--ntl-text);
	color: #fff;
	font-size: 0.9rem;
	cursor: pointer;
}

.ntl-home-search__input:focus-visible,
.ntl-home-search__button:focus-visible,
.post_content button.ntl-home-search__button:focus-visible {
	position: relative;
	z-index: 1;
	outline: 3px solid var(--ntl-main);
	outline-offset: 1px;
}

/* 属性から探す。カードと絞り込みに出る印と同じ「漢字＋色の罫」でそろえる */
.ntl-home-elements__title {
	margin-bottom: 0.5rem;
	font-size: 0.78rem;
	color: var(--ntl-muted);
}

.post_content ul.ntl-home-elements__list,
ul.ntl-home-elements__list.ntl-home-elements__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.post_content .ntl-home-elements__item,
.ntl-home-elements__list .ntl-home-elements__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.post_content .ntl-home-elements__item::before,
.ntl-home-elements__list .ntl-home-elements__item::before {
	content: none;
}

.ntl-home-elements__link,
.post_content a.ntl-home-elements__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	min-height: 3.4rem;
	border-bottom: 3px solid var(--el, var(--ntl-border));
	background: none;
	color: var(--ntl-text);
	text-decoration: none;
	transition: background-color 0.12s;
}

.ntl-home-elements__name {
	font-family: var(--ntl-display);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.2;
}

.ntl-home-elements__count {
	font-size: 0.7rem;
	color: var(--ntl-muted);
	font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (pointer: fine) {
	.ntl-home-elements__link:hover {
		background: var(--ntl-surface-muted);
	}
}

.ntl-home-elements__link:focus-visible {
	outline: 2px solid var(--ntl-main);
	outline-offset: 2px;
}

@container ntlhero (min-width: 700px) {
	.ntl-home-hero__inner {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
		gap: 2.25rem;
	}

	.post_content .ntl-home-hero p.ntl-home-hero__title,
	.ntl-home-hero p.ntl-home-hero__title {
		font-size: 2.15rem;
	}
}

/* ---------- 図鑑とツール ---------- */

.ntl-home-tools-wrap {
	container-type: inline-size;
	container-name: ntltools;
}

.post_content ul.ntl-home-tools,
ul.ntl-home-tools.ntl-home-tools {
	margin: 0 0 1.5em;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--ntl-border);
}

.post_content .ntl-home-tools__item,
.ntl-home-tools .ntl-home-tools__item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--ntl-border);
	list-style: none;
}

.post_content .ntl-home-tools__item::before,
.ntl-home-tools .ntl-home-tools__item::before {
	content: none;
}

.ntl-home-tools__link,
.post_content a.ntl-home-tools__link {
	display: grid;
	grid-template-columns: 3.5rem minmax(0, 1fr) auto;
	column-gap: 0.9rem;
	align-items: center;
	padding: 0.7rem 0.35rem;
	color: var(--ntl-text);
	text-decoration: none;
}

.ntl-home-tools__thumb {
	grid-column: 1;
	grid-row: 1 / span 2;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: 2px;
	background: var(--ntl-surface-muted);
}

/* 絵の無い行（実績）は、意味のない灰色の四角を置くより、絵の列そのものを詰めた方がよい */
.ntl-home-tools__link--noimg,
.post_content a.ntl-home-tools__link--noimg {
	grid-template-columns: minmax(0, 1fr) auto;
}

.ntl-home-tools__link--noimg .ntl-home-tools__name,
.ntl-home-tools__link--noimg .ntl-home-tools__desc {
	grid-column: 1;
}

.ntl-home-tools__link--noimg .ntl-home-tools__count {
	grid-column: 2;
}

@media (hover: hover) and (pointer: fine) {
	.ntl-home-tools__link:hover {
		background: var(--ntl-surface-muted);
	}
}

.ntl-home-tools__link:focus-visible {
	outline: 3px solid var(--ntl-main);
	outline-offset: -3px;
}

.ntl-home-tools__name {
	grid-column: 2;
	align-self: end;
	font-family: var(--ntl-display);
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ntl-text);
}

.ntl-home-tools__desc {
	grid-column: 2;
	align-self: start;
	margin-top: 0.15rem;
	font-size: 0.8rem;
	line-height: 1.55;
	color: var(--ntl-muted);
}

.ntl-home-tools__count {
	grid-column: 3;
	grid-row: 1 / span 2;
	font-size: 0.75rem;
	color: var(--ntl-muted);
	white-space: nowrap;
}

.ntl-home-tools__count .ntl-num {
	margin-right: 0.15em;
	font-size: 1.45rem;
	color: var(--ntl-text);
}

@container ntltools (min-width: 520px) {
	.ntl-home-tools__link,
	.post_content a.ntl-home-tools__link {
		grid-template-columns: 4.5rem minmax(0, 1fr) auto;
		column-gap: 1.1rem;
	}

	.ntl-home-tools__link--noimg,
	.post_content a.ntl-home-tools__link--noimg {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}
