/*
 * DawnSpar Core: structural styles only. Visual design (colours, type, spacing scale)
 * comes from the theme via CSS custom properties with safe fallbacks.
 */

/* Store badges ---------------------------------------------------------- */
.ds-store-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-block: 1rem;
}
.ds-store-link {
	display: inline-flex;
	align-items: center;
	min-height: 48px; /* touch target */
	text-decoration: none;
	line-height: 0;
}
.ds-store-link img { height: 48px; width: auto; }
.ds-store-text {
	line-height: 1.2;
	padding: 0.8rem 1.1rem;
	border-radius: 0.6rem;
	background: var(--ds-badge-bg, #111);
	color: var(--ds-badge-fg, #fff);
	font-weight: 600;
}

/* Device-aware order: the visitor's own store first. */
.ds-os-ios .ds-store-app_store,
.ds-os-android .ds-store-google_play { order: -1; }

/* QR only makes sense on desktop. */
.ds-qr { display: none; margin: 0; text-align: center; font-size: 0.8rem; }
.ds-qr img { width: 112px; height: 112px; }
.ds-os-desktop .ds-qr { display: block; }

/* Rating text ----------------------------------------------------------- */
.ds-rating { margin: 0.25rem 0; font-size: 0.9rem; opacity: 0.85; }

/* App card -------------------------------------------------------------- */
.ds-app-card {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding: 1.25rem;
	margin-block: 1.5rem;
	border: 1px solid var(--ds-border, rgba(0, 0, 0, 0.12));
	border-left: 4px solid var(--ds-accent, currentColor);
	border-radius: var(--ds-radius, 0.75rem);
}
.ds-app-card .ds-app-icon { width: 64px; height: 64px; border-radius: 22%; flex: none; }
.ds-app-card__title { margin: 0; font-weight: 700; font-size: 1.1rem; }
.ds-app-card__text { margin: 0.25rem 0 0; }
.ds-app-card--cta { padding: 1.75rem; }
.ds-app-inline { font-style: italic; }

/* Grid ------------------------------------------------------------------ */
.ds-app-grid {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}
.ds-app-grid--compare { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.ds-app-tile {
	padding: 1.5rem;
	border: 1px solid var(--ds-border, rgba(0, 0, 0, 0.12));
	border-top: 4px solid var(--ds-accent, currentColor);
	border-radius: var(--ds-radius, 0.75rem);
}
.ds-app-tile .ds-app-icon { width: 72px; height: 72px; border-radius: 22%; }
.ds-app-tile__title { margin: 0.75rem 0 0.25rem; }
.ds-app-tile__text { margin: 0; }

/* Guides ---------------------------------------------------------------- */
.ds-app-guides ul { padding-left: 1.1rem; }
.ds-app-guides li { margin-block: 0.4rem; }

/* Sticky mobile CTA ----------------------------------------------------- */
.ds-sticky-cta {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom));
	background: var(--ds-sticky-bg, #fff);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
}
.ds-sticky-cta[hidden] { display: none; }
.ds-sticky-cta .ds-app-icon { width: 40px; height: 40px; border-radius: 22%; }
.ds-sticky-cta__name { font-weight: 700; flex: 1; }
.ds-sticky-cta .ds-store-badges { margin: 0; flex-wrap: nowrap; }
.ds-sticky-cta .ds-store-link img { height: 40px; }
/* Phones only show their own store in the sticky bar; desktop never shows the bar. */
.ds-os-ios .ds-sticky-cta .ds-store-google_play,
.ds-os-android .ds-sticky-cta .ds-store-app_store { display: none; }
.ds-os-desktop .ds-sticky-cta { display: none !important; }
@media (min-width: 782px) { .ds-sticky-cta { display: none !important; } }

/* Device mockup: CSS phone frame around a real screenshot ------------- */
.ds-device {
	margin: 0 auto;
	width: min(100%, 320px);
	perspective: 1600px;
}
.ds-device__frame {
	position: relative;
	padding: 10px;
	border-radius: 44px;
	background: linear-gradient(145deg, #2c2c33, #0b0b0e);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.08) inset,
		0 30px 60px -20px rgba(0, 0, 0, 0.55),
		0 18px 36px -18px var(--ds-accent, rgba(227, 18, 31, 0.45));
}
.ds-device__frame::before { /* speaker / camera notch */
	content: "";
	position: absolute;
	top: 18px;
	left: 50%;
	width: 28%;
	height: 22px;
	transform: translateX(-50%);
	border-radius: 999px;
	background: #05060c;
	z-index: 1;
}
.ds-device__screen {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 9 / 19.5;
	object-fit: cover;
	border-radius: 34px;
}
.ds-device--tilt .ds-device__frame {
	transform: rotateY(-12deg) rotateX(4deg) rotateZ(1deg);
	transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ds-device--tilt:hover .ds-device__frame { transform: rotateY(-4deg) rotateX(2deg); }
@media (prefers-reduced-motion: reduce) {
	.ds-device--tilt .ds-device__frame { transform: none; transition: none; }
}

/* Bare mockup: the screenshot already contains a drawn phone, so drop our bezel. */
.ds-device--bare .ds-device__frame {
	padding: 0;
	background: none;
	border-radius: 0;
	box-shadow: none;
	filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45)) drop-shadow(0 12px 30px var(--ds-accent, rgba(232, 85, 61, 0.35)));
}
.ds-device--bare .ds-device__frame::before,
.ds-device--bare .ds-device__frame::after { display: none; }
.ds-device--bare .ds-device__screen { aspect-ratio: auto; object-fit: contain; border-radius: 0; }
/* "On iPhone? Get it free on launch day" under the store badge (apps with the iOS waiting list) */
.ds-app-card__ios{margin:.6rem 0 0;font-size:.88rem;font-weight:700;line-height:1.3}
.ds-app-card__ios a{display:inline-flex;align-items:center;gap:.4rem;text-decoration:none}
.ds-app-card__ios svg{flex:none}
