/* ==========================================================================
   晩ごはん食堂 TOPページ：雑誌風レイアウト（v1.80.0〜）
   上から1段ずつ：献立（特集）→ 食材（方眼のノート）→ 季節 → 人気 → カテゴリー＋詳細検索
   recipe-home.css（ヒーロー・リンク・アイコンの色づけなど）の上に重ねて読み込む。
   ========================================================================== */

.bgh-home--top.bgh-mag {
	--bgh-home-w: min(1080px, 100vw);
	--bgh-home-pad: 32px;
	--bgh-accent: #E15B45;
	--bgh-radius: 12px;
	--bgh-line: #d9d3c6;
}

.bgh-mag-sp { display: none; }
.bgh-mag-more--sp { display: none; }

/* ---------- 段 ---------- */
.bgh-mag-sec {
	margin: 104px 0 0;
}

/* ---------- 見出し：明朝＋アクセント色の英字＋右のリンク、左端から細い線 ---------- */
.bgh-mag .bgh-mag-head {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 18px;
	margin: 0 0 40px;
}

.bgh-mag .bgh-mag-head::before {
	content: "";
	position: absolute;
	right: calc(100% + 18px);
	top: 50%;
	width: 50vw;
	height: 1px;
	background: #cfc8bb;
}

.bgh-mag .bgh-mag-head h2 {
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
	font-family: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
	font-weight: 600;
	font-size: 30px !important;
	line-height: 1.25;
	letter-spacing: 0.14em;
	color: #201d19;
	white-space: nowrap;
}

.bgh-mag .bgh-mag-head h2::before,
.bgh-mag .bgh-mag-head h2::after {
	display: none !important;
	content: none !important;
}

.bgh-mag-head__en {
	font-family: "Oswald", "Noto Sans JP", sans-serif;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--bgh-accent);
	padding-bottom: 6px;
}

.bgh-mag-head__link {
	margin-left: auto;
	padding-bottom: 4px;
	font-size: 12.5px;
	letter-spacing: 0.1em;
	color: #201d19 !important;
	text-decoration: none !important;
	border-bottom: 1px solid #201d19;
	white-space: nowrap;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.bgh-mag-head__link span {
	display: inline-block;
	transition: transform 0.2s ease;
}

.bgh-mag .bgh-mag-head__link:hover,
.bgh-mag .bgh-mag-head__link:focus-visible {
	color: var(--bgh-accent) !important;
	border-bottom-color: var(--bgh-accent);
}

.bgh-mag-head__link:hover span {
	transform: translateX(4px);
}

/* ---------- 共通：写真・名前 ---------- */
.bgh-mag a {
	text-decoration: none;
	color: inherit;
}

.bgh-mag-ph {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--bgh-radius);
	background: #f1ede5;
}

.bgh-mag-ph img,
.bgh-mag-feat__ph img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.bgh-mag a:hover .bgh-mag-ph img,
.bgh-mag-feat__ph:hover img {
	transform: scale(1.03);
}

.bgh-mag-noimg {
	display: block;
	width: 100%;
	height: 100%;
	background: #f1ede5;
}

.bgh-mag-ph--wide { aspect-ratio: 16 / 10; }
.bgh-mag-ph--tall { aspect-ratio: 3 / 4; }

.bgh-mag-name {
	display: block;
	margin-top: 12px;
	font-family: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.6;
	letter-spacing: 0.04em;
	color: #201d19;
}

.bgh-mag-more {
	text-align: center;
	margin-top: 32px;
}

/* ---------- 今月のおすすめ献立：特集 ---------- */
.bgh-mag-feat {
	display: grid;
	grid-template-columns: 62% 38%;
	align-items: center;
}

.bgh-mag-feat__ph {
	display: block;
	aspect-ratio: 16 / 10.5;
	border-radius: var(--bgh-radius);
	overflow: hidden;
	background: #f1ede5;
}

.bgh-mag-feat__card {
	position: relative;
	margin-left: -64px;
	padding: 40px 36px;
	background: #fff;
	border-radius: var(--bgh-radius);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.bgh-mag .bgh-mag-feat__tag {
	margin: 0 0 10px !important;
	font-size: 11px;
	letter-spacing: 0.16em;
	color: var(--bgh-accent);
}

.bgh-mag .bgh-mag-feat__title {
	margin: 0 0 14px !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
	font-family: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
	font-weight: 600;
	font-size: 22px !important;
	line-height: 1.6;
	letter-spacing: 0.06em;
}

.bgh-mag .bgh-mag-feat__title::before,
.bgh-mag .bgh-mag-feat__title::after {
	display: none !important;
	content: none !important;
}

.bgh-mag .bgh-mag-feat__intro {
	margin: 0 0 16px !important;
	font-size: 13px;
	line-height: 2;
	color: #5a554e;
}

.bgh-mag .bgh-mag-feat__recipes {
	list-style: none !important;
	margin: 0 0 24px !important;
	padding: 0 !important;
	font-size: 12.5px;
	line-height: 2;
	color: #4a463f;
}

.bgh-mag .bgh-mag-feat__recipes li {
	margin: 0 !important;
	padding: 0 !important;
}

.bgh-mag .bgh-mag-feat__recipes li::before {
	content: "―  ";
	color: #c9c2b4;
	position: static;
	background: none;
	width: auto;
	height: auto;
	border: none;
}

.bgh-mag-minis {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	margin-top: 44px;
}

.bgh-mag-minis .bgh-mag-name {
	font-size: 14px;
}

/* ---------- 食材から探す：方眼のノートの枠（背景は白） ---------- */
.bgh-mag-note {
	background-color: #fff;
	background-image:
		linear-gradient(#ebe6dc 1px, transparent 1px),
		linear-gradient(90deg, #ebe6dc 1px, transparent 1px),
		linear-gradient(#f4f1ea 1px, transparent 1px),
		linear-gradient(90deg, #f4f1ea 1px, transparent 1px);
	background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
	background-position: -1px -1px;
	border: 1px solid #e9e3d8;
	border-radius: var(--bgh-radius);
	padding: 40px 36px 34px;
	box-shadow: 0 10px 30px rgba(90, 70, 40, 0.05);
}

.bgh-mag-ings {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
	gap: 20px 8px;
}

.bgh-mag-ing {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #2b2926;
}

.bgh-mag-ing__icon {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #ece7dd;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #201d19;
	transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.bgh-mag-ing__icon .bgh-genre-icon-svg,
.bgh-mag-ing__icon .bgh-genre-icon-img {
	width: 34px;
	height: 34px;
}

.bgh-mag-ing:hover .bgh-mag-ing__icon {
	color: var(--bgh-accent);
	border-color: var(--bgh-accent);
	transform: translateY(-2px);
}

/* ---------- 季節のレシピ：縦長、名前を上下互い違い ---------- */
/* 4件以下：4列に並べるだけ */
.bgh-mag-scroller--season.is-static {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 26px;
	align-items: start;
}

/* 5件以上：ゆっくり流れ続ける横スクロール（JSで少しずつ送る。マウスを乗せる・触ると止まる） */
.bgh-mag-scroller--season.is-marquee {
	display: flex;
	align-items: flex-start;
	gap: 26px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	scroll-snap-type: none !important;
	/* 左右は欄の外側の余白まで流す */
	margin-left: calc(var(--bgh-home-pad) * -1);
	margin-right: calc(var(--bgh-home-pad) * -1);
	padding: 0 var(--bgh-home-pad);
}

.bgh-mag-scroller--season.is-marquee::-webkit-scrollbar {
	display: none;
}

.bgh-mag-scroller--season.is-marquee > a {
	flex: 0 0 228px;
	scroll-snap-align: none !important;
}

.bgh-mag-season__card {
	display: flex;
	flex-direction: column;
}

.bgh-mag-season__txt {
	display: block;
	padding: 14px 2px 0;
}

.bgh-mag-season__card.is-up .bgh-mag-season__txt {
	padding: 0 2px 14px;
}

.bgh-mag-season__txt .bgh-mag-name {
	margin: 0;
}

.bgh-mag-kind {
	display: block;
	margin-top: 6px;
	font-family: "Oswald", "Noto Sans JP", sans-serif;
	font-size: 10px;
	letter-spacing: 0.28em;
	color: #b3ab9d;
}

.bgh-mag-season__card.is-up .bgh-mag-kind {
	margin: 0 0 6px;
}

/* ---------- 人気レシピ ---------- */
.bgh-mag-num {
	position: absolute;
	left: 16px;
	top: 2px;
	font-family: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
	font-weight: 600;
	font-size: 64px;
	line-height: 1.2;
	color: #fff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
	pointer-events: none;
}

.bgh-mag-pop__top {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}

.bgh-mag-pop__big .bgh-mag-ph {
	aspect-ratio: 4 / 3.3;
}

.bgh-mag-pop__big .bgh-mag-name {
	font-size: 16px;
	margin-top: 14px;
}

.bgh-mag-pop__rest {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 20px;
	margin-top: 40px;
	padding-top: 36px;
	border-top: 1px dotted var(--bgh-line);
}

.bgh-mag-pop__small .bgh-mag-ph {
	aspect-ratio: 1 / 1;
	border-radius: 10px;
}

.bgh-mag-pop__small .bgh-mag-num {
	font-size: 30px;
	left: 10px;
	top: 0;
}

.bgh-mag-pop__small .bgh-mag-name {
	font-size: 12.5px;
	margin-top: 9px;
	line-height: 1.55;
}

/* ---------- カテゴリーから探す＋詳細検索 ---------- */
.bgh-mag-two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 64px;
}

.bgh-mag-two .bgh-mag-head {
	margin-bottom: 32px;
}

.bgh-mag .bgh-mag-two .bgh-mag-head h2 {
	font-size: 24px !important;
}

/* 2つ目の欄は左の線を出さない（1つ目の欄を横切らないように） */
.bgh-mag .bgh-mag-two__col + .bgh-mag-two__col .bgh-mag-head::before {
	display: none;
}

.bgh-mag-cats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px 8px;
}

.bgh-mag-cat__item,
.bgh-mag .bgh-mag-exs li {
	box-sizing: border-box;
	height: 104px;
	border-bottom: 1px dotted var(--bgh-line);
}

.bgh-mag-cat__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 4px 0 10px;
	font-size: 11.5px;
	color: #2b2926;
}

.bgh-mag-cat__icon,
.bgh-mag-ex__icon {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #201d19;
	transition: color 0.2s ease, transform 0.2s ease;
}

.bgh-mag-cat__icon .bgh-genre-icon-svg,
.bgh-mag-cat__icon .bgh-genre-icon-img,
.bgh-mag-ex__icon .bgh-genre-icon-svg,
.bgh-mag-ex__icon .bgh-genre-icon-img {
	width: 38px;
	height: 38px;
}

.bgh-mag-cat__item:hover .bgh-mag-cat__icon,
a.bgh-mag-ex:hover .bgh-mag-ex__icon {
	color: var(--bgh-accent);
	transform: translateY(-2px);
}

.bgh-mag-cat__name,
.bgh-mag-ex__name {
	text-align: center;
	line-height: 1.35;
	max-height: 2.7em;
	overflow: hidden;
}

.bgh-mag .bgh-mag-exs {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.bgh-mag .bgh-mag-exs li {
	margin: 0 0 16px !important;
	padding: 0 !important;
}

.bgh-mag .bgh-mag-exs li::before {
	display: none !important;
}

.bgh-mag-ex {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 14px;
	height: 100%;
	box-sizing: border-box;
	padding: 4px 4px 10px;
	font-size: 11.5px;
	color: #2b2926;
}

.bgh-mag-ex__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 88px;
}

.bgh-mag-ex__x {
	margin-top: 16px;
	font-size: 15px;
	color: #8a847b;
}

/* PC：下の小さい献立を押すと上の特集と入れ替わる */
.bgh-mag-mini {
	cursor: pointer;
}

.bgh-mag-feat.is-swapping .bgh-mag-feat__ph,
.bgh-mag-feat.is-swapping .bgh-mag-feat__card > * {
	opacity: 0;
}

.bgh-mag-feat__ph,
.bgh-mag-feat__card > *,
.bgh-mag-mini .bgh-mag-ph,
.bgh-mag-mini .bgh-mag-name {
	transition: opacity 0.25s ease;
}

.bgh-mag-mini.is-swapping .bgh-mag-ph,
.bgh-mag-mini.is-swapping .bgh-mag-name {
	opacity: 0;
}

/* ---------- 本の紹介・YouTube（[bgh_book_info] / [bgh_youtube_info]）も同じ見出し・幅 ---------- */
.bgh-notice.bgh-mag {
	padding-bottom: 8px;
}

/* 見出しは「カテゴリーから探す」「詳細検索」と同じ大きさ・字間に揃える */
.bgh-mag.bgh-notice .bgh-mag-head h2 {
	font-size: 24px !important;
	letter-spacing: 0.14em !important;
	font-weight: 600 !important;
}

.bgh-mag.bgh-notice .bgh-mag-head h2.is-latin {
	letter-spacing: 0.04em !important;
}

/* PCは見出し右上のリンク、スマホは欄の下のリンク */
.bgh-notice.bgh-mag .bgh-home-more.bgh-mag-more--sp {
	display: none;
}

.bgh-mag-head__badge {
	margin-left: auto;
	padding-bottom: 5px;
}

.bgh-notice.bgh-mag .bgh-notice__lead {
	text-align: left;
	max-width: none;
	margin: -12px 0 32px;
}

.bgh-notice.bgh-mag .bgh-book-page-link {
	margin: -12px 0 36px;
	text-align: left;
}

.bgh-notice.bgh-mag .bgh-book-grid {
	max-width: none;
	gap: 36px 28px;
}

.bgh-notice.bgh-mag .bgh-book-card__cover {
	max-width: 170px;
}

.bgh-notice.bgh-mag .bgh-yt-embed {
	border-radius: var(--bgh-radius);
}

.bgh-notice.bgh-mag .bgh-home-more {
	text-align: center;
	margin-top: 32px;
}

/* ==========================================================================
   タブレット（〜960px）
   ========================================================================== */
@media (max-width: 960px) {
	.bgh-home--top.bgh-mag { --bgh-home-pad: 24px; }
	.bgh-mag-feat { grid-template-columns: 58% 42%; }
	.bgh-mag-feat__card { margin-left: -48px; padding: 30px 26px; }
	.bgh-mag-pop__rest { grid-template-columns: repeat(3, 1fr); }
	.bgh-mag-two { gap: 40px; }
}

/* ==========================================================================
   スマホ（〜680px）
   献立＝写真の上に名前の横スクロール、人気＝1〜4位を2×2、季節＝横スクロール
   ========================================================================== */
@media (max-width: 680px) {
	.bgh-home--top.bgh-mag { --bgh-home-pad: 18px; }

	.bgh-mag-pc { display: none !important; }
	.bgh-mag-sp { display: block; }
	.bgh-mag-more--sp,
	.bgh-notice.bgh-mag .bgh-home-more.bgh-mag-more--sp { display: block; }

	.bgh-mag-sec { margin-top: 60px; }

	.bgh-mag .bgh-mag-head {
		align-items: baseline;
		gap: 10px;
		margin-bottom: 20px;
	}

	.bgh-mag .bgh-mag-head::before,
	.bgh-mag-head__link {
		display: none;
	}

	.bgh-mag .bgh-mag-head h2,
	.bgh-mag .bgh-mag-two .bgh-mag-head h2,
	.bgh-mag.bgh-notice .bgh-mag-head h2 {
		font-size: 21px !important;
		letter-spacing: 0.12em;
	}

	.bgh-mag-head__en {
		font-size: 10px;
		padding-bottom: 0;
	}

	.bgh-mag-head__en,
	.bgh-mag-head__badge {
		white-space: nowrap;
	}

	/* 本の欄：「重版5刷御礼」は見出しの下の行へ */
	.bgh-notice.bgh-mag .bgh-mag-head {
		flex-wrap: wrap;
		row-gap: 8px;
	}

	.bgh-mag-head__badge {
		flex-basis: 100%;
		margin-left: 0;
		font-size: 11px;
		padding-bottom: 0;
	}

	.bgh-notice.bgh-mag .bgh-book-grid {
		gap: 28px 16px;
	}

	.bgh-mag-more { margin-top: 24px; }

	/* 横スクロール（右端は画面の端まで） */
	.bgh-mag-scroller {
		display: flex !important;
		gap: 12px;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		margin-right: calc(var(--bgh-home-pad) * -1);
		padding-right: var(--bgh-home-pad);
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.bgh-mag-scroller::-webkit-scrollbar { display: none; }

	.bgh-mag-scroller > a {
		scroll-snap-align: start;
		min-width: 0;
	}

	/* 献立：写真の上に名前 */
	.bgh-mag-ovcard { flex: 0 0 86%; }
	.bgh-mag-ovcard .bgh-mag-ph { aspect-ratio: 4 / 3.1; }

	.bgh-mag-ov {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		display: block;
		padding: 40px 16px 14px;
		background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
		border-radius: 0 0 var(--bgh-radius) var(--bgh-radius);
		pointer-events: none;
	}

	.bgh-mag-ovcard { position: relative; }

	.bgh-mag-ov__tag {
		display: block;
		font-size: 10px;
		letter-spacing: 0.14em;
		color: #ffd9cf;
	}

	.bgh-mag-ov__name {
		display: block;
		margin-top: 4px;
		font-family: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
		font-weight: 600;
		font-size: 16px;
		line-height: 1.5;
		color: #fff;
		text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
	}

	.bgh-mag-dots {
		display: flex;
		justify-content: center;
		gap: 6px;
		margin-top: 14px;
	}

	.bgh-mag-dots i {
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: #ddd6c9;
		transition: background 0.2s ease;
	}

	.bgh-mag-dots i.is-active { background: var(--bgh-accent); }

	/* 食材：ノートの中に1段4つ */
	.bgh-mag-note { padding: 24px 10px 18px; }

	.bgh-mag-ings {
		grid-template-columns: repeat(4, 1fr);
		gap: 16px 4px;
	}

	.bgh-mag-ing { font-size: 11.5px; gap: 7px; }
	.bgh-mag-ing__icon { width: 54px; height: 54px; }
	.bgh-mag-ing__icon .bgh-genre-icon-svg,
	.bgh-mag-ing__icon .bgh-genre-icon-img { width: 30px; height: 30px; }

	/* 季節：横スクロール */
	.bgh-mag-season__card,
	.bgh-mag-scroller--season.is-marquee > a { flex: 0 0 56%; }
	.bgh-mag-scroller--season.is-marquee { gap: 12px; margin-left: calc(var(--bgh-home-pad) * -1); padding-left: var(--bgh-home-pad); }
	.bgh-mag-season__txt { padding-top: 10px; }
	.bgh-mag-season__card.is-up .bgh-mag-season__txt { padding-bottom: 10px; }
	.bgh-mag-season__txt .bgh-mag-name { font-size: 13.5px; }
	.bgh-mag-kind { font-size: 9.5px; margin-top: 5px; }

	/* 人気：1〜4位を2×2 */
	.bgh-mag-pop__sp {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 18px 12px;
	}

	.bgh-mag-pop__sq .bgh-mag-ph { aspect-ratio: 1 / 1; }
	.bgh-mag-pop__sq .bgh-mag-num { font-size: 34px; left: 10px; }
	.bgh-mag-pop__sq .bgh-mag-name { font-size: 13px; margin-top: 8px; }

	/* カテゴリー・詳細検索：縦に並べる */
	.bgh-mag-two {
		display: block;
	}

	.bgh-mag-two__col + .bgh-mag-two__col { margin-top: 60px; }

	.bgh-mag-cats { gap: 14px 6px; }
	.bgh-mag-cat__icon .bgh-genre-icon-svg,
	.bgh-mag-cat__icon .bgh-genre-icon-img,
	.bgh-mag-ex__icon .bgh-genre-icon-svg,
	.bgh-mag-ex__icon .bgh-genre-icon-img { width: 34px; height: 34px; }

	.bgh-mag-cat__item,
	.bgh-mag .bgh-mag-exs li { height: 96px; }
	.bgh-mag .bgh-mag-exs li { margin-bottom: 14px !important; }
}

@media (prefers-reduced-motion: reduce) {
	.bgh-mag-ph img,
	.bgh-mag-feat__ph img { transition: none; }
}
