/* Layout System - Grid, Flexbox, and responsive breakpoints */

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

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

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

/* CSS Grid base classes */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* Grid columns */
.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   FLEXBOX SYSTEM
   ======================================== */

.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-around {
    justify-content: space-around;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.gap-xl {
    gap: var(--spacing-xl);
}

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

/* Section base */
section {
    padding: var(--section-spacing) 0;
}

/* Section with background */
section:nth-child(even) {
    background-color: var(--color-beige);
}

section:nth-child(odd) {
    background-color: var(--color-background-alt);
}

/* ========================================
   SKIP LINK (Accessibility)
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-brown-dark);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-md) var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   SECTION TITLES
   ======================================== */

.section-title {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brown-dark);
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

/* ========================================
   VISIBILITY UTILITIES
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Small phones (default) */
/* Base styles are mobile-first */

/* Large phones, small tablets (481px and up) */
@media (min-width: 481px) {
    :root {
        --section-spacing: var(--spacing-4xl);
    }

    .grid-cols-sm-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets portrait (768px and up) */
@media (min-width: 768px) {
    .section-title {
        font-size: var(--font-size-5xl);
    }

    .grid-cols-md-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-md-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    section {
        padding: var(--section-spacing) 0;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .section-title {
        font-size: var(--font-size-6xl);
    }

    .grid-cols-lg-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-lg-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large desktop (1280px and up) */
@media (min-width: 1280px) {
    :root {
        --container-padding: var(--spacing-xl);
    }
}
