/* * School Logo Grid Frontend Styles
 */

.slg-grid-container {
  display: flex; /* Use flexbox for the container */
  flex-wrap: wrap; /* Allow items to wrap to the next line */
  gap: 20px; /* Space between the cards */
  justify-content: flex-start; /* Align items to the start (prevents expanding) */
}

.slg-card {
  /* This is the key to your 5-column layout */
  /* 100% / 5 = 20%. Then subtract the gap. */
  /* (4 gaps * 20px) / 5 items = 16px average gap per item */
  width: calc(20% - 16px);
  
  /* These are the key to "don't expand" */
  flex-grow: 0;
  flex-shrink: 0;

  /* Card styles */
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
  box-sizing: border-box; /* Important for calc() to work correctly */
}

.slg-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.slg-card-logo {
  width: 100%;
  height: 120px; /* Fixed height for uniformity */
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slg-card-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Ensures logo fits without stretching */
}

.slg-card-name {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 10px 15px 15px;
  margin: 0;
  border-top: 1px solid #f0f0f0;
  background: #f9f9f9;
}

/* * Responsive Breakpoints
 * On smaller screens, we reduce the column count.
 */

/* Medium screens (e.g., tablets) - 3 columns */
@media (max-width: 1024px) {
  .slg-card {
    /* (2 gaps * 20px) / 3 items = ~13.3px */
    width: calc(33.33% - 14px);
  }
}

/* Small screens (e.g., landscape phones) - 2 columns */
@media (max-width: 768px) {
  .slg-card {
    /* (1 gap * 20px) / 2 items = 10px */
    width: calc(50% - 10px);
  }
}

/* Extra small screens (e.g., portrait phones) - 2 columns */
@media (max-width: 480px) {
  .slg-card {
    width: calc(50% - 10px); /* Two columns with spacing */
  }
}

/* ... [All your existing styles from Step 4 of the previous answer] ... */

/* * Styles for Search Bar 
 */
.slg-search-wrapper {
  margin-bottom: 25px; /* Adds space between search and grid */
}

.slg-search-bar {
  width: 100%;
  max-width: 450px; /* Limit width on large screens */
  padding: 12px 18px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.slg-search-bar:focus {
  border-color: #007cba; /* Highlight on focus */
  box-shadow: 0 0 0 1px #007cba;
  outline: none;
}