/*
 * AITech 建築実務 - Front Page V4
 * SWELL CHILD / home only
 */

:root {
	--ait-ink: #111827;
	--ait-muted: #6b7280;
	--ait-line: #e5e7eb;
	--ait-soft: #f6f7f9;
	--ait-accent: #1f4f8a;
	--ait-dark: #0c1320;
	--ait-max: 1180px;
}

/* SWELL HOME RESET */
html,
body.home {
	background: #fff !important;
}

body.home {
	--color_header_bg: #fff;
	--color_header_text: #111827;
}

.home #content {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: #fff !important;
}

.home #content > .l-content,
.home #content .l-content,
.home #content .l-container,
.home #content .l-mainContent,
.home #content .l-mainContent__inner {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.home .l-mainContent {
	float: none !important;
}

/* Header */
.home .l-header {
	background: #fff !important;
	color: var(--ait-ink) !important;
	box-shadow: none !important;
	border-bottom: 1px solid var(--ait-line) !important;
}

.home .l-header__inner {
	max-width: var(--ait-max) !important;
	min-height: 72px !important;
	height: 72px !important;
	margin: 0 auto !important;
	padding-left: 28px !important;
	padding-right: 28px !important;
}

.home .c-headLogo__desc {
	display: none !important;
}

.home .l-header__logo img,
.home .c-headLogo__img {
	max-height: 38px !important;
	width: auto !important;
}

.home .c-gnav > li > a {
	color: var(--ait-ink) !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: .01em;
}

.home .l-header .c-iconBtn,
.home .l-header .c-iconBtn__icon,
.home .l-header a {
	color: var(--ait-ink);
}

/* Front page */
.aitech-home,
.aitech-home * {
	box-sizing: border-box;
}

.aitech-home {
	width: 100%;
	max-width: none;
	margin: 0;
	color: var(--ait-ink);
	background: #fff;
	letter-spacing: .01em;
}

.aitech-home a {
	color: inherit;
	text-decoration: none;
}

.aitech-wrap {
	max-width: var(--ait-max);
	margin: 0 auto;
	padding: 0 28px;
}

.aitech-section {
	padding: 58px 0;
}

.aitech-kicker,
.aitech-eyebrow {
	font-size: 10px;
	letter-spacing: .18em;
	font-weight: 800;
}

.aitech-kicker {
	color: var(--ait-muted);
	margin-bottom: 8px;
}

.aitech-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}

.aitech-section-head h2 {
	margin: 0;
	font-size: 27px;
	line-height: 1.35;
	letter-spacing: .01em;
}

.aitech-more {
	font-size: 12px;
	font-weight: 700;
	padding-bottom: 3px;
	border-bottom: 1px solid #9ca3af;
}

/* Hero */
.aitech-hero {
	width: 100%;
	margin: 0;
	background: var(--ait-dark);
	color: #fff;
	overflow: hidden;
}

.aitech-hero__inner {
	max-width: var(--ait-max);
	min-height: 310px;
	margin: 0 auto;
	padding: 38px 28px;
	display: grid;
	grid-template-columns: 1.08fr .92fr;
	align-items: center;
	gap: 56px;
}

.aitech-eyebrow {
	opacity: .62;
	margin: 0 0 14px;
}

.aitech-hero h1 {
	max-width: 600px;
	color: #fff;
	font-size: clamp(38px, 3.15vw, 49px);
	line-height: 1.18;
	margin: 0 0 14px;
	letter-spacing: .01em;
}

.aitech-hero__lead {
	max-width: 610px;
	margin: 0;
	font-size: 13.5px;
	line-height: 1.9;
	color: #ccd4df;
}

.aitech-actions {
	display: flex;
	gap: 10px;
	margin-top: 21px;
}

.aitech-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 17px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	transition: opacity .18s ease, transform .18s ease;
}

.aitech-btn:hover {
	opacity: .84;
	transform: translateY(-1px);
}

.aitech-btn--light {
	background: #fff;
	color: var(--ait-ink) !important;
}

.aitech-btn--ghost {
	border: 1px solid rgba(255,255,255,.28);
	color: #fff !important;
}

.aitech-btn--dark {
	background: var(--ait-ink);
	color: #fff !important;
}

.aitech-btn--outline {
	border: 1px solid #d6dae0;
	background: #fff;
	color: var(--ait-ink) !important;
}

.aitech-hero__art {
	height: 190px;
	border: 1px solid rgba(255,255,255,.16);
	border-radius: 15px;
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #172338, #0d1624);
}

.aitech-hero__art--image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aitech-hero__art--image:after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(12,19,32,.12), rgba(12,19,32,0));
	pointer-events: none;
}

.aitech-hero__art--placeholder:before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
	background-size: 28px 28px;
	transform: perspective(500px) rotateX(58deg) scale(1.35);
	transform-origin: center 65%;
	opacity: .65;
}

.aitech-hero__art--placeholder:after {
	content: "";
	position: absolute;
	width: 70%;
	height: 58%;
	left: 14%;
	top: 20%;
	border: 2px solid rgba(138,185,255,.42);
	border-radius: 2px;
	clip-path: polygon(0 28%,38% 28%,38% 0,72% 0,72% 43%,100% 43%,100% 100%,16% 100%,16% 65%,0 65%);
}

.aitech-hero__art--placeholder span {
	position: absolute;
	right: 16px;
	bottom: 14px;
	color: #7f8da3;
	font-size: 9px;
	letter-spacing: .16em;
	z-index: 1;
}

/* Latest */
.aitech-latest {
	padding-top: 42px;
	padding-bottom: 52px;
}

.aitech-post-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}

.aitech-post-card {
	min-width: 0;
}

.aitech-thumb {
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: #edf0f3;
	overflow: hidden;
	position: relative;
}

.aitech-thumb img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform .28s ease;
}

.aitech-post-card:hover .aitech-thumb img {
	transform: scale(1.025);
}

.aitech-thumb__placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(31,79,138,.07), rgba(17,24,39,.04));
}

.aitech-thumb__placeholder i {
	position: absolute;
	left: 18px;
	right: 18px;
	height: 1px;
	background: #b9c0ca;
	opacity: .75;
}

.aitech-thumb__placeholder i:nth-child(1) { top: 31%; }
.aitech-thumb__placeholder i:nth-child(2) { top: 46%; width: 58%; }
.aitech-thumb__placeholder i:nth-child(3) { top: 61%; width: 74%; }

.aitech-meta {
	display: flex;
	gap: 9px;
	align-items: center;
	margin-top: 12px;
	font-size: 10px;
	color: var(--ait-muted);
}

.aitech-cat {
	color: var(--ait-accent);
	font-weight: 800;
}

.aitech-post-card h3 {
	font-size: 14px;
	line-height: 1.6;
	margin: 7px 0 0;
	/* 720 は可変フォント前提。SWELL の標準フォントでは 700 に丸められ意図が効かないため 700 に固定。 */
	font-weight: 700;
}

/* Topics */
.aitech-topics {
	background: var(--ait-soft);
	border-top: 1px solid #f0f1f3;
	border-bottom: 1px solid #f0f1f3;
}

.aitech-topic-list {
	border-top: 1px solid #d9dde3;
}

.aitech-topic-row {
	display: grid;
	grid-template-columns: 70px 210px 1fr 30px;
	align-items: center;
	gap: 20px;
	padding: 20px 4px;
	border-bottom: 1px solid #d9dde3;
	transition: padding .18s ease, background .18s ease;
}

.aitech-topic-row:hover {
	padding-left: 12px;
	background: #fff;
}

.aitech-num {
	font-size: 11px;
	color: #9aa1ac;
	letter-spacing: .1em;
}

.aitech-topic-row h3 {
	font-size: 18px;
	margin: 0;
}

.aitech-topic-row p {
	margin: 0;
	color: var(--ait-muted);
	font-size: 12.5px;
	line-height: 1.6;
}

.aitech-arrow {
	font-size: 18px;
	text-align: right;
}

/* Popular */
.aitech-popular-grid {
	display: grid;
	grid-template-columns: 1.05fr .95fr;
	gap: 44px;
	align-items: stretch;
}

.aitech-feature {
	border: 1px solid var(--ait-line);
	border-radius: 15px;
	overflow: hidden;
}

.aitech-feature__img {
	height: 205px;
	background: linear-gradient(145deg, #edf1f5, #dfe5eb);
	position: relative;
	overflow: hidden;
}

.aitech-feature__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aitech-feature__img:after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(17,24,39,.22));
	pointer-events: none;
}

.aitech-feature__img > span {
	position: absolute;
	left: 22px;
	bottom: 18px;
	font-size: 9px;
	letter-spacing: .18em;
	color: #fff;
	font-weight: 800;
	z-index: 1;
}

.aitech-feature__body {
	padding: 22px;
}

.aitech-feature__body h3 {
	font-size: 23px;
	line-height: 1.45;
	margin: 7px 0 10px;
}

.aitech-feature__body p {
	font-size: 12.5px;
	line-height: 1.8;
	color: var(--ait-muted);
	margin: 0;
}

.aitech-rank-list {
	border-top: 1px solid var(--ait-line);
}

.aitech-rank {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 14px;
	padding: 17px 0;
	border-bottom: 1px solid var(--ait-line);
}

.aitech-rank b {
	font-size: 20px;
	font-weight: 500;
	color: #a0a6ae;
	font-family: Georgia, serif;
}

.aitech-rank small {
	font-size: 10px;
	color: var(--ait-accent);
	font-weight: 800;
}

.aitech-rank h4 {
	font-size: 13.5px;
	line-height: 1.65;
	margin: 4px 0 0;
}

/* DX */
.aitech-dx {
	background: #0f1724;
	color: #fff;
}

.aitech-dx .aitech-kicker {
	color: #8ea0b8;
}

.aitech-dx .aitech-section-head h2 {
	color: #fff;
}

.aitech-dx .aitech-more {
	color: #fff;
	border-color: #526075;
}

.aitech-dx-intro {
	display: grid;
	grid-template-columns: .8fr 1.2fr;
	gap: 60px;
	align-items: start;
	margin-bottom: 28px;
}

.aitech-dx-intro h3 {
	color: #fff;
	font-size: 24px;
	line-height: 1.5;
	margin: 0;
}

.aitech-dx-intro p {
	margin: 0;
	color: #aeb9c9;
	font-size: 13.5px;
	line-height: 1.9;
}

.aitech-dx-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-top: 1px solid #2b3647;
	border-left: 1px solid #2b3647;
}

.aitech-dx-card {
	padding: 22px;
	min-height: 150px;
	border-right: 1px solid #2b3647;
	border-bottom: 1px solid #2b3647;
}

.aitech-dx-card small {
	color: #7f91ab;
	font-size: 9px;
	letter-spacing: .12em;
}

.aitech-dx-card h3 {
	color: #fff;
	font-size: 16px;
	margin: 18px 0 8px;
}

.aitech-dx-card p {
	color: #96a4b8;
	font-size: 12px;
	line-height: 1.7;
	margin: 0;
}

/* CTA */
.aitech-bottom-cta {
	padding: 40px 0;
	background: #fff;
}

.aitech-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
	padding: 28px 32px;
	border: 1px solid var(--ait-line);
	border-radius: 14px;
}

.aitech-cta h2 {
	margin: 0 0 6px;
	font-size: 20px;
}

.aitech-cta p {
	margin: 0;
	color: var(--ait-muted);
	font-size: 13px;
}

.aitech-cta__links {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

@media (max-width: 900px) {
	.home .l-header__inner {
		height: auto !important;
		min-height: 62px !important;
	}

	.aitech-hero__inner {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.aitech-hero__art {
		height: 170px;
	}

	.aitech-post-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.aitech-topic-row {
		grid-template-columns: 50px 150px 1fr 24px;
	}

	.aitech-popular-grid {
		grid-template-columns: 1fr;
	}

	.aitech-dx-intro {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.aitech-dx-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.aitech-wrap {
		padding: 0 18px;
	}

	.aitech-section {
		padding: 50px 0;
	}

	.aitech-hero__inner {
		padding: 36px 18px;
		min-height: auto;
	}

	.aitech-hero h1 {
		font-size: 33px;
	}

	.aitech-hero__art {
		display: none;
	}

	.aitech-actions {
		flex-wrap: wrap;
	}

	.aitech-post-grid {
		display: flex;
		overflow-x: auto;
		gap: 14px;
		padding-bottom: 8px;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
	}

	.aitech-post-card {
		min-width: 76vw;
		scroll-snap-align: start;
	}

	.aitech-topic-row {
		grid-template-columns: 38px 1fr 24px;
		gap: 12px;
	}

	.aitech-topic-row p {
		grid-column: 2 / 4;
		margin-top: -5px;
	}

	.aitech-dx-grid {
		grid-template-columns: 1fr;
	}

	.aitech-cta {
		align-items: flex-start;
		flex-direction: column;
	}

	.aitech-cta__links {
		width: 100%;
	}

	.aitech-section-head h2 {
		font-size: 24px;
	}
}


/* =========================================================
   V5 refinements based on live-site screenshot
   ========================================================= */

/* Remove SWELL's thin top catchphrase/SNS bar on the home page. */
.home .l-header__bar {
	display: none !important;
}

/* Keep the header compact after the top bar is removed. */
.home .l-header__inner {
	min-height: 68px !important;
	height: 68px !important;
}

/* Turn the company logo into a media identity without replacing the image. */
.home .c-headLogo__link {
	display: inline-flex !important;
	align-items: center !important;
	gap: 11px !important;
	white-space: nowrap;
}

/*
 * ロゴ画像 aitech3.jpg が既に「AITech」のワードマークを含むため、
 * ここで "AITech 建築実務" と出すと AITech が横並びで2回になる。
 * 暫定対応として "建築実務" のみにする（表示は「▨AITech ｜ 建築実務」）。
 *
 * TODO(Phase 1): 案A のロゴ（▨ 建築実務 / by AITech・透過SVG）が用意でき次第、
 *   このブロックごと削除し、サイト名は実DOM（SWELLのサイトタイトル設定）で出力する。
 *   CSS の content: で出した文字は選択・コピー・翻訳ができず、CSS読込失敗時に消えるため。
 */
.home .c-headLogo__link::after {
	content: "建築実務";
	display: inline-block;
	color: #111827;
	font-size: 15px;
	line-height: 1;
	font-weight: 800;
	letter-spacing: .01em;
	padding-left: 11px;
	border-left: 1px solid var(--ait-line);
}

/* Slightly reduce the image logo so the text identity has room. */
.home .l-header__logo img,
.home .c-headLogo__img {
	max-height: 33px !important;
	width: auto !important;
}

/* Keep navigation visually quiet. */
.home .c-gnav {
	align-items: center;
}

.home .c-gnav > li > a {
	padding-left: 11px !important;
	padding-right: 11px !important;
}

.home .c-gnav > li > a::after {
	opacity: .22;
}

/* Hero: exactly two visual lines on normal desktop widths. */
.aitech-hero__inner {
	grid-template-columns: 1.16fr .84fr;
	gap: 52px;
}

.aitech-hero__title span {
	display: block;
}

@media (min-width: 901px) {
	.aitech-hero__title span:first-child {
		white-space: nowrap;
	}
}

/* Slightly tighten hero proportions. */
.aitech-hero h1,
.aitech-hero__title {
	font-size: clamp(39px, 2.9vw, 46px);
	line-height: 1.2;
	margin-bottom: 14px;
}

.aitech-hero__art {
	height: 178px;
}

/* Make article thumbnails a little less dominant. */
.aitech-thumb {
	aspect-ratio: 16 / 8.4;
}

.aitech-post-card h3 {
	font-size: 13.5px;
	line-height: 1.62;
}

/* Refine section rhythm. */
.aitech-latest {
	padding-top: 38px;
	padding-bottom: 48px;
}

.aitech-section-head {
	margin-bottom: 22px;
}

/* Header behaviour on narrower screens. */
@media (max-width: 1120px) {
	.home .c-headLogo__link::after {
		font-size: 13px;
	}

	.home .c-gnav > li > a {
		padding-left: 8px !important;
		padding-right: 8px !important;
		font-size: 11px !important;
	}
}

@media (max-width: 900px) {
	.home .c-headLogo__link::after {
		display: none;
	}

	.aitech-hero__inner {
		grid-template-columns: 1fr;
	}

	.aitech-hero__title span:first-child {
		white-space: normal;
	}
}


/* =========================================================
   V6 — 改善計画書 Phase 0 / Phase 1 の CSS 側対応
   docs/improvement-plan.md の診断番号を各ブロックに記載
   ========================================================= */

/* ---------------------------------------------------------
   [診断 1-5] トップページのサイドバーを非表示にする

   front-page.php は get_footer() を通常どおり呼ぶため、SWELL が
   <aside id="sidebar"> を出力する。本文だけ全幅化されている状態
   （.home #content .l-content{width:100%} / .l-mainContent{float:none}）
   なので、サイドバーが独自デザインの直後に押し出されて表示される。

   中身は「広告 / カテゴリー24件 / 人気記事 / 最近の投稿 / 月別アーカイブ」で、
   トップページの世界観を最も損なっている要素。
   --------------------------------------------------------- */
.home .l-sidebar,
.home #sidebar {
	display: none !important;
}

/* ---------------------------------------------------------
   [診断 1-14] タイポグラフィを日本語向けに底上げ

   全体を小さくした結果、情報密度が上がりすぎて余白が効かず、
   かえって窮屈に見えていた。漢字が潰れる下限（10px以下）を解消する。
   --------------------------------------------------------- */

/* 見出し上のラベル: 10px -> 11px */
.aitech-kicker,
.aitech-eyebrow {
	font-size: 11px;
}

/* ヒーローのリード文: 13.5px -> 15px */
.aitech-hero__lead {
	font-size: 15px;
	line-height: 1.85;
}

/* 記事カードの見出し: 13.5px -> 15px（一覧の主役） */
.aitech-post-card h3 {
	font-size: 15px;
	line-height: 1.6;
}

/* 日付・カテゴリ: 10px -> 12px */
.aitech-meta {
	font-size: 12px;
}

/* 「記事一覧を見る →」等: 12px -> 13px */
.aitech-more {
	font-size: 13px;
}

/* ボタン: 12px -> 13px */
.aitech-btn {
	font-size: 13px;
	min-height: 44px;   /* タップ領域を44px以上に */
	padding: 0 20px;
}

/* テーマ一覧の説明文: 12.5px -> 13.5px */
.aitech-topic-row p {
	font-size: 13.5px;
}

/* 人気記事 */
.aitech-feature__body p { font-size: 14px; }

/*
 * フィーチャー画像のラベルは英大文字前提で letter-spacing:.18em が入っていた。
 * 実カテゴリ名（日本語）を出すよう front-page.php を変更したため字間を詰める。
 */
.aitech-feature__img > span {
	font-size: 11px;
	letter-spacing: .04em;
}
.aitech-rank small { font-size: 11px; }
.aitech-rank h4 { font-size: 14.5px; }

/* DXセクション */
.aitech-dx-intro p { font-size: 15px; }
.aitech-dx-card small { font-size: 11px; }
.aitech-dx-card p { font-size: 13px; }

/* 下部CTA */
.aitech-cta p { font-size: 14px; }

/* グローバルナビ: 12px -> 13px */
.home .c-gnav > li > a {
	font-size: 13px !important;
}

@media (max-width: 1120px) {
	/* 上の @media(max-width:1120px) が 11px !important を指定しているため再宣言 */
	.home .c-gnav > li > a {
		font-size: 12px !important;
	}
}

/* ---------------------------------------------------------
   [診断 1-1 / 計画書 Phase 0-2] グローバルナビの CTA ボタン

   現状、問い合わせページへの正しい入口がナビに存在せず、
   唯一のリンクが「法規・制度」というラベルの下に隠れている。

   使い方: 外観 > メニュー でメニュー項目「資料請求・お問い合わせ」を追加し、
          「CSS class」欄に nav-cta と入力する。
          （CSS class 欄が出ていない場合は、画面右上「表示オプション」で有効化）

   注意: このファイルはトップページでしか読み込まれないため、
        下層ページにも出すには assets/css/aitech-base.css を
        functions.php で全ページに読み込む必要がある（Phase 3）。
   --------------------------------------------------------- */
.home .c-gnav > li.nav-cta {
	margin-left: 8px;
}

.home .c-gnav > li.nav-cta > a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 18px !important;
	border-radius: 999px;
	background: var(--ait-accent);
	color: #fff !important;
	font-weight: 700;
	transition: opacity .18s ease, transform .18s ease;
}

.home .c-gnav > li.nav-cta > a:hover {
	opacity: .88;
	transform: translateY(-1px);
}

/* SWELL がナビ項目に付ける下線・区切りをCTAだけ無効化 */
.home .c-gnav > li.nav-cta > a::after {
	display: none !important;
}

/* ---------------------------------------------------------
   [計画書 5-2] ヒーローの主CTAを目立たせる

   主CTA（資料ダウンロード）と副CTA（記事を読む）の視覚的な差をつける。
   .aitech-btn--light は白背景で既に十分目立つため、
   主CTAには専用クラス .aitech-btn--primary を用意する。
   --------------------------------------------------------- */
.aitech-btn--primary {
	background: #fff;
	color: var(--ait-ink) !important;
	font-weight: 800;
	box-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}

@media (max-width: 560px) {
	/* SPではCTAを縦積みして全幅に（タップしやすさ優先） */
	.aitech-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.aitech-actions .aitech-btn {
		width: 100%;
	}
}
