/* ==========================================================================
   Layout System
   Containers, sections, and grid helpers
   ========================================================================== */

/* --- Container --- */
.container {
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    margin-left: auto;
    margin-right: auto;
    max-width: var(--container-max-width);
}

/* --- Sections --- */
.section {
    position: relative;
}

.section-padded {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
}

@media screen and (max-width: 575px) {
    .section-padded {
        padding-top: var(--section-padding-mobile);
        padding-bottom: var(--section-padding-mobile);
    }
}

/* --- Section with background image --- */
.section-hero {
    position: relative;
    overflow: hidden;
}

.section-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 0;
}

.section-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.section-hero .hero-content {
    position: relative;
    z-index: 2;
}

/* --- Flex Row --- */
.flex-row {
    display: flex;
    flex-wrap: wrap;
}

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

.flex-row.align-stretch {
    align-items: stretch;
}

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

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

.flex-row.gap-md {
    gap: 1rem;
}

.flex-row.gap-lg {
    gap: 2rem;
}

/* --- Columns --- */
.col {
    flex: 1 1 0;
    min-width: 0;
}

.col-auto {
    flex: 0 0 auto;
}

.col-half {
    flex: 0 0 calc(50% - 0.5rem); /* Assuming gap-md 1rem */
    max-width: calc(50% - 0.5rem);
}

.col-third {
    flex: 0 0 calc((100% - 2rem) / 3); /* Assuming gap-md 1rem, 2 gaps */
    max-width: calc((100% - 2rem) / 3);
}

.col-quarter {
    flex: 0 0 calc((100% - 3rem) / 4); /* Assuming gap-md 1rem, 3 gaps */
    max-width: calc((100% - 3rem) / 4);
}

@media screen and (max-width: 768px) {
    .col-half,
    .col-third,
    .col-quarter {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media screen and (max-width: 575px) {
    .col-half,
    .col-third,
    .col-quarter {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* --- Overflow --- */
.overflow-hidden {
    overflow: hidden;
}

.overflow-visible {
    overflow: visible;
}

/* --- Text alignment --- */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* --- Full width section (edge to edge) --- */
.full-width {
    width: 100%;
}
