/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-6);
  }
}

.container--sm {
  max-width: var(--container-sm);
}

.container--md {
  max-width: var(--container-md);
}

.container--lg {
  max-width: var(--container-lg);
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-20) 0;
  }
}

.section--sm {
  padding: var(--space-10) 0;
}

.section--lg {
  padding: var(--space-24) 0;
}

.section--gray {
  background: var(--color-gray-50);
}

.section--dark {
  background: var(--color-primary);
  color: var(--color-white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--color-white);
}

.section--dark p {
  color: var(--color-gray-300);
}

.section__header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-12);
}

.section__title {
  font-family: var(--font-title);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  text-align: center;
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .section__title {
    font-size: var(--text-4xl);
  }
}

.section__subtitle {
  text-align: center;
  color: var(--color-gray-600);
  font-size: var(--text-lg);
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

/* ===== GRID LAYOUTS ===== */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== FLEX LAYOUTS ===== */
.flex {
  display: flex;
}

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

.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-end {
  justify-content: flex-end;
}

/* ===== TWO COLUMN LAYOUT ===== */
.two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .two-column {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.two-column--reverse {
  direction: ltr;
}

@media (min-width: 768px) {
  .two-column--reverse > :first-child {
    order: 2;
  }
}

/* ===== MAIN CONTENT LAYOUT ===== */
.main-content {
  min-height: calc(100vh - 73px - 300px);
}

/* ===== SIDEBAR LAYOUT ===== */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .with-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

.sidebar {
  position: sticky;
  top: calc(73px + var(--space-6));
}

/* ===== NARROW CONTENT ===== */
.narrow-content {
  max-width: 800px;
  margin: 0 auto;
}

.narrow-content h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.narrow-content p {
  margin-bottom: var(--space-4);
}

.narrow-content ul,
.narrow-content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.narrow-content ul {
  list-style-type: disc;
}

.narrow-content ol {
  list-style-type: decimal;
}

.narrow-content li {
  margin-bottom: var(--space-2);
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: var(--color-gray-50);
  padding: var(--space-12) 0;
  text-align: center;
}

.page-header h1 {
  margin-bottom: var(--space-4);
}

.page-header p {
  color: var(--color-gray-600);
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
}
