/* ===================================
   Patricia Gámez Estilista
   Layout System - Grid + Containers
   Extracted from Patricia's professional stylesheet
   =================================== */

/* === Container === */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

@media (max-width: 767px) {
  .container {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
}

/* === Section === */

.section {
  padding: var(--spacing-xxl) 0;
  position: relative;
}

.section-sm {
  padding: var(--spacing-lg) 0;
}

.section-lg {
  padding: var(--spacing-xxxl) 0;
}

.section-dark {
  background-color: var(--color-charcoal);
  color: var(--color-gray-light);
}

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

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

@media (max-width: 767px) {
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .section-sm {
    padding: var(--spacing-md) 0;
  }
}

/* === Grid System === */

.grid {
  display: grid;
  gap: var(--spacing-md);
}

.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(280px, 1fr));
}

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

/* Grid Gap Variations */
.grid-gap-sm {
  gap: var(--spacing-sm);
}

.grid-gap-lg {
  gap: var(--spacing-lg);
}

.grid-gap-xl {
  gap: var(--spacing-xl);
}

/* === Responsive Grid === */

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

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

/* === Flexbox Utilities === */

.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-wrap {
  flex-wrap: wrap;
}

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

.flex-gap-sm {
  gap: var(--spacing-sm);
}

.flex-gap-md {
  gap: var(--spacing-md);
}

.flex-gap-lg {
  gap: var(--spacing-lg);
}

/* === Alignment === */

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

/* === Columns (Legacy Grid from Patricia) === */

.column {
  width: 100%;
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

.one {
  width: 100%;
}

.one-half {
  width: 50%;
}

.one-third {
  width: 33.333%;
}

.two-thirds {
  width: 66.666%;
}

.one-fourth {
  width: 25%;
}

.three-fourths {
  width: 75%;
}

@media (max-width: 767px) {
  .one-half,
  .one-third,
  .two-thirds,
  .one-fourth,
  .three-fourths {
    width: 100%;
  }
}

/* === Wrapper === */

.wrapper {
  width: 100%;
  overflow: hidden;
}

.content-wrapper {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* === Clearfix === */

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* === Aspect Ratios === */

.aspect-ratio-16-9 {
  position: relative;
  padding-bottom: 56.25%; /* 9/16 = 0.5625 */
}

.aspect-ratio-4-3 {
  position: relative;
  padding-bottom: 75%; /* 3/4 = 0.75 */
}

.aspect-ratio-1-1 {
  position: relative;
  padding-bottom: 100%;
}

.aspect-ratio-16-9 > *,
.aspect-ratio-4-3 > *,
.aspect-ratio-1-1 > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Positioning === */

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
  top: 0;
}

/* === Overflow === */

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.overflow-scroll {
  overflow: scroll;
}

/* === Width Utilities === */

.w-full {
  width: 100%;
}

.w-auto {
  width: auto;
}

.max-w-full {
  max-width: 100%;
}

.max-w-text {
  max-width: var(--max-width-text);
}

/* === Height Utilities === */

.h-full {
  height: 100%;
}

.h-screen {
  height: 100vh;
}

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