/* Layout CSS - Structural Elements */
/* Grid Systems, Containers, Navigation Layouts, Page Structures */

/* ==================== CONTAINERS ==================== */

/* Base container */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Container sizes */
.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

.container-xl {
    max-width: 1280px;
}

.container-2xl {
    max-width: 1536px;
}

/* Responsive containers */
@media (min-width: 640px) {
    .container { max-width: 640px; }
}

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

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}

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

@media (min-width: 1536px) {
    .container { max-width: 1536px; }
}

/* Full-width container */
.container-fluid {
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Section container */
.section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.section-sm {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.section-lg {
    padding-top: 8rem;
    padding-bottom: 8rem;
}

/* ==================== GRID SYSTEMS ==================== */

/* Base grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

/* Grid columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* Grid rows */
.grid-rows-1 { grid-template-rows: repeat(1, minmax(0, 1fr)); }
.grid-rows-2 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.grid-rows-3 { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.grid-rows-4 { grid-template-rows: repeat(4, minmax(0, 1fr)); }

/* Grid column span */
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-12 { grid-column: span 12 / span 12; }
.col-span-full { grid-column: 1 / -1; }

/* Grid gaps */
.grid-gap-sm { gap: 0.5rem; }
.grid-gap-md { gap: 1rem; }
.grid-gap-lg { gap: 1.5rem; }
.grid-gap-xl { gap: 2rem; }

/* Auto-fit grid (responsive without media queries) */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* ==================== FLEXBOX LAYOUTS ==================== */

/* Flex layouts */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

/* Two column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Three column layout */
.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Sidebar layout */
.sidebar-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.sidebar-layout-reverse {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
}

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

.hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, var(--primary), #004080);
    color: white;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 48rem;
}

.hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 51, 102, 0.85), rgba(0, 51, 102, 0.4));
    z-index: 1;
}

/* Hero variants */
.hero-fullscreen {
    min-height: 100vh;
}

.hero-large {
    min-height: 675px;
}

.hero-medium {
    min-height: 500px;
}

.hero-small {
    min-height: 350px;
}

/* ==================== PAGE LAYOUTS ==================== */

/* Standard page wrapper */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    flex-shrink: 0;
}

.page-content {
    flex: 1;
}

.page-footer {
    flex-shrink: 0;
}

/* Content area */
.content-area {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Split screen layout */
.split-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.split-screen-left,
.split-screen-right {
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== HEADER & NAVIGATION ==================== */

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.header-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation */
.nav-primary {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-secondary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    font-weight: 500;
    color: #374151;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

/* Mobile navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 2rem;
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    margin-bottom: 1rem;
}

.mobile-nav-link {
    display: block;
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary);
    border-radius: 0.5rem;
}

.mobile-nav-link:hover {
    background: var(--secondary);
}

/* ==================== FOOTER ==================== */

.site-footer {
    background: var(--primary);
    color: white;
    padding: 4rem 1.5rem;
}

.footer-container {
    max-width: 80rem;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

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

/* Feature section */
.features-section {
    padding: 5rem 0;
    background: var(--secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

/* CTA section */
.cta-section {
    padding: 5rem 0;
    text-align: center;
    background: linear-gradient(to right, var(--accent), #e6c200);
}

.cta-content {
    max-width: 48rem;
    margin: 0 auto;
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ==================== MASONRY LAYOUT ==================== */

.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* ==================== RESPONSIVE LAYOUTS ==================== */

/* Tablet adjustments */
@media screen and (max-width: 1024px) {
    .two-col,
    .three-col {
        grid-template-columns: 1fr;
    }
    
    .sidebar-layout,
    .sidebar-layout-reverse {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .split-screen {
        grid-template-columns: 1fr;
    }
    
    .masonry-grid {
        column-count: 2;
    }
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .hero {
        min-height: 400px;
    }
    
    .hero-content {
        padding: 2rem;
    }
    
    .nav-primary {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .masonry-grid {
        column-count: 1;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile small screens */
@media screen and (max-width: 480px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
    
    .section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .hero {
        min-height: 300px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

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

.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-3-2 { aspect-ratio: 3 / 2; }

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

.section-spacing {
    padding: 5rem 0;
}

.section-spacing-sm {
    padding: 3rem 0;
}

.section-spacing-lg {
    padding: 8rem 0;
}

/* ==================== OVERLAY ==================== */

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.overlay-light {
    background: rgba(255, 255, 255, 0.8);
}

.overlay-dark {
    background: rgba(0, 0, 0, 0.7);
}

.overlay-gradient {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7));
}

/* ==================== STICKY ELEMENTS ==================== */

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* ==================== FULL HEIGHT SECTIONS ==================== */

.min-h-screen {
    min-height: 100vh;
}

.min-h-75 {
    min-height: 75vh;
}

.min-h-50 {
    min-height: 50vh;
}

/* ==================== PRINT LAYOUTS ==================== */

@media print {
    .site-header,
    .site-footer,
    .mobile-nav {
        display: none;
    }
    
    .page-wrapper {
        display: block;
    }
    
    .section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }
}
