/* ===================================================================
   Kitchen Eyes - Layout System
   Container, grid, section, and structural layout patterns
   =================================================================== */

/* -- Container -- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--sp-lg);
}

.container--wide {
    max-width: var(--max-width-wide);
}

.container--narrow {
    max-width: 960px;
}

/* -- Section -- */
.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section--dark {
    background: var(--navy);
}

.section--darker {
    background: var(--navy-deepest);
}

.section--alt {
    background: var(--grad-section-alt);
}

.section--surface {
    background: var(--surface-dark);
}

.section--deep {
    background: linear-gradient(180deg, var(--navy-deepest) 0%, var(--navy) 100%);
}

/* Subtle top-edge for visual section rhythm */
.section--dark::before,
.section--darker::before,
.section--alt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.03) 20%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 80%, transparent 95%);
    opacity: 1;
}

/* Ambient spotlight on section tops */
.section--dark::after,
.section--alt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 300px;
    background: radial-gradient(ellipse at center top, rgba(30,127,122,0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* -- Section Header -- */
.section-header {
    text-align: center;
    margin-bottom: var(--sp-4xl);
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.section-header .label {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal-light);
    margin-bottom: var(--sp-lg);
    padding: 6px var(--sp-xl);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    background: var(--teal-glow);
    box-shadow: 0 0 20px rgba(30, 127, 122, 0.06);
}

.section-header .label--gold {
    color: var(--gold);
    border-color: var(--border-gold);
    background: var(--gold-glow);
    box-shadow: 0 0 20px rgba(184, 149, 94, 0.05);
}

.section-header h2 {
    margin-bottom: var(--sp-lg);
}

.section-header p {
    margin: 0 auto;
    color: var(--text-secondary);
    max-width: 600px;
    font-size: 1.05rem;
    line-height: 1.85;
}

/* -- Accent Bar -- */
.accent-bar {
    width: 60px;
    height: 2px;
    background: var(--grad-teal);
    border-radius: var(--radius-full);
    margin: var(--sp-lg) auto;
    position: relative;
    box-shadow: 0 0 12px rgba(30, 127, 122, 0.15);
}

.accent-bar--left {
    margin-left: 0;
}

.accent-bar--gold {
    background: var(--grad-gold);
    box-shadow: 0 0 12px rgba(184, 149, 94, 0.12);
}

/* -- Grid Layouts -- */
.grid {
    display: grid;
    gap: var(--sp-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }

.grid--auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* -- Flex Layouts -- */
.flex {
    display: flex;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    align-items: center;
    justify-content: space-between;
}

.flex--col {
    flex-direction: column;
}

.flex--gap-sm { gap: var(--sp-sm); }
.flex--gap-md { gap: var(--sp-md); }
.flex--gap-lg { gap: var(--sp-lg); }
.flex--gap-xl { gap: var(--sp-xl); }

/* -- Two Column Split -- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3xl);
    align-items: center;
}

.split--reverse {
    direction: rtl;
}
.split--reverse > * {
    direction: ltr;
}

/* -- Responsive -- */
@media (max-width: 1024px) {
    .grid--3,
    .grid--4,
    .grid--5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .split {
        grid-template-columns: 1fr;
        gap: var(--sp-2xl);
    }
}

@media (max-width: 768px) {
    .grid--2,
    .grid--3,
    .grid--4,
    .grid--5 {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 var(--sp-md);
    }
}
