/* ================================
   Logos Section - About Page
================================ */

/* ================================
   Variables
================================ */
:root {
  --color-text-main: #0a1f44;
  --color-accent: #2f9d91;
  --max-width: 1100px;
}

/* ================================
   Featured Logos Section
================================ */
.featured-logos {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(180deg, #f6fbfa 0%, #ffffff 50%);
}

.featured-logos .logos-section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.featured-logos .underline {
  width: 120px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  margin: 0.5rem auto 2rem;
}

.featured-logos .logos-section-underline {
  width: 380px;
  height: 22px;
  margin: 0.5rem auto 2rem;
  display: block;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* ================================
   Logos Container - Desktop (Default)
================================ */
.logos-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Show/hide versions based on device */
.logos-desktop {
  display: block;
}

.logos-tablet {
  display: none;
}

.logos-mobile {
  display: none;
}

.logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  min-height: 90px;
}

.logos-row:last-child {
  margin-bottom: 0;
}

.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 90px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(20%);
  transition: filter 0.3s ease;
  border-radius: 4px;
}

.logo-item:hover,
.logo-item:focus {
  filter: grayscale(0%);
  outline: none;
}

/* Desktop Row Specific Layouts - Only for desktop version */
.logos-desktop .logos-row-1 {
  /* First row: 5 logos with specific widths */
  justify-content: space-between;
}

.logos-desktop .logos-row-1 .logo-item:nth-child(1) { flex: 0 0 22.5%; }
.logos-desktop .logos-row-1 .logo-item:nth-child(2) { flex: 0 0 20.0%; }
.logos-desktop .logos-row-1 .logo-item:nth-child(3) { flex: 0 0 25.1%; }
.logos-desktop .logos-row-1 .logo-item:nth-child(4) { flex: 0 0 17.9%; }
.logos-desktop .logos-row-1 .logo-item:nth-child(5) { flex: 0 0 14.5%; }

.logos-desktop .logos-row-2 {
  /* Second row: 4 logos with specific widths */
  justify-content: space-between;
}

.logos-desktop .logos-row-2 .logo-item:nth-child(1) { flex: 0 0 21.2%; }
.logos-desktop .logos-row-2 .logo-item:nth-child(2) { flex: 0 0 20.4%; }
.logos-desktop .logos-row-2 .logo-item:nth-child(3) { flex: 0 0 39.9%; }
.logos-desktop .logos-row-2 .logo-item:nth-child(4) { flex: 0 0 18.4%; }

.logos-desktop .logos-row-3 {
  /* Third row: 2 logos with specific widths */
  justify-content: flex-start;
}

.logos-desktop .logos-row-3 .logo-item:nth-child(1) { flex: 0 0 51%; }
.logos-desktop .logos-row-3 .logo-item:nth-child(2) { flex: 0 0 49%; }

/* ================================
   Tablet Styles (1200px - 576px)
================================ */
@media (max-width: 1200px) and (min-width: 576px) {
  /* Show tablet version, hide others */
  .logos-desktop {
    display: none;
  }
  
  .logos-tablet {
    display: block;
  }
  
  .logos-mobile {
    display: none;
  }
  
  .logos-row {
    margin-bottom: 1.5rem;
    min-height: 90px;
  }
  
  .logo-item {
    min-height: 90px;
  }
  
  /* Tablet: All rows with uniform distribution */
  .logos-row-1,
  .logos-row-2,
  .logos-row-4 {
    justify-content: space-between;
  }
  
  .logos-row-3 {
    justify-content: center;
  }
  
  /* Tablet: Uniform widths for all logos */
  .logos-tablet .logo-item {
    flex: 1 1 auto;
  }
}

/* ================================
   Mobile Styles (max-width: 575px)
================================ */
@media (max-width: 575px) {
  /* Show mobile version, hide others */
  .logos-desktop {
    display: none;
  }
  
  .logos-tablet {
    display: none;
  }
  
  .logos-mobile {
    display: block;
  }

  .logos-row {
    margin-bottom: 1.5rem;
    min-height: 90px;
  }
  
  .logo-item {
    min-height: 90px;
  }
  
  /* Mobile: All rows show 2 logos per row */
  .logos-row {
    justify-content: space-between;
  }
  
  /* Mobile: Uniform 50% width for each logo */
  .logos-mobile .logo-item {
    flex: 0 0 50%;
  }
  
  /* If last row has only 1 logo, left align it */
  .logos-row:last-child .logo-item:only-child {
    flex: 0 0 50%;
    margin-right: auto;
  }
}

@media (max-width: 400px) {
  .featured-logos {
    padding: 2rem 1rem;
  }

  .logos-row {
    margin-bottom: 1rem;
    min-height: 90px;
  }

  .logo-item {
    min-height: 90px;
  }
}

/* ================================
   WordPress Editor Styles
================================ */
.wp-block-group .featured-logos {
  margin: 0;
}

.wp-block-group .logos-grid {
  margin: 0 auto;
}

/* ================================
   Accessibility
================================ */
.featured-logos:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.logos-grid img:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}
