/*--------------------------------------------------------------
# Mobile Bottom Navigation
Sticky bottom bar shown only on mobile viewports, with 5 quick
access items (Home, Trending, Cari, Bagikan, Lainnya). The middle
"Cari" item is raised inside a floating circle, sitting above the
bar itself.
--------------------------------------------------------------*/

.pjs-bottom-nav,
.pjs-bn-more-overlay,
.pjs-bn-more-drawer,
.pjs-bn-toast {
	display: none;
}

@media (max-width: 782px) {

	.pjs-bn-more-overlay,
	.pjs-bn-more-drawer,
	.pjs-bn-toast {
		display: block;
	}

	.pjs-bottom-nav {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 100020;
		background: #ffffff;
		box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.08);
		padding-bottom: env(safe-area-inset-bottom, 0);
	}

	/* Reserve space at the very bottom of the page so this fixed
	   bar never covers footer content or floating widgets. */
	body.pjs-has-bottom-nav {
		padding-bottom: var(--pjs-bottom-nav-height, 64px);
	}

	.wp-dark-mode-active .pjs-bottom-nav,
	html[data-theme="dark"] .pjs-bottom-nav {
		background: #14181f;
		box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.35);
	}

	.pjs-bottom-nav-list {
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		list-style: none;
		margin: 0;
		padding: 0 4px;
	}

	.pjs-bottom-nav-list li {
		flex: 1 1 0;
		min-width: 0;
	}

	.pjs-bottom-nav-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
		padding: 8px 2px 10px;
		text-decoration: none !important;
		color: #1a1a1a;
		text-align: center;
		background: none;
		border: 0;
		width: 100%;
		font-family: inherit;
		cursor: pointer;
	}

	.wp-dark-mode-active .pjs-bottom-nav-item,
	html[data-theme="dark"] .pjs-bottom-nav-item {
		color: #f2f2f2;
	}

	.pjs-bottom-nav-item .pjs-bn-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 24px;
		height: 24px;
	}

	.pjs-bottom-nav-item .pjs-bn-icon svg {
		width: 100%;
		height: 100%;
		stroke: currentColor;
	}

	.pjs-bottom-nav-item .pjs-bn-label {
		font-size: 12px;
		line-height: 1.2;
		font-weight: 400;
		white-space: nowrap;
	}

	/* Center "Cari" item: floats above the bar inside a soft halo. */
	.pjs-bottom-nav-item.pjs-bn-primary {
		position: relative;
		padding-top: 0;
	}

	.pjs-bottom-nav-item.pjs-bn-primary::before {
		content: "";
		position: absolute;
		width: 80px;
		height: 80px;
		top: -15px;
		left: 50%;
		transform: translateX(-50%);
		z-index: 2;
		box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);
		border-radius: 50px;
		background: #ffffff;
	}

	.wp-dark-mode-active .pjs-bottom-nav-item.pjs-bn-primary::before,
	html[data-theme="dark"] .pjs-bottom-nav-item.pjs-bn-primary::before {
		background: #14181f;
	}

	.pjs-bottom-nav-item.pjs-bn-primary::after {
		content: "";
		position: absolute;
		width: 60px;
		height: 60px;
		top: -5px;
		left: 50%;
		transform: translateX(-50%);
		background: rgba(0, 0, 0, 0.06);
		border-radius: 50px;
		z-index: 3;
	}

	.wp-dark-mode-active .pjs-bottom-nav-item.pjs-bn-primary::after,
	html[data-theme="dark"] .pjs-bottom-nav-item.pjs-bn-primary::after {
		background: rgba(255, 255, 255, 0.08);
	}

	.pjs-bottom-nav-item.pjs-bn-primary .pjs-bn-icon {
		position: relative;
		z-index: 4;
	}

	.pjs-bottom-nav-item.pjs-bn-primary .pjs-bn-icon svg {
		width: 24px;
		height: 24px;
		stroke: #1a1a1a;
	}

	.wp-dark-mode-active .pjs-bottom-nav-item.pjs-bn-primary .pjs-bn-icon svg,
	html[data-theme="dark"] .pjs-bottom-nav-item.pjs-bn-primary .pjs-bn-icon svg {
		stroke: #f2f2f2;
	}

	.pjs-bottom-nav-item.pjs-bn-primary .pjs-bn-label {
		position: relative;
		z-index: 4;
		color: #f5a623;
		font-weight: 600;
	}

	.pjs-bottom-nav-item.pjs-bn-active {
		color: #e0301e;
	}

	.pjs-bottom-nav-item:active {
		opacity: 0.7;
	}

	/* The theme's global a:hover / a:focus rule (style.css) tints
	   links blue and adds a focus outline; neutralize that here so
	   tapping/hovering any bottom-nav link (icons, labels, share and
	   trending popup links) doesn't change color. */
	#pjs-bottom-nav a:hover,
	#pjs-bottom-nav a:focus,
	#pjs-bottom-nav a:active,
	#pjs-bottom-nav a:visited {
		color: #1a1a1a;
		outline: none;
		text-decoration: none;
	}

	.wp-dark-mode-active #pjs-bottom-nav a:hover,
	.wp-dark-mode-active #pjs-bottom-nav a:focus,
	.wp-dark-mode-active #pjs-bottom-nav a:active,
	.wp-dark-mode-active #pjs-bottom-nav a:visited,
	html[data-theme="dark"] #pjs-bottom-nav a:hover,
	html[data-theme="dark"] #pjs-bottom-nav a:focus,
	html[data-theme="dark"] #pjs-bottom-nav a:active,
	html[data-theme="dark"] #pjs-bottom-nav a:visited {
		color: #f2f2f2;
	}

	/* Shared popup base: full-width strip sitting right above the
	   bar, using a slightly lighter tone than the bar so the two are
	   still visually distinguishable while feeling like one piece.
	   The "Cari", "Bagikan", and "Trending" popups all use this. */
	.pjs-bn-open-toggle {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		transform: translateY(6px);
		margin-bottom: 0;
		background: #f5f5f6;
		border-radius: 0;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
		padding: 14px 16px;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
		z-index: 1;
		max-height: 70vh;
		overflow-y: auto;
	}

	/* Cari popup: pill-shaped search bar, styled after the Aktual
	   theme's mobile search form. */
	#pjs-bn-search-popup *,
	#pjs-bn-search-popup *:focus,
	#pjs-bn-search-popup *:focus-visible,
	#pjs-bn-search-popup *:active {
		outline: none !important;
		box-shadow: none !important;
	}

	.pjs-bn-search-form {
		display: flex;
		align-items: center;
		gap: 4px;
		background: #ffffff;
		border: 1px solid rgba(0, 0, 0, 0.12);
		border-radius: 26px;
		padding: 4px 4px 4px 16px;
		overflow: hidden;
		box-sizing: border-box;
	}

	.wp-dark-mode-active .pjs-bn-search-form,
	html[data-theme="dark"] .pjs-bn-search-form {
		background: transparent;
		border-color: rgba(255, 255, 255, 0.3);
	}

	.pjs-bn-search-form:focus-within {
		border-color: rgba(0, 0, 0, 0.3);
	}

	.wp-dark-mode-active .pjs-bn-search-form:focus-within,
	html[data-theme="dark"] .pjs-bn-search-form:focus-within {
		border-color: rgba(255, 255, 255, 0.5);
	}

	.pjs-bn-search-input {
		flex: 1 1 auto;
		min-width: 0;
		width: 100%;
		background: none;
		height: 34px;
		font-size: 14px;
		color: #1a1a1a;
		-webkit-tap-highlight-color: transparent;
	}

	/* Override the theme's global input[type="text"] border (style.css
	   and theme-dark.css) which otherwise wins over a plain class
	   selector and was the real source of the visible box around the
	   field - not the focus outline. */
	.pjs-bn-search-form .pjs-bn-search-input,
	.pjs-bn-search-form .pjs-bn-search-input:focus {
		border: 0 !important;
		border-width: 0 !important;
		border-style: none !important;
		border-color: transparent !important;
		background-color: transparent !important;
	}

	.pjs-bn-search-input,
	.pjs-bn-search-input:focus,
	.pjs-bn-search-input:focus-visible {
		outline: none !important;
		box-shadow: none !important;
	}

	.pjs-bn-search-input::placeholder {
		color: rgba(26, 26, 26, 0.5);
	}

	.wp-dark-mode-active .pjs-bn-search-input,
	html[data-theme="dark"] .pjs-bn-search-input {
		color: #f2f2f2;
	}

	.wp-dark-mode-active .pjs-bn-search-input::placeholder,
	html[data-theme="dark"] .pjs-bn-search-input::placeholder {
		color: rgba(255, 255, 255, 0.5);
	}

	.pjs-bn-search-submit {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 34px;
		height: 34px;
		min-width: 34px;
		border: 0;
		margin: 0;
		padding: 0;
		background: none;
		color: #1a1a1a;
		cursor: pointer;
		-webkit-appearance: none;
		appearance: none;
		border-radius: 50%;
		-webkit-tap-highlight-color: transparent;
	}

	.pjs-bn-search-submit,
	.pjs-bn-search-submit:focus,
	.pjs-bn-search-submit:focus-visible {
		outline: none !important;
		box-shadow: none !important;
	}

	.wp-dark-mode-active .pjs-bn-search-submit,
	html[data-theme="dark"] .pjs-bn-search-submit {
		color: #f2f2f2;
	}

	.pjs-bn-search-submit svg {
		width: 18px;
		height: 18px;
		flex-shrink: 0;
		pointer-events: none;
	}

	.wp-dark-mode-active .pjs-bn-open-toggle,
	html[data-theme="dark"] .pjs-bn-open-toggle {
		background: #1c212b;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
	}

	.pjs-bn-open-toggle.pjs-bn-open {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(1px);
	}

	.pjs-bn-share-list {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 16px;
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.pjs-bn-share-list li {
		flex: 0 0 auto;
	}

	.pjs-bn-share-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 34px;
		height: 34px;
		border-radius: 50%;
		background: rgba(0, 0, 0, 0.06);
		text-decoration: none !important;
		transition: transform 0.15s ease;
	}

	.wp-dark-mode-active .pjs-bn-share-btn,
	html[data-theme="dark"] .pjs-bn-share-btn {
		background: rgba(255, 255, 255, 0.08);
	}

	.pjs-bn-share-btn:active {
		transform: scale(0.9);
	}

	.pjs-bn-share-btn svg {
		width: 16px;
		height: 16px;
	}

	.pjs-bn-share-copy svg {
		stroke: #6b7280;
	}

	.wp-dark-mode-active .pjs-bn-share-copy svg,
	html[data-theme="dark"] .pjs-bn-share-copy svg {
		stroke: #b7bcc4;
	}

	.pjs-bn-x-icon {
		fill: #1a1a1a;
	}

	.wp-dark-mode-active .pjs-bn-x-icon,
	html[data-theme="dark"] .pjs-bn-x-icon {
		fill: #f2f2f2;
	}

	/* "Link copied" toast/snackbar. */
	.pjs-bn-toast {
		position: fixed;
		left: 50%;
		bottom: calc(var(--pjs-bottom-nav-height, 64px) + 14px);
		transform: translate(-50%, 8px);
		background: #1a1a1a;
		color: #ffffff;
		font-size: 13px;
		font-weight: 600;
		white-space: nowrap;
		padding: 10px 18px;
		border-radius: 30px;
		box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
		z-index: 100030;
	}

	.pjs-bn-toast.pjs-bn-open {
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, 0);
	}

	/* Trending popup: numbered list of top most-viewed posts,
	   styled after the Aktual theme's mobile trending panel - a big
	   bold italic rank number to the left of a bold title. */
	.pjs-bn-trending-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.pjs-bn-trending-item {
		position: relative;
		min-height: 34px;
		padding: 8px 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	}

	.wp-dark-mode-active .pjs-bn-trending-item,
	html[data-theme="dark"] .pjs-bn-trending-item {
		border-bottom-color: rgba(255, 255, 255, 0.08);
	}

	.pjs-bn-trending-item:last-child {
		border-bottom: 0;
	}

	.pjs-bn-trend-rank {
		position: absolute;
		top: 6px;
		left: 0;
		width: 34px;
		font-size: 18px;
		line-height: 1.3;
		font-weight: 700;
		font-style: italic;
		color: rgba(26, 26, 26, 0.35);
	}

	.wp-dark-mode-active .pjs-bn-trend-rank,
	html[data-theme="dark"] .pjs-bn-trend-rank {
		color: rgba(255, 255, 255, 0.35);
	}

	.pjs-bn-trend-title {
		display: block;
		margin-left: 40px;
		font-size: 13px;
		line-height: 1.4;
		font-weight: 700;
		color: #1a1a1a;
		text-decoration: none !important;
	}

	.wp-dark-mode-active .pjs-bn-trend-title,
	html[data-theme="dark"] .pjs-bn-trend-title {
		color: #f2f2f2;
	}

	.pjs-bn-trending-empty {
		margin: 0;
		padding: 10px 0;
		text-align: center;
		font-size: 13px;
		color: rgba(26, 26, 26, 0.5);
	}

	.wp-dark-mode-active .pjs-bn-trending-empty,
	html[data-theme="dark"] .pjs-bn-trending-empty {
		color: rgba(255, 255, 255, 0.5);
	}

	/* "Lainnya" drawer: slides in from the right, ~95% width, showing
	   whatever widgets are placed in the "Mobile Bottom Nav - Lainnya"
	   widget area. Styled after the Aktual theme's mobile sidebar
	   drawer (.area_secondary / .opensidebar). Both the overlay and
	   the drawer stop right above the bottom nav bar so it stays
	   fully visible and usable while the drawer is open. */
	.pjs-bn-more-overlay {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: var(--pjs-bottom-nav-height, 64px);
		background: rgba(0, 0, 0, 0.5);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s ease;
		z-index: 100010;
	}

	.pjs-bn-more-overlay.pjs-bn-open {
		opacity: 1;
		visibility: visible;
	}

	.pjs-bn-more-drawer {
		position: fixed;
		top: 0;
		bottom: var(--pjs-bottom-nav-height, 64px);
		right: 0;
		width: 95%;
		max-width: 380px;
		background: #ffffff;
		box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
		transform: translateX(100%);
		transition: transform 0.3s ease;
		z-index: 100011;
		display: flex;
		flex-direction: column;
	}

	.wp-dark-mode-active .pjs-bn-more-drawer,
	html[data-theme="dark"] .pjs-bn-more-drawer {
		background: #14181f;
	}

	.pjs-bn-more-drawer.pjs-bn-open {
		transform: translateX(0);
	}

	.pjs-bn-more-body {
		flex: 1 1 auto;
		overflow-y: auto;
		padding: 16px;
		-webkit-overflow-scrolling: touch;
	}

	.pjs-bn-more-body .widget {
		margin: 0 0 24px;
		background: none !important;
		border: 0 !important;
		box-shadow: none !important;
		padding: 0 !important;
	}

	.pjs-bn-more-body .widget:last-child {
		margin-bottom: 0;
	}

	.pjs-bn-more-body .widget img,
	.pjs-bn-more-body .widget svg {
		display: block;
		margin-left: auto;
		margin-right: auto;
		max-width: 100%;
		height: auto;
	}

	.pjs-bn-more-body .widget_media_image,
	.pjs-bn-more-body .widget_media_image figure,
	.pjs-bn-more-body .widget_media_image .wp-caption {
		text-align: center;
	}

	.pjs-bn-more-empty {
		margin: 0;
		text-align: center;
		font-size: 13px;
		color: rgba(26, 26, 26, 0.5);
	}

	.wp-dark-mode-active .pjs-bn-more-empty,
	html[data-theme="dark"] .pjs-bn-more-empty {
		color: rgba(255, 255, 255, 0.5);
	}

	body.pjs-bn-more-locked {
		overflow: hidden;
	}
}
