/**
 * Layout Styles - Munazil Real Homes
 * Container, grid, and layout utilities
 * Mobile-first responsive layouts
 */

/* ===== CONTAINER ===== */

.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

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

@media (min-width: 768px) {
    .container {
        max-width: var(--container-md);
    }
}

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

@media (min-width: 1280px) {
    .container {
        max-width: var(--container-xl);
    }
}

/* Narrow container for content-focused pages */
.container-narrow {
    max-width: 800px;
}

/* ===== SECTIONS ===== */

section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

@media (min-width: 768px) {
    section {
        padding-top: var(--space-16);
        padding-bottom: var(--space-16);
    }
}

@media (min-width: 1024px) {
    section {
        padding-top: var(--space-20);
        padding-bottom: var(--space-20);
    }
}

/* Section with dark background */
.section-dark {
    background-color: var(--bg-dark);
    color: var(--text-on-dark);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
    color: var(--text-on-dark);
}

/* Section with light background */
.section-light {
    background-color: var(--bg-light);
}

/* Section with accent background */
.section-accent {
    background-color: var(--bg-accent);
}

/* ===== GRID SYSTEM ===== */

.grid {
    display: grid;
    gap: var(--space-6);
}

/* 2 column grid on tablet and up */
.grid-2 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3 column grid on desktop */
.grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 4 column grid on large desktop */
.grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Gap variations */
.gap-4 {
    gap: var(--space-4);
}

.gap-8 {
    gap: var(--space-8);
}

.gap-12 {
    gap: var(--space-12);
}

/* ===== FLEXBOX UTILITIES ===== */

.flex {
    display: flex;
}

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

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

/* ===== SPACING SECTIONS ===== */

/* Generous whitespace between sections */
.section-spacing {
    margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .section-spacing {
        margin-bottom: var(--space-16);
    }
}

@media (min-width: 1024px) {
    .section-spacing {
        margin-bottom: var(--space-20);
    }
}

/* ===== ASPECT RATIOS ===== */

/* For images and media */
.aspect-video {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.aspect-square {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.aspect-4-3 {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

/* ===== MAX WIDTH UTILITIES ===== */

.max-w-prose {
    max-width: 65ch;
}

.max-w-screen-sm {
    max-width: var(--container-sm);
}

.max-w-screen-md {
    max-width: var(--container-md);
}

.max-w-screen-lg {
    max-width: var(--container-lg);
}

/* ===== POSITION UTILITIES ===== */

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* ===== WIDTH & HEIGHT ===== */

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* ===== OVERFLOW ===== */

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Header Placeholder Sticky */
#header-placeholder {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}