/* ============================================================
   archive.css — archive-software.php / taxonomy-group.php.
   Loaded only on software + category archives.
============================================================ */

.archive-main {
	padding-bottom: 24px;
}

/* ------------------------------------------------------------
   ARCHIVE HEADER — compact 3-column hero
   columns: [icon] [title + short desc] [program count]
------------------------------------------------------------ */
.archive-header {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	padding: 22px 28px;
	margin-bottom: 18px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas: "icon info count";
	column-gap: 22px;
	row-gap: 14px;
	align-items: center;
	box-shadow: var(--shadow-sm);
	position: relative;
	overflow: hidden;
}

.archive-header::before {
	content: '';
	position: absolute;
	top: -80px;
	right: -80px;
	width: 240px;
	height: 240px;
	background: radial-gradient(circle, var(--primary-glow) 0%, transparent 65%);
	pointer-events: none;
}

.cat-emoji {
	grid-area: icon;
	width: 64px;
	height: 64px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
	display: grid;
	place-items: center;
	color: #fff;
	box-shadow: var(--shadow-md);
}

.cat-emoji svg {
	width: 32px;
	height: 32px;
}

.archive-info {
	grid-area: info;
	position: relative;
	min-width: 0;
}

.archive-info h1 {
	font-size: 28px;
	line-height: 1.2;
	margin: 0 0 4px;
	letter-spacing: -0.01em;
}

.archive-info p {
	color: var(--text-2);
	font-size: 14px;
	max-width: 70ch;
	line-height: 1.5;
	margin: 0;
}

.archive-count-block {
	grid-area: count;
	text-align: right;
	align-self: center;
	padding-left: 22px;
	border-left: 1px solid var(--border);
}

.archive-count-num {
	font-family: var(--font-display);
	font-size: 36px;
	font-weight: 800;
	line-height: 1;
	color: var(--text);
	letter-spacing: -0.02em;
}

.archive-count-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--text-3);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-top: 6px;
}

/* ------------------------------------------------------------
   LAYOUT
------------------------------------------------------------ */
.archive-layout {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 24px;
	margin-bottom: 48px;
}

.archive-main-col {
	min-width: 0;
}

/* ------------------------------------------------------------
   TOOLBAR
------------------------------------------------------------ */
.toolbar {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	padding: 11px 18px;             /* was 14px 20px — denser toolbar */
	margin-bottom: 12px;            /* was 14 */
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;                      /* was 16 */
	flex-wrap: wrap;
}

.toolbar-filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.filter-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--text-3);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-right: 4px;
}

.filter-pill {
	padding: 6px 14px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: var(--r-full);
	font-family: var(--font);
	font-size: 13px;
	font-weight: 600;
	color: var(--text-2);
	cursor: pointer;
	transition: all 0.15s;
}

.filter-pill:hover {
	background: #fff;
	border-color: var(--primary);
	color: var(--primary);
}

.filter-pill.is-active {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

.toolbar-right {
	display: flex;
	gap: 10px;
	align-items: center;
}

.sort-select {
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #fff;
	font-family: var(--font);
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	cursor: pointer;
}

.sort-select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-result-info {
	font-size: 13px;
	color: var(--text-3);
	font-weight: 600;
	margin: 0;
}

/* ------------------------------------------------------------
   APPS LIST / APP ROW
------------------------------------------------------------ */
.apps-list {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	overflow: hidden;
}

.app-row {
	display: grid;
	grid-template-columns: auto 1fr auto auto auto;
	gap: 20px;
	align-items: center;
	padding: 14px 22px;             /* was 18px 22px — denser, easier to scan */
	border-bottom: 1px solid var(--border);
	transition: background 0.15s;
}

.app-row:last-child {
	border-bottom: 0;
}

.app-row:hover {
	background: var(--bg-soft);
}

.app-row-icon-link {
	display: block;
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	text-decoration: none;
}

.app-row-icon {
	width: 52px;
	height: 52px;
	border-radius: 13px;
	display: grid;
	place-items: center;
	overflow: hidden;
	color: #fff;
	font-weight: 800;
	font-size: 22px;
	box-shadow: var(--shadow-sm);
}

.app-row-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.app-row-info {
	min-width: 0;
}

.app-row-name-link {
	text-decoration: none;
	color: inherit;
	display: inline-block;
}

.app-row-name {
	font-size: 16px;
	font-weight: 700;
	color: var(--text);
	margin: 0 0 2px;                /* was 3 — tighter to meta line */
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.app-row-name-link:hover .app-row-name {
	color: var(--primary);
}

.app-row-version {
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 7px;
	background: var(--bg-soft);
	color: var(--text-2);
	border-radius: 5px;
}

.app-row-meta {
	font-size: 12px;
	color: var(--text-2);
	font-weight: 500;
	margin-bottom: 3px;
}

.app-row-desc {
	font-size: 13px;
	color: var(--text-3);
	line-height: 1.4;
}

.app-row-platforms {
	display: flex;
	gap: 6px;
}

/* Soft, light platform badges (row). */
.platform-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	transition: all 0.15s ease;
}

.platform-badge svg {
	width: 16px;
	height: 16px;
}

.platform-badge.platform-windows {
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #dbeafe;
}

.platform-badge.platform-mac {
	background: #f3f4f6;
	color: #1f2937;
	border: 1px solid #e5e7eb;
}

.platform-badge.platform-linux {
	background: #fef3c7;
	color: #d97706;
	border: 1px solid #fde68a;
}

.platform-badge.platform-android {
	background: #d1fae5;
	color: #059669;
	border: 1px solid #a7f3d0;
}

.platform-badge.platform-ios,
.platform-badge.platform-iphone {
	background: #f3f4f6;
	color: #6b7280;
	border: 1px solid #e5e7eb;
}

.platform-badge:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.app-row-download {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	background: var(--text);
	color: #fff;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.15s;
}

.app-row-download:hover {
	background: var(--primary);
	color: #fff;
}

/* ------------------------------------------------------------
   EMPTY STATE (JS-triggered)
------------------------------------------------------------ */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	padding: 56px 24px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	color: var(--text-3);
}

.empty-state svg {
	color: var(--text-muted);
	margin-bottom: 6px;
}

.empty-state h3 {
	font-size: 19px;
	color: var(--text);
}

.empty-state p {
	font-size: 14px;
	color: var(--text-2);
	margin-bottom: 8px;
}

/* ------------------------------------------------------------
   SIDEBAR FILTERS
------------------------------------------------------------ */
.archive-sidebar {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.archive-sidebar .side-card {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	overflow: hidden;
}

.archive-sidebar .side-head {
	padding: 11px 18px;             /* was 13px 20px — quieter section header */
	background: linear-gradient(135deg, var(--bg-soft), var(--bg-tint));
	border-bottom: 1px solid var(--border);
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-2);
	display: flex;
	align-items: center;
	gap: 8px;
}

.archive-sidebar .side-head svg {
	color: var(--primary);
	flex-shrink: 0;
}

.archive-sidebar .side-body {
	padding: 8px 12px;              /* was 10px 12px */
}

.filter-checkbox {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px;              /* was 8px 10px — tighter rows */
	border-radius: 7px;
	cursor: pointer;
	transition: background 0.15s;
	font-size: 13px;
}

.filter-checkbox:hover {
	background: var(--bg-soft);
}

.filter-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	font-weight: 500;
	color: var(--text);
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	margin: 0;
	border: 1.5px solid var(--border-2);
	border-radius: 4px;
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
	transition: all 0.15s;
}

.filter-checkbox input[type="radio"] {
	border-radius: 50%;
}

.filter-checkbox input:checked {
	background: var(--primary);
	border-color: var(--primary);
}

.filter-checkbox input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	top: 1px;
	left: 4px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.filter-checkbox input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	top: 4px;
	left: 4px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #fff;
}

.filter-count {
	font-size: 11px;
	color: var(--text-3);
	font-weight: 600;
	background: var(--bg-soft);
	padding: 2px 8px;
	border-radius: var(--r-full);
}

.filter-checkbox:hover .filter-count {
	background: #fff;
}

/* Sidebar platform icons — inline SVG, subtle brand colours. */
.filter-platform-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.filter-platform-icon svg {
	width: 18px;
	height: 18px;
}

.filter-platform-icon.platform-windows { color: #2563eb; }
.filter-platform-icon.platform-mac     { color: #1f2937; }
.filter-platform-icon.platform-linux   { color: #d97706; }
.filter-platform-icon.platform-android { color: #059669; }
.filter-platform-icon.platform-ios,
.filter-platform-icon.platform-iphone,
.filter-platform-icon.platform-smartphone-app { color: #6b7280; }

.rating-opt-stars {
	display: inline-flex;
}

.clear-all-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 11px 16px;
	background: #fff;
	border: 1.5px solid var(--border-2);
	border-radius: var(--r-md);
	font-family: var(--font);
	font-size: 13px;
	font-weight: 700;
	color: var(--text-2);
	text-decoration: none;
	cursor: pointer;
	transition: all 0.15s;
}

.clear-all-btn:hover {
	border-color: var(--danger);
	color: var(--danger);
	background: var(--danger-light);
}

.empty-state .clear-all-btn {
	width: auto;
}

/* ------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------ */
@media (max-width: 1024px) {
	.archive-layout {
		grid-template-columns: 1fr;
	}

	.archive-sidebar {
		order: -1;
	}

	.app-row {
		grid-template-columns: auto 1fr auto auto;
	}

	.app-row-platforms {
		display: none;
	}
}

@media (max-width: 700px) {
	.archive-header {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"icon info"
			"count count";
		padding: 18px 20px;
		column-gap: 14px;
		row-gap: 12px;
	}

	.cat-emoji {
		width: 52px;
		height: 52px;
		border-radius: 14px;
	}

	.cat-emoji svg {
		width: 26px;
		height: 26px;
	}

	.archive-info h1 {
		font-size: 22px;
	}

	.archive-count-block {
		text-align: left;
		padding: 12px 0 0;
		border-left: 0;
		border-top: 1px solid var(--border);
		display: flex;
		align-items: baseline;
		gap: 10px;
	}

	.archive-count-num {
		font-size: 24px;
	}

	.archive-about {
		padding: 18px 20px;
	}

	.archive-about-body {
		font-size: 14px;
	}

	.app-row {
		grid-template-columns: auto 1fr auto;
		gap: 12px;
		padding: 14px;
	}

	.app-row-meta,
	.app-row-download {
		display: none;
	}
}

/* ------------------------------------------------------------
   EDITORIAL CARD BADGES (Top Pick / Editor's Choice / Trending)
------------------------------------------------------------ */
.app-row-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 4px 0 2px;
}

.card-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: var(--r-full);
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.card-badge-gold { background: #fef3c7; color: #92400e; }
.card-badge-blue { background: #eff6ff; color: #1e40af; }
.card-badge-red  { background: #fee2e2; color: #991b1b; }

/* ------------------------------------------------------------
   SIDEBAR — Subcategories list + Popular Tags cloud
------------------------------------------------------------ */
.subcat-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--text-2);
	font-size: 13px;
	transition: background 0.15s, color 0.15s;
}

.subcat-link:hover {
	background: var(--bg-soft);
	color: var(--primary);
}

.subcat-link.is-active {
	background: var(--primary-light);
	color: var(--primary-dark);
	font-weight: 600;
}

.subcat-count {
	flex-shrink: 0;
	font-size: 11px;
	color: var(--text-3);
	background: var(--bg-soft);
	padding: 2px 8px;
	border-radius: var(--r-full);
	font-weight: 600;
}

.subcat-link.is-active .subcat-count {
	background: #fff;
	color: var(--primary-dark);
}

.tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tag-badge {
	display: inline-block;
	padding: 4px 10px;
	background: var(--bg-soft);
	color: var(--text-2);
	border-radius: var(--r-full);
	font-size: 12px;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.tag-badge:hover {
	background: var(--primary);
	color: #fff;
}

/* ------------------------------------------------------------
   ABOUT THIS CATEGORY — editorial block below the program list
   (renders when the term has a `moosoft_intro` term-meta)
   Compact, content-hugging — no min-height, no flex stretching.
------------------------------------------------------------ */
.archive-about {
	width: 100%;
	max-width: 640px;             /* card sized to the text — no internal empty space */
	margin: 24px auto 0;          /* centered horizontally with a top gap */
	padding: 20px 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	box-sizing: border-box;
}

.archive-about h2 {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 10px;             /* was 14 — closer to body */
	color: var(--text);
	letter-spacing: -0.01em;
}

.archive-about-body {
	color: var(--text-2);
	font-size: 15px;
	line-height: 1.65;
	max-width: none;              /* explicit — card defines the column width, not the body */
}

.archive-about-body p {
	margin: 0 0 10px;             /* was 12 */
}

.archive-about-body p:last-child {
	margin-bottom: 0;             /* removes trailing whitespace inside the card */
}
