/* Kitgenix Document Manager – Public UI */

.kitgenix-document-manager-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	align-items: stretch;
}

.kitgenix-document-manager-cards .kitgenix-document-manager-card {
	max-width: none;
}

@media (max-width: 768px) {
	.kitgenix-document-manager-cards {
		grid-template-columns: 1fr;
	}
}

.kitgenix-document-manager-card {
	display: inline-flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--kitgenix-border-color, rgba(0, 0, 0, 0.12));
	background: var(--kitgenix-surface, transparent);
	border-radius: 10px;
	max-width: 280px;
}

.kitgenix-document-manager-card__preview {
	display: flex;
	justify-content: center;
	align-items: center;
	text-decoration: none;
}

.kitgenix-document-manager-card__img {
	width: var(--kitgenix-document-manager-thumb-size, 96px);
	height: var(--kitgenix-document-manager-thumb-size, 96px);
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--kitgenix-border-color, rgba(0, 0, 0, 0.12));
	background: var(--kitgenix-surface-alt, rgba(0, 0, 0, 0.04));
}

.kitgenix-document-manager-card__img--icon {
	object-fit: contain;
	padding: 10px;
}

.kitgenix-document-manager-card__img--placeholder {
	display: block;
}

.kitgenix-document-manager-card__title {
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	min-height: calc(1.2em * 2);
	max-height: calc(1.2em * 2);
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.kitgenix-document-manager-card__desc {
	font-size: 0.92em;
	color: var(--kitgenix-text-muted, rgba(0, 0, 0, 0.7));
	text-align: center;
	min-height: calc(1.3em * 2);
	max-height: calc(1.3em * 2);
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.kitgenix-document-manager-card__meta-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
}

.kitgenix-document-manager-card__meta {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 10px;
	font-size: 0.92em;
}

.kitgenix-document-manager-card__meta-label {
	color: var(--kitgenix-text-muted, rgba(0, 0, 0, 0.6));
	text-align: var(--kitgenix-document-manager-meta-label-align, left);
}

.kitgenix-document-manager-card__meta-value {
	font-weight: 600;
	text-align: var(--kitgenix-document-manager-meta-value-align, right);
}

.kitgenix-document-manager-card--meta-justify {
	--kitgenix-document-manager-meta-label-align: left;
	--kitgenix-document-manager-meta-value-align: right;
}

.kitgenix-document-manager-card--meta-left {
	--kitgenix-document-manager-meta-label-align: left;
	--kitgenix-document-manager-meta-value-align: left;
}

.kitgenix-document-manager-card--meta-center {
	--kitgenix-document-manager-meta-label-align: center;
	--kitgenix-document-manager-meta-value-align: center;
}

.kitgenix-document-manager-card--meta-right {
	--kitgenix-document-manager-meta-label-align: right;
	--kitgenix-document-manager-meta-value-align: right;
}

.kitgenix-document-manager-card__actions {
	display: flex;
	justify-content: center;
}

.kitgenix-document-manager-card--button-left .kitgenix-document-manager-card__actions {
	justify-content: flex-start;
}

.kitgenix-document-manager-card--button-center .kitgenix-document-manager-card__actions {
	justify-content: center;
}

.kitgenix-document-manager-card--button-right .kitgenix-document-manager-card__actions {
	justify-content: flex-end;
}

.kitgenix-document-manager-card--button-justify .kitgenix-document-manager-card__actions {
	justify-content: flex-start;
}

.kitgenix-document-manager-card--button-justify .kitgenix-document-manager-card__button {
	width: 100%;
	text-align: center;
}

.kitgenix-document-manager-card__button {
	display: inline-block;
	padding: 8px 12px;
	border: 1px solid currentColor;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 700;
	line-height: 1;
	color: var(--kitgenix-document-manager-btn-text, currentColor);
	border-color: var(--kitgenix-document-manager-btn-border, currentColor);
	background: var(--kitgenix-document-manager-btn-bg, transparent);
}

.kitgenix-document-manager-card__button--solid {
	background: var(--kitgenix-document-manager-btn-bg, var(--kitgenix-brand, currentColor));
	border-color: var(--kitgenix-document-manager-btn-border, var(--kitgenix-brand, currentColor));
	color: var(--kitgenix-document-manager-btn-text, var(--kitgenix-surface, Canvas));
}

.kitgenix-document-manager-card__button--solid:hover,
.kitgenix-document-manager-card__button--solid:focus {
	text-decoration: none;
}

.kitgenix-document-manager-card__button:hover,
.kitgenix-document-manager-card__button:focus {
	background: var(--kitgenix-document-manager-btn-hover-bg, var(--kitgenix-document-manager-btn-bg, transparent));
	border-color: var(--kitgenix-document-manager-btn-hover-border, var(--kitgenix-document-manager-btn-border, currentColor));
	color: var(--kitgenix-document-manager-btn-hover-text, var(--kitgenix-document-manager-btn-text, currentColor));
	text-decoration: underline;
}

/* Shown only to logged-in users who can manage documents, in place of a
   document that isn't currently visible to the public – never shown to
   ordinary visitors. */
.kitgenix-document-manager-card--unavailable {
	max-width: none;
	border-style: dashed;
	opacity: 0.85;
}

.kitgenix-document-manager-card__unavailable-text {
	margin: 0;
	font-size: 0.92em;
	color: var(--kitgenix-text-muted, rgba(0, 0, 0, 0.7));
}
