/*
Theme Name: Takuma Construction
Theme URI: https://www.takuma.co.jp/
Author: Takuma
Description: 吹田市資源循環エネルギーセンター 基幹的設備機能回復工事 工事情報サイト用ハイブリッドテーマ(クラシックPHPテンプレート + ACF)。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: takuma-construction
*/

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
	--primary-color: #2867a3;      /* header/footer background, headings, active states */
	--bg-alt: #EDEDED;             /* section/band background */
	--border-color: #ddd;
	--text-color: #222;
	--text-muted: #777;
	--text-faint: #999;
	--primary-light: #dbe8f2;      /* primary-colorの淡色(背景・タグ用) */
	--accent-green: #2f8f5b;       /* primary-colorと合わせる差し色(進捗・完了表示など) */
	--accent-green-light: #dcf0e3; /* accent-greenの淡色(背景・タグ用) */
	--accent-red: #c0392b;         /* 注意・警告などの強調表示用 */
	--accent-red-light: #f4dddb;   /* accent-redの淡色(背景・タグ用) */
	--dark-navy: #141932;          /* hero-overlay-startの実色版。濃色セクション用 */
	--font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;

	--placeholder-bg-a: #dcdfe6;
	--placeholder-bg-b: #ccd0d9;
	--placeholder-text: #7a8093;
	--hero-overlay-start: rgba(20, 25, 50, 0.55);
	--hero-overlay-end: rgba(20, 25, 50, 0);
	--header-gradient-accent: #3d8dc6;
	--section-heading-bar-shadow: #eeece8;
}

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

body {
	margin: 0;
	font-family: var(--font-family);
	font-size: clamp(12px, 1.4035vw, 16px);
	color: var(--text-color);
	background: #fff;
	-webkit-font-smoothing: antialiased;
}

body.nav-mobile-open {
	overflow: hidden;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: inherit;
}

ul, ol, dl, dd {
	margin: 0;
	padding: 0;
}

.site-main {
	display: block;
}

/* ==========================================================================
   Skip link
   ========================================================================== */
.skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	z-index: 1000;
	padding: 12px 20px;
	background: var(--primary-color);
	color: #fff;
	text-decoration: none;
}

.skip-link:focus {
	top: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: relative;
	background: linear-gradient(to bottom, var(--primary-color) 0%, var(--primary-color) 89%, var(--header-gradient-accent) 89%, var(--header-gradient-accent) 100%);
	color: #fff;
	height: 143px;
	padding-bottom: 16px;
	width: 100%;
	overflow-x: hidden;
	
	&::before,
	&::after {
		content: '';
		position: absolute;
		z-index: 1;
	}
	&::before {
		left: 0;
		bottom: 0px;
		width: 178px;
		height: 92px;
		background: url(assets/img/common/header-illust1.svg) no-repeat 0 0;
	}
	&::after {
		right: 0;
		bottom: 0;
		width: 294px;
		height: 140px;
		background: url(assets/img/common/header-illust2.svg) no-repeat 0 0;
	}
}

.site-header__inner {
	position: relative;
	height: 127px;
	margin: 0 auto;
	padding: 0 120px 0 30px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	z-index: 2;
}

.site-header__title-link {
	text-decoration: none;
	color: #fff;
	line-height: 1.5;
	display: block;
}

.site-header__title {
	display: block;
	font-size: clamp(12px, 1.8421vw, 21px);
	font-weight: 700;
	line-height: 1.25;
}

.site-header__nav {
	display: flex;
	gap: 0;
	flex-wrap: wrap;
}

.site-header__nav-item {
	position: relative;
	color: #fff;
	text-decoration: none;
	font-size: 18px;
	font-weight: 400;
	padding: 0 1em;
	border-bottom: 2px solid transparent;
	--nav-underline-gap: 51px; /* 文字とアンダーラインの距離。ここを調整 */
}

.site-header__nav-item::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(-1 * var(--nav-underline-gap));
	height: 2px;
	background: #fff;
	transform: scaleX(0);
	transition: transform 0.25s ease;
}

.site-header__nav-item:hover::after {
	transform: scaleX(1);
}

.site-header__toggle {
	display: none;
	background: transparent;
	border: none;
	width: 36px;
	height: 28px;
	position: relative;
	cursor: pointer;
	padding: 0;
}

.site-header__toggle-bar {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: #fff;
	transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease, bottom 0.25s ease;
}

.site-header__toggle-bar:nth-child(1) { top: 2px; }
.site-header__toggle-bar:nth-child(2) { top: 12px; }
.site-header__toggle-bar:nth-child(3) { bottom: 4px; }

.site-header__toggle.is-open .site-header__toggle-bar:nth-child(1) {
	top: 12px;
	transform: rotate(45deg);
}

.site-header__toggle.is-open .site-header__toggle-bar:nth-child(2) {
	opacity: 0;
}

.site-header__toggle.is-open .site-header__toggle-bar:nth-child(3) {
	bottom: 14px;
	transform: rotate(-45deg);
}

.site-header__nav-mobile {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 100;
	flex-direction: column;
	background: var(--primary-color);
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-header__nav-mobile-item {
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 400;
	padding: 14px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header__nav-mobile-item.is-current {
	font-weight: 700;
}

/* ==========================================================================
   Hero (front page)
   ========================================================================== */
.hero {
	position: relative;
	aspect-ratio: 1920 / 864;
	overflow: hidden;

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

.hero__placeholder {
	height: 100%;
}

.hero__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-start;
	background: linear-gradient(0deg, var(--hero-overlay-start), var(--hero-overlay-end) 25%);
}

.hero__content {
	display: flex;
	justify-content: flex-end;
	padding: 24px 40px 32px;
	margin: 0 auto;
	width: 100%;
}

.hero__title {
	display: inline-block;
	margin: 0;
	font-size: clamp(20px, 2.2396vw, 43px);
	font-weight: 700;
	color: #fff;
	text-align: left;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Section / Heading (front page)
   ========================================================================== */
.section {
	padding: 48px 24px;
}

.section--alt {
	background: var(--bg-alt);
}

.section__inner {
	max-width: 1140px;
	margin: 0 auto;
}

.section__inner--card {
	background: #fff;
	border-radius: 2px;
	padding: 36px 40px;
}

.section-heading {
	text-align: center;
	margin-bottom: 28px;
}

.section-heading__title {
	display: inline-block;
	margin: 0;
	font-size: clamp(20px, 2.1053vw, 24px);
	font-weight: 900;
	color: var(--primary-color);
}

.section-heading__title::after {
	content: '';
	display: block;
	width: 5em;
	height: 6px;
	background: var(--primary-color);
	margin: 8px auto 0;
	box-shadow: 0 4px 0 var(--section-heading-bar-shadow);
}

/* ==========================================================================
   Card list (現場状況 latest 3 on front page)
   ========================================================================== */
.card-list__item {
	display: flex;
	gap: 58px;
	padding: 20px 0;
	flex-wrap: wrap;
}

.card-list__thumb {
	flex: 0 0 284px;
	overflow: hidden;
}

.card-list__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.card-list__body {
	flex: 1;
	min-width: 220px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.card-list__title {
	margin: 0;
	font-size: clamp(15px, 1.7544vw, 20px);
	font-weight: 700;
	color: var(--text-color);
}

.card-list__excerpt {
	margin: 0;
	font-size: clamp(12px, 1.4035vw, 16px);
	color: var(--text-muted);
	line-height: 1.7;
}

.card-list__action {
	text-align: right;
}

.card-list__empty {
	text-align: center;
	color: var(--text-muted);
	font-size: 13px;
}

.btn {
	display: inline-block;
	text-decoration: none;
	font-size: clamp(12px, 1.4035vw, 16px);
	padding: 6px 16px;
}

.btn--outline {
	border: 1px solid var(--text-color);
	color: var(--text-color);
	background: #fff;
	transition: background-color 0.15s ease, color 0.15s ease;
}

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

/* ==========================================================================
   Map / Overview (建設地 section on front page)
   ========================================================================== */
.map-placeholder {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.map-placeholder iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.overview {
	margin-top: 28px;
}

/* post 2(トップページ)の本文欄をブロックエディタ(見出しブロック+表組ブロック)で編集する */
.overview .wp-block-heading {
	font-size: clamp(20px, 2.1053vw, 24px);
	font-weight: 700;
	margin: 0 0 16px;
}

.overview .wp-block-table {
	margin: 0;
}

.overview .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}

.overview .wp-block-table td {
	padding: 1em 0;
	border: 0;
	font-size: clamp(12px, 1.4035vw, 16px);
	vertical-align: top;
}

.overview .wp-block-table td:first-child {
	width: 11em;
	color: #333;
	padding-right: 1em;
}


/* ==========================================================================
   Placeholder (shared diagonal-stripe image placeholder)
   ========================================================================== */
.placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: repeating-linear-gradient(135deg, var(--placeholder-bg-a) 0, var(--placeholder-bg-a) 10px, var(--placeholder-bg-b) 10px, var(--placeholder-bg-b) 20px);
}

.placeholder__label {
	color: var(--placeholder-text);
	font-family: monospace;
	font-size: 11px;
	text-align: center;
	padding: 0 8px;
}

/* ==========================================================================
   Page title bar (shared: archive / single / fixed page)
   ========================================================================== */
.page-title-bar {
	background: var(--bg-alt);
}

.page-title-bar__inner {
	max-width: 1080px;
	margin: 0 auto;
}

.page-title-bar__title {
	margin: 0;
	font-size: clamp(22px, 3.8596vw, 44px);
	font-weight: 900;
	color: var(--primary-color);
	text-align: center;
	padding: .6em;
}

/* ==========================================================================
   Breadcrumb (shared: archive / single / fixed page)
   ========================================================================== */
.breadcrumb {
	margin: 30px 0 45px;
}
.breadcrumb__inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: clamp(12px, 1.2281vw, 14px);
	color: var(--text-color);
}

.breadcrumb__item {
	color: inherit;
	text-decoration: none;
}

a.breadcrumb__item:hover {
	text-decoration: underline;
}

.breadcrumb__sep {
	color: var(--text-faint);
}

/* ==========================================================================
   Archive grid (現場状況アーカイブ)
   ========================================================================== */
.archive-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 36px 24px 56px;
}

.archive-grid {
	display: grid;
	gap: 58px;
	grid-template-columns: repeat(3, 1fr);
}

.archive-grid__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.archive-grid__thumb {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.archive-grid__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

/* card-list__thumb と共通のホバー拡大アニメーション */
.card-list__thumb a:hover img,
.archive-grid__link:hover .archive-grid__thumb img {
	transform: scale(1.05);
	opacity: 0.95;
}

.archive-grid__caption {
	margin: 8px 0 0;
	font-size: clamp(15px, 1.7544vw, 20px);
	font-weight: 700;
	color: var(--text-color);
}

.archive-grid__empty {
	text-align: center;
	color: var(--text-muted);
	font-size: 13px;
}

/* Pagination (WordPress paginate_links output) */
.pagination {
	margin-top: 40px;
}

.pagination ul.page-numbers {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	list-style: none;
	flex-wrap: wrap;
}

.pagination .page-numbers a,
.pagination .page-numbers span {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--border-color);
	color: var(--primary-color);
	text-decoration: none;
	font-size: 13px;
	background: #fff;
}

.pagination .page-numbers span.current {
	background: var(--primary-color);
	border-color: var(--primary-color);
	color: #fff;
}

.pagination .page-numbers span.dots {
	border: none;
	background: none;
}

/* ==========================================================================
   Single genba page (現場状況個別)
   ========================================================================== */
.single-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 36px 24px 12px;
}

.desc-box {
	border: none;
	padding: 0;
}

.desc-box__heading {
	margin: 0 0 18px;
	font-size: clamp(15px, 1.9298vw, 22px);
	font-weight: 700;
}

.desc-list {
	list-style: none;
	counter-reset: none;
}

.desc-list__flow {
	margin-bottom: 36px;
	margin-left: 6em;
}

.desc-list__item {
	margin-bottom: 18px;
	margin-left: 6em;
}

.desc-list__item:last-child {
	margin-bottom: 0;
}

.desc-list__item:has(.desc-list__gallery) + .desc-list__item {
	margin-top: 36px;
}

.desc-list__item-title {
	font-weight: 700;
	font-size: clamp(15px, 1.7544vw, 20px);
}

.desc-list__gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	max-width: 780px;
	margin: 12px auto 0;
}

.desc-list__gallery-item {
	width: 100%;
}

.desc-list__gallery-item img {
	width: 100%;
	height: auto;
}

.gallery-grid__link {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
}

/* ==========================================================================
   Lightbox (gallery-grid image preview)
   ========================================================================== */
.lightbox {
	position: fixed;
	border: none;
	padding: 0;
	background: transparent;
	width: 90vw;
	height: 90vh;
	outline: none;
}

.lightbox::backdrop {
	background: rgba(0, 0, 0, 0.8);
}

.lightbox__stage {
	position: relative;
	width: 100%;
	height: 100%;
}

.lightbox__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.lightbox__image.is-active {
	opacity: 1;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
	position: absolute;
	z-index: 1;
	background: rgba(0, 0, 0, 0.3);
	border: none;
	color: #fff;
	line-height: 1;
	cursor: pointer;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
	background: rgba(0, 0, 0, 0.5);
}

.lightbox__close {
	top: 8px;
	right: 8px;
	font-size: 24px;
	outline-offset: 4px;
}

.lightbox__prev,
.lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 28px;
}

.lightbox__prev {
	left: 8px;
}

.lightbox__arrow {
	transform: translateY(-2px);
}

.lightbox__next {
	right: 8px;
}

/* ==========================================================================
   Fixed page (固定ページ共通: 施設概要・工事概要・コンセプト・工事スケジュール・完成イメージ)
   ========================================================================== */
.fixed-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 36px 24px 56px;
}

.fixed-content {
	padding: 32px;
}

/* the_content() で編集する想定(画像ブロック: 幅80%・16:9・中央配置、段落: 中央揃え本文) */
.fixed-content .wp-block-image {
	width: 80%;
	margin: 0 auto;
}

.fixed-content .wp-block-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.fixed-content p {
	margin: 28px auto 0;
	font-size: clamp(12px, 1.4035vw, 16px);
	color: #444;
	line-height: 2;
}

.fixed-content .wp-block-table {
	margin: 28px 0 0;
}

.fixed-content .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}

.fixed-content .wp-block-table td {
	padding: 1em 0;
	border: 0;
	font-size: clamp(12px, 1.4035vw, 16px);
	color: #444;
	vertical-align: top;
}

.fixed-content .wp-block-table td:first-child {
	width: 11em;
	color: #333;
	padding-right: 1em;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
	margin-top: auto;
}

.site-footer__links {
	text-align: center;
	padding: 20px 0;
}

.site-footer__link {
	color: var(--primary-color);
	text-decoration: none;
}

.site-footer__bottom {
	background: var(--primary-color);
	color: #fff;
	text-align: center;
	padding: 14px 16px;
	position: relative;
}

.site-footer__bottom p {
	margin: 0;
}

/* ==========================================================================
   Responsive (breakpoint: 780px, per README)
   ========================================================================== */
@media (max-width: 780px) {
	.site-header {
		height: 66px;
		padding-bottom: 14px;
		overflow-x: unset;

		&::before,
		&::after {
			display: none;
		}
	}
	.site-header__inner {
		height: 52px;
		padding: 0 10px;
	}
	.site-header__nav {
		display: none;
	}

	.site-header__toggle {
		display: block;
	}

	.site-header__nav-mobile.is-open {
		display: flex;
		height: 100vh; /* dvh 非対応ブラウザ向けフォールバック */
		height: 100dvh;
		overflow-y: auto;
	}

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

	.hero {
		min-height: 150px;
	}
	.hero__content {
		padding-right: 10px;
	}

	.section {
		padding: 32px 16px;
	}

	.section__inner--card {
		padding: 24px 20px;
	}

	.card-list__item,
	.card-list__body {
		gap: 20px;
	}
	.card-list__thumb {
		flex: 0 0 100%;
	}
	
	.fixed-content {
		padding: 0;
	}
	.fixed-content .wp-block-image {
		width: 100%;
	}

	.overview .wp-block-table tr,
	.fixed-content .wp-block-table tr {
		display: block;
		padding: 14px 0;
	}

	.overview .wp-block-table td,
	.fixed-content .wp-block-table td {
		display: block;
		width: auto;
		padding: 0;
	}

	.overview .wp-block-table td:first-child,
	.fixed-content .wp-block-table td:first-child {
		padding-bottom: 4px;
	}

	.desc-list__flow,
	.desc-list__item {
		margin-left: 0;
	}
	
	.site-footer__bottom {
		&::after {
			width: 130px;
			height: 69px;
			top: -56px;
		}
	}

	.sp-hide {
		display: none;
	}
}

@media (min-width: 781px) {
	.pc-hide {
		display: none;
	}
}
