/*
Theme Name: ツバメの巣研究所 (birdnest)
Description: ツバメの巣研究所（birdnest.jp）専用のテーマ。大きな写真に白い箱が重なるページ、Read more付きのカード、年表などをブロックパターンとして用意しています。
Author: EDIBLE BIRD'S NEST RESEARCH INSTITUTE
Version: 1.1.1
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: birdnest
*/

/* ==========================================================
   基本
   ========================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--wp--preset--color--base, #f4f5f9);
	color: var(--wp--preset--color--contrast, #1f2328);
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	line-height: 1.9;
	-webkit-text-size-adjust: 100%;
	overflow-wrap: anywhere;
}

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

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

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 8px 16px;
	background: #fff;
	color: #000;
}

.skip-link:focus {
	left: 8px;
}

/* ==========================================================
   ヘッダー
   ========================================================== */
.site-header__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 28px 32px 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	border-bottom: 1px solid var(--wp--preset--color--line, #2a2a2a);
}

.site-brand {
	flex: 0 0 auto;
}

.site-logo {
	display: block;
	line-height: 0;
}

.site-logo img {
	width: 230px;
	height: auto;
}

.site-since {
	margin: 6px 0 0;
	font-family: Georgia, "Times New Roman", serif;
	font-style: italic;
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.site-nav .menu,
.site-nav .lang-switch,
.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav .menu {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-end;
}

.site-nav .menu > li {
	position: relative;
}

.site-nav a {
	display: block;
	padding: 8px 10px;
	color: var(--wp--preset--color--contrast, #1f2328);
	text-decoration: none;
	font-size: 0.875rem;
	line-height: 1.5;
	white-space: nowrap;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a {
	color: var(--wp--preset--color--accent, #3d4db0);
}

/* 子メニュー（パソコン：マウスを乗せると開く） */
.site-nav .sub-menu,
.site-nav .children {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 50;
	min-width: 240px;
	padding: 8px 0;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu,
.site-nav li:hover > .children,
.site-nav li:focus-within > .children {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.site-nav .sub-menu a,
.site-nav .children a {
	padding: 8px 20px;
	white-space: normal;
}

/* 言語の切り替え */
.lang-switch {
	display: flex;
	margin-left: 8px !important;
	padding-left: 12px !important;
	border-left: 1px solid #c9ccd6;
}

.lang-switch img {
	display: none; /* 国旗は表示しない */
}

/* スマホ用メニューボタン */
.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 10px;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.nav-toggle__bar {
	display: block;
	height: 2px;
	margin: 5px 0;
	background: var(--wp--preset--color--contrast, #1f2328);
	transition: transform 0.2s, opacity 0.2s;
}

/* ==========================================================
   画面右のFacebookアイコン
   ========================================================== */
.social-float {
	position: fixed;
	right: 18px;
	top: 50%;
	z-index: 40;
	transform: translateY(-50%);
}

.social-float a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	color: #1f2328;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: background 0.15s, color 0.15s;
}

.social-float a:hover {
	background: #1877f2;
	color: #fff;
}

/* ==========================================================
   ページ本体（大きな写真＋白い箱）
   ========================================================== */
.site-main {
	padding: 56px 32px 80px;
}

.page-hero {
	max-width: 1280px;
	margin: 0 auto;
	height: 440px;
	overflow: hidden;
	line-height: 0;
}

.page-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.page-card {
	position: relative;
	max-width: 1100px;
	margin: 0 auto;
	padding: 64px 7% 72px;
	background: var(--wp--preset--color--surface, #fff);
}

.has-hero .page-card {
	margin-top: -180px;
}

.page-title {
	margin: 0 0 40px;
	font-family: var(--wp--preset--font-family--display, sans-serif);
	font-weight: 600;
	font-size: clamp(2rem, 4.2vw, 3.25rem);
	line-height: 1.25;
	text-align: center;
	letter-spacing: 0.01em;
}

.post-date {
	margin: 0 0 8px;
	text-align: center;
	color: var(--wp--preset--color--muted, #5b6270);
}

.post-list {
	list-style: none;
	padding: 0;
}

.post-list li {
	display: flex;
	gap: 24px;
	padding: 14px 0;
	border-bottom: 1px solid #e2e4ea;
}

.post-list time {
	flex: 0 0 auto;
	color: var(--wp--preset--color--muted, #5b6270);
}

/* ==========================================================
   トップページ
   ========================================================== */
.front-intro {
	padding: 24px 0 48px;
	text-align: center;
}

.front-intro__title {
	margin: 0 0 24px;
	font-family: var(--wp--preset--font-family--display, sans-serif);
	font-weight: 600;
	font-size: clamp(1.75rem, 4.4vw, 3.5rem);
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.front-intro__logo {
	width: 335px;
}

/* Latest Information */
.news {
	max-width: 1280px;
	margin: 96px auto 0;
}

.news__lead {
	margin: 0 0 40px;
	text-align: center;
	font-family: var(--wp--preset--font-family--display, sans-serif);
	font-weight: 500;
	font-size: 1.125rem;
	letter-spacing: 0.06em;
}

.news__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	max-width: 1100px;
	margin: 0 auto;
}

.news-item {
	display: flex;
	flex-direction: column;
	padding: 32px 28px;
	background: var(--wp--preset--color--surface, #fff);
	border-top: 3px solid var(--wp--preset--color--accent, #3d4db0);
}

.news-item__date {
	color: var(--wp--preset--color--muted, #5b6270);
	font-size: 0.875rem;
	letter-spacing: 0.06em;
}

.news-item__title {
	margin: 6px 0 12px;
	font-family: var(--wp--preset--font-family--display, sans-serif);
	font-weight: 500;
	font-size: 1.25rem;
	line-height: 1.4;
}

.news-item__body > *:first-child {
	margin-top: 0;
}

.news-item__body .wp-block-buttons {
	margin-top: auto;
}

/* ==========================================================
   フッター
   ========================================================== */
.site-footer__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 20px 32px 32px;
	border-top: 1px solid var(--wp--preset--color--line, #2a2a2a);
	text-align: center;
}

.site-footer__copy {
	margin: 0;
	font-size: 0.875rem;
	letter-spacing: 0.02em;
}

.site-footer__since {
	margin-left: 1.5em;
	font-style: italic;
	font-weight: 700;
}

/* ==========================================================
   タブレット・スマホ
   ========================================================== */
@media (max-width: 1279px) {
	.nav-toggle {
		display: block;
	}

	.site-nav {
		position: fixed;
		inset: 0 0 0 auto;
		z-index: 100;
		width: min(340px, 86vw);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 80px 24px 32px;
		overflow-y: auto;
		background: #fff;
		box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
		transform: translateX(105%);
		transition: transform 0.25s;
	}

	.is-nav-open .site-nav {
		transform: none;
	}

	.is-nav-open .nav-toggle {
		position: relative;
		z-index: 101;
	}

	.is-nav-open .nav-toggle__bar:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.is-nav-open .nav-toggle__bar:nth-child(2) {
		opacity: 0;
	}

	.is-nav-open .nav-toggle__bar:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	.site-nav .menu {
		display: block;
	}

	.site-nav .menu > li {
		border-bottom: 1px solid #e6e8ee;
	}

	.site-nav a {
		padding: 12px 4px;
		white-space: normal;
	}

	/* スマホでは子メニューを常に開いて表示 */
	.site-nav .sub-menu,
	.site-nav .children {
		position: static;
		min-width: 0;
		padding: 0 0 8px 16px;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.site-nav .sub-menu a,
	.site-nav .children a {
		padding: 6px 4px;
		font-size: 0.875rem;
	}

	.lang-switch {
		margin: 16px 0 0 !important;
		padding: 0 !important;
		border: 0;
	}

	.lang-switch a {
		display: inline-block;
		padding: 8px 20px;
		border: 1px solid var(--wp--preset--color--contrast, #1f2328);
	}
}

@media (max-width: 782px) {
	.site-header__inner {
		padding: 16px 16px 14px;
	}

	.site-logo img {
		width: 170px;
	}

	.site-since {
		font-size: 0.75rem;
	}

	.site-main {
		padding: 28px 16px 56px;
	}

	.page-hero {
		height: 220px;
	}

	.has-hero .page-card {
		margin-top: -60px;
		width: calc(100% - 24px);
	}

	.page-card {
		padding: 40px 20px 48px;
	}

	.page-title {
		margin-bottom: 28px;
	}

	.front-intro {
		padding: 8px 0 28px;
	}

	.front-intro__logo {
		width: 240px;
	}

	.news {
		margin-top: 64px;
	}

	.social-float {
		top: auto;
		bottom: 16px;
		right: 12px;
		transform: none;
	}

	.site-footer__inner {
		padding: 16px 16px 72px;
	}

	.site-footer__since {
		display: block;
		margin: 4px 0 0;
	}
}
