/* Graffico Blog Grid — style siatki bloga
   Wszystko scope'owane pod .gb-blog, żeby nie gryzło się z Divi. */

.gb-blog {
	--gb-card-bg: rgba(255, 255, 255, 0.04);
	--gb-card-border: rgba(255, 255, 255, 0.08);
	--gb-text: #ffffff;
	--gb-text-muted: rgba(255, 255, 255, 0.55);
	--gb-green: #86e764;
	--gb-pink: #e5147e;
	--gb-radius: 24px;
	--gb-radius-sm: 16px;

	color: var(--gb-text);
	max-width: 1200px;
	margin: 0 auto;
}

.gb-blog *,
.gb-blog *::before,
.gb-blog *::after {
	box-sizing: border-box;
}

/* ---------- Toolbar: wyszukiwarka + filtr ---------- */

.gb-blog__toolbar {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0 0 48px;
}

.gb-blog__search {
	position: relative;
	flex: 0 1 460px;
	min-width: 260px;
}

.gb-blog__search input[type="search"] {
	width: 100%;
	padding: 14px 52px 14px 24px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--gb-card-border);
	border-radius: 999px;
	color: var(--gb-text);
	font-size: 16px;
	line-height: 1.4;
	appearance: none;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.gb-blog__search input[type="search"]::placeholder {
	color: var(--gb-text-muted);
}

.gb-blog__search input[type="search"]:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.09);
}

.gb-blog__search button {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--gb-text-muted);
	cursor: pointer;
	transition: color 0.2s ease;
}

.gb-blog__search button:hover,
.gb-blog__search button:focus-visible {
	color: var(--gb-text);
}

.gb-blog__filter select {
	padding: 14px 48px 14px 24px;
	background: rgba(255, 255, 255, 0.06)
		url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
		no-repeat right 20px center;
	border: 1px solid var(--gb-card-border);
	border-radius: 999px;
	color: var(--gb-text);
	font-size: 16px;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.gb-blog__filter select:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.35);
}

.gb-blog__filter option {
	color: #111;
}

/* ---------- Siatka kart ---------- */

.gb-blog__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.gb-card {
	display: flex;
	flex-direction: column;
	padding: 16px 16px 28px;
	background: var(--gb-card-bg);
	border: 1px solid var(--gb-card-border);
	border-radius: var(--gb-radius);
	transition: transform 0.25s ease, border-color 0.25s ease;
}

.gb-card:hover {
	transform: translateY(-4px);
	border-color: rgba(255, 255, 255, 0.18);
}

.gb-card__media {
	display: block;
	overflow: hidden;
	border-radius: var(--gb-radius-sm);
	aspect-ratio: 370 / 244;
	margin-bottom: 20px;
}

.gb-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.gb-card:hover .gb-card__media img {
	transform: scale(1.04);
}

.gb-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.gb-card__title {
	margin: 0 0 10px;
	padding: 0 8px;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 500;
}

.gb-card__title a {
	color: var(--gb-text);
	text-decoration: none;
}

.gb-card__title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gb-card__cats {
	margin: 0 0 12px;
	padding: 0 8px;
	font-size: 15px;
}

.gb-card__cats a {
	color: var(--gb-green);
	text-decoration: none;
}

.gb-card__cats a:hover {
	text-decoration: underline;
}

.gb-card__excerpt {
	margin: 0;
	padding: 0 8px;
	color: var(--gb-text-muted);
	font-size: 15px;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gb-blog__empty {
	text-align: center;
	color: var(--gb-text-muted);
	padding: 64px 16px;
}

/* ---------- Paginacja ---------- */

.gb-blog__pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 56px;
}

.gb-blog__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--gb-card-border);
	border-radius: 999px;
	color: var(--gb-text);
	font-size: 15px;
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.gb-blog__pagination a.page-numbers:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.25);
}

.gb-blog__pagination .page-numbers.current {
	background: var(--gb-pink);
	border-color: var(--gb-pink);
	font-weight: 600;
}

.gb-blog__pagination .page-numbers.dots {
	background: transparent;
	border-color: transparent;
	color: var(--gb-text-muted);
}

.gb-blog__pagination .prev,
.gb-blog__pagination .next {
	padding: 0 24px;
}

/* ---------- Responsywność ---------- */

@media (max-width: 980px) {
	.gb-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.gb-blog__grid {
		grid-template-columns: 1fr;
	}

	.gb-blog__toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.gb-blog__search {
		flex-basis: auto;
	}

	.gb-blog__filter select {
		width: 100%;
	}

	.gb-blog__pagination .prev,
	.gb-blog__pagination .next {
		width: 100%;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gb-card,
	.gb-card__media img {
		transition: none;
	}
}
