/* Clients/Projects Section Styles */

.section__clients {
  padding: 7rem 0 0;
  width: 100%;
  justify-content: space-between;
  background: var(--primary);
}

.clients__grid {
  display: flex;
  flex-wrap: wrap;
  width: 100vw;
  height: calc(70vh);
}

.client__block {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: justify;
  padding: 2rem;
  overflow: hidden;
  color: var(--bg);
  cursor: default;
  flex: 1 1 50%;
}

.client__block__content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client__block.block1 {
  background-color: var(--brand);
}

.client__block.block2 {
  background-color: var(--secondary);
}

.client__block__title {
  font-size: var(--font-size-m);
  font-weight: var(--font-weight-bold);
  margin: 0;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
  color: var(--bg);
}

.client__block__description {
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-s);
  line-height: 1.65;
  max-width: 40ch;
  margin: 0 auto;
  transition: opacity 0.3s ease-in-out;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  display: none;
  color: var(--muted);
}

/* Desktop hover effects */
@media (min-width: 768px) {
  .client__block.block1:hover,
  .client__block.block2:hover {
    background-color: var(--bg);
  }

  .client__block:hover .client__block__title {
    display: none;
  }

  .client__block:hover .client__block__description {
    display: block;
  }
}

/* Desktop reordering for proper 2x2 grid layout */
@media (min-width: 769px) {

  .client__block:nth-child(1) { order: 1; } /* Process Automation - top left */
  .client__block:nth-child(2) { order: 2; } /* Booking System - top right */
  .client__block:nth-child(3) { order: 4; } /* Matching Algorithm - bottom right */
  .client__block:nth-child(4) { order: 3; } /* Product Configurator - bottom left */
}

/* Mobile styles for clients section */
@media (max-width: 767px) {
  .section__clients {
    padding-bottom: 0;
  }

  .section__clients .section__title {
    margin-bottom: 1rem;
  }

  .clients__grid {
    flex-direction: column;
    width: 100%;
    height: auto;
  }

  .client__block {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    padding: calc(0.5*var(--header-height));
    text-align: left;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }
  
  .client__block__content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .client__block__title {
    font-size: var(--font-size-s);
    position: relative;
    text-align: left;
    color: var(--bg);
    margin: 0 0 1rem 0;
    order: 1;
  }

  .client__block__description {
    font-size: var(--font-size-xs);
    position: static;
    display: block;
    color: var(--bg);
    max-width: 100%;
    margin: 0;
    order: 2;
    width: auto;
    top: auto;
    left: auto;
    transform: none;
    line-height: 1.65;
  }

  .client__block:last-child {
    margin-bottom: 0;
  }
}

/* Client link styles */
.client__link {
  color: inherit;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  transition: color 0.3s ease;
}

.client__link:hover {
  color: var(--primary);
  text-decoration: none;
}
