/* GBM Custom Styles */

/* --- Sticky Header --- */
.gbm-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--light);
}

/* --- Logo --- */
.gbm-logo-link {
	display: inline-block;
	line-height: 0;
}

.gbm-logo {
	height: 40px;
	width: auto;
	display: block;
}

.gbm-footer-logo {
	height: 36px;
	width: auto;
	display: block;
	margin-bottom: 0.75em;
}

@media (max-width: 781px) {
	.gbm-logo {
		height: 32px;
	}

	.gbm-footer-logo {
		height: 24px;
	}
}

/* --- Post Meta --- */
.gbm-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	align-items: center;
	font-size: var(--wp--preset--font-size--meta);
	color: var(--wp--preset--color--gray);
}

.gbm-post-meta a {
	color: var(--wp--preset--color--gray);
	text-decoration: none;
}

.gbm-post-meta a:hover {
	color: var(--wp--preset--color--black);
}

.gbm-reading-time {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--gray);
}

/* --- Hero Section --- */
.gbm-hero .wp-block-columns {
	flex-wrap: nowrap;
	align-items: center;
}

.gbm-hero__thumb {
	flex-shrink: 0;
}

.gbm-hero__thumb .wp-block-post-featured-image {
	aspect-ratio: 16/9;
	overflow: hidden;
	width: 100%;
}

.gbm-hero__thumb .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gbm-hero__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

@media (max-width: 781px) {
	.gbm-hero .wp-block-columns {
		flex-wrap: wrap;
	}

	.gbm-hero__thumb {
		flex-basis: 100% !important;
		max-width: 100%;
		margin-bottom: 1.5em;
	}

	.gbm-hero__body {
		flex-basis: 100% !important;
	}
}

/* --- Post Grid --- */
.gbm-post-grid {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* --- Compact List --- */
.gbm-compact-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.gbm-compact-list li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.75em 0;
	border-bottom: 1px solid var(--wp--preset--color--light);
}

.gbm-compact-list li:last-child {
	border-bottom: none;
}

.gbm-compact-list a {
	text-decoration: none;
	color: var(--wp--preset--color--dark);
}

.gbm-compact-list a:hover {
	color: var(--wp--preset--color--black);
}

/* --- Source Citation --- */
.gbm-source-citation {
	border: 1px solid var(--wp--preset--color--light);
	padding: var(--wp--preset--spacing--30);
	margin: var(--wp--preset--spacing--50) 0;
}

.gbm-source-citation__title {
	font-size: var(--wp--preset--font-size--meta);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--gray);
	margin-bottom: var(--wp--preset--spacing--20);
}

/* --- Newsletter CTA --- */
.gbm-newsletter {
	background: var(--wp--preset--color--off-white);
	border-top: 1px solid var(--wp--preset--color--light);
	border-bottom: 1px solid var(--wp--preset--color--light);
	text-align: center;
}

.gbm-newsletter input[type="email"] {
	border: 1px solid var(--wp--preset--color--light);
	padding: 0.5em 1em;
	font-size: 1rem;
	font-family: var(--wp--preset--font-family--body);
	width: 100%;
	max-width: 320px;
}

.gbm-newsletter button {
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	border: none;
	padding: 0.5em 1.5em;
	font-size: 1rem;
	font-family: var(--wp--preset--font-family--body);
	cursor: pointer;
}

.gbm-newsletter button:hover {
	background: var(--wp--preset--color--graphite);
}

/* --- Category Nav --- */
.gbm-category-nav {
	display: flex;
	gap: 1.5em;
	list-style: none;
	padding: 0;
	margin: 0;
}

.gbm-category-nav a {
	text-decoration: none;
	color: var(--wp--preset--color--graphite);
	font-size: var(--wp--preset--font-size--small);
}

.gbm-category-nav a:hover,
.gbm-category-nav a[aria-current="page"] {
	color: var(--wp--preset--color--black);
	border-bottom: 2px solid var(--wp--preset--color--black);
	padding-bottom: 0.25em;
}

/* --- Skip Link --- */
.skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 999;
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	padding: 0.5em 1em;
}

.skip-link:focus {
	position: fixed;
	top: 0;
	left: 0;
	width: auto;
	height: auto;
}

/* --- Mobile Navigation Overlay --- */
.gbm-mobile-menu {
	display: none;
}

@media (max-width: 781px) {
	.gbm-desktop-nav {
		display: none;
	}

	.gbm-mobile-toggle {
		display: block;
		background: none;
		border: none;
		cursor: pointer;
		padding: 0.5em;
	}

	.gbm-mobile-menu.is-open {
		display: flex;
		flex-direction: column;
		position: fixed;
		inset: 0;
		z-index: 200;
		background: var(--wp--preset--color--white);
		padding: var(--wp--preset--spacing--50);
		align-items: center;
		justify-content: center;
		gap: 1.5em;
	}

	.gbm-mobile-menu a {
		font-size: var(--wp--preset--font-size--large);
		text-decoration: none;
		color: var(--wp--preset--color--black);
	}
}

@media (min-width: 782px) {
	.gbm-mobile-toggle {
		display: none;
	}
}

/* ============================================
   記事コンテンツ — Post Content Styles
   ============================================ */

/* --- H2 見出し: 報道メディアらしい力強いスタイル --- */
.entry-content h2,
.wp-block-post-content h2 {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: clamp(1.375rem, 2.5vw, 1.75rem);
	line-height: 1.3;
	color: var(--wp--preset--color--black);
	margin-top: 3.5rem;
	margin-bottom: 1.5rem;
	padding-bottom: 0.6em;
	border-bottom: 2px solid var(--wp--preset--color--black);
}

/* --- H3 小見出し --- */
.entry-content h3,
.wp-block-post-content h3 {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: clamp(1.125rem, 2vw, 1.375rem);
	line-height: 1.4;
	color: var(--wp--preset--color--black);
	margin-top: 2.5rem;
	margin-bottom: 1rem;
	padding-left: 0.75em;
	border-left: 3px solid var(--wp--preset--color--black);
}

/* --- H4 --- */
.entry-content h4,
.wp-block-post-content h4 {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--dark);
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}

/* --- 本文段落のセクション間余白 --- */
.entry-content > *,
.wp-block-post-content > * {
	margin-bottom: 1.5em;
}

.entry-content > * + h2,
.wp-block-post-content > * + h2 {
	margin-top: 4rem;
}

.entry-content > * + h3,
.wp-block-post-content > * + h3 {
	margin-top: 3rem;
}

/* ============================================
   「30秒で読めるポイント」キャッチボックス
   ============================================ */

/* 最初のH2直後のリストをキャッチボックス化 */
.entry-content > h2:first-of-type,
.wp-block-post-content > h2:first-of-type {
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	font-size: 1.125rem;
	letter-spacing: 0.05em;
	padding: 0.75em 1em;
	margin-top: 2.5rem;
	margin-bottom: 0;
	border-bottom: none;
}

.entry-content > h2:first-of-type + ul,
.entry-content > h2:first-of-type + .wp-block-list,
.wp-block-post-content > h2:first-of-type + ul,
.wp-block-post-content > h2:first-of-type + .wp-block-list {
	background: var(--wp--preset--color--off-white);
	border: 1px solid var(--wp--preset--color--light);
	border-top: none;
	padding: 1.5em 1.5em 1.5em 2.5em;
	margin-top: 0;
	margin-bottom: 2.5rem;
}

.entry-content > h2:first-of-type + ul li,
.entry-content > h2:first-of-type + .wp-block-list li,
.wp-block-post-content > h2:first-of-type + ul li,
.wp-block-post-content > h2:first-of-type + .wp-block-list li {
	padding: 0.4em 0;
	line-height: 1.7;
	color: var(--wp--preset--color--dark);
}

/* ============================================
   リスト — 箇条書き (ul)
   ============================================ */
.entry-content ul,
.wp-block-post-content ul {
	list-style: none;
	padding-left: 1.25em;
	margin-bottom: 1.5em;
}

.entry-content ul > li,
.wp-block-post-content ul > li {
	position: relative;
	padding: 0.35em 0 0.35em 0;
	line-height: 1.8;
	color: var(--wp--preset--color--dark);
}

.entry-content ul > li::before,
.wp-block-post-content ul > li::before {
	content: "";
	position: absolute;
	left: -1.25em;
	top: 0.85em;
	width: 6px;
	height: 6px;
	background: var(--wp--preset--color--black);
}

/* ============================================
   リスト — 番号付き (ol)
   ============================================ */
.entry-content ol,
.wp-block-post-content ol {
	list-style: none;
	padding-left: 0;
	counter-reset: gbm-counter;
	margin-bottom: 1.5em;
}

.entry-content ol > li,
.wp-block-post-content ol > li {
	position: relative;
	padding: 0.6em 0 0.6em 2.5em;
	line-height: 1.8;
	color: var(--wp--preset--color--dark);
	counter-increment: gbm-counter;
	border-bottom: 1px solid var(--wp--preset--color--light);
}

.entry-content ol > li:last-child,
.wp-block-post-content ol > li:last-child {
	border-bottom: none;
}

.entry-content ol > li::before,
.wp-block-post-content ol > li::before {
	content: counter(gbm-counter);
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 1.6em;
	height: 1.6em;
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 0.8125rem;
	line-height: 1.6em;
	text-align: center;
}

/* ============================================
   テーブル
   ============================================ */
.entry-content table,
.wp-block-post-content table,
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	margin: 2em 0;
	font-size: 0.9375rem;
}

.entry-content table th,
.wp-block-post-content table th,
.wp-block-table table th {
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.03em;
	text-align: left;
	padding: 0.75em 1em;
	border: none;
}

.entry-content table td,
.wp-block-post-content table td,
.wp-block-table table td {
	padding: 0.75em 1em;
	border-bottom: 1px solid var(--wp--preset--color--light);
	color: var(--wp--preset--color--dark);
	vertical-align: top;
}

.entry-content table tbody tr:hover,
.wp-block-post-content table tbody tr:hover,
.wp-block-table table tbody tr:hover {
	background: var(--wp--preset--color--off-white);
}

/* テーブル内の強調 */
.entry-content table strong,
.wp-block-post-content table strong,
.wp-block-table table strong {
	color: var(--wp--preset--color--black);
}

/* ============================================
   引用 (blockquote)
   ============================================ */
.entry-content blockquote,
.wp-block-post-content blockquote,
.wp-block-quote {
	border-left: 3px solid var(--wp--preset--color--black);
	padding: 1em 1.5em;
	margin: 2em 0;
	background: var(--wp--preset--color--off-white);
}

.entry-content blockquote p,
.wp-block-post-content blockquote p,
.wp-block-quote p {
	font-size: 1rem;
	color: var(--wp--preset--color--graphite);
	line-height: 1.8;
}

/* ============================================
   元ソースボックス
   ============================================ */
.gbm-source-citation {
	border: 1px solid var(--wp--preset--color--light);
	padding: 1.25em 1.5em;
	margin: 3rem 0;
}

.gbm-source-citation__title {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--wp--preset--color--gray);
	margin-bottom: 0.75em;
	font-weight: 700;
}

/* ============================================
   記事カード — 共通レイアウト
   ============================================ */
.gbm-card .wp-block-columns {
	flex-wrap: nowrap;
	align-items: flex-start;
}

.gbm-card__thumb {
	flex-shrink: 0;
	flex-grow: 0;
	max-width: 280px;
	min-width: 200px;
}

.gbm-card__thumb .wp-block-post-featured-image {
	aspect-ratio: 16/9;
	overflow: hidden;
	width: 100%;
}

.gbm-card__thumb .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gbm-card__body {
	flex-grow: 1;
	min-width: 0;
}

.gbm-card__body .wp-block-post-excerpt {
	margin-top: 0;
	margin-bottom: 0.5em;
}

@media (max-width: 781px) {
	.gbm-card .wp-block-columns {
		flex-wrap: wrap;
	}

	.gbm-card__thumb {
		max-width: 100%;
		min-width: 100%;
		flex-basis: 100% !important;
		margin-bottom: 1em;
	}
}

/* ============================================
   関連記事 — グリッド修正
   ============================================ */
.wp-block-query .wp-block-post-template.is-layout-grid {
	gap: 1.5rem;
}

.wp-block-query .wp-block-post-template.is-layout-grid .wp-block-post-featured-image {
	aspect-ratio: 16/9;
	overflow: hidden;
	margin-bottom: 0.5em;
}

.wp-block-query .wp-block-post-template.is-layout-grid .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wp-block-query .wp-block-post-template.is-layout-grid .wp-block-post-title {
	font-size: 1rem !important;
	line-height: 1.4;
	margin: 0.25em 0;
}

/* ============================================
   区切り線（セクション間）
   ============================================ */
.entry-content hr,
.wp-block-post-content hr,
.wp-block-separator {
	border: none;
	border-top: 1px solid var(--wp--preset--color--light);
	margin: 3rem 0;
}

/* ============================================
   記事ヘッダー — タイトル周り
   ============================================ */
.wp-block-post-title {
	letter-spacing: 0.01em;
}

/* single.html の記事タイトル */
.single .wp-block-post-title,
body.single-post .wp-block-post-title {
	font-size: clamp(1.125rem, 2.5vw, 1.375rem);
	line-height: 1.5;
	margin-bottom: 0.5em;
}

/* ============================================
   画像 — レスポンシブ対応
   ============================================ */
img {
	max-width: 100%;
	height: auto;
}

.entry-content img,
.wp-block-post-content img,
.wp-block-image img,
.wp-block-post-featured-image img {
	max-width: 100%;
	height: auto;
	display: block;
}

.entry-content figure,
.wp-block-post-content figure,
.wp-block-image {
	margin: 2.5em 0;
	max-width: 100%;
	overflow: hidden;
}

.wp-block-image.alignwide,
.wp-block-image.alignfull {
	max-width: 100vw;
}

.wp-block-image.alignwide img,
.wp-block-image.alignfull img {
	width: 100%;
	height: auto;
}

/* アイキャッチ画像 */
.wp-block-post-featured-image {
	max-width: 100%;
	overflow: hidden;
}

.wp-block-post-featured-image img {
	width: 100%;
	height: auto;
	object-fit: cover;
}

.entry-content figcaption,
.wp-block-post-content figcaption {
	font-size: 0.75rem;
	color: var(--wp--preset--color--gray);
	margin-top: 0.5em;
	text-align: center;
}

/* テーブルもレスポンシブ化 */
.wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* iframe / embed もレスポンシブ */
.entry-content iframe,
.wp-block-post-content iframe,
.wp-block-embed__wrapper iframe {
	max-width: 100%;
}

.wp-block-embed {
	max-width: 100%;
	overflow: hidden;
}

/* ============================================
   Strong / Bold テキスト
   ============================================ */
.entry-content strong,
.wp-block-post-content strong {
	color: var(--wp--preset--color--black);
	font-weight: 700;
}
