/* ========================================
   LAYOUT SYSTEM - Containers, Grids, Sections
   ======================================== */

/* ============ CONTAINERS ============ */

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

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

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

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

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


/* ============ SECTIONS ============ */

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

.section--small {
  padding: var(--space-6) 0;
}

.section--large {
  padding: var(--space-9) 0;
}

.section--no-padding-top {
  padding-top: 0;
}

.section--no-padding-bottom {
  padding-bottom: 0;
}

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

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

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

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

  .section--small {
    padding: var(--space-4) 0;
  }

  .section--large {
    padding: var(--space-6) 0;
  }
}


/* ============ GRID SYSTEMS ============ */

/* Flexible Grid */
.grid {
  display: grid;
  gap: var(--space-4);
}

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

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

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

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

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

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

/* Gap variations */
.grid--gap-small {
  gap: var(--space-2);
}

.grid--gap-large {
  gap: var(--space-6);
}

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

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

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


/* ============ FLEXBOX UTILITIES ============ */

.flex {
  display: flex;
}

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

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

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

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

.flex--gap-small {
  gap: var(--space-2);
}

.flex--gap {
  gap: var(--space-4);
}

.flex--gap-large {
  gap: var(--space-6);
}


/* ============ HERO SECTIONS ============ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  overflow: hidden;
  padding-bottom: 5vh;
}

.hero--medium {
  min-height: 70vh;
}

.hero--small {
  min-height: 50vh;
}

.hero__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Hero Slideshow */
.hero__slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  user-select: none;
}

.hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero__slide--active {
  opacity: 1;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(40, 54, 24, 0.2) 0%,
    rgba(40, 54, 24, 0.35) 50%,
    rgba(40, 54, 24, 0.65) 100%
  );
  z-index: -1;
}

.hero__content {
  max-width: 800px;
  padding: 0 var(--space-4);
  animation: fadeIn 1s ease;
}

.hero__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: none;
  color: var(--color-white);
}

.hero__subtitle {
  font-size: var(--text-xl);
  font-weight: var(--font-regular);
  margin-bottom: var(--space-5);
  opacity: 0.95;
  color: var(--color-white);
}

.hero__subtitle-badge {
  display: inline-block;
  background-color: transparent;
  padding: 0.4em 1.2em;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__cta {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.6;
}

/* Hero decorative corner accents */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-color: rgba(255, 255, 255, 0.15);
  border-style: solid;
  pointer-events: none;
  z-index: 1;
}

.hero::before {
  top: 100px;
  left: 30px;
  border-width: 2px 0 0 2px;
}

.hero::after {
  bottom: 100px;
  right: 30px;
  border-width: 0 2px 2px 0;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 80vh;
  }

  .hero__title {
    font-size: var(--text-2xl);
    line-height: 1.1;
  }

  .hero__subtitle {
    font-size: var(--text-lg);
  }

  .hero__cta {
    flex-direction: column;
    align-items: center;
  }
}


/* ============ SPLIT LAYOUT ============ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
}

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .split--reverse {
    direction: ltr;
  }
}


/* ============ GALLERY LAYOUTS ============ */

/* Masonry-style gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-3);
  grid-auto-flow: dense;
}

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

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

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

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

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

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


/* ============ UTILITY CLASSES ============ */

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Mobile-specific utilities */
@media (max-width: 768px) {
  .hidden-mobile { display: none; }
}

@media (min-width: 769px) {
  .hidden-desktop { display: none; }
}
