/* ==========================================================================
   Rin Blog — main.css

   読者の大半はスマホ。スマホの表示を基準に書き、画面が広いときだけ段組みや余白を足す。

   文字の方針
   - 和文も欧文も端末の書体（ヒラギノ角ゴ / Noto Sans JP）。飾りの書体は使わない
   - 本文は 17px・行間 1.9。補助の文字も 13px 未満にしない。灰色は背景とのコントラスト 4.5:1 以上
   - 等幅の書体はコードだけ。日付や数字は本文の書体のまま桁をそろえる（tabular-nums）

   配色
   - 既定はベージュの紙色。端末のダークモード設定には従わず、ヘッダーの切り替えで選んだときだけダークにする
   - ダークは真っ黒にせず、温かみのある濃い灰褐色にする
   - 色はアイキャッチのジャンル色だけ。アプリ・ゲームへの入口だけポータルの青緑を使う

   構成
     1. トークン          2. リセットと基本      3. レイアウト       4. ヘッダー
     5. 検索ダイアログ     6. メニュー            7. 共通の部品       8. カード
     9. トップページ      10. アプリへの入口      11. 一覧            12. 記事
    13. 本文              14. 目次               15. 互換と埋め込み   16. コード
    17. 広告              18. フッター           19. 動きを減らす設定・印刷
   ========================================================================== */

/* 1. トークン -------------------------------------------------------------- */

:root {
	color-scheme: light;

	--paper: #f4f0e8;
	--paper-2: #ebe5d8;
	--card: #fbf9f4;
	--ink: #1f1c18;
	--ink-2: #4a453e;
	--ink-3: #6b655b;
	--rule: #ddd5c6;
	--rule-strong: #1f1c18;
	--mark: #ffe066;
	--focus: #2f5bff;
	--shadow: 0 1px 0 rgb(31 28 24 / 0.04), 0 16px 36px -22px rgb(31 28 24 / 0.35);

	/* ジャンル色（アイキャッチの重ね色と同じ） */
	--g-web: #6666cc;
	--g-book: #b866cc;
	--g-gourmet: #e36e26;
	--g-game: #6c757d;
	--g-qa: #0047ab;
	--g-life: #09ac60;
	--g-default: #1f1c18;

	/* 文字に使うときのジャンル色（紙色の地で 4.5:1 以上） */
	--g-web-ink: #4b4bb4;
	--g-book-ink: #8a3aa1;
	--g-gourmet-ink: #a84a0f;
	--g-game-ink: #525c66;
	--g-qa-ink: #0047ab;
	--g-life-ink: #08703f;
	--g-default-ink: #1f1c18;

	/* アプリ・ゲームのポータルの色（ポータル側のブランドに合わせる） */
	--portal-bg: #0f2a30;
	--portal-bg-2: #17404a;
	--portal-ink: #eef8f9;
	--portal-muted: #a9c9cc;
	--portal-accent: #6fd3df;

	/* コード */
	--code-bg: #26231f;
	--code-ink: #efe9df;
	--code-muted: #a69e91;

	/* 書体 */
	--font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "BIZ UDPGothic", Meiryo, sans-serif;
	--font-en: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", sans-serif;
	--font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

	/* 寸法 */
	--gutter: clamp(16px, 4vw, 40px);
	--max: 1200px;
	--measure: 720px;
	--header-h: 56px;
	--radius: 12px;
	--radius-sm: 8px;
	--radius-lg: 18px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	--g: var(--g-default);
	--g-ink: var(--g-default-ink);
}

/* ダーク（ヘッダーの切り替えで選んだときだけ） */
:root[data-theme="dark"] {
	color-scheme: dark;
	--paper: #2b2824;
	--paper-2: #35312c;
	--card: #312d28;
	--ink: #efe9de;
	--ink-2: #cfc7ba;
	--ink-3: #a69e91;
	--rule: #4a443d;
	--rule-strong: #d9d1c4;
	--mark: #7a6718;
	--focus: #9db4ff;
	--shadow: 0 1px 0 rgb(0 0 0 / 0.2), 0 18px 40px -24px rgb(0 0 0 / 0.7);
	--g-default: #efe9de;
	--g-web-ink: #b0b0f7;
	--g-book-ink: #dcaaeb;
	--g-gourmet-ink: #f4a674;
	--g-game-ink: #b8c0c7;
	--g-qa-ink: #93b5f3;
	--g-life-ink: #6fd6a0;
	--g-default-ink: #efe9de;
	--code-bg: #1f1c19;
}

@media (min-width: 1080px) {
	:root {
		--header-h: 64px;
	}
}

.genre-web { --g: var(--g-web); --g-ink: var(--g-web-ink); }
.genre-book { --g: var(--g-book); --g-ink: var(--g-book-ink); }
.genre-gourmet { --g: var(--g-gourmet); --g-ink: var(--g-gourmet-ink); }
.genre-game { --g: var(--g-game); --g-ink: var(--g-game-ink); }
.genre-qa { --g: var(--g-qa); --g-ink: var(--g-qa-ink); }
.genre-life { --g: var(--g-life); --g-ink: var(--g-life-ink); }
.genre-default { --g: var(--g-default); --g-ink: var(--g-default-ink); }

/* 同じサイト内のページ遷移を滑らかにつなぐ（対応ブラウザだけ） */
@view-transition {
	navigation: auto;
}

/* 2. リセットと基本 ---------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-ja);
	font-size: 15px;
	line-height: 1.75;
	letter-spacing: 0.02em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: anywhere;
	font-variant-numeric: tabular-nums;
}

html[lang^="en"] body {
	font-family: var(--font-en);
	letter-spacing: 0;
}

:where(html[lang^="ja"]) body {
	line-break: strict;
	text-autospace: normal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	font-weight: 800;
	line-height: 1.45;
	text-wrap: balance;
}

:lang(ja) :is(h1, h2, h3, h4) {
	font-feature-settings: "palt";
	letter-spacing: 0.03em;
	word-break: auto-phrase;
	text-spacing-trim: trim-start;
}

p,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

button,
input,
select,
textarea {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
	border-radius: 4px;
}

::selection {
	background: var(--mark);
	color: var(--ink);
}

kbd {
	display: inline-block;
	min-width: 1.8em;
	padding: 0.1em 0.45em;
	border: 1px solid var(--rule);
	border-bottom-width: 2px;
	border-radius: 6px;
	background: var(--card);
	color: var(--ink-2);
	font: 600 12px/1.4 var(--font-en);
	text-align: center;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--ink);
	color: var(--paper);
	font-weight: 700;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* 3. レイアウト ------------------------------------------------------------ */

.container {
	width: 100%;
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.site-main {
	display: block;
	min-height: 60vh;
}

.page-block {
	padding-block: 20px 8px;
}

.home-section {
	margin-top: 48px;
}

@media (min-width: 768px) {
	.page-block {
		padding-block: 36px 16px;
	}

	.home-section {
		margin-top: 72px;
	}
}

/* 4. ヘッダー -------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--paper) 90%, transparent);
	-webkit-backdrop-filter: saturate(1.3) blur(14px);
	backdrop-filter: saturate(1.3) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s;
}

.site-header.is-scrolled {
	border-bottom-color: var(--rule);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: calc(var(--max) + 2 * var(--gutter));
	height: var(--header-h);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.brand {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 8px;
	color: var(--ink);
	text-decoration: none;
}

.brand__mark {
	display: block;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 1px var(--rule);
	object-fit: cover;
}

.brand__name {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.site-nav {
	display: none;
}

.nav-list {
	display: flex;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	white-space: nowrap;
}

.nav-list a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 38px;
	padding: 0 12px;
	border-radius: 999px;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}

.nav-list a:hover,
.nav-list a[aria-current],
.nav-list .current-menu-item > a,
.nav-list .current-post-ancestor > a,
.nav-list .current-menu-parent > a {
	background: var(--paper-2);
	color: var(--ink);
}

.dot {
	display: inline-block;
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--g);
}

.site-actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.icon-button {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s;
}

.icon-button:hover {
	background: var(--paper-2);
}

/* アプリ・ゲームへの入口（ヘッダー）。検索ボタンと同じ枠線つきの形にして、ヘッダーの中で浮かせない */
.portal-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	margin-right: 2px;
	padding: 0 12px 0 10px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.2s;
}

.portal-pill .icon {
	color: var(--ink-2);
}

.portal-pill:hover {
	border-color: var(--ink-3);
}

.search-trigger {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.search-trigger__label,
.search-trigger__kbd,
.lang-switch--header,
.site-header .theme-toggle {
	display: none;
}

.search-fallback {
	display: none;
}

html:not(.js) .search-trigger,
html:not(.js) .theme-toggle,
html:not(.js) .share__js {
	display: none;
}

html:not(.js) .search-fallback {
	display: inline-grid;
}

.theme-toggle .icon--sun {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .icon--moon {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .icon--sun {
	display: block;
}

.lang-switch ul {
	display: flex;
	margin: 0;
	padding: 3px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	list-style: none;
}

.lang-switch a {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 32px;
	padding: 0 10px;
	border-radius: 999px;
	color: var(--ink-2);
	font: 700 13px/1 var(--font-en);
	letter-spacing: 0.04em;
	text-decoration: none;
}

.lang-switch a:hover {
	color: var(--ink);
}

.lang-switch a[aria-current] {
	background: var(--ink);
	color: var(--paper);
}

.read-progress {
	position: fixed;
	inset: 0 0 auto;
	z-index: 60;
	height: 3px;
	background: var(--g);
	transform: scaleX(0);
	transform-origin: 0 50%;
	pointer-events: none;
}

@supports (animation-timeline: scroll()) {
	.read-progress {
		animation: rb-progress linear both;
		animation-timeline: scroll(root);
	}
}

@supports not (animation-timeline: scroll()) {
	.read-progress {
		display: none;
	}
}

@keyframes rb-progress {
	to {
		transform: scaleX(1);
	}
}

@media (min-width: 1080px) {
	.site-header__inner {
		gap: 20px;
	}

	.brand__mark {
		width: 34px;
		height: 34px;
	}

	.brand__name {
		font-size: 20px;
	}

	.site-nav {
		display: block;
		flex: 1;
		min-width: 0;
	}

	.site-actions {
		gap: 8px;
	}

	.menu-toggle {
		display: none;
	}

	.search-trigger {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		width: auto;
		height: 40px;
		padding: 0 8px 0 13px;
		border: 1px solid var(--rule);
		background: var(--card);
		color: var(--ink-2);
		font-size: 14px;
	}

	.search-trigger:hover {
		border-color: var(--ink-3);
		color: var(--ink);
	}

	.search-trigger__label {
		display: inline;
		min-width: 4.5em;
		text-align: left;
	}

	.search-trigger__kbd,
	.lang-switch--header {
		display: inline-block;
	}

	.site-header .theme-toggle {
		display: inline-grid;
	}

	.portal-pill {
		height: 40px;
		padding: 0 16px 0 13px;
		font-size: 14px;
	}
}

/* 1080〜1279px は横幅が足りず、カテゴリのナビとボタン類が重なるので、検索は虫眼鏡だけにして詰める */
@media (min-width: 1080px) and (max-width: 1279.98px) {
	.site-header__inner {
		gap: 12px;
	}

	.search-trigger {
		justify-content: center;
		width: 40px;
		padding: 0;
	}

	.search-trigger__label,
	.search-trigger__kbd {
		display: none;
	}

	.nav-list a {
		padding: 0 9px;
	}
}

/* 5. 検索ダイアログ -------------------------------------------------------- */

.search-dialog {
	width: 100vw;
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--card);
	color: var(--ink);
	overflow: hidden;
}

.search-dialog[open] {
	display: flex;
	flex-direction: column;
	animation: rb-pop 0.2s var(--ease);
}

.search-dialog::backdrop {
	background: rgb(20 18 15 / 0.45);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

@keyframes rb-pop {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

.search-dialog__form {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px 10px 16px;
	border-bottom: 1px solid var(--rule);
	color: var(--ink-2);
}

.search-dialog__input {
	flex: 1;
	min-width: 0;
	height: 44px;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: 17px;
	outline: none;
}

.search-dialog__input::-webkit-search-cancel-button {
	display: none;
}

.search-dialog__close {
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--paper);
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.search-dialog__body {
	flex: 1;
	padding: 8px;
	overflow: auto;
	overscroll-behavior: contain;
}

.search-dialog__status {
	padding: 8px 10px;
	color: var(--ink-2);
	font-size: 14px;
}

.search-dialog__status:empty {
	display: none;
}

.search-results {
	margin: 0;
	padding: 0;
	list-style: none;
}

.search-result {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	align-items: center;
	gap: 4px 12px;
	padding: 10px;
	border-radius: 10px;
	color: var(--ink);
	text-decoration: none;
}

.search-result:hover,
.search-result[aria-selected="true"] {
	background: var(--paper-2);
}

.search-result__thumb {
	grid-row: span 2;
	display: block;
	width: 80px;
	height: auto;
	aspect-ratio: 760 / 428;
	border-radius: 6px;
	background: var(--g);
	object-fit: cover;
}

.search-result__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.55;
}

.search-result__title mark {
	background: var(--mark);
	color: inherit;
	border-radius: 2px;
}

.search-result__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ink-2);
	font-size: 13px;
}

.search-result--all {
	grid-template-columns: 1fr;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 700;
}

.search-dialog__browse {
	padding: 12px 10px;
}

.search-dialog.has-query .search-dialog__browse {
	display: none;
}

.search-dialog__label {
	margin-bottom: 10px;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 700;
}

.search-dialog__hint {
	display: none;
}

@media (min-width: 720px) {
	.search-dialog {
		width: min(680px, calc(100vw - 32px));
		height: auto;
		max-height: min(76vh, 680px);
		margin: 9vh auto auto;
		border: 1px solid var(--rule);
		border-radius: var(--radius-lg);
		box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.5);
	}

	.search-dialog__hint {
		display: flex;
		align-items: center;
		gap: 6px;
		margin: 0;
		padding: 10px 16px;
		border-top: 1px solid var(--rule);
		color: var(--ink-2);
		font-size: 13px;
	}
}

/* 6. メニュー（スマホ） ---------------------------------------------------- */

.menu-panel {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(420px, 100vw);
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 1px solid var(--rule);
	background: var(--paper);
	color: var(--ink);
	overflow: auto;
	overscroll-behavior: contain;
}

.menu-panel[open] {
	animation: rb-slide 0.25s var(--ease);
}

.menu-panel::backdrop {
	background: rgb(20 18 15 / 0.35);
}

@keyframes rb-slide {
	from {
		opacity: 0;
		transform: translateX(24px);
	}
}

/* 余白も含めて中身で覆い、パネルの外（暗くなった背景）を押したときだけ閉じるようにする */
.menu-panel__inner {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-height: 100%;
	padding: 10px var(--gutter) calc(28px + env(safe-area-inset-bottom));
}

html:has(.menu-panel[open]) {
	overflow: hidden;
}

/* JS が動かない環境ではメニューを開けないので、ボタンを出さない（カテゴリはフッターにある） */
html:not(.js) .menu-toggle {
	display: none;
}

.menu-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.menu-panel__title {
	font-size: 20px;
	font-weight: 800;
}

.menu-panel__foot {
	display: grid;
	gap: 16px;
	margin-top: auto;
}

.menu-panel__prefs {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 14px;
	border-top: 1px solid var(--rule);
}

.index-list {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--rule);
	list-style: none;
}

.index-list__item > a {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding-block: 8px;
	border-bottom: 1px solid var(--rule);
	color: var(--ink);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.index-list__item > a:hover .index-list__name {
	text-decoration: underline;
	text-decoration-color: var(--g);
	text-decoration-thickness: 2px;
}

.index-list__count {
	color: var(--ink-3);
	font-size: 13px;
	font-weight: 600;
}

.index-list--panel .index-list__name {
	font-size: 17px;
}

.index-list__item:has(.index-list__children) > a {
	border-bottom: 0;
}

.index-list__children {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0 0 14px 18px;
	border-bottom: 1px solid var(--rule);
	list-style: none;
}

.index-list__children a {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.index-list__children a:hover {
	border-color: var(--g);
	color: var(--ink);
}

/* 7. 共通の部品 ------------------------------------------------------------ */

.section-heading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	font-size: 21px;
	font-weight: 800;
	line-height: 1.4;
}

.section-heading::before {
	content: "";
	flex: none;
	width: 6px;
	height: 1.15em;
	border-radius: 3px;
	background: var(--ink);
}

@media (min-width: 768px) {
	.section-heading {
		margin-bottom: 22px;
		font-size: 25px;
	}
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ink-2);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
}

a.chip {
	height: 36px;
	padding: 0 13px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	transition: border-color 0.2s, color 0.2s;
}

a.chip:hover {
	border-color: var(--g);
	color: var(--ink);
}

a.chip[aria-current] {
	border-color: var(--ink);
	background: var(--ink);
	color: var(--paper);
}

.chip__count {
	color: var(--ink-3);
	font-size: 12px;
	font-weight: 600;
}

a.chip[aria-current] .chip__count {
	color: inherit;
}

.chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--ink);
	color: var(--paper);
	font-size: 15px;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
}

/* 並んだボタンのうち、2番目に大事なもの */
.button--quiet {
	background: transparent;
	color: var(--ink);
	box-shadow: inset 0 0 0 1.5px var(--ink);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	color: var(--ink-2);
	font-size: 12.5px;
	line-height: 1.7;
	list-style: none;
}

.breadcrumbs li {
	min-width: 0;
}

.breadcrumbs li:not(:last-child)::after {
	content: "›";
	margin-inline: 6px;
	color: var(--ink-3);
}

.breadcrumbs a {
	text-decoration: none;
}

.breadcrumbs a:hover {
	color: var(--ink);
	text-decoration: underline;
}

.breadcrumbs [aria-current] {
	display: -webkit-box;
	overflow: hidden;
	color: var(--ink-3);
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}

.search-form {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 560px;
	padding: 4px 4px 4px 14px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink-2);
}

.search-form:focus-within {
	border-color: var(--ink);
}

.search-form__input {
	flex: 1;
	min-width: 0;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: 16px;
	outline: none;
}

.search-form__submit {
	height: 40px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--ink);
	color: var(--paper);
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
}

.pagination {
	margin-top: 36px;
}

.pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.pagination a.page-numbers:hover {
	border-color: var(--ink);
}

.pagination .current {
	border-color: var(--ink);
	background: var(--ink);
	color: var(--paper);
}

.pagination .dots {
	border-color: transparent;
	background: transparent;
}

/* 8. カード ---------------------------------------------------------------- */

.card {
	position: relative;
	min-width: 0;
}

.card__link {
	display: flex;
	flex-direction: column;
	gap: 12px;
	color: var(--ink);
	text-decoration: none;
}

/* 幅は 100% と明示する。中身から幅を決める配置になると、画像の読み込み前は枠が幅0・高さ0になり、
   読み込み後に伸びてレイアウトがずれる（CLS 0.10 を実測して修正済み） */
.card__thumb {
	position: relative;
	width: 100%;
	overflow: hidden;
	aspect-ratio: 760 / 428;
	border-radius: var(--radius);
	background: var(--g);
}

.card__thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgb(31 28 24 / 0.08);
	pointer-events: none;
}

.thumb__img,
.card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--ease);
}

.card__link:hover .card__thumb img {
	transform: scale(1.03);
}

.thumb__fallback {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: 6%;
	background: linear-gradient(135deg, var(--g), color-mix(in srgb, var(--g) 60%, #000));
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
}

.thumb__fallback span {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: 6%;
	border: 1.5px solid rgb(255 255 255 / 0.9);
}

.card__body {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 10px;
	color: var(--ink-2);
	font-size: 12.5px;
	line-height: 1.5;
}

.card__title {
	color: var(--ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.02em;
	text-wrap: pretty;
}

html[lang^="en"] .card__title {
	letter-spacing: 0;
}

.card__link:hover .card__title {
	text-decoration: underline;
	text-decoration-color: var(--g);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

.card__summary {
	display: -webkit-box;
	overflow: hidden;
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.8;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.card--feature .card__thumb {
	border-radius: 14px;
	box-shadow: var(--shadow);
}

.card--feature .card__title {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.5;
}

.card--row .card__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 112px;
	align-items: start;
	gap: 14px;
	padding-block: 14px;
	border-bottom: 1px solid var(--rule);
}

.card--row .card__thumb {
	order: 2;
	border-radius: var(--radius-sm);
}

.card--row .card__title {
	font-size: 15.5px;
}

/* 一覧: スマホは1件目だけ大きく、2件目からはサムネイルを右に置いた行にする */
.card-grid {
	display: grid;
	border-top: 1px solid var(--rule);
}

.card-grid > .card,
.card-grid__ad {
	padding-block: 16px;
	border-bottom: 1px solid var(--rule);
}

.card-grid > .card .card__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 112px;
	align-items: start;
	gap: 14px;
}

.card-grid > .card .card__thumb {
	order: 2;
	border-radius: var(--radius-sm);
}

.card-grid > .card:first-child .card__link {
	display: flex;
}

.card-grid > .card:first-child .card__thumb {
	order: 0;
	border-radius: var(--radius);
}

.card-grid > .card:first-child .card__title {
	font-size: 18px;
}

@media (min-width: 640px) {
	.card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 24px;
		border-top: 0;
	}

	.card-grid > .card,
	.card-grid__ad {
		padding-block: 0;
		border-bottom: 0;
	}

	.card-grid > .card .card__link {
		display: flex;
	}

	.card-grid > .card .card__thumb {
		order: 0;
		border-radius: var(--radius);
	}

	.card-grid > .card:first-child .card__title {
		font-size: 16px;
	}

	.card--row .card__link {
		grid-template-columns: minmax(0, 1fr) 150px;
	}
}

@media (min-width: 1080px) {
	.card-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 40px 28px;
	}

	.card__title {
		font-size: 16.5px;
	}

	.card--feature .card__title {
		font-size: 26px;
	}
}

/* 9. トップページ ---------------------------------------------------------- */

.home {
	padding-top: 12px;
}

/* ジャンルのタブ: スマホは1行の横スクロール */
.genre-tabs {
	margin-inline: calc(-1 * var(--gutter));
}

.genre-tabs__list {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 4px var(--gutter) 6px;
	overflow-x: auto;
	list-style: none;
	scroll-padding-inline: var(--gutter);
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.genre-tabs__list::-webkit-scrollbar {
	display: none;
}

.genre-tabs__list li {
	flex: none;
	scroll-snap-align: start;
}

.genre-tabs a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 15px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.2s;
}

.genre-tabs a:hover {
	border-color: var(--g);
}

.genre-tabs__count {
	color: var(--ink-3);
	font-size: 13px;
	font-weight: 600;
}

.home .genre-tabs + .home-section {
	margin-top: 24px;
}

@media (min-width: 1080px) {
	.home {
		padding-top: 24px;
	}

	.genre-tabs {
		margin-inline: 0;
	}

	.genre-tabs__list {
		flex-wrap: wrap;
		padding-inline: 0;
		overflow: visible;
	}

	.home .genre-tabs + .home-section {
		margin-top: 40px;
	}
}

.latest__layout {
	display: grid;
	gap: 8px;
}

.latest__index {
	margin: 12px 0 0;
	padding: 0;
	border-top: 1px solid var(--rule);
	list-style: none;
}

@media (min-width: 960px) {
	.latest__layout {
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
		align-items: start;
		gap: 48px;
	}

	.latest__index {
		margin-top: 0;
	}
}

/* ジャンル別 */
.sections .genre-block {
	display: grid;
	gap: 14px;
	padding-block: 20px;
	border-top: 1px solid var(--rule);
}

.sections .section-heading + .genre-block {
	padding-top: 0;
	border-top: 0;
}

/* タイルの地色は、白文字とのコントラストが 4.6:1 以上になる濃さまでジャンル色を深くしたもの */
.genre-block__tile {
	--tile: var(--g);
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px 16px;
	border-radius: 14px;
	background: var(--tile);
	color: #fff;
	isolation: isolate;
}

.genre-book .genre-block__tile {
	--tile: #a059b1;
}

.genre-gourmet .genre-block__tile {
	--tile: #b85a20;
}

.genre-life .genre-block__tile {
	--tile: #0a854b;
}

.genre-default .genre-block__tile {
	--tile: #1f1c18;
}

/* アイキャッチと同じ白い内枠 */
.genre-block__tile::before {
	content: "";
	position: absolute;
	inset: 7px;
	z-index: -1;
	border: 1.5px solid rgb(255 255 255 / 0.7);
	border-radius: 9px;
	pointer-events: none;
}

.genre-block__name {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.3;
}

.genre-block__name a {
	color: inherit;
	text-decoration: none;
}

.genre-block__name a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.genre-block__count {
	font-size: 14px;
	font-weight: 700;
}

/* チップの地は黒を薄く重ねる（白を重ねると地が明るくなり、白文字のコントラストが落ちるため） */
.genre-block__children {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}

.genre-block__children a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 12px;
	border: 1px solid rgb(255 255 255 / 0.35);
	border-radius: 999px;
	background: rgb(0 0 0 / 0.14);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
}

.genre-block__children a span {
	font-size: 12px;
	font-weight: 600;
}

.genre-block__children a:hover {
	border-color: #fff;
	background: rgb(0 0 0 / 0.24);
}

.genre-block__more {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 6px;
	padding-top: 10px;
	border-top: 1px solid rgb(255 255 255 / 0.35);
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	text-decoration: none;
}

.genre-block__posts {
	display: flex;
	gap: 14px;
	margin-inline: calc(-1 * var(--gutter));
	padding-inline: var(--gutter);
	overflow-x: auto;
	scroll-padding-inline: var(--gutter);
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.genre-block__posts::-webkit-scrollbar {
	display: none;
}

.genre-block__posts > .card {
	flex: 0 0 min(74vw, 300px);
	scroll-snap-align: start;
}

.genre-block__posts .card__title {
	font-size: 15px;
}

.sections__ad {
	padding-block: 20px;
	border-top: 1px solid var(--rule);
}

@media (min-width: 720px) {
	.genre-block__posts {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}

	.genre-block__posts > .card {
		flex: none;
	}
}

@media (min-width: 1080px) {
	.sections .genre-block {
		grid-template-columns: 260px minmax(0, 1fr);
		gap: 28px;
		padding-block: 28px;
	}

	.genre-block__tile {
		padding: 22px 22px 18px;
	}

	.genre-block__more {
		margin-top: auto;
	}
}

.scroller {
	display: flex;
	gap: 14px;
	margin-inline: calc(-1 * var(--gutter));
	padding: 2px var(--gutter) 12px;
	overflow-x: auto;
	scroll-padding-inline: var(--gutter);
	scroll-snap-type: x mandatory;
}

.scroller > .card {
	flex: 0 0 min(74vw, 300px);
	scroll-snap-align: start;
}

.about-card {
	display: grid;
	gap: 16px;
}

.about-card.home-section {
	padding: 22px 20px;
	border: 1px solid var(--rule);
	border-radius: var(--radius-lg);
	background: var(--card);
}

.about-card__avatar img {
	display: block;
	width: 72px;
	height: auto;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 1px var(--rule);
}

.about-card .section-heading {
	margin-bottom: 10px;
	font-size: 19px;
}

.about-card__name {
	margin-bottom: 4px;
	font-size: 17px;
	font-weight: 800;
}

.about-card__bio {
	max-width: 62ch;
	color: var(--ink-2);
	font-size: 15px;
	line-height: 1.85;
}

.about-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-top: 16px;
}

.about-card--single {
	padding-block: 24px;
	border-block: 1px solid var(--rule);
}

@media (min-width: 640px) {
	.about-card {
		grid-template-columns: auto minmax(0, 1fr);
		gap: 24px;
	}

	.about-card.home-section {
		padding: 32px;
	}

	.about-card__avatar img {
		width: 96px;
	}
}

/* 10. アプリ・ゲーム（トップ）と入口 ------------------------------------------- */

/* トップの「アプリ・ゲーム」。記事の一覧と同じ見出し・罫線・カードの形にそろえる */
.apps__lead {
	max-width: 46em;
	margin-top: -4px;
	color: var(--ink-2);
	font-size: 15px;
	line-height: 1.85;
}

.apps__group {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--rule);
}

.apps__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 10px;
	margin-bottom: 14px;
}

.apps__title {
	font-size: 17px;
	font-weight: 800;
	line-height: 1.5;
}

.apps__note {
	color: var(--ink-3);
	font-size: 13px;
	font-weight: 600;
}

/*
 * スマホは横にスクロールする1列。数が増えても列が中途半端に余らない。
 * position: relative で列自体を配置の基準にする。リンク内の読み上げ用の補足（screen-reader-text、absolute）が
 * 列の外を基準にするとスクロールで隠れず、ページの横幅を押し広げてしまうため。
 */
.apps__icons,
.apps__tiles {
	position: relative;
	display: flex;
	margin: 0 calc(-1 * var(--gutter));
	padding: 2px var(--gutter) 6px;
	overflow-x: auto;
	list-style: none;
	scroll-padding-inline: var(--gutter);
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.apps__icons::-webkit-scrollbar,
.apps__tiles::-webkit-scrollbar {
	display: none;
}

.apps__icons {
	gap: 12px;
}

.apps__icons li {
	flex: 0 0 88px;
	scroll-snap-align: start;
}

.apps__tiles {
	gap: 14px;
}

.apps__tiles li {
	flex: 0 0 64%;
	scroll-snap-align: start;
}

.app-icon {
	display: grid;
	justify-items: center;
	gap: 8px;
	color: var(--ink);
	text-align: center;
	text-decoration: none;
}

.app-icon img {
	display: block;
	width: 64px;
	height: 64px;
	border-radius: 15px;
	background: var(--card);
	box-shadow: 0 0 0 1px var(--rule);
}

.app-icon__name,
.app-tile__name {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 700;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.app-icon__name {
	font-size: 12.5px;
	line-height: 1.45;
	/* 「さきどり家計／簿」のように語の途中で折れないよう、文節で改行する */
	word-break: auto-phrase;
	text-wrap: balance;
}

.app-tile {
	display: grid;
	gap: 8px;
	color: var(--ink);
	text-decoration: none;
}

.app-tile img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 800 / 451;
	border-radius: var(--radius);
	background: var(--paper-2);
	box-shadow: 0 0 0 1px var(--rule);
}

.app-tile__name {
	font-size: 15px;
	line-height: 1.55;
}

.app-icon:hover .app-icon__name,
.app-tile:hover .app-tile__name {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.apps__more {
	margin-top: 16px;
}

@media (min-width: 640px) {
	.apps__icons {
		flex-wrap: wrap;
		gap: 20px 16px;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}

	.apps__icons li {
		flex-basis: 96px;
	}

	.app-icon img {
		width: 72px;
		height: 72px;
		border-radius: 17px;
	}
}

@media (min-width: 768px) {
	.apps__tiles {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px 20px;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}
}

/* 記事の終わりとメニューの小さな入口 */
.portal-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--portal-bg-2), var(--portal-bg));
	color: var(--portal-ink);
	text-decoration: none;
}

.portal-card__thumbs {
	display: flex;
}

.portal-card__thumbs img {
	display: block;
	width: 54px;
	height: auto;
	aspect-ratio: 800 / 451;
	border: 2px solid var(--portal-bg);
	border-radius: 6px;
	background: #0b1d21;
}

.portal-card__thumbs img + img {
	margin-left: -24px;
}

.portal-card__body {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.portal-card__kicker {
	color: var(--portal-accent);
	font: 700 12px/1.4 var(--font-en);
	letter-spacing: 0.04em;
}

.portal-card__title {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.45;
}

.portal-card__text {
	color: var(--portal-muted);
	font-size: 13.5px;
	line-height: 1.6;
}

.portal-card > .icon {
	color: var(--portal-accent);
}

.portal-card:hover .portal-card__title {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

@media (max-width: 419px) {
	.portal-card {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.portal-card__thumbs {
		display: none;
	}
}

/* 11. 一覧 ------------------------------------------------------------------ */

.archive-header {
	margin-bottom: 20px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--rule);
}

.archive-header .breadcrumbs {
	margin-bottom: 14px;
}

.archive-header__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.35;
}

.archive-header.genre-web .archive-header__title::before,
.archive-header.genre-book .archive-header__title::before,
.archive-header.genre-gourmet .archive-header__title::before,
.archive-header.genre-game .archive-header__title::before,
.archive-header.genre-qa .archive-header__title::before,
.archive-header.genre-life .archive-header__title::before {
	content: "";
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--g);
}

.archive-header__desc {
	max-width: 62ch;
	margin-top: 10px;
	color: var(--ink-2);
	font-size: 15px;
}

.archive-header__meta {
	margin-top: 6px;
	color: var(--ink-2);
	font-size: 14px;
}

.archive-header .subnav,
.archive-header .search-form {
	margin-top: 14px;
}

@media (min-width: 768px) {
	.archive-header {
		margin-bottom: 32px;
		padding-bottom: 24px;
	}

	.archive-header__title {
		font-size: 34px;
	}
}

.empty-state {
	display: grid;
	justify-items: start;
	gap: 14px;
	padding: 24px 20px;
	border: 1px dashed var(--rule);
	border-radius: var(--radius-lg);
}

.empty-state__title {
	font-size: 18px;
	font-weight: 800;
}

.empty-state .search-form {
	width: 100%;
}

.not-found {
	display: grid;
	gap: 16px;
	padding-block: 12px 32px;
	border-bottom: 1px solid var(--rule);
}

.not-found__code {
	color: var(--ink-3);
	font: 800 72px/1 var(--font-en);
	letter-spacing: -0.02em;
}

.not-found__body {
	display: grid;
	justify-items: start;
	gap: 14px;
}

.not-found__body .search-form {
	width: 100%;
}

.not-found__title {
	font-size: 22px;
	font-weight: 800;
}

@media (min-width: 768px) {
	.not-found__code {
		font-size: 120px;
	}

	.not-found__title {
		font-size: 28px;
	}
}

/* 12. 記事 ----------------------------------------------------------------- */

.entry {
	--entry-width: var(--measure);
}

.entry-header,
.entry-hero,
.entry-layout,
.entry-footer {
	width: 100%;
	max-width: calc(var(--entry-width) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.entry-header {
	padding-top: 14px;
}

.entry-kicker {
	margin: 14px 0 10px;
}

.entry-title {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.5;
}

html[lang^="en"] .entry-title {
	letter-spacing: -0.005em;
}

.entry-standfirst {
	margin-top: 14px;
	padding: 12px 14px;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--card);
	color: var(--ink-2);
	font-size: 15px;
	line-height: 1.85;
}

.entry-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 14px;
	padding-block: 10px;
	border-block: 1px solid var(--rule);
	color: var(--ink-2);
	font-size: 13px;
}

.entry-byline__author {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--ink);
	font-weight: 700;
	text-decoration: none;
}

.entry-byline__author img {
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 1px var(--rule);
}

/* スマホは「書き手 … 英語版へのリンク」の1行と、日付の1行にまとめる */
.entry-byline__meta {
	display: flex;
	flex-wrap: wrap;
	flex-basis: 100%;
	order: 1;
	gap: 4px 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.entry-byline__meta li {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.translation-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	margin-left: auto;
	padding: 0 14px;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
}

.translation-pill:hover {
	border-color: var(--ink);
}

.entry-hero {
	margin-top: 16px;
}

.entry-hero img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 760 / 428;
	border-radius: var(--radius);
	object-fit: cover;
}

.entry-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin-top: 24px;
}

.entry-rail {
	display: none;
}

.entry-footer {
	display: grid;
	gap: 24px;
	margin-top: 36px;
}

@media (min-width: 768px) {
	.entry-header {
		padding-top: 28px;
	}

	.entry-title {
		font-size: 32px;
		line-height: 1.45;
	}

	.entry-standfirst {
		padding: 16px 20px;
		font-size: 16px;
	}

	.entry-byline {
		margin-top: 18px;
	}

	.entry-byline__meta {
		flex-basis: auto;
		order: 0;
	}

	.entry-hero {
		margin-top: 24px;
	}

	.entry-hero img {
		border-radius: 14px;
		box-shadow: var(--shadow);
	}

	.entry-layout {
		margin-top: 36px;
	}

	.entry-footer {
		margin-top: 48px;
	}
}

/* PC は本文の右に目次と広告を追従させる（300px の広告が入る幅があるときだけ） */
@media (min-width: 1280px) {
	.has-toc-rail .entry {
		--entry-width: calc(var(--measure) + 56px + 300px);
	}

	.entry-title {
		font-size: 36px;
	}

	.has-toc-rail .entry-layout {
		grid-template-columns: minmax(0, var(--measure)) 300px;
		column-gap: 56px;
	}

	.has-toc-rail .entry-rail {
		display: block;
	}

	.entry-header > :not(.entry-title),
	.entry-hero img,
	.entry-footer > * {
		max-width: var(--measure);
	}
}

.entry-rail__inner {
	position: sticky;
	top: calc(var(--header-h) + 24px);
	display: grid;
	gap: 24px;
}

.toc-rail__title {
	margin-bottom: 8px;
	font-size: 15px;
	font-weight: 800;
}

.toc-rail__list {
	max-height: calc(100vh - var(--header-h) - 360px);
	min-height: 120px;
	margin: 0;
	padding: 0;
	overflow: auto;
	border-left: 2px solid var(--rule);
	counter-reset: toc-rail;
	list-style: none;
	scrollbar-width: thin;
}

.toc-rail__list li {
	counter-increment: toc-rail;
}

.toc-rail__list a {
	display: grid;
	grid-template-columns: 1.6em minmax(0, 1fr);
	margin-left: -2px;
	padding: 6px 0 6px 12px;
	border-left: 2px solid transparent;
	color: var(--ink-2);
	font-size: 13.5px;
	line-height: 1.55;
	text-decoration: none;
}

.toc-rail__list a::before {
	content: counter(toc-rail);
	color: var(--ink-3);
	font-weight: 700;
}

.toc-rail__list a:hover {
	color: var(--ink);
}

.toc-rail__list a[aria-current] {
	border-left-color: var(--g);
	color: var(--ink);
	font-weight: 700;
}

.toc-rail__list a[aria-current]::before {
	color: var(--g-ink);
}

.widget + .widget {
	margin-top: 20px;
}

.widget__title {
	margin-bottom: 8px;
	font-size: 15px;
	font-weight: 800;
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tag-list a {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	background: var(--paper-2);
	color: var(--ink-2);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
}

.tag-list a:hover {
	color: var(--ink);
}

.share {
	display: grid;
	gap: 10px;
	padding-block: 16px;
	border-block: 1px solid var(--rule);
}

.share__label {
	font-size: 15px;
	font-weight: 800;
}

.share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.share__button {
	display: inline-grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.share__button:hover {
	border-color: var(--ink);
	background: var(--ink);
	color: var(--paper);
}

.share__button.is-done {
	border-color: var(--g-life-ink);
	color: var(--g-life-ink);
}

.share__hatena {
	font: 800 16px/1 var(--font-en);
	letter-spacing: -0.03em;
}

.post-nav {
	display: grid;
	gap: 12px;
}

.post-nav__link {
	display: grid;
	gap: 6px;
	padding: 14px 16px;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--card);
	color: var(--ink);
	text-decoration: none;
}

.post-nav__link:hover {
	border-color: var(--ink);
}

.post-nav__label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--ink-2);
	font-size: 13px;
	font-weight: 700;
}

.post-nav__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.post-nav__link--next {
	text-align: right;
}

.post-nav__link--next .post-nav__label {
	justify-self: end;
}

@media (min-width: 640px) {
	.share {
		display: flex;
		align-items: center;
		gap: 16px;
	}

	.post-nav {
		grid-template-columns: 1fr 1fr;
	}

	.post-nav__link--next {
		grid-column: 2;
	}
}

.related {
	margin-top: 56px;
}

.entry--page .entry-title {
	margin-top: 12px;
}

/* 13. 本文 ----------------------------------------------------------------- */

.entry-content {
	min-width: 0;
	color: var(--ink);
	font-size: 17px;
	line-height: 1.9;
	letter-spacing: 0.02em;
}

html[lang^="en"] .entry-content {
	line-height: 1.75;
	letter-spacing: 0;
}

@media (min-width: 768px) {
	.entry-content {
		line-height: 2;
	}

	html[lang^="en"] .entry-content {
		font-size: 18px;
		line-height: 1.8;
	}
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

.entry-content > * + * {
	margin-top: 1.4em;
}

/*
 * 見出しは形を変えて階層を分ける。
 * H2 = ジャンル色を薄く敷いた帯（左端に色の縁）/ H3 = 下線（ジャンル色の太線＋細い罫線）/ H4 = ひし形の印
 */
.entry-content h2 {
	clear: both;
	margin-top: 2.4em;
	padding: 0.65em 0.8em 0.65em 1em;
	border-radius: 10px;
	background: color-mix(in srgb, var(--g) 14%, var(--card));
	box-shadow: inset 5px 0 0 var(--g);
	font-size: 20px;
	font-weight: 800;
	line-height: 1.5;
}

.entry-content h3 {
	clear: both;
	margin-top: 2em;
	padding-bottom: 0.5em;
	background:
		linear-gradient(var(--g), var(--g)) left bottom / 3em 3px no-repeat,
		linear-gradient(var(--rule), var(--rule)) left bottom / 100% 1px no-repeat;
	font-size: 18.5px;
	font-weight: 800;
	line-height: 1.55;
}

.entry-content h4 {
	display: flex;
	align-items: baseline;
	gap: 0.55em;
	margin-top: 1.8em;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.6;
}

.entry-content h4::before {
	content: "";
	flex: none;
	width: 0.5em;
	height: 0.5em;
	border-radius: 2px;
	background: var(--g);
	transform: translateY(-0.1em) rotate(45deg);
}

@media (min-width: 768px) {
	.entry-content h2 {
		font-size: 23px;
	}

	.entry-content h3 {
		font-size: 20px;
	}

	.entry-content h4 {
		font-size: 17.5px;
	}
}

.entry-content :is(h2, h3, h4) + * {
	margin-top: 1em;
}

.entry-content :is(h2, h3, h4) :is(a, strong) {
	color: inherit;
}

.entry-content strong {
	font-weight: 700;
}

.entry-content a {
	color: var(--g-ink);
	text-decoration-color: color-mix(in srgb, var(--g-ink) 50%, transparent);
	text-underline-offset: 0.28em;
}

.entry-content a:hover {
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
}

.entry-content :is(ul, ol) {
	padding-left: 1.4em;
}

.entry-content li + li {
	margin-top: 0.45em;
}

.entry-content li > :is(ul, ol) {
	margin-top: 0.45em;
}

.entry-content li::marker {
	color: var(--g);
}

.entry-content ol > li::marker {
	color: var(--g-ink);
	font-weight: 700;
}

.entry-content blockquote {
	padding: 1em 1.2em;
	border-left: 4px solid var(--rule);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--card);
	color: var(--ink-2);
}

.entry-content blockquote > * + * {
	margin-top: 0.8em;
}

.entry-content hr {
	clear: both;
	margin-block: 2.4em;
	border: 0;
	border-top: 1px solid var(--rule);
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content .aligncenter {
	display: block;
	margin-inline: auto;
}

.entry-content :is(.alignleft, .alignright) {
	display: block;
	margin-inline: auto;
}

@media (min-width: 640px) {
	.entry-content .alignleft {
		float: left;
		margin: 0.4em 1.5em 1em 0;
	}

	.entry-content .alignright {
		float: right;
		margin: 0.4em 0 1em 1.5em;
	}
}

.entry-content :is(figure, .wp-caption) {
	max-width: 100%;
}

.entry-content :is(figcaption, .wp-caption-text) {
	margin-top: 0.5em;
	color: var(--ink-2);
	font-size: 13.5px;
	text-align: center;
}

.entry-content iframe {
	max-width: 100%;
	border: 0;
}

/*
 * WordPress の記事の埋め込み（wp-embedded-content）は、読み込みが終わるまで position: absolute で隠れている。
 * その間は幅が画面基準で計算され、本文の左の余白の分だけ画面の右へはみ出して、スマホで横にずれる。
 * 左端を画面の左にそろえてはみ出しを防ぐ（読み込み後は通常の配置に戻るので left は効かない）。
 */
.entry-content iframe.wp-embedded-content {
	left: 0;
}

.entry-content iframe[src*="youtube"] {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
}

.entry-content .table-wrap {
	clear: both;
	max-width: 100%;
	overflow-x: auto;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--card);
}

.entry-content .table-wrap.is-scrollable {
	box-shadow: inset -16px 0 14px -14px rgb(31 28 24 / 0.3);
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
	line-height: 1.7;
	letter-spacing: 0.01em;
}

.entry-content :is(th, td) {
	min-width: 6em;
	padding: 10px 12px;
	border-bottom: 1px solid var(--rule);
	text-align: left;
	vertical-align: top;
}

.entry-content :is(th, td) + :is(th, td) {
	border-left: 1px solid var(--rule);
}

.entry-content tr:last-child > :is(th, td) {
	border-bottom: 0;
}

.entry-content :is(thead th, tr:first-child > th) {
	background: var(--paper-2);
	font-weight: 700;
}

.entry-content tbody th {
	font-weight: 700;
}

.page-links {
	margin-top: 2em;
}

/* 14. 目次（[rtoc_mokuji] をテーマで出したもの） ------------------------------ */

.entry-content .toc {
	margin-block: 1.8em;
}

.toc__details {
	border: 1px solid var(--rule);
	border-radius: 14px;
	background: var(--card);
	overflow: hidden;
}

.toc__summary {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 10px 16px;
	cursor: pointer;
	list-style: none;
}

.toc__summary::-webkit-details-marker {
	display: none;
}

.toc__summary::after {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	margin-left: auto;
	border-right: 2px solid var(--ink-2);
	border-bottom: 2px solid var(--ink-2);
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s;
}

.toc__details[open] .toc__summary::after {
	transform: translateY(2px) rotate(-135deg);
}

.toc__title {
	font-size: 16px;
	font-weight: 800;
}

.toc__count {
	color: var(--ink-3);
	font-size: 13px;
	font-weight: 600;
}

.entry-content .toc__list {
	margin: 0;
	padding: 6px 16px 16px;
	border-top: 1px solid var(--rule);
	counter-reset: toc;
	list-style: none;
}

.entry-content .toc__list > li {
	margin: 0;
	padding-top: 10px;
	counter-increment: toc;
}

.entry-content .toc__list > li > a {
	display: grid;
	grid-template-columns: 1.7em minmax(0, 1fr);
	color: var(--ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
}

.entry-content .toc__list > li > a::before {
	content: counter(toc);
	color: var(--g-ink);
	font-weight: 800;
}

.entry-content .toc__sub {
	display: grid;
	gap: 4px;
	margin: 6px 0 0 1.7em;
	padding: 0;
	list-style: none;
}

.entry-content .toc__sub li {
	margin: 0;
}

.entry-content .toc__sub a {
	position: relative;
	display: block;
	padding-left: 14px;
	color: var(--ink-2);
	font-size: 14px;
	line-height: 1.6;
	text-decoration: none;
}

.entry-content .toc__sub a::before {
	content: "";
	position: absolute;
	top: 0.8em;
	left: 0;
	width: 6px;
	height: 2px;
	background: var(--ink-3);
}

.entry-content .toc a:hover {
	text-decoration: underline;
	text-decoration-color: var(--g);
}

/* 15. 互換（JIN のボックス）と埋め込み -------------------------------------- */

.entry-content :is(.simple-box6, .simple-box9) {
	position: relative;
	padding: 1em 1.2em;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--card);
	font-size: 16px;
}

.entry-content .simple-box6 {
	border-top: 3px solid var(--g);
}

.entry-content :is(.simple-box6, .simple-box9) > * + * {
	margin-top: 0.7em;
}

.entry-content .simple-box9 {
	overflow: hidden;
}

/* simple-box9 は右上を折った付箋（JIN の意匠を引き継ぐ） */
.entry-content .simple-box9::after {
	content: "";
	position: absolute;
	top: -1px;
	right: -1px;
	border-style: solid;
	border-width: 0 24px 24px 0;
	border-color: transparent var(--paper) var(--rule) transparent;
}

.entry-content .jin-img-shadow img {
	box-shadow: var(--shadow);
}

.entry-content .codepen {
	border-radius: var(--radius);
}

.entry-content .twitter-tweet {
	margin-inline: auto;
}

/* 16. コード --------------------------------------------------------------- */

.entry-content code {
	font-family: var(--font-mono);
	font-size: 0.86em;
	letter-spacing: 0;
}

.entry-content :not(pre) > code {
	padding: 0.1em 0.4em;
	border: 1px solid var(--rule);
	border-radius: 6px;
	background: var(--paper-2);
	color: var(--ink);
	overflow-wrap: anywhere;
}

.entry-content pre {
	position: relative;
	clear: both;
	margin-inline: 0;
	padding: 16px 0;
	border-radius: var(--radius);
	background: var(--code-bg);
	color: var(--code-ink);
	font-size: 14px;
	line-height: 1.7;
	letter-spacing: 0;
	overflow: hidden;
	tab-size: 2;
}

.entry-content pre.has-code-bar {
	padding-top: 52px;
}

.entry-content pre code {
	display: block;
	padding: 0 16px;
	overflow-x: auto;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
	white-space: pre;
}

.code-bar {
	position: absolute;
	inset: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 40px;
	padding: 0 6px 0 16px;
	border-bottom: 1px solid rgb(255 255 255 / 0.08);
	color: var(--code-muted);
	font: 700 12px/1 var(--font-en);
	letter-spacing: 0.06em;
}

.code-copy {
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding: 0 12px;
	border: 1px solid rgb(255 255 255 / 0.16);
	border-radius: 999px;
	background: transparent;
	color: var(--code-ink);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}

.code-copy:hover {
	background: rgb(255 255 255 / 0.08);
}

.code-copy.is-done {
	border-color: #7ee2a8;
	color: #7ee2a8;
}

@media (min-width: 768px) {
	.entry-content pre {
		font-size: 14.5px;
	}

	.entry-content pre code {
		padding-inline: 20px;
	}
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: #a39b8e;
	font-style: italic;
}

.token.punctuation {
	color: #c4bcae;
}

.token.tag,
.token.deleted,
.token.property,
.token.constant,
.token.symbol {
	color: #ffa592;
}

.token.boolean,
.token.number {
	color: #f7c677;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
	color: #b8e3a2;
}

.token.operator,
.token.entity,
.token.url,
.token.variable {
	color: #ebdfc9;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
	color: #a4caff;
}

.token.keyword {
	color: #dbb1ff;
}

.token.regex,
.token.important {
	color: #ffd27a;
}

.token.important,
.token.bold {
	font-weight: 700;
}

.token.italic {
	font-style: italic;
}

/* 17. 広告 ----------------------------------------------------------------- */

.ad {
	margin-block: 2em;
	text-align: center;
}

.ad__label {
	margin-bottom: 6px;
	color: var(--ink-3);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
}

/*
 * AdSense が枠を処理する（data-adsbygoogle-status が付く）までは枠ごと出さない。
 * 広告ブロックを使う読者に、本文の途中の大きな空白を見せないため。
 * 処理が始まったら高さを確保して、広告が表示されたときに本文がずれないようにする。
 */
.ad:not(:has(ins[data-adsbygoogle-status])),
.card-grid__ad:not(:has(ins[data-adsbygoogle-status])),
.sections__ad:not(:has(ins[data-adsbygoogle-status])) {
	display: none;
}

.ad--in-article ins[data-adsbygoogle-status],
.ad--in-article-more ins[data-adsbygoogle-status] {
	min-height: 240px;
}

.ad--after-content ins[data-adsbygoogle-status],
.ad--after-related ins[data-adsbygoogle-status] {
	min-height: 280px;
}

.ad--infeed ins[data-adsbygoogle-status] {
	min-height: 180px;
}

.ad--rail {
	margin: 0;
}

.ad--rail ins[data-adsbygoogle-status] {
	min-height: 250px;
}

/* 誤クリック対策で広告を止めている閲覧者 */
.ads-blocked :is(.ad, .card-grid__ad, .sections__ad) {
	display: none !important;
}

.card-grid__ad .ad,
.sections__ad .ad,
.entry-footer .ad {
	margin-block: 0;
}

.comments-wrap {
	max-width: calc(var(--measure) + 2 * var(--gutter));
	margin-top: 56px;
}

.comment-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-form :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--rule);
	border-radius: var(--radius-sm);
	background: var(--card);
	font-size: 16px;
}

/* 18. フッター ------------------------------------------------------------- */

.site-footer {
	margin-top: 64px;
	border-top: 1px solid var(--rule);
	background: var(--paper-2);
}

.site-footer__inner {
	display: grid;
	gap: 28px;
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin-inline: auto;
	padding: 32px var(--gutter);
}

.footer-col__title {
	margin-bottom: 8px;
	font-size: 15px;
	font-weight: 800;
}

.footer-col .link-list + .footer-prefs {
	margin-top: 20px;
}

.footer-prefs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--rule);
}

.footer-widgets ul {
	margin: 0;
	padding: 0;
	columns: 2 120px;
	column-gap: 16px;
	list-style: none;
}

.footer-widgets li {
	padding-block: 3px;
	font-size: 14px;
	break-inside: avoid;
}

.footer-widgets a {
	color: var(--ink-2);
	text-decoration: none;
}

.link-list {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.link-list a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	color: var(--ink-2);
	font-size: 14.5px;
	text-decoration: none;
}

.link-list a:hover {
	color: var(--ink);
	text-decoration: underline;
}

.social-links {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer .index-list {
	border-top: 0;
}

.site-footer .index-list__item > a {
	min-height: 44px;
	font-size: 14.5px;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin-inline: auto;
	padding: 14px var(--gutter) calc(18px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--rule);
	color: var(--ink-2);
	font-size: 13px;
}

.to-top {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	color: var(--ink-2);
	font-weight: 700;
	text-decoration: none;
}

@media (min-width: 768px) {
	.site-footer {
		margin-top: 96px;
	}

	.site-footer__inner {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 40px;
		padding-block: 44px;
	}

	.footer-widgets {
		grid-column: 1 / -1;
	}
}

/* 19. 動きを減らす設定・印刷 -------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

@media (prefers-reduced-motion: reduce) {
	@view-transition {
		navigation: none;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.entry-rail,
	.share,
	.ad,
	.post-nav,
	.related,
	.read-progress,
	.search-dialog,
	.menu-panel,
	.portal-card,
	.about-card--single {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}
}
