/**
 * @file
 * GB Global Theme - Layout Stylesheet
 * Page layout and grid structures
 */

/* ========================================
   Container Customization
   ======================================== */
.container-custom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
}

.container-full-width {
  width: 100%;
  padding: 0;
}

/* ========================================
   Main Layout Structure
   ======================================== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

/* ========================================
   Grid Layouts
   ======================================== */
.grid-2-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.grid-5-col {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
}

/* Responsive Grid */
@media (max-width: 1200px) {
  .grid-5-col {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 768px) {
  .grid-2-col,
  .grid-3-col,
  .grid-4-col,
  .grid-5-col {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .grid-2-col,
  .grid-3-col,
  .grid-4-col,
  .grid-5-col {
    grid-template-columns: 1fr;
  }
}

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

.layout-with-sidebar.left-sidebar {
  grid-template-columns: 300px 1fr;
}

@media (max-width: 992px) {
  .layout-with-sidebar,
  .layout-with-sidebar.left-sidebar {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Section Spacing
   ======================================== */
.section-space-small {
  padding: 2rem 0;
}

.section-space-medium {
  padding: 4rem 0;
}

.section-space-large {
  padding: 6rem 0;
}

/* ========================================
   Content Width Variations
   ======================================== */
.content-narrow {
  max-width: 800px;
  margin: 0 auto;
}

.content-medium {
  max-width: 1000px;
  margin: 0 auto;
}

.content-wide {
  max-width: 1200px;
  margin: 0 auto;
}

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

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

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

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

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

/* ========================================
   Header Layout
   ======================================== */
.header-wrapper {
  position: relative;
}

.header-top {
  background-color: var(--primary-navy);
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.header-main {
  background-color: var(--primary-navy);
  padding: 1rem 0;
}

/* ========================================
   Footer Layout
   ======================================== */
.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ========================================
   Region Layouts
   ======================================== */
.region-hero {
  width: 100%;
}

.region-featured {
  background-color: #f8f9fa;
  padding: 4rem 0;
}

.region-content-top,
.region-content-bottom {
  padding: 2rem 0;
}

/* ========================================
   Two Column Content Layout
   ======================================== */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.two-col-layout.reverse {
  direction: rtl;
}

.two-col-layout.reverse > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .two-col-layout {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Image-Text Combo Layouts
   ======================================== */
.image-text-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.image-text-section.image-right {
  direction: rtl;
}

.image-text-section.image-right > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .image-text-section {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Spacing Utilities
   ======================================== */
.mt-small { margin-top: 1rem; }
.mt-medium { margin-top: 2rem; }
.mt-large { margin-top: 4rem; }

.mb-small { margin-bottom: 1rem; }
.mb-medium { margin-bottom: 2rem; }
.mb-large { margin-bottom: 4rem; }

.pt-small { padding-top: 1rem; }
.pt-medium { padding-top: 2rem; }
.pt-large { padding-top: 4rem; }

.pb-small { padding-bottom: 1rem; }
.pb-medium { padding-bottom: 2rem; }
.pb-large { padding-bottom: 4rem; }

/* ========================================
   Full Width Sections
   ======================================== */
.full-width-section {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
