/* IMK APK Hub - public pages. Colours follow your theme; only the button colour is set in the plugin settings. */

.imk-apk {
	--imk-accent: #1558d6;
	--imk-border: rgba(128, 128, 128, .28);
	--imk-soft: rgba(128, 128, 128, .09);
	--imk-cols: 3;
	box-sizing: border-box;
	width: 100%;
	color: inherit;
}
.imk-apk *,
.imk-apk *::before,
.imk-apk *::after { box-sizing: inherit; }

.imk-apk .imk-apk-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- buttons ---------- */

.imk-apk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--imk-accent);
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	white-space: nowrap;
	transition: filter .15s, transform .15s;
}
.imk-apk-btn:hover,
.imk-apk-btn:focus { filter: brightness(1.1); color: #fff !important; }
.imk-apk-btn:active { transform: translateY(1px); }
.imk-apk-btn--lg { padding: 14px 26px; font-size: 16px; }
.imk-apk-btn--ghost {
	background: transparent;
	color: var(--imk-accent) !important;
	box-shadow: inset 0 0 0 2px var(--imk-accent);
}
.imk-apk-btn--ghost:hover,
.imk-apk-btn--ghost:focus { color: var(--imk-accent) !important; }
.imk-apk-btn.is-disabled {
	opacity: .45;
	pointer-events: none;
	background: #6b7280;
}
.imk-apk-ico { flex: none; }

/* ---------- icon ---------- */

.imk-apk-icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 18px;
	overflow: hidden;
	background: var(--imk-soft);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.imk-apk-icon img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }
.imk-apk-icon--letter {
	background: var(--imk-accent);
	color: #fff;
	font-size: 28px;
	font-weight: 700;
}
.imk-apk-icon--lg { width: 112px; height: 112px; border-radius: 26px; }
.imk-apk-icon--lg.imk-apk-icon--letter { font-size: 48px; }

/* ---------- chips ---------- */

.imk-apk-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}
.imk-apk-chips li {
	margin: 0 !important;
	padding: 3px 10px !important;
	border-radius: 999px;
	background: var(--imk-soft);
	font-size: 12.5px;
	line-height: 1.5;
	list-style: none !important;
}

/* ---------- toolbar ---------- */

.imk-apk-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
	margin-bottom: 24px;
}
.imk-apk-search {
	display: flex;
	flex: 0 1 320px;
	min-width: 220px;
	margin: 0;
	border: 1px solid var(--imk-border);
	border-radius: 999px;
	overflow: hidden;
}
.imk-apk-search input[type="search"] {
	flex: 1;
	min-width: 0;
	border: 0 !important;
	outline: 0;
	box-shadow: none !important;
	background: transparent;
	color: inherit;
	padding: 10px 16px;
	font-size: 15px;
	margin: 0;
	height: auto;
}
.imk-apk-search button {
	flex: none;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 0 14px;
	cursor: pointer;
	opacity: .7;
}
.imk-apk-search button:hover { opacity: 1; }
.imk-apk-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.imk-apk-cats a {
	padding: 7px 14px;
	border-radius: 999px;
	border: 1px solid var(--imk-border);
	color: inherit;
	font-size: 14px;
	text-decoration: none;
	line-height: 1.2;
}
.imk-apk-cats a:hover { border-color: var(--imk-accent); }
.imk-apk-cats a.is-active {
	background: var(--imk-accent);
	border-color: var(--imk-accent);
	color: #fff;
}

/* ---------- grid + cards ---------- */

/* Up to --imk-cols columns, but a card is never narrower than ~220px, so the grid
   adapts to however wide your theme's content area is. */
.imk-apk-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(max(220px, calc((100% - (var(--imk-cols) - 1) * 20px) / var(--imk-cols))), 1fr));
	gap: 20px;
}
.imk-apk-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--imk-border);
	border-radius: 18px;
	transition: box-shadow .2s, transform .2s, border-color .2s;
}
.imk-apk-card:hover {
	border-color: var(--imk-accent);
	box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
	transform: translateY(-2px);
}
.imk-apk-card__icon { align-self: flex-start; text-decoration: none; }
.imk-apk-card__body { flex: 1; min-width: 0; }
.imk-apk-card__title {
	margin: 0 0 4px !important;
	font-size: 19px !important;
	line-height: 1.25 !important;
}
.imk-apk-card__title a { color: inherit; text-decoration: none; }
.imk-apk-card__title a:hover { color: var(--imk-accent); }
.imk-apk-card__desc {
	margin: 0 !important;
	font-size: 14.5px;
	line-height: 1.5;
	opacity: .8;
}
.imk-apk-card__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 16px;
}
.imk-apk-link {
	color: var(--imk-accent);
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: none;
}
.imk-apk-link:hover { text-decoration: underline; }

.imk-apk-empty {
	padding: 40px 20px;
	text-align: center;
	border: 1px dashed var(--imk-border);
	border-radius: 18px;
	opacity: .8;
}

.imk-apk-pages { margin-top: 28px; text-align: center; }
.imk-apk-pages .page-numbers {
	display: inline-block;
	min-width: 38px;
	margin: 0 3px;
	padding: 8px 12px;
	border: 1px solid var(--imk-border);
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
	line-height: 1.2;
}
.imk-apk-pages .page-numbers.current {
	background: var(--imk-accent);
	border-color: var(--imk-accent);
	color: #fff;
}

/* ---------- single app ---------- */

.imk-apk-single { max-width: 100%; }
.imk-apk-hero {
	display: flex;
	gap: 24px;
	align-items: center;
	padding: 24px;
	margin-bottom: 28px;
	border: 1px solid var(--imk-border);
	border-radius: 22px;
	background: var(--imk-soft);
}
.imk-apk-hero__main { flex: 1; min-width: 0; }
.imk-apk-hero__tag { margin: 0 0 4px !important; font-size: 17px; line-height: 1.45; }
.imk-apk-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.imk-apk-hero__note { margin: 10px 0 0 !important; font-size: 13px; opacity: .7; }

.imk-apk-section { margin: 0 0 30px; }
.imk-apk-section > h2 { margin: 0 0 12px !important; font-size: 22px !important; }

.imk-apk-shots {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	padding-bottom: 10px;
	scroll-snap-type: x proximity;
}
.imk-apk-shots a { flex: none; scroll-snap-align: start; line-height: 0; }
.imk-apk-shots img {
	display: block;
	height: 340px;
	width: auto;
	max-width: none;
	border-radius: 14px;
	border: 1px solid var(--imk-border);
}

.imk-apk-info {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin: 0;
}
.imk-apk-info > div {
	padding: 12px 14px;
	border: 1px solid var(--imk-border);
	border-radius: 12px;
}
.imk-apk-info dt { margin: 0; font-size: 12.5px; opacity: .65; }
.imk-apk-info dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.imk-apk-info code { font-size: 13px; }

.imk-apk-sha { margin-top: 12px; font-size: 14px; }
.imk-apk-sha summary { cursor: pointer; opacity: .8; }
.imk-apk-sha code { display: block; margin-top: 8px; padding: 10px 12px; font-size: 12px; word-break: break-all; }

.imk-apk-steps { margin: 0 0 0 1.2em !important; padding: 0 !important; }
.imk-apk-steps li { margin: 0 0 8px !important; line-height: 1.55; }

.imk-apk-back { margin: 10px 0 0; }
.imk-apk-back a { color: var(--imk-accent); font-weight: 600; text-decoration: none; }

.imk-apk-inline { --imk-accent: #1558d6; display: inline-block; }

/* ---------- QR codes ---------- */

.imk-apk-qrcard {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0 0 28px;
	padding: 16px 20px;
	border: 1px solid var(--imk-border);
	border-radius: 18px;
}
.imk-apk-qrcard__img { flex: none; line-height: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--imk-border); background: #fff; }
.imk-apk-qrcard__img svg { display: block; width: 132px; height: 132px; max-width: none; }
.imk-apk-qrcard__text { min-width: 0; }
.imk-apk-qrcard__text p { margin: 0 0 4px !important; font-size: 15px; line-height: 1.5; opacity: .85; }
.imk-apk-qrcard__text .imk-apk-qrcard__title { font-size: 18px; font-weight: 700; opacity: 1; }

.imk-apk-qr { margin: 0 0 1em; text-align: center; }
.imk-apk-qr__img { display: inline-block; line-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--imk-border); background: #fff; max-width: 100%; }
.imk-apk-qr__img svg { display: block; max-width: 100%; height: auto; }
.imk-apk-qr figcaption { margin-top: 8px; font-size: 14px; opacity: .8; }

/* ---------- responsive ---------- */

@media (max-width: 600px) {
	/* On a phone you cannot scan your own screen, so the QR card is only shown on larger screens. */
	.imk-apk-qrcard { display: none; }
	.imk-apk-search { flex: 1 1 100%; }
	.imk-apk-hero { flex-direction: column; align-items: flex-start; padding: 20px; gap: 16px; }
	.imk-apk-icon--lg { width: 88px; height: 88px; border-radius: 22px; }
	.imk-apk-hero__cta .imk-apk-btn { width: 100%; }
	.imk-apk-shots img { height: 260px; }
}
