/* Fino Theme — サイト共通の見た目の仕組み（Phase 2-A） */

/* スティッキーヘッダー */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
	background-color: rgba(255, 255, 255, 0.8) !important;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
}

@media (min-width: 782px) {
	.site-header {
		padding-left: 2.5rem !important;
		padding-right: 2.5rem !important;
	}
}

/* ナビゲーション最後の項目（お問い合わせ）だけボタン化して行動導線を強調 */
.wp-block-navigation .wp-block-navigation-item:last-child > .wp-block-navigation-item__content {
	background-color: var(--wp--preset--color--primary);
	color: #fff;
	padding: 0.55rem 1.25rem;
	border-radius: var(--wp--custom--radius--pill);
	transition: opacity 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item:last-child > .wp-block-navigation-item__content:hover {
	opacity: 0.85;
	color: #fff;
}

/* ナビゲーション項目同士の間隔を広げ、ホバー時に背景色をつけて操作感を出す */
.wp-block-navigation .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.6rem 1rem;
	border-radius: var(--wp--custom--radius--md);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item:not(:last-child) > .wp-block-navigation-item__content:hover {
	background-color: var(--wp--preset--color--surface);
}

/* カード共通スタイル（Bento Grid等で使用） */
.card {
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: var(--wp--custom--shadow--card);
	padding: 1.75rem 1.5rem;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--wp--custom--shadow--cardHover);
}

/* ボタンの浮き上がり */
.wp-block-button__link,
.wpcf7-submit {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-button__link:hover,
.wpcf7-submit:hover {
	transform: translateY(-2px);
	box-shadow: var(--wp--custom--shadow--card);
}

/* Contact Form 7 送信ボタンをテーマのボタンスタイルに合わせる */
.wpcf7-submit {
	background-color: var(--wp--preset--color--primary);
	color: #fff;
	border: none;
	border-radius: var(--wp--custom--radius--pill);
	padding: 0.85rem 1.75rem;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--medium);
	cursor: pointer;
}

.wpcf7-submit:hover {
	background-color: var(--wp--preset--color--primary);
	opacity: 0.9;
}

/* Contact Form 7 の入力欄に余白を持たせ、文字が見切れないようにする */
.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-textarea {
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
	font-size: var(--wp--preset--font-size--medium);
	box-sizing: border-box;
}

/* ヒーローの見出し上の小さなラベル */
.kicker {
	display: block;
	text-align: center;
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.08em;
	margin-bottom: 0.75rem;
}

/* ヒーローセクションの背景画像（淡いオーバーレイでテキストの可読性を確保） */
.hero-section {
	position: relative;
	background-image: url("../images/hero-bg.jpg");
	background-size: cover;
	background-position: center;
	isolation: isolate;
}

.hero-section::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(242, 246, 246, 0.5) 0%, rgba(242, 246, 246, 0.38) 55%, rgba(242, 246, 246, 0.6) 100%);
}

/* ヒーローの各行が上から順に浮かび上がるアニメーション */
@keyframes hero-line-in {
	from {
		opacity: 0;
		transform: translateY(28px);
		filter: blur(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
		filter: blur(0);
	}
}

.hero-line {
	opacity: 0;
	animation: hero-line-in 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-line-1 {
	animation-delay: 0.2s;
}

.hero-line-2 {
	animation-delay: 0.7s;
}

.hero-line-3 {
	animation-delay: 1.4s;
}

.hero-line-4 {
	animation-delay: 2s;
}

/* サービス4分類のカードグリッド（4つを同格で並べる） */
.bento-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 1fr;
	gap: 1.5rem;
}

.bento-grid .card {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

@media (max-width: 960px) {
	.bento-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.bento-grid {
		grid-template-columns: 1fr;
	}
}

/* カード内アイコン */
.card-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--custom--radius--md);
	background-color: rgba(20, 108, 116, 0.08);
	color: var(--wp--preset--color--primary);
	margin-bottom: 1.25rem;
}

.card-icon svg {
	width: 24px;
	height: 24px;
}

/* 実績サマリー（数字カード） */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
}

.stats-grid .stat {
	text-align: center;
	padding: 1.5rem 1rem;
}

.stats-grid .stat .stat-number {
	display: block;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	line-height: 1.2;
}

.stats-grid .stat .stat-label {
	display: block;
	margin-top: 0.5rem;
	color: var(--wp--preset--color--foreground);
	opacity: 0.75;
	font-size: var(--wp--preset--font-size--medium);
}

/* 数字カードごとに異なるホバー演出をつける（1:拡大 2:フェード＋右からスライドイン 3:回転 4:文字間隔） */
.stats-grid .stat:nth-child(1) .stat-number {
	display: inline-block;
	transition: transform 0.3s ease;
}

.stats-grid .stat:nth-child(1):hover .stat-number {
	transform: scale(1.15);
}

.stats-grid .stat:nth-child(3) .stat-number {
	display: inline-block;
	transition: transform 0.6s ease;
}

.stats-grid .stat:nth-child(3):hover .stat-number {
	transform: rotate(360deg);
}

.stats-grid .stat:nth-child(4) .stat-number {
	display: inline-block;
	transition: letter-spacing 0.3s ease;
}

.stats-grid .stat:nth-child(4):hover .stat-number {
	letter-spacing: 0.15em;
}

@keyframes stat-fade-slide-in {
	0% {
		opacity: 1;
		transform: translateX(0);
	}
	40% {
		opacity: 0;
		transform: translateX(0);
	}
	70% {
		opacity: 0;
		transform: translateX(24px);
	}
	100% {
		opacity: 1;
		transform: translateX(0);
	}
}

.stats-grid .stat:nth-child(2) .stat-number {
	display: inline-block;
}

.stats-grid .stat:nth-child(2):hover .stat-number {
	animation: stat-fade-slide-in 0.6s ease;
}

@media (max-width: 781px) {
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.stats-grid {
		grid-template-columns: 1fr;
	}
}

/* お問い合わせCTAセクション */
.cta-section {
	background: linear-gradient(135deg, var(--wp--preset--color--primary) 0%, #0b3d42 100%);
	border-radius: var(--wp--custom--radius--lg);
	padding: 4.5rem 2rem;
}

.cta-section h2,
.cta-section p {
	color: #ffffff;
}

.cta-section .wp-block-button.is-style-outline .wp-block-button__link {
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.6);
}

.cta-section .wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: #ffffff;
	background-color: rgba(255, 255, 255, 0.1);
}

/* 固定ページ共通のタイトル帯（Phase 2-C） */
.page-hero h1 {
	margin: 0;
}

/* 404（ページが見つかりません）テンプレート */
.error-404-code {
	margin: 0 0 0.5rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	opacity: 0.55;
}

.error-404-links {
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
}

.error-404-links li {
	border-top: 1px solid var(--wp--preset--color--border, #e2e8e8);
	margin: 0;
}

.error-404-links li:last-child {
	border-bottom: 1px solid var(--wp--preset--color--border, #e2e8e8);
}

.error-404-links a {
	display: block;
	padding: 0.75rem 0.25rem;
	text-decoration: none;
}

.error-404-links a:hover {
	text-decoration: underline;
}

/* 固定ページ内で使う2カラムのカードグリッド（サービス・実績ページ） */
.content-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

@media (max-width: 781px) {
	.content-grid {
		grid-template-columns: 1fr;
	}
}

/* 実績・事例ページ：項目ごとの文字量の差が大きいため、画面幅を問わず1カラムで表示 */
.content-grid.content-grid--stack {
	grid-template-columns: 1fr;
}

.content-grid .card ul,
.content-grid .card ol {
	margin: 1rem 0 0;
	padding-left: 1.25rem;
}

.content-grid .card li {
	margin-bottom: 0.5rem;
	line-height: 1.7;
}

.content-grid .card .process-label {
	display: block;
	margin-top: 1.5rem;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	letter-spacing: 0.04em;
}

/* 会社概要ページの沿革タイムライン */
.timeline {
	list-style: none;
	margin: 2rem 0 0;
	padding: 0;
	border-left: 2px solid var(--wp--preset--color--border);
}

.timeline li {
	position: relative;
	padding: 0 0 2rem 1.75rem;
}

.timeline li:last-child {
	padding-bottom: 0;
}

.timeline li::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 0.35rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary);
}

.timeline-year {
	display: block;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	margin-bottom: 0.25rem;
}

/* お知らせ一覧（クエリループ）の見た目 */
.wp-block-post-template {
	border-top: 1px solid var(--wp--preset--color--border);
}

.wp-block-post-template > li {
	padding: 2rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.wp-block-post-template .wp-block-post-title a {
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-post-template .wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary);
}

/* お知らせ一覧の日付＋カテゴリバッジ */
.post-meta-row {
	align-items: center;
}

.post-category-badge a {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.7rem;
	border-radius: var(--wp--custom--radius--pill);
	border: 1px solid currentColor;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

.post-category-badge a[href*="/category/ai-wordpress/"] {
	color: var(--wp--preset--color--primary);
}

.post-category-badge a[href*="/category/wp7-next-stage/"] {
	color: var(--wp--preset--color--accent);
}

/* お知らせ一覧のページ送り */
.wp-block-query-pagination {
	margin-top: 2.5rem;
	gap: 0.5rem;
}

.wp-block-query-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.6rem;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-query-pagination .page-numbers:hover {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
}

.wp-block-query-pagination .page-numbers.current {
	background-color: var(--wp--preset--color--primary);
	color: #fff;
}

/* ブログ詳細ページの前後記事ナビゲーション */
.post-nav {
	border-top: 1px solid var(--wp--preset--color--border);
}

.wp-block-post-navigation-link a {
	color: var(--wp--preset--color--foreground);
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-post-navigation-link a:hover {
	color: var(--wp--preset--color--primary);
}

.wp-block-post-navigation-link__arrow-previous,
.wp-block-post-navigation-link__arrow-next {
	color: var(--wp--preset--color--muted);
}

.post-nav .post-navigation-link-next {
	margin-left: auto;
	text-align: right;
}

@media (max-width: 600px) {
	.post-nav-row {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	.post-nav .post-navigation-link-next {
		margin-left: 0;
		text-align: left;
	}
}

/* スクロールで浮かび上がる要素 */
.reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* アニメーションを好まない設定のユーザーへの配慮 */
@media (prefers-reduced-motion: reduce) {
	.site-header,
	.card,
	.wp-block-button__link,
	.wpcf7-submit,
	.reveal,
	.hero-line,
	.stats-grid .stat-number {
		transition: none !important;
		animation: none !important;
	}

	.card:hover,
	.wp-block-button__link:hover,
	.wpcf7-submit:hover,
	.stats-grid .stat:hover .stat-number {
		transform: none !important;
		letter-spacing: normal !important;
	}

	.reveal {
		opacity: 1;
		transform: none;
	}

	.hero-line {
		opacity: 1;
		transform: none;
		filter: none;
	}
}
