/* Container & Kadence Compatibility */
.gr-pro-wrapper {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	display: block; /* Ensures proper document flow */
}

.gr-pro-inner {
	width: 100%;
}

/* =========================================
   LAYOUT MODES
   ========================================= */

/* 1. Strict Grid (Respects exact Column count) */
.gr-layout-grid {
	display: grid;
	grid-template-columns: repeat(var(--gr-cols, 3), 1fr);
	gap: var(--gr-gap, 15px);
}

/* 2. Strict Flex (Respects exact Column count via calc) */
.gr-layout-flex {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gr-gap, 15px);
}
.gr-layout-flex .gr-pro-card {
	/* Calculates precise width: (100% / cols) - (gap * (cols - 1) / cols) */
	width: calc((100% / var(--gr-cols)) - (var(--gr-gap) * (var(--gr-cols) - 1) / var(--gr-cols)));
	flex-grow: 0;
	flex-shrink: 0;
}

/* 3. Hybrid (Fluid auto-fill, prevents blowout in narrow Kadence columns) */
.gr-layout-hybrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--gr-card-min, 250px)), 1fr));
	gap: var(--gr-gap, 15px);
}

/* Responsive Fallbacks for Strict Grid & Flex */
@media (max-width: 900px) {
	.gr-layout-grid { grid-template-columns: repeat(2, 1fr); }
	.gr-layout-flex .gr-pro-card { width: calc((100% / 2) - (var(--gr-gap) / 2)); }
}
@media (max-width: 600px) {
	.gr-layout-grid { grid-template-columns: 1fr; }
	.gr-layout-flex .gr-pro-card { width: 100%; }
}

/* =========================================
   CARD DESIGN
   ========================================= */

.gr-pro-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 6px;
	box-sizing: border-box;
	overflow: hidden;
	position: relative;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid transparent;
}

.gr-pro-card.equal-height {
	height: 100%;
}

.gr-style-solid .gr-pro-card { border-color: #e2e8f0; }
.gr-shadow-light .gr-pro-card { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.gr-shadow-medium .gr-pro-card { box-shadow: 0 4px 10px rgba(0,0,0,0.08); }

.gr-hover-lift .gr-pro-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.gr-hover-zoom .gr-pro-card:hover .gr-pro-img { transform: scale(1.05); }

/* Image Area */
.gr-pro-img-wrap {
	position: relative;
	overflow: hidden;
	width: 100%;
	background: #f1f5f9;
	display: block;
}

.gr-ratio-16-9 { padding-bottom: 56.25%; }
.gr-ratio-4-3 { padding-bottom: 75%; }
.gr-ratio-1-1 { padding-bottom: 100%; }

.gr-pro-img {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

/* Content Area */
.gr-pro-content {
	padding: var(--gr-pad, 15px);
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.gr-pro-meta {
	font-size: 12px;
	color: #64748b;
	margin-bottom: 8px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.gr-pro-cat {
	color: #2563eb;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 11px;
}

.gr-pro-title {
	margin: 0 0 10px 0;
	font-size: var(--gr-title-sz, 18px);
	line-height: var(--gr-title-lh, 1.4);
	color: var(--gr-title-c, #000);
}

.gr-pro-title a { color: inherit; text-decoration: none; transition: color 0.2s; }
.gr-pro-title a:hover { color: #2563eb; }

.gr-pro-excerpt {
	font-size: var(--gr-exc-sz, 14px);
	line-height: var(--gr-exc-lh, 1.5);
	color: var(--gr-exc-c, #555);
	margin: 0 0 15px 0;
	flex-grow: 1;
}

/* =========================================
   LOAD MORE SYSTEM
   ========================================= */

/* The wrapper guarantees it is full width and centered below the inner grid */
.gr-pro-load-more-wrap {
	display: block;
	text-align: center;
	width: 100%;
	margin-top: 40px;
	clear: both;
}

.gr-pro-btn {
	background: #2563eb;
	color: #fff;
	border: none;
	padding: 12px 30px;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: background 0.2s, opacity 0.2s, transform 0.1s;
}

.gr-pro-btn:hover { background: #1d4ed8; transform: translateY(-1px); }
.gr-pro-btn:active { transform: translateY(0); }
.gr-pro-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gr-loader-spinner {
	animation: gr-spin 1s linear infinite;
	display: none;
}

@keyframes gr-spin { 100% { transform: rotate(360deg); } }

/* Overlays */
.gr-pro-overlay {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
	pointer-events: none;
}