/**
 * Freedomman Theme - Layout, Container & Responsive Foundation
 *
 * @package Freedomman
 * @version 1.0.0
 */

/* --------------------------------------------------------------------------
 * 1. Unified Container System (Reusable across all pages and sections)
 * -------------------------------------------------------------------------- */
.fm-container {
	width: 100%;
	max-width: var(--fm-container-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--fm-gutter);
	padding-right: var(--fm-gutter);
}

/* Fluid full-bleed breakout if needed */
.fm-container-fluid {
	width: 100%;
	padding-left: var(--fm-gutter);
	padding-right: var(--fm-gutter);
}

/* --------------------------------------------------------------------------
 * 2. Section Spacing Foundation
 * -------------------------------------------------------------------------- */
.fm-section {
	padding-top: var(--fm-section-spacing);
	padding-bottom: var(--fm-section-spacing);
}

.fm-section-top {
	padding-top: var(--fm-section-spacing);
}

.fm-section-bottom {
	padding-bottom: var(--fm-section-spacing);
}

/* --------------------------------------------------------------------------
 * 3. Responsive Column Grid Foundation
 * Baseline: Desktop 12 cols, Tablet 8 cols, Mobile 4 cols
 * -------------------------------------------------------------------------- */
.fm-grid {
	display: grid;
	gap: var(--fm-space-6);
}

/* 12-Column Base Grid */
.fm-grid-12 {
	grid-template-columns: repeat(12, minmax(0, 1fr));
}

@media (max-width: 1023px) {
	.fm-grid-12 {
		grid-template-columns: repeat(8, minmax(0, 1fr));
		gap: var(--fm-space-4);
	}
}

@media (max-width: 767px) {
	.fm-grid-12 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--fm-space-3);
	}
}

/* Common Column Spans */
.fm-col-12 { grid-column: span 12 / span 12; }
.fm-col-8  { grid-column: span 8 / span 8; }
.fm-col-6  { grid-column: span 6 / span 6; }
.fm-col-4  { grid-column: span 4 / span 4; }
.fm-col-3  { grid-column: span 3 / span 3; }

@media (max-width: 1023px) {
	.fm-col-8,
	.fm-col-6 {
		grid-column: span 8 / span 8;
	}
	.fm-col-4,
	.fm-col-3 {
		grid-column: span 4 / span 4;
	}
}

@media (max-width: 767px) {
	.fm-col-12,
	.fm-col-8,
	.fm-col-6,
	.fm-col-4,
	.fm-col-3 {
		grid-column: span 4 / span 4;
	}
}

/* --------------------------------------------------------------------------
 * 4. Flexbox Layout Helpers
 * -------------------------------------------------------------------------- */
.fm-flex {
	display: flex;
}

.fm-flex-col {
	display: flex;
	flex-direction: column;
}

.fm-flex-center {
	display: flex;
	align-items: center;
	justify-content: center;
}

.fm-flex-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.fm-gap-sm { gap: var(--fm-space-2); }
.fm-gap-md { gap: var(--fm-space-4); }
.fm-gap-lg { gap: var(--fm-space-6); }

/* --------------------------------------------------------------------------
 * 5. Content Flow Foundation
 * -------------------------------------------------------------------------- */
.fm-posts-flow {
	display: flex;
	flex-direction: column;
	gap: var(--fm-space-6);
}
