/* =========================================================================
 * GARRY – Příspěvkový carousel  (frontend styly)
 * ========================================================================= */

.gpc {
	--gpc-gap: 25px;
	--gpc-accent: #d16b55;
	--gpc-visible: 3;
	--gpc-visible-t: 2;
	--gpc-visible-m: 1;
	position: relative;
	width: 100%;
}

.gpc-viewport {
	overflow: hidden;
	width: 100%;
}

.gpc-track {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	will-change: transform;
}

.gpc-item {
	flex: 0 0 auto;
	box-sizing: border-box;
	min-width: 0;
	/* Šířka karty řízena CSS (funguje i bez JS) – JS pak jen posouvá */
	width: calc((100% - (var(--gpc-visible) - 1) * var(--gpc-gap)) / var(--gpc-visible));
	margin-right: var(--gpc-gap);
	display: flex;
	flex-direction: column;
	background: var(--gpc-card-bg, #FBFAF6);
}
@media (max-width: 1024px) {
	.gpc-item { width: calc((100% - (var(--gpc-visible-t) - 1) * var(--gpc-gap)) / var(--gpc-visible-t)); }
}
@media (max-width: 767px) {
	.gpc-item { width: calc((100% - (var(--gpc-visible-m) - 1) * var(--gpc-gap)) / var(--gpc-visible-m)); }
}

.gpc-media {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #eee;
}
.gpc-media .gpc-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.gpc-item:hover .gpc-media .gpc-img { transform: scale(1.05); }

.gpc-media-ph {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(135deg, #f0ebe4 0%, #e6ded4 100%);
}
.gpc-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;
}

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

.gpc-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;
}
.gpc-title:hover { color: var(--gpc-accent); }

.gpc-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;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

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

/* ---- Navigační šipky ---- */
.gpc-nav {
	position: absolute;
	top: 38%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--gpc-accent);
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
	transition: background .2s ease, transform .2s ease;
}
.gpc-nav:hover { background: #b95a45; transform: translateY(-50%) scale(1.06); }
.gpc-nav:active { transform: translateY(-50%) scale(.96); }
.gpc-prev { left: -8px; }
.gpc-next { right: -8px; }
.gpc-nav[disabled] { opacity: .35; cursor: default; }

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

@media (max-width: 767px) {
	.gpc-nav { width: 40px; height: 40px; font-size: 22px; }
	.gpc-prev { left: 0; }
	.gpc-next { right: 0; }
}
