/* ============================================
   LAYOUT — Grid, Containers, Responsive
   ============================================ */

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

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

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

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

.section--clip {
  overflow: hidden;
}

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-light);
}

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

.section--dark p {
  color: var(--color-text-on-dark);
}

.section--dark .section__label {
  color: var(--color-accent);
}

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

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

/* Section Header (titulo + subtitulo de seccion) */
.section__header {
  text-align: center;
  max-width: var(--container-narrow);
  margin: 0 auto var(--space-2xl);
}

.section__label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  position: relative;
}

.section__label::before,
.section__label::after {
  content: '';
  display: inline-block;
  width: 30px;
  height: 1px;
  background: var(--color-accent);
  vertical-align: middle;
  margin: 0 var(--space-md);
  opacity: 0.5;
}

.section__title {
  margin-bottom: var(--space-lg);
}

.section__title .accent {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--color-primary);
}

.section__description {
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
}

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

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

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

/* === FLEX HELPERS === */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* === DIVIDERS === */
.divider {
  width: 60px;
  height: 1px;
  background: var(--color-accent);
  margin: var(--space-lg) auto;
  opacity: 0.5;
}

.divider--leaf {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  margin: var(--space-xl) auto;
  position: relative;
}

.divider--leaf::before {
  content: '\1F33F';
  font-size: 1.5rem;
  opacity: 0.4;
}

/* === RESPONSIVE === */
@media (max-width: 1400px) {
  .container { padding: 0 var(--space-lg); }
}

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

@media (max-width: 768px) {
  .container { padding: 0 var(--space-md); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .section__label::before,
  .section__label::after { width: 20px; }
}

@media (max-width: 480px) {
  :root {
    --section-padding: clamp(3rem, 8vh, 5rem);
  }
}
