/* ==========================================================================
   App Marketing V1 by CraftBook Magazine — front-end display
   --------------------------------------------------------------------------
   Everything is scoped under .amv1-pub so it can't leak into the theme and
   the theme can't easily leak in. Apple-adjacent visual language: rounded
   tiles, soft layered depth, system type, generous spacing, one accent.
   Works on Chrome, Firefox, Edge, Safari and the Kindle Fire Silk browser;
   no web fonts are loaded. Light / dark / auto themes; reduced-motion safe.
   ========================================================================== */

.amv1-pub,
.amv1-pub * {
	box-sizing: border-box;
}

.amv1-pub {
	/* Accent is overridden inline from the plugin setting. */
	--amv1-accent: #0a84ff;

	/* Light theme tokens. */
	--amv1-ink: #1d1d1f;
	--amv1-muted: #6e6e73;
	--amv1-line: #e5e5ea;
	--amv1-surface: #ffffff;
	--amv1-surface-2: #f5f5f7;
	--amv1-star: #ffb703;
	--amv1-star-empty: #d5d5da;

	--amv1-radius: 18px;
	--amv1-radius-sm: 12px;
	--amv1-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.07);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
	color: var(--amv1-ink);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	max-width: 100%;
}

/* ----- Theme: dark (explicit) -------------------------------------------- */
.amv1-pub.amv1-theme-dark {
	--amv1-ink: #f5f5f7;
	--amv1-muted: #a1a1a6;
	--amv1-line: #38383c;
	--amv1-surface: #1c1c1e;
	--amv1-surface-2: #2c2c2e;
	--amv1-star-empty: #4a4a4f;
	--amv1-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ----- Theme: auto (follows the device) ---------------------------------- */
@media (prefers-color-scheme: dark) {
	.amv1-pub.amv1-theme-auto {
		--amv1-ink: #f5f5f7;
		--amv1-muted: #a1a1a6;
		--amv1-line: #38383c;
		--amv1-surface: #1c1c1e;
		--amv1-surface-2: #2c2c2e;
		--amv1-star-empty: #4a4a4f;
		--amv1-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
	}
}

/* ----- Shared atoms ------------------------------------------------------- */
.amv1-pub img {
	max-width: 100%;
	height: auto;
	display: block;
}

.amv1-chip {
	display: inline-flex;
	align-items: center;
	background: var(--amv1-surface-2);
	color: var(--amv1-muted);
	border-radius: 999px;
	padding: 4px 11px;
	font-size: 12.5px;
	font-weight: 500;
	white-space: nowrap;
}
.amv1-chip--price {
	color: var(--amv1-ink);
}

.amv1-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--amv1-accent);
	color: #fff;
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
	transition: filter 0.15s ease, transform 0.15s ease;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.amv1-btn:hover,
.amv1-btn:focus-visible {
	color: #fff;
	filter: brightness(0.95);
	transform: translateY(-1px);
}
.amv1-btn-glyph {
	width: 17px;
	height: 17px;
	flex: 0 0 auto;
}

/* ----- Ratings ------------------------------------------------------------ */
.amv1-rating {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--amv1-muted);
}
.amv1-stars {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	line-height: 0;
}
.amv1-stars-base .amv1-star { fill: var(--amv1-star-empty); }
.amv1-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
}
.amv1-stars-fill .amv1-star { fill: var(--amv1-star); }
.amv1-star {
	width: 15px;
	height: 15px;
	display: inline-block;
}
.amv1-rating-num { font-weight: 600; color: var(--amv1-ink); }

/* ----- Screenshot gallery ------------------------------------------------- */
.amv1-gallery {
	margin-top: 16px;
}
.amv1-gallery-track {
	display: flex;
	gap: 12px;
	margin: 0;
	padding: 4px 2px 12px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.amv1-gallery-item {
	margin: 0;
	flex: 0 0 auto;
	scroll-snap-align: start;
}
.amv1-gallery-link {
	display: block;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	outline-offset: 3px;
}
.amv1-gallery-img {
	height: 360px;
	width: auto;
	border-radius: 14px;
	background: var(--amv1-surface-2);
}

/* ===== Card layout ======================================================== */
.amv1-card {
	background: var(--amv1-surface);
	border: 1px solid var(--amv1-line);
	border-radius: var(--amv1-radius);
	box-shadow: var(--amv1-shadow);
	padding: 22px;
	margin: 0 0 1.5em;
}
.amv1-c-head {
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas: "icon main cta";
	gap: 16px;
	align-items: center;
}
.amv1-c-iconwrap { grid-area: icon; }
.amv1-c-headmain { grid-area: main; min-width: 0; }
.amv1-c-cta { grid-area: cta; }
.amv1-c-icon {
	width: 96px;
	height: 96px;
	border-radius: 22px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}
.amv1-c-title {
	margin: 0 0 2px;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--amv1-ink);
}
.amv1-c-dev {
	margin: 0 0 8px;
	color: var(--amv1-accent);
	font-weight: 500;
	font-size: 14px;
}
.amv1-c-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.amv1-c-desc {
	margin-top: 16px;
	color: var(--amv1-ink);
	font-size: 15px;
}
.amv1-c-desc p { margin: 0 0 0.7em; }
.amv1-c-desc p:last-child { margin-bottom: 0; }

/* ===== Banner layout ===================================================== */
.amv1-banner {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--amv1-surface);
	border: 1px solid var(--amv1-line);
	border-radius: var(--amv1-radius);
	box-shadow: var(--amv1-shadow);
	padding: 14px 18px;
	margin: 0 0 1.5em;
}
.amv1-b-icon {
	width: 72px;
	height: 72px;
	border-radius: 17px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}
.amv1-b-main { flex: 1 1 auto; min-width: 0; }
.amv1-b-title {
	margin: 0 0 1px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
}
.amv1-b-dev {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--amv1-accent);
	font-weight: 500;
}
.amv1-b-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.amv1-b-cta { flex: 0 0 auto; }

/* ===== Full layout ======================================================= */
.amv1-full {
	background: var(--amv1-surface);
	border: 1px solid var(--amv1-line);
	border-radius: var(--amv1-radius);
	box-shadow: var(--amv1-shadow);
	padding: 28px;
	margin: 0 0 1.5em;
}
.amv1-f-hero {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 22px;
	align-items: center;
}
.amv1-f-icon {
	width: 132px;
	height: 132px;
	border-radius: 30px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.amv1-f-title {
	margin: 0 0 4px;
	font-size: 28px;
	line-height: 1.15;
	font-weight: 700;
}
.amv1-f-dev {
	margin: 0 0 12px;
	color: var(--amv1-accent);
	font-weight: 500;
	font-size: 15px;
}
.amv1-f-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}
.amv1-f-body { margin-top: 8px; }
.amv1-f-section { margin-top: 26px; }
.amv1-f-h {
	margin: 0 0 10px;
	font-size: 19px;
	font-weight: 700;
}
.amv1-f-desc { font-size: 15px; color: var(--amv1-ink); }
.amv1-f-desc p { margin: 0 0 0.7em; }
.amv1-f-infogrid {
	margin: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	background: var(--amv1-line);
	border: 1px solid var(--amv1-line);
	border-radius: var(--amv1-radius-sm);
	overflow: hidden;
}
.amv1-f-inforow {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	background: var(--amv1-surface);
	padding: 11px 14px;
}
.amv1-f-inforow dt { color: var(--amv1-muted); font-size: 13px; margin: 0; }
.amv1-f-inforow dd { margin: 0; font-size: 13px; font-weight: 600; text-align: right; }

/* ----- Editor-only hint --------------------------------------------------- */
.amv1-note {
	display: inline-block;
	background: #fff7e6;
	border: 1px solid #f5d28a;
	color: #7a5b00;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 13px;
}

/* ----- Lightbox ----------------------------------------------------------- */
.amv1-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.86);
	padding: 4vmin;
	opacity: 0;
	transition: opacity 0.18s ease;
}
.amv1-lightbox.is-open { opacity: 1; }
.amv1-lightbox img {
	max-width: 100%;
	max-height: 92vh;
	width: auto;
	border-radius: 12px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}
.amv1-lb-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.amv1-lb-btn:hover,
.amv1-lb-btn:focus-visible { background: rgba(255, 255, 255, 0.3); }
.amv1-lb-prev { left: 3vmin; }
.amv1-lb-next { right: 3vmin; }
.amv1-lb-close { top: 3vmin; right: 3vmin; transform: none; }

/* ----- Focus visibility (accessibility) ---------------------------------- */
.amv1-pub a:focus-visible,
.amv1-gallery-link:focus-visible,
.amv1-btn:focus-visible,
.amv1-lb-btn:focus-visible {
	outline: 3px solid var(--amv1-accent);
	outline-offset: 2px;
}

/* ----- Responsive --------------------------------------------------------- */
@media (max-width: 600px) {
	.amv1-card { padding: 18px; }
	.amv1-c-head {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"icon main"
			"cta  cta";
		gap: 14px;
	}
	.amv1-c-cta { justify-self: stretch; }
	.amv1-c-cta .amv1-btn { width: 100%; justify-content: center; }
	.amv1-c-icon { width: 72px; height: 72px; border-radius: 17px; }
	.amv1-c-title { font-size: 19px; }
	.amv1-gallery-img { height: 260px; }

	.amv1-banner { flex-wrap: wrap; }
	.amv1-b-cta { width: 100%; }
	.amv1-b-cta .amv1-btn { width: 100%; justify-content: center; }

	.amv1-f-hero {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
	}
	.amv1-f-facts { justify-content: center; }
	.amv1-f-infogrid { grid-template-columns: 1fr; }
	.amv1-f-title { font-size: 23px; }
	.amv1-f-icon { width: 104px; height: 104px; border-radius: 24px; }
}

/* ----- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.amv1-btn,
	.amv1-lightbox { transition: none; }
	.amv1-btn:hover,
	.amv1-btn:focus-visible { transform: none; }
	.amv1-gallery-track { scroll-behavior: auto; }
}
