/* Frontend styles for imported app posts. Enqueued only on singular
 * posts that carry the _appsapk_package_name meta (see appsapk-importer.php).
 * Inline styles in post_content would have to live without media queries,
 * so the gallery (which needs a fundamentally different layout on
 * mobile vs desktop) lives here. */

/* ── App header — feature graphic / icon + meta strip + CTA ─────────────
 *
 * The image source is the JSON-LD `image` field from Google Play, which
 * is usually the wide feature graphic (1024×500). Some apps emit a
 * square icon instead — `object-fit: contain` keeps both shapes rendering
 * correctly without cropping. The padded background fills the empty
 * space cleanly for either aspect ratio.
 */

.appsapk-app-header {
	margin: 0 0 24px;
	text-align: center;
}

.appsapk-hero-image {
	display: block;
	width: 100%;
	max-width: 480px;
	height: auto;
	max-height: 270px;
	margin: 0 auto 12px;
	border-radius: 14px;
	border: 1px solid #e2e2e2;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	background: #f6f7f9;
	object-fit: contain;
}

.appsapk-hero-meta {
	margin: 0 0 14px;
	font-size: 14px;
	color: #475569;
	line-height: 1.4;
}

@media (max-width: 480px) {
	.appsapk-hero-image {
		max-height: 180px;
		border-radius: 10px;
	}
	.appsapk-hero-meta {
		font-size: 13px;
	}
}

/* ── Screenshot gallery ──────────────────────────────────────────────────
 *
 * Mobile (default, < 1024px): horizontal swipeable strip — matches the
 * Google Play screenshots carousel pattern users already know. Saves
 * vertical real estate; users scroll left/right at their own pace.
 *
 * Desktop (>= 1024px): 5-column grid with portrait aspect-ratio enforced
 * via `aspect-ratio: 9/16; object-fit: cover`. Mixed landscape+portrait
 * captures center-crop to portrait cells so the row looks uniform.
 */

.appsapk-screenshots {
	display: flex;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 0;
	gap: 12px;
	padding: 4px 0 16px;
	margin: 20px 0;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.appsapk-screenshots::-webkit-scrollbar { height: 6px; }
.appsapk-screenshots::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}
.appsapk-screenshots::-webkit-scrollbar-track { background: transparent; }

.appsapk-screenshots img {
	flex: 0 0 auto;
	width: 150px;
	height: auto;
	max-height: 280px;
	border-radius: 10px;
	border: 1px solid #e2e2e2;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
	scroll-snap-align: start;
	display: block;
	background: #f6f7f9;
}

@media (min-width: 600px) {
	.appsapk-screenshots img {
		width: 180px;
		max-height: 340px;
	}
}

@media (min-width: 1024px) {
	.appsapk-screenshots {
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		overflow-x: visible;
		padding: 0;
		scroll-snap-type: none;
	}
	.appsapk-screenshots img {
		width: 100%;
		max-height: none;
		aspect-ratio: 9 / 16;
		object-fit: cover;
	}
}

/* ── Download Now CTA (still inline-styled in HTML so it works without
 *    this CSS, but here we add the polish: hover + active states). */
.appsapk-cta a {
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.appsapk-cta a:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
	background: #017a55 !important;
}
.appsapk-cta a:active {
	transform: translateY(0);
}

/* ── Facts table — mobile horizontal scroll if needed. */
.appsapk-facts {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
}
.appsapk-facts th,
.appsapk-facts td {
	padding: 8px 12px;
	border-bottom: 1px solid #eef0f3;
	text-align: left;
	vertical-align: top;
	font-size: 15px;
}
.appsapk-facts th {
	width: 35%;
	font-weight: 600;
	color: #475569;
	background: #fafbfc;
}
@media (max-width: 480px) {
	.appsapk-facts th { width: 40%; font-size: 14px; }
	.appsapk-facts td { font-size: 14px; }
}
