/*
Theme Name: Heigensha Default
Theme URI: https://www.heigensha.co.jp/
Description: 有限会社平原社のテーマ（スマートフォン対応版）
Author: OZAKI Keisuke
Version: 2.2
Requires PHP: 7.4
Text Domain: heigensha
*/

/* ------------------------------------------------------------
   基本設定
------------------------------------------------------------ */
:root {
	--green: #3d7a4b;        /* ロゴの緑を少し淡く */
	--green-dark: #326840;
	--green-nav: #366f44;
	--green-tint: #f0f5f1;
	--ink: #3a3a3a;
	--muted: #7a7a7a;
	--line: #e3e9e4;
	--bg: #f8faf8;
	--white: #fff;
	--radius: 10px;
	--gutter: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
	font-size: 16px;
	line-height: 1.8;
	overflow-wrap: anywhere;
}

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

a { color: var(--green); }
a:hover { color: var(--green-dark); }

h1, h2, h3, h4 { line-height: 1.5; margin: 0; }
p { margin: 0 0 1em; }

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

.grecaptcha-badge { visibility: hidden; }

/* ------------------------------------------------------------
   ヘッダー
------------------------------------------------------------ */
.site-header {
	background: var(--green);
	color: #fff;
}
.site-header__inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}
.site-logo {
	display: block;
	padding: 14px 0;
	line-height: 0;
}
.site-logo img { height: 30px; width: auto; }

.global-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
}
.global-nav a {
	display: block;
	padding: 18px 16px;
	color: #fff;
	text-decoration: none;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.4;
	letter-spacing: .05em;
}
.global-nav a:hover { background: var(--green-dark); color: #fff; }

/* ------------------------------------------------------------
   レイアウト
------------------------------------------------------------ */
.site-body {
	max-width: 1080px;
	margin: 0 auto;
	padding: 32px var(--gutter) 48px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 32px;
	align-items: start;
}

.main {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 32px 36px;
	min-width: 0;
}

/* ------------------------------------------------------------
   見出し
------------------------------------------------------------ */
.section-title,
.entry-title {
	font-size: 1.4rem;
	font-weight: 500;
	color: var(--ink);
	padding-bottom: .5em;
	margin-bottom: 1em;
	border-bottom: 2px solid var(--green);
}
.entry-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin: 0 0 .3em;
}
.entry-meta .label { text-decoration: none; }
.entry-meta .entry-date { margin: 0; }
.entry-date {
	display: block;
	color: var(--muted);
	font-size: .9rem;
	margin-bottom: .2em;
}

/* ------------------------------------------------------------
   更新情報の一覧
------------------------------------------------------------ */
.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--line);
}
.post-list__item { border-bottom: 1px solid var(--line); margin: 0; }
.post-list__item a {
	display: block;
	padding: 14px 32px 14px 4px;
	color: var(--ink);
	text-decoration: none;
	position: relative;
}
.post-list__item a::after {
	content: "";
	position: absolute;
	right: 10px;
	top: 50%;
	width: 8px; height: 8px;
	border-top: 1.5px solid var(--green);
	border-right: 1.5px solid var(--green);
	transform: translateY(-50%) rotate(45deg);
}
.post-list__item a:hover { background: var(--green-tint); }
.post-list__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin-bottom: 2px;
}
.post-list__meta:empty { display: none; }
.post-list__item time {
	color: var(--muted);
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
}
.post-list__title { display: block; font-weight: normal; line-height: 1.65; }
.post-list__excerpt {
	display: block;
	margin-top: 4px;
	color: var(--muted);
	font-size: .9rem;
}
.post-list--compact .post-list__item a { padding-top: 10px; padding-bottom: 10px; }
.post-list--compact .post-list__title { font-size: .95rem; }

/* 事業ラベル */
.label {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: .75rem;
	line-height: 1.6;
	letter-spacing: .03em;
	white-space: nowrap;
	color: var(--label-ink, #4f5a52);
	background: var(--label-bg, #eef1ef);
}
.label--publishing     { --label-bg: #eaf0f8; --label-ink: #3f5f86; }
.label--insurance      { --label-bg: #e8f2ea; --label-ink: #326840; }
.label--digitalcontent { --label-bg: #f6efe2; --label-ink: #85612a; }

.more-link { margin: 16px 0 0; text-align: right; }
.more-link a { text-decoration: none; }
.more-link a::after { content: " ›"; }

/* トップページ：3事業の欄 */
.business-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	margin-top: 40px;
}
.business {
	border: 1px solid var(--line);
	border-top: 3px solid var(--biz, var(--green));
	border-radius: var(--radius);
	padding: 20px 22px 18px;
}
.business--publishing     { --biz: #7d9cc4; }
.business--insurance      { --biz: #6fa07b; }
.business--digitalcontent { --biz: #c9a66b; }
.business__title { font-size: 1.1rem; font-weight: 500; margin-bottom: .3em; }
.business__lead { color: var(--muted); font-size: .9rem; margin-bottom: .8em; }
.business__empty {
	color: var(--muted);
	font-size: .9rem;
	padding: 10px 0;
	margin: 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}
.business__links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	justify-content: flex-end;
	margin: 12px 0 0;
	font-size: .9rem;
}
.business__links a { text-decoration: none; }
.business__links a::after { content: " ›"; }

.archive-description { color: var(--muted); margin-bottom: 1em; }
.side-list .label { margin-right: 8px; }

/* ページ送り */
.pagination { margin-top: 24px; }
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}
.pagination .page-numbers {
	display: inline-block;
	min-width: 44px;
	padding: 8px 14px;
	text-align: center;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	background: var(--white);
}
.pagination .page-numbers.current {
	background: var(--green);
	border-color: var(--green);
	color: #fff;
}

/* ------------------------------------------------------------
   本文
------------------------------------------------------------ */
.entry { font-size: 1rem; }
.entry h2 {
	font-size: 1.2rem;
	font-weight: 500;
	margin: 2em 0 .8em;
	padding: .3em .6em;
	background: var(--green-tint);
	border-left: 4px solid var(--green);
}
.entry h3 {
	font-size: 1.1rem;
	font-weight: 500;
	margin: 1.8em 0 .6em;
	padding-left: .6em;
	border-left: 3px solid var(--green);
}
.entry h2:first-child, .entry h3:first-child { margin-top: 0; }
.entry ul, .entry ol { margin: 0 0 1em; padding-left: 1.5em; }
.entry li { margin-bottom: .3em; }
.entry hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry p.sign { text-align: right; }

/* 会社概要などの定義リスト */
.entry dl {
	display: grid;
	grid-template-columns: 9em minmax(0, 1fr);
	margin: 0 0 1.5em;
	border-top: 1px solid var(--line);
}
.entry dt, .entry dd {
	margin: 0;
	padding: 12px 8px;
	border-bottom: 1px solid var(--line);
}
.entry dt { font-weight: normal; color: var(--green-dark); background: var(--green-tint); }

/* 表：古い固定幅の指定を打ち消し、はみ出す場合は横スクロール */
.table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0 0 1.5em;
}
.entry table {
	width: 100% !important;
	border-collapse: collapse;
	font-size: .95rem;
}
.entry table td, .entry table th {
	width: auto !important;
	font-size: inherit !important;
	padding: 8px 10px;
	vertical-align: top;
}
.entry table table td, .entry table table th { border: 1px solid #d5dbd6 !important; }
.entry table table td[style*="background"] { background: var(--green-tint) !important; font-weight: normal !important; color: var(--green-dark); }
.entry table table td:first-child:not(:only-child) { min-width: 6.5em; }

.edit-link { margin-top: 2em; font-size: .9rem; }

/* 前後の記事 */
.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 32px;
}
.post-nav a {
	display: block;
	height: 100%;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
	font-size: .9rem;
	line-height: 1.6;
}
.post-nav a:hover { background: var(--green-tint); }
.post-nav span {
	display: block;
	color: var(--green);
	font-size: .8rem;
	margin-bottom: .2em;
}
.post-nav__next { grid-column: 2; text-align: right; }
.back-link { margin: 20px 0 0; text-align: center; }

/* ボタン */
.button {
	display: inline-block;
	padding: 10px 20px;
	background: var(--green);
	color: #fff !important;
	border-radius: var(--radius);
	text-decoration: none;
	font-weight: 500;
	line-height: 1.5;
}
.button:hover { background: var(--green-dark); }

/* ------------------------------------------------------------
   サイドバー
------------------------------------------------------------ */
.sidebar { display: grid; gap: 20px; min-width: 0; }
.side-box {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 20px;
}
.side-box p:last-child { margin-bottom: 0; }
.side-box--plain { background: transparent; border-style: dashed; }
.side-title {
	font-size: 1rem;
	font-weight: 500;
	color: var(--green-dark);
	margin-bottom: .7em;
	padding-bottom: .4em;
	border-bottom: 2px solid var(--green-tint);
}
.side-tel { margin-bottom: .2em; }
.side-tel a {
	font-size: 1.45rem;
	font-weight: 500;
	text-decoration: none;
	letter-spacing: .02em;
}
.side-note { font-size: .875rem; color: var(--muted); }
.side-box--contact .button { display: block; text-align: center; margin-top: 12px; }

.side-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.side-list li { border-bottom: 1px dotted var(--line); }
.side-list li:last-child { border-bottom: 0; }
.side-list a { display: block; padding: 8px 0; text-decoration: none; line-height: 1.6; }

.map {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 6px;
	overflow: hidden;
	background: var(--green-tint);
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 検索フォーム */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	font: inherit;
	font-size: 16px; /* iPhoneで拡大されないように */
	padding: 8px 10px;
	border: 1px solid #cfd6d0;
	border-radius: 6px;
}
.search-form button {
	font: inherit;
	padding: 8px 16px;
	border: 0;
	border-radius: 6px;
	background: var(--green);
	color: #fff;
	cursor: pointer;
}
.search-again { margin-bottom: 20px; }

/* ------------------------------------------------------------
   フッター
------------------------------------------------------------ */
.site-footer {
	background: #4a5a4d;
	color: #e2e8e3;
	font-size: .875rem;
}
.site-footer__inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 28px var(--gutter);
}
.site-footer a { color: #fff; }
.site-footer__name { color: #fff; font-size: 1rem; margin-bottom: .4em; }
.site-footer__copy { margin: 1.2em 0 0; font-size: .8rem; color: #c3ccc5; }

/* ------------------------------------------------------------
   タブレット・スマートフォン
------------------------------------------------------------ */
@media (max-width: 860px) {
	.site-body {
		grid-template-columns: minmax(0, 1fr);
		padding-top: 20px;
		gap: 20px;
	}
	.main { padding: 24px 20px; }
}

@media (max-width: 600px) {
	.site-header__inner { padding: 0; }
	.site-logo { padding: 12px var(--gutter); }
	.global-nav { width: 100%; background: var(--green-nav); }
	.global-nav ul { width: 100%; }
	.global-nav li { flex: 1; }
	.global-nav li + li { border-left: 1px solid rgba(255,255,255,.18); }
	.global-nav a { text-align: center; padding: 12px 4px; }

	.site-body { padding: 16px 12px 32px; }
	.main { padding: 20px 16px; }

	.section-title, .entry-title { font-size: 1.2rem; }

	.post-list__item a { padding: 12px 28px 12px 2px; }
	.post-list__item time { font-size: .8rem; }
	.business { padding: 16px 14px 14px; }
	.business-grid { margin-top: 32px; }

	.entry dl { grid-template-columns: minmax(0, 1fr); }
	.entry dt { border-bottom: 0; padding-bottom: 4px; }
	.entry dd { padding-top: 4px; }

	.post-nav { grid-template-columns: minmax(0, 1fr); }
	.post-nav__next { grid-column: 1; }
}

/* ------------------------------------------------------------
   印刷
------------------------------------------------------------ */
@media print {
	body { background: #fff; font-size: 11pt; }
	.site-header, .global-nav, .sidebar, .site-footer, .post-nav, .back-link, .pagination, .edit-link { display: none !important; }
	.site-body { display: block; padding: 0; }
	.main { border: 0; padding: 0; }
	a { color: #000; text-decoration: none; }
}
