/* Modern Gallery Grid Layout */
/* Note: grid-template-columns is set dynamically via inline styles based on user's gallery_thumb_size setting */
.file-gallery-grid {
	display: grid;
	gap: 20px;
	margin: 20px 0;
}

/* Gallery Item Card */
.file-gallery-item {
	background: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.file-gallery-item:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	transform: translateY(-4px);
}

/* Gallery Link */
.file-gallery-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	height: 100%;
}

/* Image Wrapper */
.file-gallery-image-wrapper {
	position: relative;
	width: 100%;
	padding-top: 100%; /* 1:1 Aspect Ratio */
	overflow: hidden;
	background: #f3f4f6;
}

.file-gallery-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.file-gallery-item:hover .file-gallery-image {
	transform: scale(1.05);
}

/* Overlay Effect */
.file-gallery-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0);
	transition: background 0.3s ease;
	pointer-events: none;
}

.file-gallery-item:hover .file-gallery-overlay {
	background: rgba(0, 0, 0, 0.1);
}

/* Info Section */
.file-gallery-info {
	padding: 12px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* Title - Bold and Distinct */
.file-gallery-title {
	margin: 0;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
}

/* Description - Lighter and Smaller */
.file-gallery-description {
	margin: 0;
	padding: 0;
	font-size: 12px;
	line-height: 1.5;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
}

/* Responsive Design */
@media (max-width: 1200px) {
	.file-gallery-grid {
		gap: 16px;
	}
}

@media (max-width: 768px) {
	.file-gallery-grid {
		gap: 12px;
	}
	
	.file-gallery-info {
		padding: 10px;
	}
	
	.file-gallery-title {
		font-size: 13px;
	}
	
	.file-gallery-description {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.file-gallery-grid {
		gap: 10px;
	}
	
	.file-gallery-info {
		padding: 8px;
	}
	
	.file-gallery-title {
		font-size: 12px;
		-webkit-line-clamp: 1;
	}
	
	.file-gallery-description {
		font-size: 10px;
		-webkit-line-clamp: 1;
	}
}

/* Backward Compatibility - Keep old class names working */
.file_gallery {
	float: none;
	width: auto;
	margin: 0;
}