/* ============================================================================
   AVICIENA LAW FIRM — NATIVE ANDROID APK, iOS APP & EXECUTIVE TABLET LAYOUT
   - Native standalone PWA safe-area handling (Notch / Dynamic Island / Home Bar)
   - Native Android Material 3 + iOS Bottom Tab Bar (<= 768px)
   - Executive Tablet (768px – 1080px) multi-column balanced grid choreography
   - Smooth touch targets (>= 44px) & zero horizontal overflow
   ============================================================================ */

/* Global App-Like Touch & Viewport Polish */
html,
body {
	overflow-x: clip;
	-webkit-text-size-adjust: 100%;
}

a,
button {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

/* Native Bottom App Tab Bar — hidden on Desktop & Tablet (> 768px) */
.alf-app-tabbar {
	display: none;
}

/* Install App Button inside Mobile Drawer */
.alf-install-app-btn {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: 8px;
	padding: 11px 14px;
	border-radius: 12px;
	border: 1px solid rgba(143, 0, 8, 0.28);
	background: linear-gradient(135deg, #8F0008 0%, #6D0006 100%);
	color: #FFFFFF !important;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 6px 16px -6px rgba(143, 0, 8, 0.45);
	transition: transform 0.16s ease, opacity 0.16s ease;
}

.alf-install-app-btn.is-available {
	display: inline-flex;
}

.alf-install-app-btn:active {
	transform: scale(0.97);
}

/* iOS Add-to-Home-Screen Mini Sheet */
.alf-ios-install-sheet {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: calc(84px + env(safe-area-inset-bottom, 0px));
	z-index: 1250;
	max-width: 420px;
	margin: 0 auto;
	padding: 16px 18px;
	border-radius: 20px;
	background: rgba(22, 22, 28, 0.96);
	color: #FFFFFF;
	border: 1px solid rgba(255, 255, 255, 0.18);
	box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.alf-ios-install-sheet.is-hidden {
	display: none !important;
}

.alf-ios-install-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.alf-ios-install-head strong {
	font-size: 14px;
	font-weight: 700;
	color: #FFFFFF;
}

.alf-ios-install-close {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.10);
	color: #FFFFFF;
	font-size: 17px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.alf-ios-install-steps {
	margin: 0;
	padding-left: 18px;
	font-size: 12.5px;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.86);
}

/* ============================================================================
   1. EXECUTIVE TABLET LAYOUT (769px – 1080px: iPad Mini / Air / Pro / Galaxy Tab)
   ============================================================================ */
@media (min-width: 769px) and (max-width: 1080px) {
	.wrap {
		padding: 0 28px;
	}

	/* Refined Floating Tablet Top Bar */
	.site-nav {
		top: calc(12px + env(safe-area-inset-top, 0px));
		width: calc(100% - 32px);
		height: 54px;
	}

	.nav-links a {
		padding: 6px 10px;
		font-size: 12px;
	}

	.site-nav .btn-outline {
		padding: 6.5px 13px;
		font-size: 12px;
	}

	/* Portrait Tablet (769px – 900px): 2-Column Clean Navigation Sheet */
	.nav-mobile-sheet {
		top: calc(74px + env(safe-area-inset-top, 0px));
		left: 24px;
		right: 24px;
		padding: 14px 18px;
		border-radius: 22px;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 6px 14px;
	}

	.nav-mobile-sheet > a {
		padding: 11px 12px;
		border-radius: 12px;
		border-bottom: none;
		background: rgba(118, 118, 128, 0.08);
		font-weight: 600;
	}

	.nav-mobile-sheet .mobile-theme-row,
	.nav-mobile-sheet .alf-install-app-btn {
		grid-column: 1 / -1;
	}

	/* Hero Balanced Tablet Framing */
	.hero {
		min-height: auto;
		padding: calc(104px + env(safe-area-inset-top, 0px)) 0 56px;
	}

	.hero-main {
		grid-template-columns: 1fr;
		gap: 34px;
		align-items: center;
	}

	.hero-copy {
		max-width: 680px;
	}

	.hero-title {
		font-size: clamp(32px, 4.6vw, 44px);
	}

	.hero-3d-stage {
		height: 390px;
		max-width: 660px;
		margin: 0 auto;
		width: 100%;
	}

	/* Visi Kami & Partners: Clean 2-Col Overview + 3-Col Partners */
	.about-grid,
	.visi-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 18px !important;
	}

	.partners-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 12px !important;
	}

	/* Strategic Approach 2x2 Grid */
	.services-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 16px !important;
	}

	/* ALF Sidang Simulator Tablet Showcase */
	.nf-billboard {
		grid-template-columns: 1.05fr 0.95fr !important;
		gap: 22px !important;
		padding: 18px !important;
		border-radius: 22px !important;
	}

	/* Services Directory: 2-Column Executive Cards */
	.matrix-cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 14px !important;
	}

	.services-directory-section {
		padding: 20px !important;
		border-radius: 22px !important;
	}

	/* Team Tablet Layout */
	.team-circular-stage-box {
		height: 410px;
	}

	.team-card {
		flex: 0 0 calc(42% - 10px) !important;
	}

	/* Berita Bento Grid: 2-Col Balanced on Tablet */
	.news-bento-top {
		grid-template-columns: 1fr !important;
		gap: 16px !important;
	}

	.news-bento-quad,
	.news-bento-row,
	.news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 14px !important;
	}

	/* YouTube Tablet Showcase */
	.yt-billboard {
		grid-template-columns: 1fr !important;
		gap: 18px !important;
	}

	.yt-card {
		flex: 0 0 calc(40% - 10px) !important;
	}

	/* Footer 2x2 Tablet Grid */
	.footer-top {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 32px 28px !important;
	}

	/* Artikel / Publikasi Hub Tablet */
	.art-picks-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

/* Portrait Tablet (769px – 900px) Simulator Stacked Cinema Card */
@media (min-width: 769px) and (max-width: 900px) {
	.nf-billboard {
		grid-template-columns: 1fr !important;
		gap: 18px !important;
	}

	.sim-media-stage {
		aspect-ratio: 16 / 9;
		min-height: 260px;
	}
}

/* ============================================================================
   2. NATIVE ANDROID APK & iOS APP EXPERIENCE (<= 768px Phones)
   ============================================================================ */
@media (max-width: 768px) {
	body {
		padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
	}

	.wrap {
		padding: 0 16px;
	}

	/* Native Compact Top App Bar (Respects Notch & Status Bar) */
	.site-nav {
		top: calc(10px + env(safe-area-inset-top, 0px));
		width: calc(100% - 20px);
		height: 52px;
		border-radius: 18px;
	}

	.nav-inner {
		padding: 0 10px;
		gap: 8px;
	}

	.brand {
		padding: 3px 9px;
	}

	.brand img {
		height: 23px;
	}

	.nav-links,
	.site-nav .btn-outline {
		display: none !important;
	}

	.nav-toggle {
		display: inline-flex !important;
		width: 36px;
		height: 36px;
		border-radius: 12px;
	}

	/* Native Bottom Sheet Drawer Style for Mobile Menu */
	.nav-mobile-sheet {
		top: calc(68px + env(safe-area-inset-top, 0px));
		left: 10px;
		right: 10px;
		padding: 12px 14px 16px;
		border-radius: 22px;
		max-height: calc(100dvh - 155px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.nav-mobile-sheet > a {
		padding: 12px 10px;
		font-size: 14px;
		border-radius: 12px;
	}

	/* Native Android Material 3 + iOS Bottom Navigation Tab Bar */
	.alf-app-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1120;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		align-items: center;
		padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
		background: rgba(255, 255, 255, 0.92);
		backdrop-filter: blur(14px) saturate(140%);
		-webkit-backdrop-filter: blur(14px) saturate(140%);
		border-top: 1px solid rgba(15, 23, 42, 0.09);
		box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
	}

	html[data-theme="dark"] .alf-app-tabbar {
		background: rgba(15, 17, 24, 0.94);
		border-top-color: rgba(255, 255, 255, 0.10);
		box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.48);
	}

	html[data-theme="glass"] .alf-app-tabbar {
		background: rgba(24, 23, 22, 0.84);
		border-top-color: rgba(255, 255, 255, 0.16);
		box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.42);
	}

	.alf-tab-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 48px;
		padding: 4px 2px;
		text-decoration: none;
		color: #6B7280;
		font-size: 10.5px;
		font-weight: 600;
		letter-spacing: -0.01em;
		transition: color 0.18s ease, transform 0.14s ease;
	}

	.alf-tab-item:active {
		transform: scale(0.92);
	}

	.alf-tab-pill {
		width: 48px;
		height: 28px;
		border-radius: 999px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		transition: background-color 0.2s ease, transform 0.2s ease;
	}

	.alf-tab-pill svg {
		width: 19px;
		height: 19px;
	}

	.alf-tab-item.active {
		color: #8F0008;
	}

	.alf-tab-item.active .alf-tab-pill {
		background: rgba(143, 0, 8, 0.12);
	}

	html[data-theme="dark"] .alf-tab-item,
	html[data-theme="glass"] .alf-tab-item {
		color: rgba(255, 255, 255, 0.64);
	}

	html[data-theme="dark"] .alf-tab-item.active,
	html[data-theme="glass"] .alf-tab-item.active {
		color: #FFFFFF;
	}

	html[data-theme="dark"] .alf-tab-item.active .alf-tab-pill {
		background: rgba(229, 9, 20, 0.28);
	}

	html[data-theme="glass"] .alf-tab-item.active .alf-tab-pill {
		background: rgba(255, 255, 255, 0.20);
	}

	/* Keep Floating Controls & Banners Cleanly Above Bottom App Tab Bar */
	.to-top {
		right: 14px !important;
		bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
		width: 42px;
		height: 42px;
	}

	.alf-cookie-banner {
		left: 12px !important;
		right: 12px !important;
		bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
		width: auto !important;
		padding: 15px 16px;
		border-radius: 18px;
	}

	.art-floating-home {
		right: 12px !important;
		bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Hero Native App Header & Card Stack */
	.hero {
		min-height: auto;
		padding: calc(84px + env(safe-area-inset-top, 0px)) 0 36px;
	}

	.hero-main {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.hero-badge {
		font-size: 10.5px;
		padding: 5px 11px;
	}

	.hero-title {
		font-size: clamp(27px, 7.6vw, 35px);
		line-height: 1.14;
	}

	.hero-side {
		font-size: 14px;
		line-height: 1.55;
	}

	.hero-cta-row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		width: 100%;
	}

	.hero-cta-row .btn {
		width: 100%;
		justify-content: center;
		min-height: 44px;
		padding: 10px 12px;
		font-size: 13px;
		border-radius: 14px;
	}

	.hero-line,
	.hero-cta-row .since {
		grid-column: 1 / -1;
	}

	.hero-3d-stage {
		height: 295px;
		width: 100%;
		margin: 4px auto 0;
	}

	.banner-3d-card,
	.depth-carousel__card {
		left: 50% !important;
		top: 47% !important;
		width: min(320px, calc(100vw - 44px)) !important;
		height: 250px !important;
		border-radius: 18px;
	}

	.banner-card-overlay h3 {
		font-size: 16.5px;
	}

	.banner-card-overlay p {
		font-size: 12px;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.depth-carousel__dots {
		left: 50% !important;
		bottom: 2px;
	}

	/* Sections Spacing */
	.frame,
	.about,
	.services,
	.team,
	.news,
	.yt-section {
		padding: 46px 0 52px !important;
	}

	.section-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		margin-bottom: 20px;
	}

	/* Visi Kami & Partners Mobile App Cards */
	.partners-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 10px !important;
	}

	/* Strategic Approach + Simulator + Directory Mobile App Cards */
	.services-grid {
		grid-template-columns: 1fr !important;
		gap: 12px !important;
	}

	.nf-billboard {
		grid-template-columns: 1fr !important;
		gap: 14px !important;
		padding: 14px !important;
		border-radius: 20px !important;
	}

	.sim-media-stage {
		min-height: 205px !important;
		border-radius: 14px !important;
	}

	.nf-billboard-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		width: 100%;
	}

	.nf-play-btn,
	.nf-info-btn {
		width: 100%;
		justify-content: center;
		min-height: 44px;
		padding: 10px 12px !important;
		font-size: 13px !important;
		border-radius: 13px !important;
	}

	.services-directory-section {
		padding: 16px 14px !important;
		border-radius: 20px !important;
	}

	.services-dir-controls,
	.ios-segmented {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.ios-segmented::-webkit-scrollbar {
		display: none;
	}

	.matrix-cards-grid {
		grid-template-columns: 1fr !important;
		gap: 12px !important;
	}

	/* Team Native App Horizontal Snap Cards */
	.team-circular-stage-box {
		height: 340px !important;
		border-radius: 18px !important;
	}

	.team-slider {
		scroll-padding-left: 16px;
		padding-bottom: 14px;
	}

	.team-card {
		flex: 0 0 80vw !important;
		border-radius: 18px !important;
	}

	/* Berita & Publikasi Native App Feed */
	.news-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.news-bento-top,
	.news-bento-quad,
	.news-bento-row,
	.news-grid {
		grid-template-columns: 1fr !important;
		gap: 12px !important;
	}

	.news-card {
		border-radius: 18px !important;
	}

	/* YouTube Mobile App Rail */
	.yt-billboard {
		grid-template-columns: 1fr !important;
		gap: 14px !important;
		padding: 14px !important;
		border-radius: 20px !important;
	}

	.yt-card {
		flex: 0 0 76vw !important;
		border-radius: 16px !important;
	}

	/* Consultation & Modals -> Native Bottom-Sheet Feel on Phone */
	.ios-modal-backdrop {
		align-items: flex-end !important;
		padding: 0 !important;
	}

	.ios-modal {
		width: 100% !important;
		max-width: 100% !important;
		max-height: 90dvh !important;
		border-radius: 24px 24px 0 0 !important;
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	/* Footer Clean Stack */
	.site-footer {
		padding-top: 40px !important;
	}

	.footer-top {
		grid-template-columns: 1fr !important;
		gap: 26px !important;
		padding-bottom: 30px !important;
	}

	.footer-nl-form {
		flex-direction: column;
	}

	.footer-nl-btn {
		width: 100%;
		min-height: 44px;
	}

	/* Ruang Publikasi (artikel.html) App Bar Polish */
	.art-nav-wrap {
		top: 0;
		padding-top: env(safe-area-inset-top, 0px);
	}

	.art-archive-controls {
		width: 100%;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.art-search-field {
		min-width: 0 !important;
		width: 100% !important;
	}
}

/* Standalone Installed App Mode (Android APK / iOS Home Screen) */
html.is-standalone-app .alf-install-app-btn {
	display: none !important;
}
