/*
 * TubeMag main stylesheet
 * すべての色は CSS 変数で管理。ダークモードは body.tm-dark で切替。
 */

/* ===== トークン ===== */
:root {
	--tm-primary: #ff0033;
	--tm-primary-dark: #c8001f;
	--tm-accent: #2563eb;

	--tm-fg: #0f1115;
	--tm-muted: #65728a;
	--tm-border: #e6e9f0;
	--tm-surface: #ffffff;
	--tm-surface-2: #f5f7fb;
	--tm-bg: #ffffff;

	--tm-grid-cols: 3;
	--tm-card-radius: 14px;
	--tm-container: 1200px;
	--tm-gap: 26px;

	--tm-shadow-sm: 0 1px 2px rgba(15, 17, 21, .06), 0 2px 8px rgba(15, 17, 21, .05);
	--tm-shadow-md: 0 6px 24px rgba(15, 17, 21, .12);

	--tm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

body.tm-dark {
	--tm-fg: #e8ebf2;
	--tm-muted: #9aa6bd;
	--tm-border: #2a2f3a;
	--tm-surface: #161922;
	--tm-surface-2: #1d212c;
	--tm-bg: #0f1115;
}

/* ===== ベース ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--tm-font);
	color: var(--tm-fg);
	background: var(--tm-bg);
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--tm-primary); text-decoration: none; }
a:hover { color: var(--tm-primary-dark); }

h1, h2, h3, h4 { line-height: 1.3; color: var(--tm-fg); }

.tm-container {
	width: 100%;
	max-width: var(--tm-container);
	margin: 0 auto;
	padding: 0 20px;
}

.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;
}

.tm-skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100000;
	padding: 12px 20px; background: var(--tm-surface); color: var(--tm-fg);
	border-radius: 0 0 8px 0;
}
.tm-skip-link:focus { left: 8px; top: 8px; }

.tm-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 11px 22px; border-radius: 999px;
	background: var(--tm-primary); color: #fff !important;
	font-weight: 700; border: 0; cursor: pointer;
	transition: background .2s, transform .1s;
	font-size: .95rem; line-height: 1;
}
.tm-btn:hover { background: var(--tm-primary-dark); transform: translateY(-1px); }
.tm-btn--ghost { background: transparent; color: var(--tm-fg) !important; border: 1px solid var(--tm-border); }
.tm-btn--ghost:hover { background: var(--tm-surface-2); }
.tm-btn--yt { background: #ff0000; }
.tm-btn--yt:hover { background: #d40000; }

/* ===== ヘッダー ===== */
.tm-header { position: sticky; top: 0; z-index: 1000; }
.tm-header__bar {
	background: var(--tm-surface);
	border-bottom: 1px solid var(--tm-border);
	backdrop-filter: saturate(180%) blur(8px);
}
.tm-header__inner {
	display: flex; align-items: center; gap: 20px;
	min-height: 68px;
}
.tm-branding { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.tm-branding img, .custom-logo { max-height: 44px; width: auto; }
.tm-branding__text { display: flex; flex-direction: column; line-height: 1.2; }
.tm-site-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.tm-site-title a { color: var(--tm-fg); }
.tm-site-title a:hover { color: var(--tm-primary); }
.tm-site-desc { font-size: .78rem; color: var(--tm-muted); }

.tm-nav { display: flex; }
.tm-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.tm-menu li { position: relative; }
.tm-menu a {
	display: block; padding: 10px 14px; border-radius: 8px;
	color: var(--tm-fg); font-weight: 600; font-size: .95rem;
}
.tm-menu a:hover, .tm-menu .current-menu-item > a { background: var(--tm-surface-2); color: var(--tm-primary); }

/* サブメニュー */
.tm-menu .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 200px;
	background: var(--tm-surface); border: 1px solid var(--tm-border);
	border-radius: 12px; box-shadow: var(--tm-shadow-md);
	list-style: none; margin: 8px 0 0; padding: 8px;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: .18s;
}
.tm-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.tm-header__actions { display: flex; align-items: center; gap: 6px; }
.tm-search-toggle, .tm-dark-toggle, .tm-nav-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; border-radius: 50%;
	background: transparent; border: 0; color: var(--tm-fg); cursor: pointer;
	transition: background .2s;
}
.tm-search-toggle:hover, .tm-dark-toggle:hover { background: var(--tm-surface-2); }

.tm-dark-toggle .tm-icon-sun { display: none; }
body.tm-dark .tm-dark-toggle .tm-icon-moon { display: none; }
body.tm-dark .tm-dark-toggle .tm-icon-sun { display: block; }

.tm-nav-toggle { display: none; flex-direction: column; gap: 5px; }
.tm-nav-toggle__bar, .tm-nav-toggle__bar::before, .tm-nav-toggle__bar::after {
	content: ""; display: block; width: 22px; height: 2px; background: var(--tm-fg);
	border-radius: 2px; transition: .25s;
}
.tm-nav-toggle__bar { position: relative; }
.tm-nav-toggle__bar::before { position: absolute; top: -7px; }
.tm-nav-toggle__bar::after { position: absolute; top: 7px; }
.tm-nav-toggle[aria-expanded="true"] .tm-nav-toggle__bar { background: transparent; }
.tm-nav-toggle[aria-expanded="true"] .tm-nav-toggle__bar::before { top: 0; transform: rotate(45deg); }
.tm-nav-toggle[aria-expanded="true"] .tm-nav-toggle__bar::after { top: 0; transform: rotate(-45deg); }

/* 検索パネル */
.tm-search-panel {
	background: var(--tm-surface); border-bottom: 1px solid var(--tm-border);
	padding: 16px 0;
}
.tm-search-panel[hidden] { display: none; }

.tm-searchform { display: flex; gap: 8px; max-width: 640px; }
.tm-searchform__field {
	flex: 1; padding: 12px 16px; font-size: 1rem;
	border: 1px solid var(--tm-border); border-radius: 999px;
	background: var(--tm-bg); color: var(--tm-fg);
}
.tm-searchform__field:focus { outline: 2px solid var(--tm-primary); border-color: transparent; }
.tm-searchform__submit {
	display: inline-flex; align-items: center; justify-content: center;
	width: 48px; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--tm-primary); color: #fff;
}
.tm-searchform__submit:hover { background: var(--tm-primary-dark); }

/* コンパクト検索（サイドバー内） */
.tm-sidebar .tm-searchform { max-width: 100%; gap: 6px; }
.tm-sidebar .tm-searchform__field { padding: 8px 12px; font-size: .88rem; }
.tm-sidebar .tm-searchform__submit { width: 40px; }
.tm-sidebar .tm-widget--search,
.tm-sidebar .widget_search { padding: 14px 16px; }

/* ブロックの検索ウィジェットもコンパクトに */
.tm-sidebar .wp-block-search__inside-wrapper { gap: 6px; }
.tm-sidebar .wp-block-search__input {
	padding: 8px 12px; font-size: .88rem; border-radius: 999px;
	border: 1px solid var(--tm-border); background: var(--tm-bg); color: var(--tm-fg);
}
.tm-sidebar .wp-block-search__button {
	padding: 8px 14px; margin-left: 0; border: 0; border-radius: 999px;
	background: var(--tm-primary); color: #fff; cursor: pointer;
}
.tm-sidebar .wp-block-search__button:hover { background: var(--tm-primary-dark); }

/* ===== レイアウト ===== */
.tm-site-content { min-height: 50vh; }
.tm-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 40px;
	padding-top: 32px; padding-bottom: 60px;
	align-items: start;
}
body.tm-sidebar-left .tm-layout { grid-template-columns: 320px minmax(0, 1fr); }
body.tm-sidebar-left .tm-sidebar { order: -1; }
body.tm-no-sidebar .tm-layout,
.tm-layout.tm-no-sidebar { grid-template-columns: minmax(0, 1fr); }
body.tm-no-sidebar .tm-sidebar { display: none; }

.tm-page-head { margin-bottom: 26px; }
.tm-page-title { font-size: 2rem; font-weight: 800; margin: 0 0 6px; }
.tm-archive-desc { color: var(--tm-muted); margin: 0; }
/* 下階層ページの見出し画像（カスタマイザー > レイアウト。レスポンシブで自動縮小） */
.tm-page-head__image { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 0 0 12px; }

/* ===== パンくず ===== */
.tm-breadcrumbs { margin-bottom: 18px; font-size: .85rem; color: var(--tm-muted); }
.tm-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; align-items: center; }
.tm-breadcrumbs a { color: var(--tm-muted); }
.tm-breadcrumbs a:hover { color: var(--tm-primary); }
.tm-breadcrumbs__sep { color: var(--tm-border); }

/* ===== グリッド & カード ===== */
.tm-grid {
	display: grid;
	grid-template-columns: repeat(var(--tm-grid-cols), minmax(0, 1fr));
	gap: var(--tm-gap);
}
.tm-grid__ad { grid-column: 1 / -1; }

.tm-card {
	background: var(--tm-surface);
	border-radius: var(--tm-card-radius);
	overflow: hidden;
	transition: transform .2s, box-shadow .2s;
}
.tm-card:hover { transform: translateY(-4px); box-shadow: var(--tm-shadow-md); }

.tm-card__thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--tm-surface-2); }
.tm-card__img { width: 100%; height: 100%; object-fit: cover; }
.tm-card__badge {
	position: absolute; left: 10px; top: 10px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 50%;
	background: var(--tm-primary); color: #fff;
	box-shadow: var(--tm-shadow-sm);
	opacity: 0; transform: scale(.8); transition: .2s;
}
.tm-card:hover .tm-card__badge { opacity: 1; transform: scale(1); }
.tm-card__duration {
	position: absolute; right: 8px; bottom: 8px;
	background: rgba(0,0,0,.82); color: #fff;
	font-size: .75rem; font-weight: 600; padding: 2px 7px; border-radius: 5px;
}
.tm-card__body { padding: 14px 4px 6px; }
.tm-card__title { font-size: 1rem; font-weight: 700; margin: 0 0 8px; line-height: 1.4; }
.tm-card__title a { color: var(--tm-fg); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm-card__title a:hover { color: var(--tm-primary); }

.tm-entry-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: .8rem; color: var(--tm-muted); }
.tm-meta-cat { color: var(--tm-accent); font-weight: 600; }

/* ===== フィルターバー ===== */
.tm-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tm-filter__item {
	padding: 7px 16px; border-radius: 999px; font-size: .88rem; font-weight: 600;
	background: var(--tm-surface-2); color: var(--tm-fg);
}
.tm-filter__item:hover { background: var(--tm-primary); color: #fff; }
.tm-filter__item.is-active { background: var(--tm-primary); color: #fff; }

/* ===== ヒーロー ===== */
.tm-hero { padding: 40px 0 10px; background: linear-gradient(180deg, var(--tm-surface-2), transparent); }
.tm-hero__inner { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
/* 見出し・検索ボックス非表示時（カスタマイザー設定）は注目動画を全幅で見せる */
.tm-hero__inner--no-intro { grid-template-columns: 1fr; max-width: 860px; }
.tm-hero__title { font-size: 2.6rem; font-weight: 800; margin: 0 0 12px; letter-spacing: -.02em; }
.tm-hero__subtitle { font-size: 1.1rem; color: var(--tm-muted); margin: 0 0 22px; }
.tm-hero__feature {
	position: relative; display: block; border-radius: 18px; overflow: hidden;
	aspect-ratio: 16 / 9; box-shadow: var(--tm-shadow-md); background: #000;
}
.tm-hero__img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tm-hero__feature:hover .tm-hero__img { transform: scale(1.04); }
.tm-hero__badge {
	position: absolute; left: 14px; top: 14px; z-index: 2;
	background: var(--tm-primary); color: #fff; font-size: .78rem; font-weight: 700;
	padding: 4px 12px; border-radius: 999px;
}
.tm-hero__play {
	position: absolute; inset: 0; margin: auto; z-index: 2;
	width: 72px; height: 72px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: rgba(255,0,51,.92); color: #fff;
	box-shadow: 0 8px 30px rgba(0,0,0,.4); transition: transform .2s;
}
.tm-hero__feature:hover .tm-hero__play { transform: scale(1.08); }
.tm-hero__caption {
	position: absolute; inset: auto 0 0 0; z-index: 2;
	padding: 40px 18px 16px;
	background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.tm-hero__feature-title { color: #fff; font-weight: 700; font-size: 1.15rem; display: block; }

/* ヒーロー動画のサイズ（カスタマイザー > トップページ。スマホ幅では常に全幅） */
@media (min-width: 1025px) {
	.tm-hero--size-small .tm-hero__inner:not(.tm-hero__inner--no-intro) { grid-template-columns: 1.5fr 1fr; }
	.tm-hero--size-large .tm-hero__inner:not(.tm-hero__inner--no-intro) { grid-template-columns: 1fr 1.9fr; }
}
.tm-hero--size-small .tm-hero__inner--no-intro { max-width: 640px; }
.tm-hero--size-large .tm-hero__inner--no-intro { max-width: 1080px; }

/* ===== ヒーローのカルーセル（注目動画を複数枚） ===== */
.tm-hero-carousel { position: relative; min-width: 0; }
.tm-hero-carousel__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	border-radius: 18px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.tm-hero-carousel__track::-webkit-scrollbar { display: none; }
.tm-hero-carousel__slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.tm-hero-carousel__btn {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
	width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	background: rgba(15, 17, 21, .55); color: #fff;
	transition: background .2s;
}
.tm-hero-carousel__btn:hover { background: var(--tm-primary); }
.tm-hero-carousel__btn--prev { left: 12px; }
.tm-hero-carousel__btn--next { right: 12px; }
.tm-hero-carousel__dots {
	position: absolute; right: 14px; bottom: 12px; z-index: 3;
	display: flex; gap: 7px;
}
.tm-hero-carousel__dot {
	width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: rgba(255, 255, 255, .5); transition: background .2s, transform .2s;
}
.tm-hero-carousel__dot:hover { background: #fff; }
.tm-hero-carousel__dot.is-active { background: var(--tm-primary); transform: scale(1.25); }

/* ===== トップページのセクション ===== */
.tm-front { padding: 40px 20px 60px; }
.tm-front__section { margin-bottom: 50px; }
.tm-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.tm-section-title {
	font-size: 1.5rem; font-weight: 800; margin: 0; position: relative; padding-left: 16px;
}
.tm-section-title::before {
	content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
	width: 6px; height: 1.1em; border-radius: 3px; background: var(--tm-primary);
}
.tm-section-more { font-size: .9rem; font-weight: 600; white-space: nowrap; }

/* ===== 単一ページ ===== */
.tm-single { background: var(--tm-surface); border-radius: 16px; overflow: hidden; }
.tm-single--video { background: transparent; }
.tm-single__player { aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 22px; }
.tm-single__head { margin-bottom: 24px; }
.tm-single__title { font-size: 1.9rem; font-weight: 800; margin: 0 0 12px; line-height: 1.3; }
.tm-single__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tm-single__featured { margin: 0 0 24px; border-radius: 12px; overflow: hidden; }
.tm-single__content { font-size: 1.02rem; }
.tm-single__content > * { margin-top: 0; margin-bottom: 1.2em; }
.tm-single__content img { border-radius: 10px; }
/* 本文に貼った埋め込み（YouTube等のoEmbed iframe）を画面からはみ出させない */
.tm-single__content iframe { max-width: 100%; }
.tm-single__content iframe[src*="youtu"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.tm-single__content h2 { font-size: 1.6rem; margin-top: 1.6em; }
.tm-single__content h3 { font-size: 1.3rem; margin-top: 1.4em; }
.tm-single__content blockquote {
	border-left: 4px solid var(--tm-primary); margin: 1.5em 0; padding: 4px 18px;
	color: var(--tm-muted); background: var(--tm-surface-2); border-radius: 0 8px 8px 0;
}
.tm-single__content a { color: var(--tm-accent); text-decoration: underline; }

.tm-single__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tm-tag { font-size: .85rem; color: var(--tm-muted); background: var(--tm-surface-2); padding: 5px 12px; border-radius: 999px; }
.tm-tag:hover { background: var(--tm-primary); color: #fff; }

/* 動画ファサード（クリックで再生） */
.tm-player { position: relative; width: 100%; height: 100%; }
.tm-player__btn { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; }
.tm-player__poster { width: 100%; height: 100%; object-fit: cover; }
.tm-player__play { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; transition: transform .2s; }
.tm-player__play-bg { fill: #212121; opacity: .8; transition: fill .2s, opacity .2s; }
.tm-player__btn:hover .tm-player__play-bg { fill: var(--tm-primary); opacity: 1; }
.tm-player__btn:hover .tm-player__play { transform: scale(1.06); }
.tm-player iframe { width: 100%; height: 100%; border: 0; }

.tm-related { margin-top: 50px; }

/* ===== サイドバー / ウィジェット ===== */
.tm-sidebar { display: flex; flex-direction: column; gap: 26px; position: sticky; top: 88px; }
.tm-widget { background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: 14px; padding: 20px; }
.tm-widget__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--tm-border); }
.tm-widget ul { list-style: none; margin: 0; padding: 0; }
.tm-widget li { padding: 7px 0; border-bottom: 1px dashed var(--tm-border); }
.tm-widget li:last-child { border-bottom: 0; }
.tm-widget a { color: var(--tm-fg); }
.tm-widget a:hover { color: var(--tm-primary); }

/* カテゴリー一覧（件数付き） */
.tm-termlist { list-style: none; margin: 0; padding: 0; }
.tm-termlist li {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 8px 0; border-bottom: 1px dashed var(--tm-border);
}
.tm-termlist li:last-child { border-bottom: 0; }
.tm-termlist a { color: var(--tm-fg); font-weight: 600; }
.tm-termlist a:hover { color: var(--tm-primary); }
.tm-termlist__count {
	flex: none; min-width: 26px; text-align: center;
	font-size: .72rem; font-weight: 700; color: var(--tm-muted);
	background: var(--tm-surface-2); border-radius: 999px; padding: 2px 8px;
}

/* 月別アーカイブ */
.tm-archives { list-style: none; margin: 0; padding: 0; }
.tm-archives li { padding: 8px 0; border-bottom: 1px dashed var(--tm-border); }
.tm-archives li:last-child { border-bottom: 0; }
.tm-archives a { color: var(--tm-fg); }
.tm-archives a:hover { color: var(--tm-primary); }

/* サイドバーのテキスト版ランキング */
.tm-rank-mini { list-style: none; margin: 0; padding: 0; counter-reset: tm-rank; }
.tm-rank-mini__item {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 10px 0; border-bottom: 1px dashed var(--tm-border);
}
.tm-rank-mini__item:last-child { border-bottom: 0; }
.tm-rank-mini__num {
	counter-increment: tm-rank; flex: none;
	width: 26px; height: 26px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: .82rem; font-weight: 800;
	background: var(--tm-surface-2); color: var(--tm-muted);
}
.tm-rank-mini__num::before { content: counter(tm-rank); }
.tm-rank-mini__item:nth-child(1) .tm-rank-mini__num { background: linear-gradient(135deg, #ffd700, #f0a500); color: #5a3e00; }
.tm-rank-mini__item:nth-child(2) .tm-rank-mini__num { background: linear-gradient(135deg, #dfe4ea, #aab2bd); color: #3a3f47; }
.tm-rank-mini__item:nth-child(3) .tm-rank-mini__num { background: linear-gradient(135deg, #f0b27a, #cd7f32); color: #4a2a09; }
.tm-rank-mini__body { min-width: 0; }
.tm-rank-mini__title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	color: var(--tm-fg); font-weight: 700; font-size: .9rem; line-height: 1.4;
}
.tm-rank-mini__title:hover { color: var(--tm-primary); }
.tm-rank-mini__views { display: block; font-size: .74rem; color: var(--tm-muted); margin-top: 3px; }
.tm-rank-mini__more { display: inline-block; margin-top: 12px; font-size: .82rem; font-weight: 600; }

/* ===== ランキングページ ===== */
.tm-ranking-intro { margin-bottom: 28px; }
.tm-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.tm-rank-item {
	display: flex; align-items: center; gap: 16px; padding: 12px;
	background: var(--tm-surface); border: 1px solid var(--tm-border);
	border-radius: 14px; transition: transform .2s, box-shadow .2s;
}
.tm-rank-item:hover { transform: translateY(-2px); box-shadow: var(--tm-shadow-md); }
.tm-rank-item__num {
	flex: none; width: 46px; height: 46px; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.35rem; font-weight: 900;
	background: var(--tm-surface-2); color: var(--tm-muted);
}
.tm-rank-item:nth-child(1) .tm-rank-item__num { background: linear-gradient(135deg, #ffd700, #f0a500); color: #5a3e00; }
.tm-rank-item:nth-child(2) .tm-rank-item__num { background: linear-gradient(135deg, #dfe4ea, #aab2bd); color: #3a3f47; }
.tm-rank-item:nth-child(3) .tm-rank-item__num { background: linear-gradient(135deg, #f0b27a, #cd7f32); color: #4a2a09; }
.tm-rank-item__thumb {
	flex: none; position: relative; display: block;
	width: 168px; aspect-ratio: 16 / 9; border-radius: 10px;
	overflow: hidden; background: var(--tm-surface-2);
}
.tm-rank-item__img { width: 100%; height: 100%; object-fit: cover; }
.tm-rank-item__body { min-width: 0; flex: 1; }
.tm-rank-item__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; line-height: 1.4; }
.tm-rank-item__title a {
	color: var(--tm-fg);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tm-rank-item__title a:hover { color: var(--tm-primary); }
.tm-rank-item__pinned {
	font-size: .68rem; font-weight: 700; color: var(--tm-primary);
	border: 1px solid var(--tm-primary); border-radius: 999px; padding: 1px 8px;
}

/* ===== 広告 ===== */
.tm-ad { margin: 20px auto; text-align: center; }
.tm-ad__label { display: block; font-size: .68rem; color: var(--tm-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.tm-ad__inner { display: inline-block; max-width: 100%; }
.tm-ad--header { padding: 12px 0; background: var(--tm-surface-2); }

/* ===== ページネーション ===== */
.tm-pagination { margin-top: 44px; }
.tm-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; padding: 0; margin: 0; }
.tm-pagination a, .tm-pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px;
	background: var(--tm-surface); border: 1px solid var(--tm-border); color: var(--tm-fg); font-weight: 600;
}
.tm-pagination a:hover { background: var(--tm-surface-2); }
.tm-pagination .current { background: var(--tm-primary); color: #fff; border-color: var(--tm-primary); }

/* ===== コメント ===== */
.tm-comments { margin-top: 50px; background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: 16px; padding: 28px; }
.tm-comments__title { font-size: 1.3rem; margin: 0 0 20px; }
.tm-comment-list { list-style: none; margin: 0 0 30px; padding: 0; }
.tm-comment-list ol { list-style: none; }
.tm-comment-list .comment-body { padding: 16px 0; border-bottom: 1px solid var(--tm-border); }
.tm-comments input[type="text"], .tm-comments input[type="email"], .tm-comments input[type="url"], .tm-comments textarea {
	width: 100%; padding: 11px 14px; border: 1px solid var(--tm-border); border-radius: 10px;
	background: var(--tm-bg); color: var(--tm-fg); font-family: inherit;
}
.tm-comments .comment-form > p { margin-bottom: 14px; }

/* ===== フッター ===== */
.tm-footer { margin-top: 60px; background: var(--tm-surface); border-top: 1px solid var(--tm-border); }
.tm-footer__widgets { padding: 50px 0 30px; }
.tm-footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.tm-footer__bottom { border-top: 1px solid var(--tm-border); padding: 24px 0; }
.tm-footer__bottom-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.tm-footer-menu { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin: 0; padding: 0; }
.tm-footer-menu a { color: var(--tm-muted); font-size: .9rem; }
.tm-footer-menu a:hover { color: var(--tm-primary); }
.tm-copyright { color: var(--tm-muted); font-size: .85rem; }

.tm-social__links { display: flex; gap: 10px; }
.tm-social__link {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--tm-surface-2); color: var(--tm-fg); transition: .2s;
}
.tm-social__link:hover { background: var(--tm-primary); color: #fff; transform: translateY(-2px); }

/* ===== 404 / 検索なし ===== */
.tm-404 { text-align: center; padding: 40px 0; }
.tm-404__code { font-size: 6rem; font-weight: 900; color: var(--tm-primary); margin: 0; line-height: 1; }
.tm-404__title { font-size: 1.8rem; margin: 0 0 12px; }
.tm-404__links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.tm-404 .tm-searchform { margin: 0 auto 10px; }
.tm-404__suggest { margin-top: 50px; text-align: left; }
.tm-no-results { background: var(--tm-surface); border-radius: 16px; padding: 40px; text-align: center; }
.tm-no-results__title { margin-top: 0; }

/* ===== トップへ戻る ===== */
.tm-to-top {
	position: fixed; right: 22px; bottom: 22px; z-index: 900;
	width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--tm-primary); color: #fff; box-shadow: var(--tm-shadow-md);
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none;
}
.tm-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.tm-to-top[hidden] { display: flex; }

/* ===== LPテンプレート（templates/lp.php） ===== */
.tm-lp { min-height: 50vh; }
.tm-lp__content > *:not(.alignfull):not(.alignwide) {
	max-width: 760px;
	margin-left: auto; margin-right: auto;
	padding-left: 20px; padding-right: 20px;
}
.tm-lp__content > .alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.tm-lp__content > * + *:not(.alignfull) { margin-top: 1.4em; }
.tm-lp__content > .alignfull { margin-top: 0; margin-bottom: 0; }

/* LP用セクション（ブロックの「高度な設定 > 追加CSSクラス」で使用） */
.tm-lp-hero {
	background: linear-gradient(135deg, var(--tm-primary) 0%, #ff5e00 100%);
	color: #fff;
	padding: 90px 24px;
	text-align: center;
}
.tm-lp-hero h1, .tm-lp-hero h2, .tm-lp-hero p { color: #fff; }
.tm-lp-hero h1 { font-size: 2.6rem; line-height: 1.3; margin: 0 0 14px; }
.tm-lp-hero p { font-size: 1.1rem; opacity: .95; }
.tm-lp-section { padding: 60px 24px; }
.tm-lp-section--alt { background: var(--tm-surface-2); }
.tm-lp-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 28px; }
.tm-lp-num { text-align: center; }
.tm-lp-num h3 { font-size: 2.2rem; color: var(--tm-primary); margin: 0 0 4px; }
.tm-lp-cta {
	background: #0f1115;
	color: #fff;
	padding: 70px 24px;
	text-align: center;
}
.tm-lp-cta h2, .tm-lp-cta p { color: #fff; }
@media (max-width: 600px) {
	.tm-lp-hero { padding: 60px 20px; }
	.tm-lp-hero h1 { font-size: 1.8rem; }
	.tm-lp-section { padding: 40px 20px; }
}

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) {
	:root { --tm-grid-cols: 3; }
	/* 下階層ページは1カラム化し、サイドバーは本文下の横並びカード帯に。
	   minmax(0,1fr) にしないと、本文内の幅指定つき埋め込み（YouTube iframe等）が
	   グリッドを押し広げて横スクロールが発生する。 */
	.tm-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.tm-sidebar { position: static; top: auto; flex-direction: row; flex-wrap: wrap; }
	.tm-sidebar .tm-widget { flex: 1 1 260px; }
	.tm-hero__inner { grid-template-columns: 1fr; }
	.tm-hero__title { font-size: 2.1rem; }
}

@media (max-width: 860px) {
	:root { --tm-grid-cols: 2; }
	.tm-nav {
		position: fixed; inset: 68px 0 auto 0; z-index: 999;
		background: var(--tm-surface); border-bottom: 1px solid var(--tm-border);
		flex-direction: column; padding: 12px 20px 24px;
		/* translateY(-100vh) ではなく自身の高さ基準の%指定だと、メニュー項目が
		   少なく高さが低い場合に画面外まで隠れずヘッダーに重なってクリックを
		   奪ってしまうため、ビューポート基準の固定量で確実に隠す。 */
		transform: translateY(-100vh); transition: transform .3s; box-shadow: var(--tm-shadow-md);
		max-height: calc(100vh - 68px); overflow-y: auto;
	}
	.tm-nav.is-open { transform: translateY(0); }
	.tm-menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.tm-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding-left: 16px; margin: 0; }
	.tm-nav-toggle { display: flex; }
	.tm-footer__grid { grid-template-columns: 1fr; gap: 28px; }
	.tm-footer__bottom-inner { flex-direction: column; text-align: center; }
	/* 下階層ページの余白・本文 */
	.tm-single { border-radius: 12px; }
	.tm-comments { padding: 22px; }
	.tm-single__content h2 { font-size: 1.4rem; }
	.tm-single__content h3 { font-size: 1.2rem; }
}

@media (max-width: 600px) {
	/* スマホではサイドバーを非表示（カスタマイザー「サイドバー」でオフにできる） */
	body.tm-hide-sidebar-mobile .tm-sidebar { display: none; }
	/* サイドバーを1カラムに戻す */
	.tm-sidebar { flex-direction: column; gap: 20px; }
	.tm-sidebar .tm-widget { flex: 1 1 100%; }
	.tm-layout { gap: 28px; padding-top: 24px; padding-bottom: 44px; }
	.tm-section-head { flex-wrap: wrap; }
	/* ランキングページ */
	.tm-rank-item { gap: 12px; padding: 10px; }
	.tm-rank-item__num { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; }
	.tm-rank-item__thumb { width: 132px; }
	.tm-rank-item__title { font-size: .98rem; }
}

@media (max-width: 520px) {
	:root { --tm-grid-cols: 1; --tm-gap: 18px; }
	.tm-container { padding: 0 16px; }
	.tm-site-title { font-size: 1.1rem; }
	.tm-site-desc { display: none; }
	.tm-page-title, .tm-hero__title { font-size: 1.6rem; }
	.tm-single__title { font-size: 1.4rem; }
	.tm-widget { padding: 16px; }
	.tm-comments { padding: 18px; }
	.tm-single__actions .tm-btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 400px) {
	/* 極小画面: ランキングはサムネイルを詰めて横並び維持 */
	.tm-rank-item__thumb { width: 104px; }
	.tm-rank-item__num { width: 32px; height: 32px; font-size: 1rem; }
}

/* アクセシビリティ: 視差軽減 */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}
