/*
Theme Name: SEO Simple
Theme URI: https://example.com/seo-simple
Author: osamu
Author URI: https://example.com
Description: 企業・サービスサイト向けの、SEOに強くシンプルかつ高品質なWordPressテーマです。セマンティックなマークアップ、構造化データ、高速表示、完全レスポンシブ対応をベースに、カスタマイザーからアクセントカラーを自由に変更できます。
Version: 1.9.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: seo-simple
Tags: blog, e-commerce, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

SEO Simple is distributed under the terms of the GNU GPL v2 or later.
*/

/* =========================================================
   0. CSS Custom Properties (Design Tokens)
   ========================================================= */
:root {
	--color-accent: #2563eb;
	--color-accent-dark: #1d4ed8;
	--color-text: #1a1a1a;
	--color-text-muted: #5b5b5b;
	--color-bg: #ffffff;
	--color-bg-alt: #f6f7f9;
	--color-border: #e5e7eb;

	--font-base: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-heading: var(--font-base);

	--container-width: 1200px;
	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;
	--space-5: 4rem;
	--space-6: 6rem;

	--radius: 8px;
	--transition: 0.2s ease;
}

/* =========================================================
   1. Reset / Base
   ========================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: var(--font-base);
	font-size: 16px;
	line-height: 1.8;
	letter-spacing: 0.02em;
	color: var(--color-text);
	background: var(--color-bg);
	word-break: break-word;
	overflow-wrap: break-word;
}

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

a {
	color: var(--color-accent);
	text-decoration: none;
	transition: color var(--transition);
}

a:hover,
a:focus {
	color: var(--color-accent-dark);
	text-decoration: underline;
}

ul,
ol {
	padding-left: 1.4em;
}

table {
	width: 100%;
	border-collapse: collapse;
}

button,
input,
textarea,
select {
	font-family: inherit;
	font-size: 1rem;
}

/* =========================================================
   2. Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	line-height: 1.4;
	font-weight: 700;
	margin: 0 0 var(--space-2);
	color: var(--color-text);
}

h1 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem); }
h4 { font-size: 1.2rem; }

p {
	margin: 0 0 var(--space-2);
}

.eyebrow {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-accent);
	margin-bottom: var(--space-1);
}

/* =========================================================
   3. Layout helpers
   ========================================================= */
.container {
	width: 100%;
	max-width: var(--container-width);
	margin-inline: auto;
	padding-inline: var(--space-2);
}

.section {
	padding-block: var(--space-5);
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--color-bg);
	border-radius: var(--radius);
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.4);
	clip: auto !important;
	clip-path: none;
	color: var(--color-text);
	display: block;
	font-size: 0.9rem;
	font-weight: 700;
	height: auto;
	left: var(--space-2);
	line-height: normal;
	padding: var(--space-1) var(--space-2);
	text-decoration: none;
	top: var(--space-2);
	width: auto;
	z-index: 100000;
}

/* =========================================================
   4. Buttons
   ========================================================= */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.85em 1.6em;
	border-radius: var(--radius);
	background: var(--color-accent);
	color: #fff;
	font-weight: 700;
	border: 2px solid var(--color-accent);
	cursor: pointer;
	transition: background var(--transition), border-color var(--transition), transform var(--transition);
	text-decoration: none;
}

.btn:hover,
.btn:focus {
	background: var(--color-accent-dark);
	border-color: var(--color-accent-dark);
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}

.btn-outline {
	background: transparent;
	color: var(--color-accent);
}

.btn-outline:hover,
.btn-outline:focus {
	background: var(--color-accent);
	color: #fff;
}

/* =========================================================
   5. Site header
   ========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--color-header-bg, rgba(255, 255, 255, 0.92));
	backdrop-filter: saturate(180%) blur(8px);
	border-bottom: 1px solid var(--color-border);
}

/* Native "外観 > ヘッダー画像" support: the photo sits behind, the chosen
   header background color becomes a tint overlay so text/logo stay legible. */
.site-header.has-header-image {
	background-size: cover;
	background-position: center;
	background-color: transparent;
	border-bottom-color: transparent;
}

.site-header.has-header-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--color-header-bg, rgba(255, 255, 255, 0.92));
	backdrop-filter: saturate(180%) blur(8px);
	z-index: 0;
}

.site-header.has-header-image .site-header-inner {
	position: relative;
	z-index: 1;
}

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	padding-block: var(--space-1);
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.6em;
	/* Lets the title truncate instead of overflowing/squashing the
	   hamburger button on narrow phones (flex children default to
	   min-width:auto, which ignores this otherwise). */
	min-width: 0;
}

.site-title {
	font-size: 1.3rem;
	font-weight: 800;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.site-title a {
	color: var(--color-text);
	text-decoration: none;
}

.site-description {
	font-size: 0.8rem;
	color: var(--color-text-muted);
	margin: 0;
}

.custom-logo-link img {
	max-height: 44px;
	width: auto;
}

/* Primary nav */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.main-navigation a {
	color: var(--color-text);
	font-weight: 600;
	text-decoration: none;
	padding: 0.4em 0;
	border-bottom: 2px solid transparent;
}

.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation .current-menu-item > a {
	color: var(--color-accent);
	border-bottom-color: var(--color-accent);
}

.main-navigation ul ul {
	display: none;
	position: absolute;
	flex-direction: column;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 0.5em;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	min-width: 200px;
}

.main-navigation li {
	position: relative;
}

.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
	display: flex;
}

/* Freeform note (e.g. company address): only meaningful inside the mobile
   off-canvas panel, so it's hidden by default and revealed in the
   @media (max-width: 782px) block below. */
.mobile-menu-note {
	display: none;
}

.menu-toggle {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* 44x44px minimum tap target (mobile accessibility best practice). */
	min-width: 44px;
	min-height: 44px;
	background: none;
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
	padding: 0.5em 0.7em;
	cursor: pointer;
}

.menu-toggle .bar {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--color-text);
	margin: 5px 0;
	transition: transform var(--transition), opacity var(--transition);
}

/* =========================================================
   5b. Hero section (front page main visual)
   ========================================================= */
.hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: var(--space-6);
	overflow: hidden;
}

.hero.has-gradient {
	min-height: 420px;
	background-image: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
}

/* Fixed aspect-ratio (rather than a fixed min-height with a fluid width)
   so the background image scales up/down as one piece at any site width —
   the framing/crop stays identical, only the overall size changes. */
.hero.has-image {
	aspect-ratio: 21 / 9;
	background-size: cover;
	background-position: center;
}

.hero.has-image .hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.55));
}

.hero-inner {
	position: relative;
	z-index: 1;
	/* Matches --container-width so the hero content column lines up exactly
	   with the rest of the site's content edges at any viewport size. */
	max-width: var(--container-width);
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.hero-title {
	color: #fff;
	margin-bottom: var(--space-2);
}

.hero-text {
	color: rgba(255, 255, 255, 0.92);
	font-size: 1.15rem;
	max-width: 42em;
	margin: 0 auto var(--space-3);
	white-space: pre-line;
}

.hero-actions {
	margin: 0;
}

/* Glassmorphism: translucent + blurred, so the hero image/gradient shows
   through while the button still reads clearly as a button. */
.hero-button {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #fff;
	backdrop-filter: blur(14px) saturate(180%);
	-webkit-backdrop-filter: blur(14px) saturate(180%);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.hero-button:hover,
.hero-button:focus {
	background: rgba(255, 255, 255, 0.28);
	border-color: rgba(255, 255, 255, 0.7);
	color: #fff;
}

/* Browsers without backdrop-filter support (rare) still get a legible,
   solid-ish button rather than a near-invisible transparent one. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.hero-button {
		background: rgba(255, 255, 255, 0.85);
		color: var(--color-text);
	}
}

/* =========================================================
   6. Site footer
   ========================================================= */
.site-footer {
	background: var(--color-footer-bg, var(--color-bg-alt));
	border-top: 1px solid var(--color-border);
	padding-block: var(--space-4);
	margin-top: var(--space-5);
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-3);
	font-size: 0.9rem;
	color: var(--color-text-muted);
}

.site-footer a {
	color: var(--color-text-muted);
}

/* =========================================================
   7. Cards / entry lists
   ========================================================= */
.entry-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--space-3);
}

.entry-card {
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--color-bg);
	transition: box-shadow var(--transition), transform var(--transition);
}

.entry-card:hover {
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.entry-card .entry-thumb img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

.entry-card .entry-body {
	padding: var(--space-2);
}

.entry-meta {
	font-size: 0.8rem;
	color: var(--color-text-muted);
}

/* =========================================================
   8. Single / page content
   ========================================================= */
.entry-content {
	/* 1文字=1em相当のCJKで換算し、1行あたり約38文字（読みやすいとされる35〜40字）に収まる幅。
	   ch単位は半角基準のためCJKでは実際の文字数とズレるので、font-sizeに連動するem指定にしている。 */
	max-width: 38em;
	font-size: 1.0625rem; /* 本文のみ気持ち大きめの17px相当にして可読性を優先 */
	line-height: 1.9;
}

.entry-content > * {
	margin-top: 0;
	margin-bottom: 1.7em;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

/* 見出しの前後は「前を広く・後ろを狭く」で階層をはっきりさせる（本文どうしの行間より明確に区切る） */
.entry-content > h2,
.entry-content > h3,
.entry-content > h4 {
	margin-top: 2.2em;
	margin-bottom: 0.8em;
}

.entry-content > h2:first-child,
.entry-content > h3:first-child,
.entry-content > h4:first-child {
	margin-top: 0;
}

.entry-content ul,
.entry-content ol {
	margin-bottom: 1.7em;
}

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

.entry-content img,
.entry-content figure {
	border-radius: var(--radius);
	margin-top: 0.4em;
	margin-bottom: 2em;
}

.entry-content figcaption {
	font-size: 0.85em;
	color: var(--color-text-muted);
	margin-top: 0.6em;
	text-align: center;
}

.entry-content blockquote {
	border-left: 4px solid var(--color-accent);
	margin: 1.8em 0;
	padding: 0.2em var(--space-3);
	color: var(--color-text-muted);
	font-style: italic;
}

/* =========================================================
   8b. Single/page entry chrome, archive headers, comments
   ========================================================= */
.entry-header {
	margin-bottom: var(--space-3);
}

.entry-title {
	margin-bottom: var(--space-1);
}

.entry-thumb {
	margin-bottom: var(--space-3);
	border-radius: var(--radius);
	overflow: hidden;
}

.entry-thumb img {
	width: 100%;
}

.entry-footer {
	margin-top: var(--space-3);
	padding-top: var(--space-2);
	border-top: 1px solid var(--color-border);
	font-size: 0.85rem;
	color: var(--color-text-muted);
}

.page-header {
	margin-bottom: var(--space-3);
}

.page-title {
	margin-bottom: var(--space-1);
}

.archive-description {
	color: var(--color-text-muted);
	max-width: 65ch;
}

.front-page-entry .entry-content {
	max-width: none;
}

.comments-area {
	margin-top: var(--space-5);
	padding-top: var(--space-4);
	border-top: 1px solid var(--color-border);
	max-width: 38em;
}

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

.comment-list .children {
	list-style: none;
	padding-left: var(--space-3);
}

.comment-body {
	padding: var(--space-2) 0;
	border-bottom: 1px solid var(--color-border);
}

.no-results {
	padding-block: var(--space-4);
}

.widget {
	margin-bottom: var(--space-3);
	padding-bottom: var(--space-3);
	border-bottom: 1px solid var(--color-border);
}

.widget-title {
	font-size: 1.05rem;
	margin-bottom: var(--space-1);
}

/* =========================================================
   9. Forms
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
textarea,
select {
	width: 100%;
	padding: 0.75em 1em;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-bg);
	color: var(--color-text);
}

input:focus,
textarea:focus,
select:focus {
	outline: 2px solid var(--color-accent);
	outline-offset: 1px;
}

/* =========================================================
   10. Pagination / breadcrumbs
   ========================================================= */
.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-top: var(--space-4);
}

.pagination a,
.pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* min 44px tap target on touch devices, matching .menu-toggle. */
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.6em;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	color: var(--color-text);
	text-decoration: none;
}

.pagination .current {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: #fff;
}

.breadcrumbs {
	font-size: 0.85rem;
	color: var(--color-text-muted);
	margin-bottom: var(--space-2);
}

.breadcrumbs a {
	color: var(--color-text-muted);
}

.breadcrumbs [aria-current="page"] {
	color: var(--color-text);
}

/* =========================================================
   11. Utility
   ========================================================= */
.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* =========================================================
   11b. Scroll & image animations
   Driven entirely by body classes set from the Customizer
   (seo_simple_scroll_animation / seo_simple_image_animation).
   The only thing JS ever does is toggle ".is-inview" — so with
   JS disabled (html stays ".no-js") everything is fully visible.
   ========================================================= */

/* --- Scroll-in reveal for cards / section headers --- */
html.js body.has-scroll-anim .js-animate {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

html.js body.has-scroll-anim.scroll-anim-fade-in .js-animate {
	transform: none;
}

html.js body.has-scroll-anim.scroll-anim-zoom-in .js-animate {
	transform: scale(0.94);
}

html.js body.has-scroll-anim .js-animate.is-inview {
	opacity: 1;
	transform: none;
}

/* Stagger cards slightly within a grid for a less mechanical reveal. */
html.js body.has-scroll-anim .entry-grid .js-animate:nth-child(2) { transition-delay: 0.08s; }
html.js body.has-scroll-anim .entry-grid .js-animate:nth-child(3) { transition-delay: 0.16s; }
html.js body.has-scroll-anim .entry-grid .js-animate:nth-child(4) { transition-delay: 0.24s; }
html.js body.has-scroll-anim .entry-grid .js-animate:nth-child(n+5) { transition-delay: 0.3s; }

/* --- Image-specific effects --- */
html.js body.img-anim-fade-in .js-animate-img,
html.js body.img-anim-zoom-in .js-animate-img {
	opacity: 0;
	transition: opacity 0.8s ease, transform 0.9s ease;
}

html.js body.img-anim-zoom-in .js-animate-img {
	transform: scale(1.08);
}

html.js body.img-anim-fade-in .js-animate-img.is-inview,
html.js body.img-anim-zoom-in .js-animate-img.is-inview {
	opacity: 1;
	transform: none;
}

/* Parallax: the wrapper clips, the image itself is translated by JS via a
   CSS custom property so there's no per-frame style recalculation cost. */
html.js body.img-anim-parallax .js-animate-img {
	overflow: hidden;
}

html.js body.img-anim-parallax .js-animate-img > img {
	transform: translateY(var(--seo-simple-parallax, 0px)) scale(1.15);
	will-change: transform;
}

/* =========================================================
   12. Responsive
   ========================================================= */
@media (max-width: 782px) {
	.main-navigation {
		position: fixed;
		inset: 0 0 0 30%;
		background: var(--color-mobile-menu-bg, var(--color-bg));
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		transform: translateX(100%);
		transition: transform var(--transition);
		padding: var(--space-5) var(--space-3);
		overflow-y: auto;
		box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
	}

	.main-navigation.is-open {
		transform: translateX(0);
	}

	.main-navigation ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	/* Full-width, ~48px-tall rows: the whole row is tappable, not just the
	   text, and each row clears the 44px minimum recommended touch target. */
	.main-navigation a {
		display: block;
		padding: 0.9em 0;
		border-bottom: 1px solid var(--color-border);
	}

	.main-navigation li:last-child > a {
		border-bottom: none;
	}

	.main-navigation ul ul {
		position: static;
		display: flex;
		border: none;
		box-shadow: none;
		padding-left: var(--space-2);
	}

	.main-navigation ul ul a {
		border-bottom: none;
		padding-block: 0.7em;
	}

	.mobile-menu-note {
		display: block;
		margin-top: var(--space-4);
		padding-top: var(--space-3);
		border-top: 1px solid var(--color-border);
		font-size: 0.85rem;
		line-height: 1.7;
		color: var(--color-text-muted);
	}

	.menu-toggle {
		display: inline-flex;
	}

	.entry-grid {
		grid-template-columns: 1fr;
	}

	/* Taller ratio on tablet/mobile: 21:9 gets too short to hold text
	   once the viewport narrows, so the crop shifts to a squarer shape. */
	.hero.has-image {
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 480px) {
	.section {
		padding-block: var(--space-4);
	}

	.hero {
		padding-block: var(--space-4);
	}

	.hero.has-gradient {
		min-height: 320px;
	}

	.hero.has-image {
		aspect-ratio: 3 / 4;
	}

	.hero-text {
		font-size: 1rem;
	}
}

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

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