/* ============================================
   LOTUS THEME — LAYOUT
   Grid system, containers, section spacing
   ============================================ */

/* --- Containers --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

/* --- Sections --- */
.section {
  padding-block: var(--section-padding);
  position: relative;
  overflow: hidden;
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  overflow: hidden;
  position: relative;
}

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

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--navy {
  background-color: var(--color-navy);
  color: var(--color-text-on-dark);
  overflow: hidden;
  position: relative;
}

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

/* Dark section enhancements — subtle glow + animated gradient */
.section--dark::before,
.section--navy::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(224, 138, 44, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Section divider lines — gradient saffron fade */
.section + .section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(80%, 600px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 138, 44, 0.2) 30%, rgba(224, 138, 44, 0.2) 70%, transparent);
  pointer-events: none;
}

/* Don't show divider after dark sections (the color change is enough) */
.section--dark + .section::after,
.section--navy + .section::after,
.section + .section--dark::after,
.section + .section--navy::after {
  display: none;
}

.section--no-top { padding-top: 0; }
.section--no-bottom { padding-bottom: 0; }
.section--sm { padding-block: calc(var(--section-padding) * 0.5); }

/* --- Section Header --- */
.section__header {
  max-width: 720px;
  margin-bottom: var(--space-16);
}

.section__header--center {
  text-align: center;
  margin-inline: auto;
}

.section__header .label {
  margin-bottom: var(--space-4);
}

.section__header h2 {
  margin-bottom: var(--space-4);
}

.section__header p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.section--dark .section__header p,
.section--navy .section__header p {
  color: var(--color-text-on-dark);
  opacity: 0.8;
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: var(--gutter);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.grid--3 > * {
  width: calc((100% - var(--gutter) * 2) / 3);
}
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

.grid--auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 > * { width: calc((100% - var(--gutter)) / 2); }
}

@media (max-width: 768px) {
  .grid--2,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  .grid--3 > * { width: 100%; }
  .grid--6 { grid-template-columns: repeat(2, 1fr); }
}

/* --- Flex utilities --- */
.flex {
  display: flex;
}

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

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

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

.flex--gap-sm  { gap: var(--space-2); }
.flex--gap     { gap: var(--space-4); }
.flex--gap-md  { gap: var(--space-6); }
.flex--gap-lg  { gap: var(--space-8); }
.flex--gap-xl  { gap: var(--space-12); }

/* --- Spacing utilities --- */
.mt-auto { margin-top: auto; }
.mb-0    { margin-bottom: 0; }
.mb-4    { margin-bottom: var(--space-4); }
.mb-6    { margin-bottom: var(--space-6); }
.mb-8    { margin-bottom: var(--space-8); }
.mb-12   { margin-bottom: var(--space-12); }
.mb-16   { margin-bottom: var(--space-16); }

/* --- Content width --- */
.max-w-prose {
  max-width: 65ch;
}

/* --- Main content offset for sticky header --- */
.site-main {
  padding-top: var(--header-height);
}

/* The homepage hero handles its own offset */
.home .site-main {
  padding-top: 0;
}
