/* ============================================================
   Grid Portfolio — CSS isolado (âmbito .gp-wrap)
   ============================================================ */

.gp-wrap,
.gp-wrap *,
.gp-wrap *::before,
.gp-wrap *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-wrap {
	--gp-per-view: 4;
	--gp-accent: #E32227;
	--gp-filter-active: #E32227;
	--gp-radius: 16px;
	--gp-title-fs: 19px;
	--gp-title-fw: 700;
	--gp-text-fs: 14.5px;
	--gp-logo-size: 84px;
	--gp-badge-size: 40px;
	--gp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	width: 100%;
	font-family: var(--gp-font);
}

/* ---------- Filtros ---------- */
.gp-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 30px;
}

.gp-filter-btn {
	appearance: none;
	border: 1.5px solid #e2e2e5;
	background: #fff;
	color: #3a3a3d;
	font-size: 14px;
	font-weight: 600;
	padding: 11px 22px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .25s ease;
	white-space: nowrap;
	font-family: var(--gp-font);
}

.gp-filter-btn:hover {
	border-color: var(--gp-filter-active);
	color: var(--gp-filter-active);
}

.gp-filter-btn.is-active {
	background: var(--gp-filter-active);
	border-color: var(--gp-filter-active);
	color: #fff;
}

/* ---------- Carrossel ---------- */
.gp-carousel {
	width: 100%;
	overflow: hidden;
}

.gp-track {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 4px;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.gp-track::-webkit-scrollbar { display: none; }

/* ---------- Card ---------- */
.gp-card {
	flex: 0 0 calc((100% - (var(--gp-per-view) - 1) * 24px) / var(--gp-per-view));
	scroll-snap-align: start;
	background: #fff;
	border-radius: var(--gp-radius);
	border: 1.5px solid transparent;
	overflow: visible;
	box-shadow: 0 4px 18px rgba(20,20,25,0.06);
	transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
	display: flex;
	flex-direction: column;
}

.gp-card:hover {
	border-color: var(--gp-accent);
	box-shadow: 0 16px 30px rgba(20,20,25,0.1);
	transform: translateY(-4px);
}

.gp-card-media {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: var(--gp-radius) var(--gp-radius) 0 0;
	overflow: hidden;
	background: #e9e9eb;
}

.gp-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gp-card-media-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eee, #f7f7f7);
}

.gp-card-badge {
	position: absolute;
	top: 16px;
	right: 16px;
	width: var(--gp-badge-size);
	height: var(--gp-badge-size);
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.gp-card-badge .dashicons {
	color: var(--gp-accent);
	font-size: calc(var(--gp-badge-size) * 0.46);
	width: calc(var(--gp-badge-size) * 0.46);
	height: calc(var(--gp-badge-size) * 0.46);
}

.gp-card-logo {
	position: absolute;
	left: 20px;
	bottom: calc(var(--gp-logo-size) * -0.32);
	width: var(--gp-logo-size);
	height: var(--gp-logo-size);
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(0,0,0,0.14);
	overflow: hidden;
	padding: 8px;
}

.gp-card-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.gp-card-body {
	padding: calc(var(--gp-logo-size) * 0.4) 22px 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.gp-card-title {
	font-size: var(--gp-title-fs);
	font-weight: var(--gp-title-fw);
	color: #16161a;
	letter-spacing: -0.01em;
	line-height: 1.3;
	margin-bottom: 10px;
}

.gp-card-underline {
	display: block;
	width: 34px;
	height: 3px;
	border-radius: 2px;
	background: var(--gp-accent);
	margin-bottom: 14px;
}

.gp-card-text {
	font-size: var(--gp-text-fs);
	line-height: 1.6;
	color: #6a6a70;
}

/* ---------- Controlos (pontos + setas) ---------- */
.gp-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 32px;
}

.gp-dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.gp-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #d6d6da;
	border: 0;
	padding: 0;
	cursor: pointer;
	transition: all .25s ease;
}

.gp-dot.is-active {
	background: var(--gp-accent);
	width: 22px;
	border-radius: 5px;
}

.gp-arrows {
	display: flex;
	gap: 10px;
	margin-left: auto;
}

.gp-arrow {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1.5px solid #e2e2e5;
	background: #fff;
	color: #3a3a3d;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all .2s ease;
}

.gp-arrow:hover {
	border-color: var(--gp-accent);
	color: var(--gp-accent);
}

.gp-arrow:disabled {
	opacity: .35;
	cursor: default;
	border-color: #e2e2e5 !important;
	color: #3a3a3d !important;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
	.gp-card { flex-basis: calc((100% - 24px) / 2); }
}

@media (max-width: 620px) {
	.gp-card { flex-basis: 88%; }
	.gp-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
	.gp-controls { margin-top: 26px; }
}
