#main-content {
  margin-top: 90px;
}

.work-container {
  padding: var(--spacing-md) 5%;
  margin-bottom: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  position: relative;
}

/* Add a subtle connecting line between sections (Brush stroke concept) */
.work-container::before {
  content: '';
  position: absolute;
  left: 5%;
  bottom: -4rem;
  width: 2px;
  height: 4rem;
  background: linear-gradient(to bottom, var(--primary), transparent);
  opacity: 0.3;
}

.work-container:last-of-type::before {
  display: none;
}

/* Desktop: Alternating Layout handled naturally by HTML order, 
   just need to switch to row layout */
@media (min-width: 900px) {
  .work-container {
    flex-direction: row;
    gap: 4rem;
    align-items: stretch;
    /* Stretch to make heights equal */
  }

  .work-container:nth-child(even) {
    flex-direction: row-reverse;
    /* Just in case we want to force zig-zag, though HTML structure dictates it mostly */
  }
}

/* 2. TEXT BOX (Glass/Paper Effect) */
.text-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px 40px 20px 40px;
  /* Organic corners */
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: transform 0.3s ease;
}

.text-box:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

/* Decorative 'Tape' element on top of text box */
.text-box::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 25px;
  background: rgba(224, 122, 95, 0.2);
  /* Primary color low opacity */
  transform: translateX(-50%) rotate(-2deg);
  border-left: 2px dotted rgba(0, 0, 0, 0.1);
  border-right: 2px dotted rgba(0, 0, 0, 0.1);
}

.text-box h2 {
  font-family: var(--font-heading);
  font-size: var(--h2-size);
  margin-bottom: 1.5rem;
  color: var(--text-main);
  line-height: 1.2;
}

.text-box p {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* 3. IMAGE GRID (The "Collage" Layout) */
.image-grid {
  flex: 1;
  width: 100%;
  display: grid;
  gap: 10px;
  align-self: center;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 150px;
}

.image-grid .img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Hover effect: Pop out */
.image-grid .img:hover {
  transform: scale(1.03);
  z-index: 2;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.img1 {
  grid-column: 1 / 3;
  grid-row: span 2;
}

/* Big hero image */
.img2 {
  grid-column: 1 / 2;
}

.img3 {
  grid-column: 2 / 3;
}

.img4 {
  grid-column: 1 / 2;
}

.img5 {
  grid-column: 2 / 3;
}

/* Desktop Layout Logic (Complex Bento/Masonry) */
@media (min-width: 900px) {
  .image-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 140px);
    gap: 15px;
  }

  /* Asymmetric Art Collage Layout */
  .img1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    border-radius: 20px 4px 4px 20px;
  }

  .img2 {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
    border-radius: 4px 20px 4px 4px;
  }

  .img3 {
    grid-column: 3 / 4;
    grid-row: 2 / 4;
  }

  .img4 {
    grid-column: 4 / 5;
    grid-row: 2 / 4;
    border-radius: 4px 4px 20px 4px;
  }

  .img5 {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
    border-radius: 4px 4px 4px 20px;
  }
}

/* 4. MODAL / LIGHTBOX STYLES (UPDATED FOR SMOOTH TRANSITION) */
.img-modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(45, 42, 38, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Flex is always on, we control visibility/opacity */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* Hidden State */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  /* Smooth Transition */
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Active State */
.img-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.img-modal-content {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--bg-paper);

  /* Initial Zoom State */
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.img-modal.show .img-modal-content {
  transform: scale(1);
}

/* Close Button */
.img-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s, transform 0.3s;
  font-family: var(--font-body);
  line-height: 1;
  z-index: 2001;
}

.img-close:hover {
  color: var(--primary);
  transform: rotate(90deg);
}

/* Navigation Arrows */
.img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2001;
}

.img-nav:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.img-nav.left {
  left: 5%;
}

.img-nav.right {
  right: 5%;
}

@media (max-width: 768px) {
  .img-modal-content {
    max-width: 95%;
  }

  .img-nav {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
  }

  .img-nav.left {
    left: 2%;
  }

  .img-nav.right {
    right: 2%;
  }
}