/*
Theme Name: TMCテーマ
Description: 会社のサイト向けの、軽いテーマです。設定は［外観］→［テーマの設定］の 1 枚だけ。サイトの上から順に並んでいます。
Version: 0.3.1
Requires at least: 6.0
Requires PHP: 7.4
Author: 株式会社イーコム
Text Domain: tmc-theme
*/

/*
 * 色と文字の大きさは、設定の画面の値が :root の変数に入る（functions.php の tmct_inline_css）。
 *   --tmct-main  メインの色（ヘッダー・札・帯）
 *   --tmct-font  文字の大きさ（本文）
 * 並び：土台 → ヘッダー → トップページ（大きな写真・お知らせ）→ お問合せの帯 → フッター → 中のページ → スマホ
 */

/* ───────── 土台 ───────── */

:root {
	--tmct-main: #d80100;
	--tmct-font: 15px;
	--tmct-text: #333;
	--tmct-line: #ddd;
	--tmct-width: 1150px;
	--tmct-header: 90px;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--tmct-header); /* ページの中の見出しへ飛んだ時に、上の帯の下に隠れないように */
	-webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	color: var(--tmct-text);
	background: #fff;
	font-family: Arial, "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;
	font-size: var(--tmct-font);
	line-height: 1.8;
	overflow-wrap: anywhere;
}

img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.tmct-inner {
	max-width: var(--tmct-width);
	margin: 0 auto;
	padding: 0 20px;
}

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

/* キーボードで［本文へ］に来た時だけ、見えるようにする。 */
a.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 200;
	width: auto;
	height: auto;
	padding: 10px 16px;
	clip: auto;
	color: #000;
	background: #fff;
}

/* ───────── ヘッダー ───────── */

.tmct-header {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--tmct-header);
	background: var(--tmct-main);
	color: #fff;
}

.admin-bar .tmct-header {
	top: 32px;
}

.tmct-header .tmct-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	gap: 24px;
}

.tmct-logo {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
}

.tmct-logo a {
	display: block;
}

.tmct-logo img {
	display: block;
	max-height: 50px;
	width: auto;
}

.tmct-nav {
	align-self: stretch; /* 帯の高さいっぱいにする（カテゴリの箱を、帯のすぐ下に出すため） */
}

.tmct-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tmct-nav > ul {
	display: flex;
	gap: 44px;
	height: 100%;
}

.tmct-nav > ul > li {
	display: flex;
	align-items: center;
}

.tmct-nav a,
.tmct-sub-button {
	display: block;
	padding: 10px 0;
	font-size: 14px;
	line-height: 1.4;
}

.tmct-nav a:hover,
.tmct-nav a[aria-current="page"],
.tmct-sub-button:hover,
.tmct-has-sub.is-current > .tmct-sub-button {
	opacity: 0.7;
}

/* 一番右の項目を、白いボタンの形にした時 */
.tmct-nav a.tmct-nav-button {
	padding: 9px 24px;
	border-radius: 20px;
	color: var(--tmct-main);
	background: #fff;
}

.tmct-nav a.tmct-nav-button:hover,
.tmct-nav a.tmct-nav-button[aria-current="page"] {
	opacity: 0.85;
}

/* カテゴリ（名前を押すか、マウスを乗せると、下に箱が開く） */
.tmct-has-sub {
	position: relative;
}

.tmct-sub-button {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 0;
	color: inherit;
	background: transparent;
	font-family: inherit;
	cursor: pointer;
}

.tmct-sub-button::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-top: -4px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.tmct-nav .tmct-sub {
	display: none;
	position: absolute;
	top: 100%;
	left: -24px;
	min-width: 280px;
	padding: 8px 0;
	color: var(--tmct-text);
	background: #fff;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.tmct-nav > ul > li:last-child > .tmct-sub {
	left: auto;
	right: 0;
}

.tmct-has-sub:hover > .tmct-sub,
.tmct-has-sub:focus-within > .tmct-sub,
.tmct-has-sub.is-open > .tmct-sub {
	display: block;
}

.tmct-nav .tmct-sub a {
	padding: 12px 24px;
	white-space: nowrap;
}

.tmct-nav .tmct-sub a:hover,
.tmct-nav .tmct-sub a[aria-current="page"] {
	opacity: 1;
	color: var(--tmct-main);
	background: #f4f4f4;
}

.tmct-menu-button {
	display: none;
}

/* ───────── トップページ：大きな写真 ───────── */

.tmct-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: calc(100vh - var(--tmct-header));
	min-height: 420px;
	padding: 40px 20px;
	color: #fff;
	text-align: center;
	background: #1b1f2a center / cover no-repeat;
}

.tmct-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
}

.tmct-hero > div {
	position: relative;
	max-width: calc(var(--tmct-width) - 40px);
}

.tmct-hero h2 {
	margin: 0;
	font-size: clamp(22px, 3vw, 38px);
	font-weight: 400;
	line-height: 1.5;
	text-wrap: balance; /* 折り返す時は、行の長さをそろえる（1 字だけ次の行に落ちないように） */
}

.tmct-hero p {
	margin: 20px 0 0;
	font-size: 16px;
	line-height: 2;
}

/* ───────── トップページ：お知らせ ───────── */

.tmct-section {
	max-width: var(--tmct-width);
	margin: 0 auto;
	padding: 90px 20px;
}

.tmct-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 40px;
}

.tmct-section-head h2 {
	margin: 0;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.25;
}

.tmct-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 170px;
	height: 45px;
	padding: 0 30px;
	color: #fff;
	background: #bbb;
	font-size: 14px;
}

.tmct-more:hover {
	background: var(--tmct-main);
}

.tmct-news {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--tmct-line);
}

.tmct-news li + li {
	border-top: 1px solid var(--tmct-line);
}

.tmct-news a {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 60px;
	padding: 10px 25px;
	font-size: 14px;
	line-height: 1.6;
}

.tmct-news a:hover {
	background: #f7f7f7;
}

.tmct-news time {
	flex: none;
	width: 70px;
	font-size: 12px;
	font-weight: 700;
}

.tmct-tag {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 110px;
	height: 30px;
	padding: 0 16px;
	border-radius: 15px;
	color: #fff;
	background: var(--tmct-main);
	font-size: 12px;
	line-height: 1;
}

.tmct-none {
	margin: 0;
	padding: 30px 25px;
	border: 1px solid var(--tmct-line);
	color: #777;
}

/* ───────── お問合せの帯 ───────── */

.tmct-cta {
	position: relative;
	padding: 110px 20px;
	color: #fff;
	text-align: center;
	background: #2a2d33 center / cover no-repeat;
}

.tmct-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.tmct-cta > div {
	position: relative;
	max-width: 900px;
	margin: 0 auto;
}

.tmct-cta h2 {
	margin: 0;
	font-size: clamp(22px, 2.8vw, 34px);
	font-weight: 400;
	line-height: 1.5;
	text-wrap: balance;
}

.tmct-cta p {
	margin: 24px 0 0;
	font-size: 14px;
	line-height: 2.4;
	text-wrap: pretty; /* 行の終わりに 1〜2 字だけ残らないようにする */
}

.tmct-cta-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 240px;
	height: 50px;
	margin-top: 36px;
	padding: 0 40px;
	border-radius: 25px;
	color: #333;
	background: #fff;
	font-size: 14px;
}

.tmct-cta-button:hover {
	color: #fff;
	background: var(--tmct-main);
}

/* ───────── フッター ───────── */

.tmct-footer {
	padding: 70px 20px 50px;
	color: #fff;
	text-align: center;
	background: #000;
}

.tmct-footer ul {
	margin: 0 0 50px;
	padding: 0;
	list-style: none;
	font-size: 12px;
	line-height: 2.4;
}

.tmct-footer a:hover {
	opacity: 0.7;
}

/* フッターのメニューを、カテゴリごとの列に分けた時 */
.tmct-footer-cols {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 30px 80px;
	margin: 0 0 50px;
	text-align: left;
}

.tmct-footer-cols ul {
	margin: 0;
}

.tmct-footer-head {
	margin: 0 0 8px;
	padding: 0 0 8px;
	border-bottom: 1px solid #444;
	color: #aaa;
	font-size: 12px;
	line-height: 1.6;
}

.tmct-footer-logo {
	margin: 0 0 20px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
}

.tmct-footer-logo img {
	max-height: 50px;
	width: auto;
}

.tmct-address {
	margin: 0;
	font-size: 13px;
}

.tmct-copyright {
	margin: 0;
	padding: 0 70px;
	min-height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: var(--tmct-main);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.tmct-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 90;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #333;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s;
}

.tmct-top.is-show {
	opacity: 0.9;
	visibility: visible;
}

.tmct-top::before {
	content: "";
	position: absolute;
	top: 24px;
	left: 21px;
	width: 12px;
	height: 12px;
	border-top: 2px solid #fff;
	border-left: 2px solid #fff;
	transform: rotate(45deg);
}

/* ───────── 中のページ（固定ページ・お知らせ） ───────── */

.tmct-title {
	padding: 60px 20px;
	text-align: center;
	background: #f4f4f4;
}

.tmct-title h1 {
	margin: 0;
	font-size: clamp(22px, 2.6vw, 32px);
	font-weight: 700;
	line-height: 1.5;
}

.tmct-title p {
	margin: 10px 0 0;
	color: #777;
	font-size: 13px;
}

.tmct-content {
	max-width: 890px;
	margin: 0 auto;
	padding: 70px 20px 100px;
	line-height: 2;
}

.tmct-content::after {
	content: "";
	display: block;
	clear: both;
}

.tmct-content > *:first-child {
	margin-top: 0;
}

.tmct-content h2 {
	margin: 2.4em 0 1em;
	padding: 0.2em 0 0.2em 0.7em;
	border-left: 5px solid var(--tmct-main);
	font-size: 1.5em;
	line-height: 1.5;
}

.tmct-content h3 {
	margin: 2.2em 0 0.9em;
	padding-bottom: 0.4em;
	border-bottom: 1px solid var(--tmct-line);
	font-size: 1.25em;
	line-height: 1.5;
}

.tmct-content h4 {
	margin: 2em 0 0.8em;
	font-size: 1.1em;
}

.tmct-content p {
	margin: 0 0 1.6em;
}

.tmct-content a {
	color: var(--tmct-main);
	text-decoration: underline;
}

.tmct-content a:hover {
	opacity: 0.7;
}

/* 中身の無い段落（ショートコードを <p> で囲んだ時などにできる）は、すき間を作らない。 */
.tmct-content p:empty {
	display: none;
}

/* 本文の初めが TMCフォームの時、フォームの上の余白を、本文の上の余白に重ねない（題名との間を、ほかのページと同じにする）。 */
.tmct-content > .tmcf:first-child,
.tmct-content > p:empty:first-child + .tmcf {
	padding-top: 0;
}

.tmct-content ul,
.tmct-content ol {
	margin: 0 0 1.6em;
	padding-left: 1.6em;
}

.tmct-content table {
	width: 100%;
	margin: 0 0 1.8em;
	border-collapse: collapse;
}

.tmct-content th,
.tmct-content td {
	padding: 14px 18px;
	border: 1px solid var(--tmct-line);
	text-align: left;
	vertical-align: top;
	line-height: 1.8;
}

.tmct-content th {
	width: 28%;
	background: #f7f7f7;
	font-weight: 700;
}

.tmct-content blockquote {
	margin: 0 0 1.6em;
	padding: 18px 24px;
	border-left: 4px solid var(--tmct-line);
	background: #f7f7f7;
}

.tmct-content .alignleft {
	float: left;
	margin: 0.4em 1.6em 1em 0;
}

.tmct-content .alignright {
	float: right;
	margin: 0.4em 0 1em 1.6em;
}

.tmct-content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.tmct-list {
	max-width: var(--tmct-width);
	margin: 0 auto;
	padding: 70px 20px 100px;
}

.tmct-pager {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-top: 60px;
	padding-top: 30px;
	border-top: 1px solid var(--tmct-line);
	font-size: 14px;
}

.tmct-pager a {
	color: var(--tmct-text);
	text-decoration: none;
}

.tmct-pager a:hover {
	color: var(--tmct-main);
}

.navigation.pagination {
	margin-top: 50px;
	text-align: center;
}

.navigation.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	margin: 0 2px;
	padding: 0 10px;
	border: 1px solid var(--tmct-line);
	font-size: 14px;
}

.navigation.pagination .page-numbers.current,
.navigation.pagination a.page-numbers:hover {
	color: #fff;
	border-color: var(--tmct-main);
	background: var(--tmct-main);
}

/* ───────── スマホ・タブレット ───────── */

@media (max-width: 782px) {
	.admin-bar .tmct-header {
		top: 46px;
	}
}

@media (max-width: 767px) {
	:root {
		--tmct-header: 60px;
	}

	.tmct-logo {
		font-size: 20px;
	}

	.tmct-logo img {
		max-height: 34px;
	}

	.tmct-menu-button {
		display: block;
		position: relative;
		width: 44px;
		height: 44px;
		margin-right: -10px;
		padding: 0;
		border: 0;
		color: #fff;
		background: transparent;
		cursor: pointer;
	}

	.tmct-menu-button span,
	.tmct-menu-button span::before,
	.tmct-menu-button span::after {
		content: "";
		position: absolute;
		left: 11px;
		width: 22px;
		height: 2px;
		background: currentColor;
	}

	.tmct-menu-button span {
		top: 21px;
	}

	.tmct-menu-button span::before {
		left: 0;
		top: -7px;
	}

	.tmct-menu-button span::after {
		left: 0;
		top: 7px;
	}

	.tmct-nav {
		display: none;
		position: absolute;
		top: var(--tmct-header);
		left: 0;
		right: 0;
		max-height: calc(100vh - var(--tmct-header)); /* 項目が多い時は、メニューの中で動かせるようにする */
		overflow-y: auto;
		background: #222;
	}

	.tmct-nav.is-open {
		display: block;
	}

	.tmct-nav > ul {
		display: block;
		height: auto;
	}

	.tmct-nav > ul > li {
		display: block;
	}

	.tmct-nav > ul > li + li {
		border-top: 1px solid #444;
	}

	.tmct-nav a {
		padding: 16px 20px;
	}

	.tmct-nav a.tmct-nav-button {
		padding: 16px 20px;
		border-radius: 0;
		color: inherit;
		background: transparent;
	}

	/* スマホでは、カテゴリの名前を小さな見出しにして、中の項目を字下げで並べる（いつも開いている）。 */
	.tmct-sub-button {
		width: 100%;
		padding: 16px 20px 4px;
		color: #aaa;
		font-size: 12px;
		text-align: left;
		cursor: default;
	}

	.tmct-sub-button:hover,
	.tmct-has-sub.is-current > .tmct-sub-button {
		opacity: 1;
	}

	.tmct-sub-button::after {
		display: none;
	}

	.tmct-nav .tmct-sub,
	.tmct-nav > ul > li:last-child > .tmct-sub {
		display: block;
		position: static;
		min-width: 0;
		padding: 0 0 6px;
		color: inherit;
		background: transparent;
		box-shadow: none;
	}

	.tmct-nav .tmct-sub a {
		padding: 12px 20px 12px 36px;
		white-space: normal;
	}

	.tmct-nav .tmct-sub a:hover,
	.tmct-nav .tmct-sub a[aria-current="page"] {
		opacity: 0.7;
		color: inherit;
		background: transparent;
	}

	.tmct-hero {
		height: 70vh;
	}

	.tmct-hero p {
		font-size: 14px;
	}

	.tmct-section {
		padding: 50px 20px;
	}

	.tmct-section-head {
		margin-bottom: 24px;
	}

	.tmct-section-head h2 {
		font-size: 26px;
	}

	.tmct-more {
		min-width: 0;
		height: 38px;
		padding: 0 18px;
		font-size: 12px;
	}

	.tmct-news a {
		flex-wrap: wrap;
		gap: 6px 12px;
		padding: 14px 16px;
	}

	.tmct-news time {
		width: auto;
	}

	.tmct-tag {
		min-width: 0;
		height: 24px;
		padding: 0 12px;
		font-size: 11px;
	}

	.tmct-news a > span:last-child {
		width: 100%;
	}

	.tmct-cta {
		padding: 70px 20px;
	}

	.tmct-cta p {
		line-height: 2;
	}

	.tmct-footer {
		padding: 50px 20px 40px;
	}

	/* スマホでは、列を縦に積む（まん中ぞろえ）。 */
	.tmct-footer-cols {
		display: block;
		margin-bottom: 40px;
		text-align: center;
	}

	.tmct-footer-col + .tmct-footer-col {
		margin-top: 26px;
	}

	.tmct-footer-head {
		display: inline-block;
		margin-bottom: 4px;
		padding: 0 14px 6px;
	}

	.tmct-copyright {
		padding: 10px 20px;
		font-size: 11px;
	}

	.tmct-title {
		padding: 40px 20px;
	}

	.tmct-content,
	.tmct-list {
		padding: 40px 20px 70px;
	}

	/* ページの中に書いてある幅（style="width: 30%" など）にも勝つように、!important を付ける。 */
	.tmct-content th,
	.tmct-content td {
		display: block;
		width: auto !important;
	}

	.tmct-content td {
		border-top: 0;
	}

	.tmct-top {
		right: 12px;
		bottom: 12px;
		width: 46px;
		height: 46px;
	}

	.tmct-top::before {
		top: 20px;
		left: 17px;
	}
}
