/*
 * App Showcase — portable styles.
 * Tweak from your theme's Additional CSS by overriding the variables, e.g.:
 *   .app-showcase { --app-max-width: 1290px; }
 *   .app-grid, .app-list, .app-showcase { --app-accent: #e11d48; }
 */

.app-showcase,
.app-grid,
.app-list {
	--app-accent: var(--global-palette1, var(--ast-global-color-0, var(--accent, #2563eb)));
	--app-border: #e2e5ea;
	--app-surface: #fff;
	--app-chip: #eef0f4;
	--app-text: #1f2937;
	--app-radius: 16px;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.app-showcase *,
.app-grid *,
.app-list * {
	box-sizing: border-box;
}

/* ---------- Page container (used by archive + single) ---------- */
.app-showcase {
	--app-max-width: 1200px;
	box-sizing: border-box;
	max-width: var(--app-max-width);
	margin: 0 auto;
	padding: 2rem 1.5rem;
}

.app-showcase img {
	max-width: 100%;
	height: auto;
}

.app-archive__header h1 {
	margin: 0 0 1.5rem;
}

/* ---------- Grid ---------- */
.app-grid {
	--app-cols: 4;
	display: grid;
	grid-template-columns: repeat(var(--app-cols), minmax(0, 1fr));
	gap: 1.25rem;
}

@media (max-width: 1024px) {
	.app-grid { --app-cols: 3; }
}

@media (max-width: 768px) {
	.app-grid { --app-cols: 2; gap: 0.75rem; }
}

/* ---------- Card ---------- */
.app-grid .app-card {
	padding: 1rem;
	border: 1px solid var(--app-border);
	border-radius: var(--app-radius);
	background: var(--app-surface);
	color: var(--app-text);
	text-align: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-grid .app-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.app-grid .app-card a {
	display: block;
	color: inherit;
	text-decoration: none;
}

.app-grid .app-card img {
	display: block;
	width: 100%;
	max-width: 120px;
	height: auto;
	margin: 0 auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 22px;
}

.app-grid .app-card h3 {
	margin: 0.75rem 0 0.25rem;
	font-size: 1rem;
	line-height: 1.3;
	color: inherit;
}

.app-grid .app-card p {
	display: -webkit-box;
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.8;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- List layout: [app_list layout="list"] ---------- */
.app-list {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.app-list .app-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--app-border);
	border-radius: 16px;
	background: var(--app-surface);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 6px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-list .app-row:hover,
.app-list .app-row:focus-within {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
	transform: translateY(-1px);
}

.app-list .app-row__icon {
	flex: none;
	display: block;
	line-height: 0;
}

.app-list .app-row__icon img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 16px;
}

.app-list .app-row__body {
	flex: 1;
	min-width: 0;
}

.app-list .app-row__title {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.3;
	overflow-wrap: break-word;
	word-break: break-word;
}

.app-list .app-row__title a {
	color: var(--app-text);
	text-decoration: none;
}

.app-list .app-row__title a:hover {
	text-decoration: underline;
}

.app-list .app-row__tags {
	margin: 0.15rem 0 0;
	font-size: 0.78rem;
	color: var(--app-text);
	opacity: 0.5;
}

.app-list .app-row__stat,
.app-list .app-row__badge {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0.2rem 0 0;
	font-size: 0.82rem;
	line-height: 1.3;
}

.app-list .app-row__stat svg,
.app-list .app-row__badge svg {
	flex: none;
	width: 14px;
	height: 14px;
}

.app-list .app-row__stat {
	color: var(--app-text);
	opacity: 0.7;
}

.app-list .app-row__badge {
	color: #16a34a;
	font-weight: 600;
}

.app-list .app-row__cta {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem 1.15rem;
	border-radius: 999px;
	background: var(--app-accent);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.app-list .app-row__cta:hover {
	color: #fff;
	opacity: 0.88;
}

.app-list .app-row a:focus-visible,
.app-list .app-row__cta:focus-visible {
	outline: 2px solid var(--app-accent);
	outline-offset: 2px;
}

/* Mobile keeps the same icon-left / text-middle / button-right row —
   it only shrinks a little so nothing gets cramped on narrow phones. */
@media (max-width: 420px) {
	.app-list .app-row {
		gap: 0.65rem;
		padding: 0.75rem 0.85rem;
	}

	.app-list .app-row__icon img {
		width: 52px;
		height: 52px;
	}

	.app-list .app-row__title {
		font-size: 0.92rem;
	}

	.app-list .app-row__stat,
	.app-list .app-row__badge {
		font-size: 0.76rem;
	}

	.app-list .app-row__cta {
		padding: 0.5rem 0.85rem;
		font-size: 0.78rem;
	}
}

/* ---------- Detail hero ---------- */
.app-hero {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	margin-bottom: 2rem;
}

.app-hero__icon img {
	width: 160px;
	height: 160px;
	object-fit: cover;
	border-radius: 24px;
}

.app-hero__info {
	flex: 1;
	min-width: 0;
}

.app-hero__title {
	margin: 0 0 0.5rem;
}

.app-hero__summary {
	margin: 0 0 1rem;
	opacity: 0.85;
}

.app-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
	padding: 0;
	list-style: none;
}

.app-meta li {
	margin: 0;
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	background: var(--app-chip);
	color: var(--app-text);
	font-size: 0.9rem;
}

.app-meta li span {
	margin-right: 0.25rem;
	font-weight: 600;
}

.app-meta li a {
	color: inherit;
}

.app-meta li.app-meta__badge {
	background: rgba(22, 163, 74, 0.12);
	color: #16a34a;
	font-weight: 600;
}

.app-cta {
	display: inline-block;
	padding: 0.7rem 1.6rem;
	border-radius: 8px;
	background: var(--app-accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.app-cta:hover {
	color: #fff;
	opacity: 0.9;
}

.app-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.app-cta--secondary {
	background: transparent;
	color: var(--app-accent);
	border: 1px solid var(--app-accent);
}

.app-cta--secondary:hover {
	color: var(--app-accent);
	opacity: 0.85;
}

/* ---------- Stats strip ---------- */
.app-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem 2rem;
	justify-content: center;
	margin: 0 0 2.5rem;
	padding: 1.25rem 1.5rem;
	border-radius: 14px;
	background: #14161a;
	list-style: none;
}

.app-stats li {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 80px;
	text-align: center;
}

.app-stats__value {
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
}

.app-stats__label {
	margin-top: 0.15rem;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.65);
}

/* ---------- Extra sections (accordion) ---------- */
.app-accordion {
	margin-bottom: 0.6rem;
	border: 1px solid var(--app-border);
	border-radius: 10px;
	overflow: hidden;
}

.app-accordion summary {
	padding: 0.85rem 1.1rem;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

.app-accordion summary::-webkit-details-marker {
	display: none;
}

.app-accordion[open] summary {
	background: var(--app-accent);
	color: #fff;
}

.app-accordion__body {
	padding: 0.25rem 1.1rem 1rem;
}

.app-accordion[open] .app-accordion__body {
	background: var(--app-accent);
	color: #fff;
}

.app-accordion__body p {
	margin: 0.5rem 0;
}

/* ---------- Requirements table ---------- */
.app-requirements-card {
	background: var(--app-surface);
	border: 1px solid var(--app-border);
	border-radius: 12px;
	padding: 0.25rem 1.25rem;
}

.app-requirements {
	width: 100%;
	border-collapse: collapse;
}

.app-requirements tr {
	border-bottom: 1px solid var(--app-border);
}

.app-requirements tr:last-child {
	border-bottom: none;
}

.app-requirements th,
.app-requirements td {
	padding: 0.6rem 0.25rem;
	text-align: left;
	font-weight: 400;
	color: var(--app-text);
}

.app-requirements th {
	opacity: 0.7;
	font-weight: 500;
	width: 45%;
}

.app-requirements td {
	text-align: right;
	font-weight: 600;
	opacity: 1;
}

/* ---------- Install steps ---------- */
.app-steps {
	padding-left: 1.25rem;
}

.app-steps li {
	margin-bottom: 0.5rem;
}

/* ---------- Detail sections ---------- */
.app-section {
	margin-top: 2.5rem;
}

.app-features {
	padding-left: 1.25rem;
}

.app-features li {
	margin-bottom: 0.4rem;
}

.app-faq details {
	margin-bottom: 0.6rem;
	padding: 0.8rem 1rem;
	border: 1px solid var(--app-border);
	border-radius: 8px;
}

.app-faq summary {
	cursor: pointer;
	font-weight: 600;
}

.app-faq details p {
	margin: 0.6rem 0 0;
}

.app-related {
	margin-top: 3rem;
}

@media (max-width: 600px) {
	.app-showcase {
		padding: 1.25rem 1rem;
	}

	.app-hero {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.app-hero__icon img {
		width: 120px;
		height: 120px;
	}

	.app-meta {
		justify-content: center;
	}

	.app-hero__actions {
		flex-direction: column;
		width: 100%;
	}

	.app-cta {
		width: 100%;
		text-align: center;
	}

	.app-stats {
		gap: 1rem 1.25rem;
		padding: 1rem;
	}

	.app-section {
		margin-top: 2rem;
	}
}

@media (max-width: 480px) {
	.app-requirements,
	.app-requirements tbody {
		display: block;
	}

	.app-requirements tr {
		display: flex;
		flex-direction: column;
		gap: 0.15rem;
		padding: 0.6rem 0;
	}

	.app-requirements th,
	.app-requirements td {
		width: auto;
		padding: 0;
		text-align: left;
	}

	.app-requirements td {
		font-size: 0.95rem;
	}
}
