/**
 * Spacing System
 * Consistent spacing scale for Build for India theme
 * 
 * @package BuildForIndia
 * @since 1.0.0
 */

/* ============================================
   Spacing Scale (CSS Variables)
   ============================================ */
:root {
	--bfi-space-xs: 0.5rem;    /* 8px - Tight spacing, small gaps */
	--bfi-space-sm: 0.75rem;   /* 12px - Small gaps, compact lists */
	--bfi-space-md: 1rem;      /* 16px - Standard gaps, card sections */
	--bfi-space-lg: 1.5rem;    /* 24px - Section spacing, card padding */
	--bfi-space-xl: 2rem;      /* 32px - Large sections, major spacing */
	--bfi-space-2xl: 3rem;     /* 48px - Major sections, page spacing */
	
	/* Phase 5: Gap Scale for consistent spacing */
	--bfi-gap-xs: 0.5rem;      /* 8px */
	--bfi-gap-sm: 0.75rem;     /* 12px */
	--bfi-gap-md: 1rem;        /* 16px */
	--bfi-gap-lg: 1.5rem;      /* 24px */
	--bfi-gap-xl: 2rem;        /* 32px */
}

/* ============================================
   Card Spacing
   ============================================ */
.bfi-card {
	padding: var(--bfi-space-lg);
}

@media (min-width: 768px) {
	.bfi-card {
		padding: var(--bfi-space-lg);
	}
}

.bfi-card-section {
	margin-bottom: var(--bfi-space-md);
}

.bfi-card-section:last-child {
	margin-bottom: 0;
}

.bfi-card-metadata {
	gap: var(--bfi-space-md);
}

.bfi-card-metadata-row {
	gap: var(--bfi-space-md);
}

/* ============================================
   Section Spacing
   ============================================ */
.bfi-section {
	margin-bottom: var(--bfi-space-xl);
}

.bfi-section-tight {
	margin-bottom: var(--bfi-space-lg);
}

.bfi-section-loose {
	margin-bottom: var(--bfi-space-2xl);
}

/* ============================================
   Filter Spacing
   ============================================ */
.bfi-filter-group {
	margin-bottom: var(--bfi-space-lg);
}

.bfi-filter-group:last-child {
	margin-bottom: 0;
}

.bfi-filter-options {
	gap: var(--bfi-space-xs);
}

/* Phase 5: Standardized Filter Section Spacing */
.filter-section {
	gap: var(--bfi-gap-lg);
}

.filter-section-content {
	gap: var(--bfi-gap-md);
	margin-bottom: var(--bfi-gap-md);
}

/* ============================================
   Grid Spacing
   ============================================ */
.bfi-grid-tight {
	gap: var(--bfi-space-md);
}

.bfi-grid-normal {
	gap: var(--bfi-space-lg);
}

.bfi-grid-loose {
	gap: var(--bfi-space-xl);
}

/* ============================================
   Container Padding
   ============================================ */
.bfi-container {
	padding-left: var(--bfi-space-md);
	padding-right: var(--bfi-space-md);
}

@media (min-width: 640px) {
	.bfi-container {
		padding-left: var(--bfi-space-lg);
		padding-right: var(--bfi-space-lg);
	}
}

@media (min-width: 1024px) {
	.bfi-container {
		padding-left: var(--bfi-space-xl);
		padding-right: var(--bfi-space-xl);
	}
}

/* ============================================
   Phase 5: Spacing Normalization & Mobile Optimizations
   ============================================ */

/* Standardize sidebar card spacing */
.lg\:col-span-1 > div,
aside > div {
	gap: var(--bfi-gap-lg);
}

/* Improve mobile card padding - more comfortable touch area */
@media (max-width: 767px) {
	.startup-card,
	.investor-card,
	.incubator-card,
	.mou-partner-card {
		padding: 1.25rem !important; /* 20px - improved from 16px */
	}
	
	/* Ensure adequate spacing for mobile readability */
	.startup-card > *,
	.investor-card > *,
	.incubator-card > *,
	.mou-partner-card > * {
		margin-bottom: var(--bfi-gap-md);
	}
	
	.startup-card > *:last-child,
	.investor-card > *:last-child,
	.incubator-card > *:last-child,
	.mou-partner-card > *:last-child {
		margin-bottom: 0;
	}
}

/* Consistent section spacing on detail pages */
@media (min-width: 768px) {
	.lg\:col-span-2 > div,
	.lg\:col-span-2 .flex.flex-col.gap-8 > * {
		/* margin-bottom: var(--bfi-gap-xl); */
	}
	
	.lg\:col-span-2 > div:last-child,
	.lg\:col-span-2 .flex.flex-col.gap-8 > *:last-child {
		margin-bottom: 0;
	}
}

/* Normalize grid gaps across pages */
.grid.gap-6 {
	gap: var(--bfi-gap-lg);
}

.grid.gap-8 {
	gap: var(--bfi-gap-xl);
}

/* Consistent flex gaps */
.flex.gap-3 {
	gap: var(--bfi-gap-sm);
}

.flex.gap-4 {
	gap: var(--bfi-gap-md);
}

.flex.gap-6 {
	gap: var(--bfi-gap-lg);
}

.flex.gap-8 {
	gap: var(--bfi-gap-xl);
}

/* Mobile-specific spacing improvements */
@media (max-width: 767px) {
	/* Reduce excessive gaps on mobile for better content density */
	.flex.flex-col.gap-8 {
		gap: var(--bfi-gap-lg) !important;
	}
	
	/* Ensure comfortable spacing between sections */
	.mb-8 {
		margin-bottom: var(--bfi-gap-lg) !important;
	}
	
	/* Optimize form spacing on mobile */
	form .flex.flex-col.gap-4,
	.space-y-4 > * + * {
		margin-top: var(--bfi-gap-md) !important;
	}
}

