/*
Theme Name: テヲイレル
Theme URI: https://tewoireru.com
Author: hyodorantaro
Description: テヲイレル（tewoireru.com）専用テーマ。白地にカードを並べるマガジンレイアウト。
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tewoireru
*/

:root {
	--red: #e1302b;
	--ink: #333;
	--main: #555;
	--muted: #b5b5b5;
	--line: #e6e6e6;
	--bg: #fff;
	--soft: #f6f7f9;
	--link: #039;
	--wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
	font-size: 16px;
	line-height: 1.75;
}
img, svg { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { line-height: 1.5; overflow-wrap: anywhere; }
p { margin: 0 0 1em; }
button, input { font: inherit; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.y-skip {
	position: absolute; left: 8px; top: 8px; z-index: 200;
	transform: translateY(-140%);
	background: var(--main); color: #fff; padding: 8px 12px;
}
.y-skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.b-wrap { width: min(var(--wrap), 92%); margin: 0 auto; }
.b-check { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- ヘッダー ---------- */
.b-header {
	position: relative;
	z-index: 40;
	background: #fff;
	border-top: 4px solid var(--red);
	box-shadow: 0 3px 6px rgba(0,0,0,.18);
}
.b-header-bar {
	width: min(var(--wrap), 96%);
	margin: 0 auto;
	min-height: 74px;
	display: flex;
	align-items: stretch;
	gap: 8px;
}
.b-logo {
	margin: 0;
	display: flex;
	align-items: center;
	min-width: 0;
	flex: 0 1 auto;
	max-width: min(280px, 42vw);
}
.b-logo a {
	display: flex;
	align-items: center;
	min-width: 0;
	max-width: 100%;
	line-height: 0;
}
.b-logo a:hover { opacity: .72; }
.b-logo-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 52px;
	object-fit: contain;
	object-position: left center;
}
.b-iconbtn {
	display: none;
	width: 48px;
	flex: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #333;
}
.b-nav-open { flex-direction: column; gap: 5px; }
.b-nav-open span[aria-hidden] { display: block; width: 20px; height: 2px; background: #333; }

.b-desk { margin-left: auto; display: flex; align-items: stretch; }
.b-desk .b-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: stretch; }
.b-desk .b-nav a {
	position: relative;
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 10px;
	color: #333;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}
.b-desk .b-nav a::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 3px;
	background: var(--red);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .3s ease;
}
.b-desk .b-nav a:hover::after,
.b-desk .b-nav a.is-on::after { transform: scaleX(1); }

.b-drawer {
	position: fixed;
	z-index: 90;
	top: 0; left: 0; bottom: 0;
	width: min(280px, 86vw);
	padding: 20px 18px 32px;
	background: #fff;
	overflow: auto;
	transform: translateX(-105%);
	transition: transform .25s ease;
	box-shadow: 2px 0 16px rgba(0,0,0,.15);
}
.b-drawer-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--main); }
.b-drawer .b-nav a {
	display: block;
	padding: 12px 2px;
	border-bottom: 1px solid var(--line);
	color: #333;
	font-weight: 700;
}
.b-drawer .b-nav a.is-on { color: var(--red); }
.b-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); }
.b-nav-scrim { z-index: 80; }
.b-search-scrim { z-index: 100; }
.b-nav-check:checked ~ .b-drawer { transform: none; }
.b-nav-check:checked ~ .b-nav-scrim { display: block; }

.b-search-modal {
	display: none;
	position: fixed;
	z-index: 120;
	left: 0; right: 0; top: 38%;
	padding: 0 16px;
}
.b-search-label { max-width: 350px; margin: 0 auto 8px; color: #fff; font-weight: 700; }
.b-search-check:checked ~ .b-search-modal { display: block; }
.b-search-check:checked ~ .b-search-scrim { display: block; }
.b-search-modal .c-search { max-width: 350px; margin: 0 auto; }
.b-search-modal .c-search-btn { background: #eaeaea; color: #4e4e4e; border-color: #eaeaea; }

/* ---------- 本文カラム ---------- */
.b-content { padding: 28px 0 40px; }
.b-cols {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 28px 32px;
	align-items: start;
}
.b-main, .b-side { min-width: 0; }

.c-crumbs { font-size: 13px; color: #888; margin: 0 0 16px; }
.c-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; }
.c-crumbs li + li::before { content: ">"; margin: 0 6px; color: #bbb; }
.c-crumbs a:hover { text-decoration: underline; }

.b-arc {
	margin: 0 0 1.5em;
	padding: 8px 14px 12px;
	border-top: 3px solid var(--main);
	background: #fff;
}
.b-arc h1 { margin: .35em 0; font-size: 1.55em; color: #444; }
.b-arc p { margin: 0; color: var(--main); font-size: .92em; }
.c-count { margin-top: 6px; font-size: 13px; color: #888; }

/* ---------- カード ---------- */
.b-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 25px;
}
.b-card {
	position: relative;
	background: #fff;
	border-radius: 2px;
	box-shadow: 0 0 3px rgba(0,0,0,.12), 0 2px 3px rgba(0,0,0,.22);
	transition: transform .2s ease, box-shadow .2s ease;
}
.b-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 15px 30px -5px rgba(0,0,0,.15), 0 0 5px rgba(0,0,0,.1);
}
.b-card-link { display: block; padding-bottom: 22px; color: #555; }
.b-card-img {
	display: block;
	position: relative;
	height: 0;
	margin: 0;
	padding-bottom: 57.7%;
	overflow: hidden;
	border-radius: 2px 2px 0 0;
	background: #eee;
}
.b-card-img img,
.b-card-img .c-thumb-fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.c-thumb-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--main);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}
.b-card-date {
	display: block;
	margin: 13px 13px 6px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
}
.b-card-title {
	margin: 0 13px;
	color: #333;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.55;
}
.b-card .c-badge {
	position: absolute;
	z-index: 2;
	top: 13px;
	left: 13px;
}
.c-badge, .c-new {
	display: inline-block;
	height: 22px;
	padding: 0 10px;
	border-radius: 14px;
	background: var(--main);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 22px;
	vertical-align: middle;
}
.c-badge:hover { background: silver; color: #fff; }

/* ---------- ページ送り ---------- */
.y-pager { margin-top: 8px; text-align: center; }
.y-pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: 4px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.15);
	color: #333;
	font-size: 17px;
	font-weight: 700;
}
.y-pager a.page-numbers:hover { background: var(--soft); }
.y-pager .page-numbers.current { background: var(--main); color: #fff; }
.y-pager .page-numbers.dots { width: auto; background: transparent; box-shadow: none; }
.y-empty { padding: 28px 12px; text-align: center; color: var(--main); background: var(--soft); }

/* ---------- サイドバー ---------- */
.c-widget { margin: 0 0 2.2em; background: #fff; }
.c-widget-title {
	margin: 0;
	padding: 7px 13px;
	background: var(--main);
	color: #fff;
	font-size: 1.15em;
	font-weight: 700;
}
.c-rank li, .c-recent li { position: relative; padding: 8px 0; }
.c-rank a, .c-recent a {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 8px;
	align-items: center;
	color: #333;
}
.c-rank a:hover, .c-recent a:hover { color: #92979f; }
.c-rank-thumb { display: block; width: 88px; height: 88px; overflow: hidden; background: #eee; }
.c-rank-thumb img, .c-rank-noimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-rank-num {
	position: absolute;
	z-index: 2;
	top: 8px;
	left: 0;
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: var(--main);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.c-rank li:nth-child(n+4) .c-rank-num { background: #f3f3f3; color: #9a9a9a; }
.c-rank-title { font-size: .9em; line-height: 1.5; }
.c-recent-date { display: block; margin-top: 4px; color: #b7b7b7; font-size: 13px; font-weight: 500; }

.c-search { display: flex; width: 100%; }
.c-search-input {
	flex: 1;
	min-width: 0;
	width: auto;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-right: 0;
	background: #fff;
	color: #333;
}
.c-search-btn {
	flex: none;
	padding: 0 14px;
	border: 1px solid var(--main);
	background: var(--main);
	color: #fff;
	cursor: pointer;
}

/* ---------- 記事 ---------- */
.b-entry-title { margin: 8px 0 10px; color: #444; font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
.b-entry-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.b-entry-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; color: #a5aaaf; font-size: 15px; }
.b-entry-thumb { margin: 8px 0 18px; }
.b-entry-thumb img { width: 100%; height: auto; }
.y-content { font-size: 16.5px; line-height: 1.9; overflow-wrap: anywhere; }
.y-content > * + * { margin-top: 1em; }
.y-content h2 { margin: 2.2em 0 .6em; font-size: 1.4em; line-height: 1.6; }
.y-content h3 {
	margin: 2em 0 .6em;
	padding: 8px 0 8px 10px;
	border-left: 4px solid var(--main);
	font-size: 1.2em;
}
.y-content h4 { margin: 1.6em 0 .5em; font-size: 1.05em; }
.y-content a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.y-content ul, .y-content ol { margin: .6em 0 1em; }
.y-content ul li { list-style: disc; margin-left: 1.3em; margin-bottom: .35em; }
.y-content ol li { list-style: decimal; margin-left: 1.4em; margin-bottom: .35em; }
.y-content img { height: auto; margin: 1.2em auto; }
.y-content figure { margin: 1.4em 0; }
.y-content figcaption { font-size: .8em; text-align: center; color: var(--main); }
.y-content table { width: 100%; border-collapse: collapse; font-size: .92em; }
.y-content th, .y-content td { border: 1px solid #ddd; padding: 8px 10px; text-align: left; }
.y-content th { background: var(--soft); }
.y-content blockquote { margin: 1.2em 0; padding: 12px 16px; border: 2px dotted #ccc; color: var(--main); }
.y-content code { background: var(--soft); padding: 1px 5px; }
.c-toc { margin: 0 0 1.6em; padding: 14px 16px; border: 1px solid var(--main); background: #fff; }
.c-toc-title { margin: 0 0 8px; font-weight: 700; color: var(--main); }
.c-toc a { color: var(--link); }
.c-source, .c-disclaimer { margin-top: 22px; padding: 12px 14px; background: var(--soft); font-size: 13px; color: var(--main); }
.c-source-title, .c-disclaimer-title { margin: 0 0 6px; font-size: 12px; font-weight: 700; }
.c-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; }
.c-share-label { font-size: 12px; font-weight: 700; color: var(--main); }
.c-share-btn { padding: 6px 12px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.c-share-btn:hover { background: var(--main); color: #fff; }
.c-post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.c-chip { font-size: 12px; padding: 3px 8px; background: var(--soft); color: var(--main); }
.b-postnav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.b-postnav a { display: block; padding: 12px; background: var(--soft); color: #333; line-height: 1.5; }
.b-postnav a:hover { color: var(--link); }
.b-postnav div:last-child { text-align: right; }
.c-related { margin-top: 40px; padding-top: 8px; }
.c-related + .c-related { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.c-block-title { margin: 0 0 8px; font-size: 1.15em; font-weight: 700; letter-spacing: .02em; }
.c-related-lead { margin: 0 0 16px; font-size: 13.5px; line-height: 1.7; color: #888; }
.c-related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px 16px;
}
.c-related-item {
	display: block;
	color: #333;
	transition: opacity .15s ease;
}
.c-related-item:hover { opacity: .72; }
.c-related-thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	margin-bottom: 8px;
	background: #eee;
}
.c-related-thumb img,
.c-related-thumb .c-thumb-fallback {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.c-related-cat {
	display: block;
	margin-bottom: 2px;
	font-size: 11px;
	color: var(--main);
	font-weight: 700;
	letter-spacing: .04em;
}
.c-related-title {
	display: block;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.5;
}
.c-related-date {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: #aaa;
}
.c-related-for-you .c-block-title { color: var(--ink); }
.c-comments { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }
.c-comment-list { list-style: none; margin: 0; padding: 0; }
.c-comment-list li { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.comment-form input, .comment-form textarea {
	width: 100%;
	max-width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
}
.comment-form .form-submit input {
	width: auto;
	padding: 8px 18px;
	border: 0;
	background: var(--main);
	color: #fff;
	cursor: pointer;
}
.b-404-code { margin: 0; font-size: 64px; font-weight: 700; color: var(--main); line-height: 1; }
.b-404-home { color: var(--link); text-decoration: underline; }

/* ---------- フッター ---------- */
.b-footer {
	margin-top: 48px;
	background: #fff;
	color: #3c3c3c;
	font-size: .95em;
}
.b-footer a { color: #3c3c3c; }
.b-footer-top {
	background: var(--soft);
	border-top: 1px solid var(--line);
}
.b-footer-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
	gap: 32px 48px;
	padding: 32px 0 30px;
	align-items: start;
}
.b-ft-title {
	display: inline-block;
	margin: 0 0 14px;
	padding: 5px 12px;
	background: var(--main);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1.4;
}
.b-ft-rank-list { margin: 0; padding: 0; list-style: none; }
.b-ft-rank-list li {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr);
	gap: 8px;
	align-items: start;
	padding: 7px 0;
	border-bottom: 1px solid #e4e6ea;
	font-size: 13.5px;
	line-height: 1.45;
}
.b-ft-rank-list li:first-child { padding-top: 0; }
.b-ft-rank-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.b-ft-rank-num {
	font-weight: 700;
	color: #fff;
	background: var(--main);
	text-align: center;
	font-size: 11px;
	line-height: 20px;
	height: 20px;
}
.b-ft-rank-list li:nth-child(-n+3) .b-ft-rank-num { background: var(--red); }
.b-ft-rank-list a:hover { color: var(--red); }
.b-footer-search .c-search {
	max-width: 100%;
	border: 1px solid #d5d5d5;
	background: #fff;
}
.b-footer-search .c-search-input {
	border: 0;
	background: transparent;
	min-height: 44px;
}
.b-footer-search .c-search-btn {
	width: 48px;
	border: 0;
	border-left: 1px solid #eee;
	background: var(--main);
	color: #fff;
}
.b-footer-search .c-search-btn:hover { opacity: .88; }

.b-footer-menu {
	border-top: 1px solid var(--line);
	padding: 20px 0 6px;
	text-align: center;
}
.b-footer-menu-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.b-ft-home {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 128px;
	padding: 9px 20px;
	border: 1px solid #ccc;
	background: #fff;
	color: #333;
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: .08em;
}
.b-ft-home:hover {
	background: var(--main);
	border-color: var(--main);
	color: #fff;
}
.b-copy {
	margin: 0;
	padding: 8px 16px 26px;
	text-align: center;
	font-size: 12px;
	color: #999;
}

@media (min-width: 520px) {
	.b-cards { grid-template-columns: 1fr 1fr; column-gap: 4%; }
}
@media (min-width: 1030px) {
	.b-card-title { font-size: 18px; }
}
@media (max-width: 900px) {
	.b-cols { grid-template-columns: 1fr; }
	.c-related-grid { grid-template-columns: 1fr 1fr; }
	.b-footer-inner {
		grid-template-columns: 1fr;
		gap: 26px;
		padding: 26px 0 22px;
	}
}
@media (max-width: 859px) {
	.b-header-bar { width: 100%; padding: 0 2px; }
	.b-iconbtn { display: flex; }
	.b-desk { display: none; }
	.b-logo {
		flex: 1 1 auto;
		justify-content: center;
		max-width: calc(100% - 104px);
		margin: 0 auto;
	}
	.b-logo a { justify-content: center; }
	.b-logo-img {
		max-height: 40px;
		max-width: 100%;
		margin: 0 auto;
	}
}
@media (max-width: 640px) {
	.b-wrap { width: min(var(--wrap), 94%); }
	.b-postnav { grid-template-columns: 1fr; }
	.b-postnav div:last-child { text-align: left; }
	.y-content { font-size: 16px; }
	.y-content table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 520px) {
	.c-related-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.b-card, .b-drawer, .b-desk .b-nav a::after { transition: none; }
	.b-card:hover { transform: none; }
}
