/* =========================================================
 * AI用語辞典 — アーカイブページ（/glossary/）専用スタイル
 * ========================================================= */

/* ── ラッパー上マージン
 * --------------------------------------------------------- */
.aind-ga-wrap {
	margin-top: 0;
}


/* ── 1カラム（フル幅）強制
 * このCSSは glossary ページ専用なので body クラス不要。
 * 検索時（?s=）に body クラスが変わっても確実に隠れるよう aside を直接対象にする。
 * --------------------------------------------------------- */
.l-sidebar,
.l-sidebarArea,
aside {
	display: none !important;
}

/* main とその祖先コンテナを横いっぱいに広げる */
.l-mainContent,
.l-mainContent__inner,
.l-contents,
.l-wrap {
	max-width: 100% !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	float: none !important;
}


/* ── ヒーロー（検索エリア）
 * --------------------------------------------------------- */
.aind-ga__hero {
	background: linear-gradient(135deg, #1a2a4a 0%, #2a4a7a 100%);
	border: none;
	border-radius: 0;
	padding: 48px 32px 36px;
	margin-bottom: 40px;
	text-align: center;
}

/* ── ヒーロー見出し
 * --------------------------------------------------------- */
.aind-ga__hero-heading {
	margin-bottom: 28px;
}

.aind-ga__hero-title {
	font-size: 1.6rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.08em;
	margin: 0 0 8px;
}

.aind-ga__hero-subtitle {
	font-size: 0.88rem;
	color: rgba(255, 255, 255, 0.7);
	margin: 0;
	letter-spacing: 0.04em;
}


/* ── 検索フォーム
 * --------------------------------------------------------- */
.aind-ga__search-form {
	max-width: 640px;
	margin: 0 auto;
}

.aind-ga__search-wrap {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 6px;
	padding: 6px 6px 6px 20px;
	gap: 8px;
	border: none;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.aind-ga__search-icon {
	width: 20px;
	height: 20px;
	color: #94a3b8;
	flex-shrink: 0;
}

.aind-ga__search-input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 1rem;
	background: transparent;
	color: #1e293b;
}
.aind-ga__search-input::placeholder {
	color: #94a3b8;
}

/* Chrome の search 入力欄デフォルト「×」ボタンを維持しつつスタイルを整える */
.aind-ga__search-input::-webkit-search-cancel-button {
	cursor: pointer;
}

.aind-ga__search-btn {
	background: #2a52a0;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 10px 28px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}
.aind-ga__search-btn:hover {
	background: #1e4490;
}


/* ── 人気ワード
 * --------------------------------------------------------- */
.aind-ga__popular {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

.aind-ga__popular-label {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.82rem;
	flex-shrink: 0;
}

.aind-ga__popular-chip {
	background: rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 3px;
	padding: 4px 14px;
	font-size: 0.82rem;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.aind-ga__popular-chip:hover {
	background: rgba(255, 255, 255, 0.25);
	border-color: rgba(255, 255, 255, 0.4);
	color: #fff;
	text-decoration: none;
}


/* ── 五十音スティッキーナビ
 * --------------------------------------------------------- */
.aind-ga__nav {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 36px;
}

.aind-ga__nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.aind-ga__nav-list li {
	margin: 0;
	padding: 0;
}

.aind-ga__nav-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	padding: 6px 10px;
	border-radius: 3px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
	color: #5a6a7a;
	background: #f2f4f6;
}
.aind-ga__nav-item:hover {
	background: #4a6888;
	color: #fff;
	text-decoration: none;
}
.aind-ga__nav-item.is-empty {
	color: #c4cdd6;
	background: #f8f9fa;
	pointer-events: none;
	cursor: default;
}
.aind-ga__nav-item.is-active {
	background: #4a6888;
	color: #fff;
}

/* A-Z ナビアイテム */
.aind-ga__nav-item.is-alpha {
	background: #f2f4f6;
	color: #5a6a7a;
}
.aind-ga__nav-item.is-alpha:hover,
.aind-ga__nav-item.is-alpha.is-active {
	background: #4a6888;
	color: #fff;
}
.aind-ga__nav-item.is-alpha.is-empty {
	background: #f8f9fa;
	color: #c4cdd6;
}


/* ── アンカーオフセット用隠しスパン
 *
 * <section> の先頭に置き、IDをこのスパンに移すことで
 * SWELLの「span.offsetTop - headerHeight」計算が sticky nav 分だけ
 * 自動的にずれ、セクション見出しが nav の真下に来る。
 *
 * position: relative + top で span.offsetTop を引き下げ、
 * 後続の <h3> は通常フローのままにする（margin-top では h3 も押し上がる）。
 * --------------------------------------------------------- */
.aind-ga__anchor {
	display: block;
	height: 0;
	visibility: hidden;
	pointer-events: none;
	position: relative;
	/* SWELLの固定ヘッダー(63px) + 余白(16px) ≈ 80px */
	top: -80px;
}


/* ── 用語グループ
 * --------------------------------------------------------- */
.aind-ga__groups {
	display: flex;
	flex-direction: column;
	gap: 36px;
}

.aind-ga__group {
	/* sticky ナビ + ヘッダーを考慮したアンカーオフセット */
	scroll-margin-top: 160px;
}

.aind-ga__group-label {
	display: flex;
	align-items: center;
	gap: 20px;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	color: #2a3444;
	background: none;
	border: none;
	padding: 0;
	margin: 0 0 20px;
	width: 100%;
}
.aind-ga__group-label-text {
	display: inline-block;
	background: #4a6888;
	color: #fff;
	padding: 5px 22px 5px 14px;
	/* 右端をV字にカットしてリボン先端を作る */
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
	flex-shrink: 0;
}

.aind-ga__group-label::after {
	content: '';
	flex: 1;
	height: 1px;
	background: linear-gradient(to right, #b0bcc8 0%, transparent 100%);
}

/* A-Z グループ（同スタイル） */
.aind-ga__group--alpha .aind-ga__group-label {
	color: #2a3444;
}


/* ── 用語タグチップ
 * --------------------------------------------------------- */
.aind-ga__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.aind-ga__tag {
	display: inline-flex;
	align-items: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 2px;
	padding: 7px 16px;
	font-size: 0.9rem;
	color: #334155;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.aind-ga__tag:hover {
	background: #2d5fa0;
	border-color: #2d5fa0;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}


/* ── トップに戻るボタン
 * --------------------------------------------------------- */
.aind-ga__back-top {
	text-align: center;
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid #e8edf4;
}

.aind-ga__back-top-btn {
	display: inline-block;
	color: #2d5fa0;
	font-size: 0.9rem;
	text-decoration: none;
	border: 1px solid #c4d4ec;
	padding: 8px 24px;
	border-radius: 2px;
	transition: background 0.15s, color 0.15s;
}
.aind-ga__back-top-btn:hover {
	background: #2d5fa0;
	color: #fff;
	text-decoration: none;
}


/* ── 検索結果
 * --------------------------------------------------------- */
.aind-ga__results {
	margin-top: 8px;
}

.aind-ga__results-summary {
	font-size: 0.95rem;
	color: #475569;
	padding: 12px 16px;
	background: #f8fafc;
	border-radius: 0;
	margin-bottom: 20px;
}

.aind-ga__results-empty {
	color: #64748b;
	text-align: center;
	padding: 48px 24px;
	background: #f8fafc;
	border-radius: 0;
	font-size: 0.95rem;
}

.aind-ga__results-back {
	margin-top: 28px;
}
.aind-ga__results-back a {
	color: #2d5fa0;
	font-size: 0.9rem;
}


/* ── レスポンシブ
 * --------------------------------------------------------- */
@media (max-width: 768px) {
	.aind-ga__hero {
		padding: 32px 16px 24px;
		border-radius: 0;
		margin-bottom: 28px;
	}

	.aind-ga__hero-title {
		font-size: 1.3rem;
	}

	.aind-ga__search-wrap {
		padding: 6px 6px 6px 14px;
	}

	.aind-ga__search-btn {
		padding: 8px 16px;
		font-size: 0.82rem;
	}

	.aind-ga__nav {
		border-radius: 12px;
		padding: 10px 12px;
	}

	.aind-ga__nav-item {
		min-width: 36px;
		padding: 5px 8px;
		font-size: 0.8rem;
	}

	.aind-ga__group {
		scroll-margin-top: 80px;
	}
}
