/* =========================================================================
 * GARRY – Příspěvková matice  (frontend styly, statická mřížka)
 * ========================================================================= */

.gpm {
	--gpm-cols: 2;
	--gpm-gap: 24px;
	--gpm-accent: #d16b55;
	width: 100%;
}

.gpm-grid {
	display: grid;
	grid-template-columns: repeat(var(--gpm-cols), minmax(0, 1fr));
	gap: var(--gpm-gap);
}

.gpm-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: var(--gpm-card-bg, #FBFAF6);
	transition: transform .3s ease;
}
/* Hover „grow" celé karty (jako elementor-animation-grow v původním UC Post Grid) */
.gpm-item:hover { transform: scale(1.03); }

.gpm-media {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #eee;
}
.gpm-media .gpm-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* Ztmavovací překrytí obrázku při najetí (uc_post_image_overlay) */
.gpm-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--gpm-overlay, rgba(0, 0, 0, .12));
	opacity: 0;
	transition: opacity .3s ease;
}
.gpm-item:hover .gpm-media::after { opacity: 1; }

.gpm-media-ph {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #f0ebe4 0%, #e6ded4 100%);
}
.gpm-media-ph::after {
	content: "";
	position: absolute;
	inset: 0;
	background: no-repeat center / 42px 42px
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bcae9c' stroke-width='1.5'><rect x='3' y='4' width='18' height='16' rx='2'/><circle cx='9' cy='10' r='2'/><path d='M3 17l5-4 4 3 4-4 5 4'/></svg>");
	opacity: .8;
}

.gpm-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding: 18px 18px 22px;
	text-align: center;
}

.gpm-title {
	display: block;
	font-size: 21px;
	line-height: 1.25;
	font-weight: 700;
	color: #333;
	text-decoration: none;
	margin: 4px 0 10px;
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
}
.gpm-title:hover { color: var(--gpm-accent); }

.gpm-perex {
	margin: 0 0 16px;
	color: #7A7A7A;
	font-size: 14px;
	line-height: 1.55;
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
}

.gpm-more {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	align-self: center;
	padding: 8px 0;
	color: var(--gpm-accent);
	text-transform: uppercase;
	letter-spacing: .06em;
	font-size: 13px;
	text-decoration: none;
	position: relative;
}
.gpm-more::after {
	content: "";
	position: absolute;
	left: 0; bottom: 0;
	height: 1px; width: 0;
	background: var(--gpm-accent);
	transition: width .5s ease;
}
.gpm-more:hover::after { width: 100%; }
.gpm-arrow {
	width: 44px;
	height: auto;
	fill: none;
	stroke: var(--gpm-accent);
	stroke-width: 1.08px;
	transition: transform .3s ease;
}
.gpm-more:hover .gpm-arrow { transform: translateX(4px); }

.gpm-empty {
	padding: 24px;
	text-align: center;
	color: #777;
	background: #f5f5f5;
	border: 1px dashed #ccc;
	border-radius: 6px;
}

/* Responsivita */
@media (max-width: 1024px) {
	.gpm--cols-3 .gpm-grid,
	.gpm--cols-4 .gpm-grid,
	.gpm--cols-5 .gpm-grid,
	.gpm--cols-6 .gpm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.gpm-grid { grid-template-columns: 1fr !important; }
}
