/* PS Post Gallery – frontend */

.ps-gallery {
	display: grid;
	grid-template-columns: repeat(var(--ps-gallery-cols, 3), minmax(0, 1fr));
	gap: var(--ps-gallery-gap, 10px);
	justify-content: center;
	align-items: start;
	margin-left: auto;
	margin-right: auto;
	max-width: var(--ps-gallery-max-width, 100%);
}

/* Οριζόντια στοίχιση του κάθε item μέσα στη στήλη του */
.ps-gallery--align-start  { justify-items: start; }
.ps-gallery--align-center { justify-items: center; }
.ps-gallery--align-end    { justify-items: end; }

.ps-gallery--align-start  .ps-gallery__caption { text-align: left; }
.ps-gallery--align-center .ps-gallery__caption { text-align: center; }
.ps-gallery--align-end    .ps-gallery__caption { text-align: right; }

.ps-gallery__item {
	margin: 0;
	padding: 0;
	position: relative;
	overflow: hidden;
	line-height: 0;
	width: 100%;
	max-width: var(--ps-gallery-img-max-width, 100%);
}

.ps-gallery__link {
	display: block;
	line-height: 0;
}

.ps-gallery__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
	transition: transform 0.4s ease, opacity 0.3s ease;
}

/* Φυσικό πλάτος αρχείου: η εικόνα δεν τεντώνεται πέρα από τις πραγματικές της διαστάσεις */
.ps-gallery--fit-natural .ps-gallery__item {
	width: auto;
}

.ps-gallery--fit-natural .ps-gallery__img {
	width: auto;
	max-width: 100%;
}

/* Σταθερή αναλογία (crop) */
.ps-gallery--ratio .ps-gallery__link,
.ps-gallery--ratio > .ps-gallery__item > .ps-gallery__img {
	aspect-ratio: var(--ps-gallery-ratio, 1);
	display: block;
	width: 100%;
}

.ps-gallery--ratio .ps-gallery__link .ps-gallery__img,
.ps-gallery--ratio > .ps-gallery__item > .ps-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Hover effects */
.ps-gallery--hover-zoom .ps-gallery__item:hover .ps-gallery__img {
	transform: scale(1.06);
}

.ps-gallery--hover-fade .ps-gallery__item:hover .ps-gallery__img {
	opacity: 0.75;
}

/* Caption */
.ps-gallery__caption {
	line-height: 1.4;
	margin-top: 8px;
	font-size: 0.85em;
}

/* Placeholder μέσα στον Elementor editor */
.ps-gallery-placeholder {
	padding: 20px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	color: #6b6f76;
	font-size: 13px;
	text-align: center;
}

@media (max-width: 480px) {
	.ps-gallery:not([style*="--ps-gallery-cols"]) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
