/* Stage546: mobile footer links use two fixed rows and horizontally scrollable columns. */
@media screen and (max-width: 767px) {
	#js-footer-widget .menu {
		display: grid !important;
		grid-template-rows: repeat(2, 44px) !important;
		grid-template-columns: none !important;
		grid-auto-flow: column !important;
		grid-auto-columns: minmax(220px, 76vw) !important;
		gap: 7px !important;
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 2px 18vw 8px 0 !important;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		overscroll-behavior-inline: contain;
		scroll-snap-type: x proximity;
		scroll-padding-left: 0;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	#js-footer-widget .menu > li,
	#js-footer-widget .menu > li[data-happyell-footer-wide="1"] {
		grid-column: auto !important;
		box-sizing: border-box !important;
		width: auto !important;
		min-width: 0 !important;
		height: 44px !important;
		margin: 0 !important;
		padding: 0 !important;
		scroll-snap-align: start;
	}

	#js-footer-widget .menu > li > a {
		display: flex !important;
		box-sizing: border-box !important;
		width: 100% !important;
		height: 44px !important;
		min-height: 44px !important;
		padding: 8px 12px !important;
		align-items: center !important;
		white-space: nowrap !important;
		overflow: hidden !important;
	}

	#js-footer-widget .happyell-footer-link-label {
		display: block;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

/*
 * Stage551: the live smartphone footer is a Custom HTML widget, not a menu.
 * The server-side mobile class keeps this behavior in both portrait and
 * landscape, including landscape widths wider than 767px.
 */
.l-footer.happyell-mobile-footer #js-footer-widget .textwidget,
.l-footer.happyell-mobile-footer #js-footer-widget .textwidget p {
	display: block !important;
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0 !important;
	line-height: 0 !important;
	overflow: visible !important;
}

.l-footer.happyell-mobile-footer #js-footer-widget .happyell-footer-scroll-links,
.l-footer.happyell-mobile-footer #js-footer-widget .menu {
	display: grid !important;
	grid-template-rows: repeat(2, 44px) !important;
	grid-template-columns: none !important;
	grid-auto-flow: column !important;
	grid-auto-columns: clamp(220px, 76vw, 360px) !important;
	gap: 7px !important;
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 2px 48px 8px 0 !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x proximity;
	scroll-padding-left: 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	touch-action: pan-x pan-y;
}

.l-footer.happyell-mobile-footer #js-footer-widget .menu > li,
.l-footer.happyell-mobile-footer #js-footer-widget .menu > li[data-happyell-footer-wide="1"] {
	grid-column: auto !important;
	box-sizing: border-box !important;
	width: auto !important;
	min-width: 0 !important;
	height: 44px !important;
	margin: 0 !important;
	padding: 0 !important;
	scroll-snap-align: start;
}

.l-footer.happyell-mobile-footer #js-footer-widget .happyell-footer-scroll-links > a,
.l-footer.happyell-mobile-footer #js-footer-widget .menu > li > a {
	display: flex !important;
	box-sizing: border-box !important;
	width: 100% !important;
	height: 44px !important;
	min-width: 0 !important;
	min-height: 44px !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 8px 12px !important;
	align-items: center !important;
	justify-content: space-between !important;
	border-radius: 9px !important;
	font-size: 12px !important;
	line-height: 1.25 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	scroll-snap-align: start;
}

.l-footer.happyell-mobile-footer #js-footer-widget .happyell-footer-scroll-links > a::after,
.l-footer.happyell-mobile-footer #js-footer-widget .menu > li > a::after {
	flex: 0 0 auto;
	margin-left: 6px;
}

.l-footer.happyell-mobile-footer #js-footer-widget .happyell-footer-link-label {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Stage546: compact mobile guide to the next two article sections. */
.happyell-next-section-nav {
	display: none;
}

@media screen and (max-width: 767px) and (orientation: portrait) {
	.happyell-next-section-nav.is-visible {
		position: fixed;
		top: var(--happyell-next-section-nav-top, 0px);
		left: 0;
		z-index: 992;
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) minmax(0, .9fr) 40px;
		box-sizing: border-box;
		width: 100%;
		min-height: 48px;
		padding: 4px 4px 4px 8px;
		align-items: stretch;
		gap: 4px;
		border-bottom: 1px solid #efdce3;
		background: rgba(255, 255, 255, .98);
		box-shadow: 0 4px 14px rgba(20, 38, 64, .12);
		backdrop-filter: blur(8px);
	}

	.happyell-next-section-nav__lead {
		display: flex;
		align-items: center;
		padding: 0 3px;
		color: #8d244b;
		font-size: 11px;
		font-weight: 800;
		line-height: 1;
		text-transform: uppercase;
	}

	.happyell-next-section-nav__link {
		display: flex;
		min-width: 0;
		padding: 6px 8px;
		align-items: center;
		border: 1px solid #ebd7df;
		border-radius: 8px;
		background: #fff7fa;
		color: #4a2633 !important;
		font-size: 12px;
		font-weight: 700;
		line-height: 1.25;
		text-decoration: none !important;
	}

	.happyell-next-section-nav__link span {
		display: block;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.happyell-next-section-nav__link[hidden] {
		display: none !important;
	}

	.happyell-next-section-nav__close {
		display: grid;
		width: 40px;
		min-width: 40px;
		min-height: 40px;
		margin: 0;
		padding: 0;
		place-items: center;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: #704252;
		font-size: 24px;
		line-height: 1;
		cursor: pointer;
	}

	html.happyell-next-section-nav-active #happyell-rtoc-return {
		display: none !important;
	}

	#ninkiranking,
	#happyell-article-video-ranking,
	[data-happyell-latest-video-strip="article"],
	#happyell-event-video-ranking,
	[data-happyell-latest-video-strip="event"],
	#jya-kansai,
	#happyell-event-ranking,
	#happyell-event-genre-picker,
	.happyell-usj-footer-nav,
	.p-entry__body h2[id],
	.p-entry__body h3[id] {
		scroll-margin-top: calc(var(--happyell-next-section-nav-top, 0px) + 58px);
	}
}

@media print, screen and (min-width: 768px), screen and (max-width: 767px) and (orientation: landscape) {
	.happyell-next-section-nav {
		display: none !important;
	}
}
