/**
 * 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, .32);
	--rhmapwa-shadow: 0 -12px 34px rgba(15, 23, 42, .12);
}

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

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

	body.rhmapwa-enabled .footer,
	body.rhmapwa-enabled footer {
		margin-bottom: 72px;
	}

	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-bottom-nav {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		z-index: 99992;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		gap: 4px;
		align-items: center;
		min-height: 64px;
		padding: 8px 8px 7px;
		border: 1px solid var(--rhmapwa-border);
		border-radius: 24px;
		background: rgba(255, 255, 255, .94);
		box-shadow: var(--rhmapwa-shadow);
		backdrop-filter: saturate(170%) blur(18px);
	}

	.rhmapwa-nav-item {
		appearance: none;
		-webkit-appearance: none;
		border: 0;
		background: transparent;
		color: var(--rhmapwa-muted);
		text-decoration: none;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		padding: 6px 2px;
		border-radius: 18px;
		font-family: inherit;
		font-size: 11px;
		font-weight: 700;
		line-height: 1.1;
		cursor: pointer;
	}

	.rhmapwa-nav-item svg {
		width: 22px;
		height: 22px;
		display: block;
	}

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

	.rhmapwa-nav-main {
		position: relative;
		margin-top: -24px;
		color: #fff;
	}

	.rhmapwa-nav-main svg {
		width: 48px;
		height: 48px;
		padding: 12px;
		border-radius: 999px;
		background: var(--rhmapwa-primary);
		box-shadow: 0 10px 24px rgba(191, 12, 73, .34);
	}

	.rhmapwa-nav-main span {
		color: var(--rhmapwa-primary);
	}

	.rhmapwa-install-card {
		position: fixed;
		left: 14px;
		right: 14px;
		bottom: calc(88px + env(safe-area-inset-bottom, 0px));
		z-index: 99993;
		display: grid;
		grid-template-columns: 44px minmax(0, 1fr) auto 28px;
		gap: 10px;
		align-items: center;
		padding: 12px;
		border: 1px solid var(--rhmapwa-border);
		border-radius: 22px;
		background: rgba(255, 255, 255, .96);
		box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
		backdrop-filter: saturate(170%) blur(18px);
	}

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

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

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

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

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

	.rhmapwa-install-copy span {
		font-size: 12px;
		line-height: 1.35;
		color: var(--rhmapwa-muted);
	}

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

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

	.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: block;
		padding: 10px 16px calc(96px + env(safe-area-inset-bottom, 0px));
		border-radius: 28px 28px 0 0;
		background: #fff;
		box-shadow: 0 -24px 70px rgba(15, 23, 42, .22);
	}

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

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

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

	.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;
	}

	.rhmapwa-channel-grid a {
		min-width: 0;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 13px;
		border: 1px solid #e2e8f0;
		border-radius: 18px;
		background: #f8fafc;
		text-decoration: none;
		color: var(--rhmapwa-text);
	}

	.rhmapwa-channel-grid a span {
		width: 34px;
		height: 34px;
		border-radius: 12px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		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;
	}
}
