/* ===========================================================================
   lg.apps — the apps page (/app/, _pages/apps.php)
   ---------------------------------------------------------------------------
       .lg-apps
         .lg-apps__layout          main column + graphic (from 1024px)
         .lg-apps__main
         .lg-apps__head            title + lead
         .lg-apps__preview         note when ?android=… previews a state
         .lg-apps__grid            one card per platform; two columns from 640px
           section.lg-apps__card   --soon | --testing | --live
             .lg-apps__card-head   icon, name, status pill
             .lg-apps__text
             .lg-apps__action      only when there is a link: button + store
                                   name, pushed to the card's bottom
         .lg-apps__feedback        contact line
         .lg-apps__visual          desktop only: blob, gold underlay, phones
         section.lg-apps__faq      four questions (free? state? offline? Premium in the app?)

   Head and cards follow the contact page (lg.contact.css). Colours are
   tokens only (css/tokens.css), which is all dark mode needs.
   =========================================================================== */

.lg-apps {
	padding: 0.5rem 0 2rem;
	font-family: var(--lg-font);
	color: var(--lg-text);
}

/* --- Head ---------------------------------------------------------------- */
.lg-apps__head {
	max-width: 46rem;
	margin-bottom: 1.75rem;
}

.lg-apps__title {
	margin: 0 0 0.5rem;
	color: var(--lg-text);
	font-family: var(--lg-font-heading);
	font-size: clamp(1.6rem, 1.25rem + 1vw, 2.1rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.lg-apps__lead {
	margin: 0;
	color: var(--lg-text-muted);
	font-size: 1.05rem;
	line-height: 1.55;
}

/* --- Cards --------------------------------------------------------------- */
.lg-apps__grid {
	display: grid;
	gap: 1.25rem;
	max-width: 52rem;
}

@media (min-width: 640px) {
	.lg-apps__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 1.5rem;
	}
}

.lg-apps__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.85rem;
	padding: 1.4rem 1.4rem 1.5rem;
	border: 1px solid var(--lg-border);
	border-radius: var(--lg-radius-card);
	background-color: var(--lg-surface);
	box-shadow: 0 2px 10px rgba(var(--lg-shadow-rgb), 0.06);
}

.lg-apps__card-head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
}

.lg-apps__icon {
	display: inline-flex;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	color: var(--lg-text);
}

.lg-apps__icon svg {
	width: 100%;
	height: 100%;
}

.lg-apps__name {
	flex: 1 1 auto;
	margin: 0;
	font-family: var(--lg-font-heading);
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

/* The state, as the reading cards' status pills (lg.texts.css). */
.lg-apps__status {
	flex: 0 0 auto;
	padding: 0.15rem 0.65rem;
	border-radius: 999px;
	background-color: var(--lg-surface-alt);
	color: var(--lg-text-muted);
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
}

.lg-apps__card--testing .lg-apps__status {
	background-color: var(--lg-status-started-bg);
	color: var(--lg-status-started-text);
}

.lg-apps__card--live .lg-apps__status {
	background-color: var(--lg-status-perfect-bg);
	color: var(--lg-status-perfect-text);
}

.lg-apps__text {
	margin: 0;
	color: var(--lg-text-soft);
	line-height: 1.55;
}

/* Button and store name at the bottom of the card. Side by side the cards
   are equally tall (grid rows stretch); the "testing" text is longer than
   the "live" one, and without this the two buttons would sit at different
   heights. Stacked (one column) the auto margin does nothing. */
.lg-apps__action {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.4rem;
	margin-top: auto;
	padding-top: 0.25rem;
}

.lg-apps__button {
	display: inline-block;
	padding: 0.7rem 1.4rem;
	border-radius: var(--lg-radius-cta);
	background-color: var(--lg-red);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.lg-apps__button:hover,
.lg-apps__button:focus-visible {
	background-color: var(--lg-red-hover);
	color: #fff;
	text-decoration: none;
}

.lg-apps__store {
	color: var(--lg-text-muted);
	font-size: 0.8rem;
}

/* --- Feedback line ------------------------------------------------------- */
.lg-apps__feedback {
	margin: 1.75rem 0 0;
	color: var(--lg-text-muted);
}

.lg-apps__feedback a {
	color: var(--lg-red);
	font-weight: 600;
}

/* --- Preview note --------------------------------------------------------- */
.lg-apps__preview {
	max-width: 52rem;
	margin: 0 0 1.25rem;
	padding: 0.6rem 0.9rem;
	border-radius: var(--lg-radius);
	background-color: var(--lg-status-started-bg);
	color: var(--lg-status-started-text);
	font-size: 0.9rem;
}

/* --- Layout and graphic --------------------------------------------------- */
/* The graphic as on the start page and the premium page (a.css .lg-hero__visual,
   lg.premium.css .lg-premium__visual): an irregular blob with a soft gold
   copy of it peeking out bottom right - here filled, not a photo, with the
   two phones (images/app-phones.*, transparent) standing on it and reaching
   past its edge. Blob and underlay share --lg-apps-blob, or their edges stop
   running parallel. Desktop only: on a phone it would push the download
   buttons down for nothing (the <picture> loads a 1px gif below 1024px). */
.lg-apps__visual {
	display: none;
}

@media (min-width: 1024px) {

	.lg-apps__layout {
		display: grid;
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
		gap: 3rem;
		align-items: center;
	}

	.lg-apps__visual {
		--lg-apps-blob: 42% 58% 63% 37% / 41% 44% 56% 59%;
		display: block;
		position: relative;
		width: 100%;
		max-width: 30rem;
		aspect-ratio: 1 / 1;
		justify-self: end;
	}

	.lg-apps__shape,
	.lg-apps__blob {
		position: absolute;
		inset: 8% 10% 10% 6%;
		border-radius: var(--lg-apps-blob);
	}

	.lg-apps__shape {
		background-color: var(--lg-score-track);
		transform: translate(14px, 16px);
	}

	.lg-apps__blob {
		background-color: var(--lg-surface-alt);
	}

	.lg-apps__phones,
	.lg-apps__phones img {
		position: absolute;
		inset: 0;
		display: block;
		width: 100%;
		height: 100%;
	}

	.lg-apps__phones img {
		object-fit: contain;
	}
}

/* Dark: the gold underlay would glow; the premium page does the same. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .lg-apps__shape { background-color: var(--lg-border); }
}
:root[data-theme="dark"] .lg-apps__shape { background-color: var(--lg-border); }

/* --- FAQ ------------------------------------------------------------------ */
/* Below cards and graphic, full width of the text column. Plain question and
   answer - four short entries need no accordion. */
.lg-apps__faq {
	max-width: 46rem;
	margin-top: 2.75rem;
	padding-top: 2rem;
	border-top: 1px solid var(--lg-border);
}

.lg-apps__faq-title {
	margin: 0 0 1.25rem;
	font-family: var(--lg-font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
}

.lg-apps__faq-item + .lg-apps__faq-item {
	margin-top: 1.25rem;
}

.lg-apps__faq-question {
	margin: 0 0 0.35rem;
	color: var(--lg-text);
	font-family: var(--lg-font);
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.35;
}

.lg-apps__faq-answer {
	margin: 0;
	color: var(--lg-text-soft);
	line-height: 1.6;
}

.lg-apps__faq-answer a {
	color: var(--lg-red);
	font-weight: 600;
}
