/**
 * RedaksiHub Mobile App PWA frontend styles.
 */
:root {
	--rhmapwa-primary: #bf0c49;
	--rhmapwa-bg: #ffffff;
	--rhmapwa-text: #0f172a;
	--rhmapwa-muted: #64748b;
	--rhmapwa-border: rgba(148, 163, 184, .28);
	--rhmapwa-soft: #f8fafc;
	--rhmapwa-shadow: 0 -14px 38px rgba(15, 23, 42, .16);
}

.rhmapwa-bottom-nav,
.rhmapwa-install-banner,
.rhmapwa-sheet,
.rhmapwa-sheet-backdrop {
	display: none;
}

@media (max-width: 782px) {
	body.rhmapwa-enabled {
		padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
		background: var(--rhmapwa-bg);
	}

	body.rhmapwa-install-visible {
		padding-top: 70px;
	}

	body.rhmapwa-enabled .footer,
	body.rhmapwa-enabled footer {
		margin-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
	}

	body.rhmapwa-mediawp header.header {
		box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
		backdrop-filter: saturate(150%) blur(12px);
	}

	body.rhmapwa-mediawp .container {
		max-width: 100%;
	}

	.rhmapwa-install-banner {
		position: fixed;
		left: 12px;
		right: 12px;
		top: calc(8px + env(safe-area-inset-top, 0px));
		z-index: 99996;
		display: grid;
		grid-template-columns: 40px minmax(0, 1fr) auto 28px;
		gap: 10px;
		align-items: center;
		min-height: 58px;
		padding: 9px 10px;
		border: 1px solid rgba(226, 232, 240, .78);
		border-radius: 20px;
		background: rgba(255, 255, 255, .96);
		box-shadow: 0 18px 42px rgba(15, 23, 42, .15);
		backdrop-filter: saturate(170%) blur(18px);
	}

	body.admin-bar .rhmapwa-install-banner {
		top: calc(54px + env(safe-area-inset-top, 0px));
	}

	.rhmapwa-install-banner[hidden] {
		display: none !important;
	}

	.rhmapwa-install-mark {
		width: 40px;
		height: 40px;
		border-radius: 14px;
		background: #fff;
		box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .24);
		overflow: hidden;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.rhmapwa-install-mark img {
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	.rhmapwa-install-text {
		min-width: 0;
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	.rhmapwa-install-text strong {
		font-size: 14px;
		line-height: 1.15;
		color: var(--rhmapwa-text);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.rhmapwa-install-text span {
		font-size: 12px;
		line-height: 1.25;
		color: var(--rhmapwa-muted);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.rhmapwa-install-btn {
		border: 0;
		border-radius: 999px;
		background: var(--rhmapwa-primary);
		color: #fff;
		font-size: 12px;
		font-weight: 800;
		padding: 8px 12px;
		line-height: 1;
		cursor: pointer;
	}

	.rhmapwa-install-x,
	.rhmapwa-sheet-head button {
		border: 0;
		background: transparent;
		color: var(--rhmapwa-muted);
		font-size: 24px;
		line-height: 1;
		cursor: pointer;
		padding: 2px;
	}

	.rhmapwa-bottom-nav {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		z-index: 99992;
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 0;
		align-items: stretch;
		width: 100%;
		min-height: calc(66px + env(safe-area-inset-bottom, 0px));
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
		border: 0;
		border-top: 1px solid rgba(226, 232, 240, .92);
		border-radius: 18px 18px 0 0;
		background: rgba(255, 255, 255, .985);
		box-shadow: 0 -8px 24px rgba(15, 23, 42, .10);
		backdrop-filter: saturate(170%) blur(18px);
		-webkit-backdrop-filter: saturate(170%) blur(18px);
	}

	.rhmapwa-nav-item {
		appearance: none;
		-webkit-appearance: none;
		border: 0 !important;
		background: transparent !important;
		color: var(--rhmapwa-muted);
		text-decoration: none !important;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 54px;
		padding: 5px 2px 4px;
		border-radius: 14px;
		font-family: inherit;
		font-size: 10.5px;
		font-weight: 800;
		line-height: 1.1;
		cursor: pointer;
		box-shadow: none !important;
	}

	.rhmapwa-nav-item svg {
		width: 21px;
		height: 21px;
		display: block;
		flex: 0 0 auto;
	}

	.rhmapwa-nav-item:hover,
	.rhmapwa-nav-item:focus,
	.rhmapwa-nav-item:active {
		color: var(--rhmapwa-primary);
		text-decoration: none !important;
		outline: none;
	}

	.rhmapwa-nav-main {
		position: relative;
		color: var(--rhmapwa-primary) !important;
	}

	.rhmapwa-nav-main svg {
		width: 42px;
		height: 42px;
		padding: 10px;
		border-radius: 999px;
		background: var(--rhmapwa-primary);
		color: #fff;
		box-shadow: 0 8px 18px rgba(191, 12, 73, .26);
	}

	.rhmapwa-nav-main span {
		color: var(--rhmapwa-primary);
		font-weight: 900;
		margin-top: -1px;
	}

	.rhmapwa-sheet-backdrop {
		position: fixed;
		inset: 0;
		z-index: 99994;
		display: block;
		background: rgba(15, 23, 42, .34);
		backdrop-filter: blur(4px);
	}

	.rhmapwa-sheet-backdrop[hidden] {
		display: none !important;
	}

	.rhmapwa-sheet {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99995;
		display: flex;
		flex-direction: column;
		max-height: min(78vh, 620px);
		padding: 10px 16px calc(84px + env(safe-area-inset-bottom, 0px));
		border-radius: 24px 24px 0 0;
		background: #fff;
		box-shadow: 0 -20px 52px rgba(15, 23, 42, .22);
	}

	.rhmapwa-sheet[hidden] {
		display: none !important;
	}

	.rhmapwa-sheet-handle {
		width: 48px;
		height: 5px;
		border-radius: 999px;
		background: #cbd5e1;
		margin: 4px auto 14px;
		flex: 0 0 auto;
	}

	.rhmapwa-sheet-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		margin-bottom: 14px;
		flex: 0 0 auto;
	}

	.rhmapwa-sheet-head strong {
		display: block;
		font-size: 18px;
		line-height: 1.2;
		color: var(--rhmapwa-text);
	}

	.rhmapwa-sheet-head span {
		display: block;
		font-size: 13px;
		line-height: 1.4;
		color: var(--rhmapwa-muted);
		margin-top: 2px;
	}

	.rhmapwa-channel-grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		overflow-y: auto;
		padding-bottom: 8px;
	}

	.rhmapwa-channel-grid a {
		min-width: 0;
		display: grid;
		grid-template-columns: 36px minmax(0, 1fr) auto;
		align-items: center;
		gap: 10px;
		padding: 12px;
		border: 1px solid #e2e8f0;
		border-radius: 18px;
		background: #f8fafc;
		text-decoration: none !important;
		color: var(--rhmapwa-text);
	}

	.rhmapwa-channel-grid a span {
		width: 36px;
		height: 36px;
		border-radius: 13px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background: color-mix(in srgb, var(--rhmapwa-primary) 12%, #ffffff);
		color: var(--rhmapwa-primary);
		font-weight: 900;
		text-transform: uppercase;
	}

	.rhmapwa-channel-grid a strong {
		font-size: 13px;
		line-height: 1.25;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.rhmapwa-channel-grid a small {
		min-width: 26px;
		padding: 3px 7px;
		border-radius: 999px;
		background: #fff;
		color: var(--rhmapwa-muted);
		font-size: 11px;
		font-weight: 800;
		text-align: center;
	}

	@supports (padding: max(0px)) {
		.rhmapwa-bottom-nav {
			padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
		}
	}

	@media (max-width: 360px) {
		.rhmapwa-nav-item {
			font-size: 10px;
		}

		.rhmapwa-nav-item svg {
			width: 20px;
			height: 20px;
		}

		.rhmapwa-nav-main svg {
			width: 39px;
			height: 39px;
		}
	}

}
