/* Group Grid Layout Styles */

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}
/* ============================================================
   Grid layout styles for group boxes
   ============================================================ */

/* Main Grid Container */
.group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 100%;
}

/* First row: 3 columns */
.group-grid .group-box:nth-child(-n+3) {
  grid-row: 1;
}

.group-grid .group-box:nth-child(1) { grid-column: 1; }
.group-grid .group-box:nth-child(2) { grid-column: 2; }
.group-grid .group-box:nth-child(3) { grid-column: 3; }

/* Second row: 2 boxes of equal width, positioned at columns 1 and 3 */
.group-grid .group-box:nth-child(4) {
  grid-row: 2;
  grid-column: 1;
  justify-self: center;
  width: 100%;
}

.group-grid .group-box:nth-child(5) {
  grid-row: 2;
  grid-column: 3;
  justify-self: center;
  width: 100%;
}

/* Box Styling */
.group-box {
  border: 1px solid rgba(234, 179, 8, 0.3); /* Yellow border accent */
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  background: transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.group-box:hover {
  border-color: rgba(234, 179, 8, 0.6);
}

/* Group Name Styling */
.group-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #eab308; /* Yellow accent color */
}

/* Event Information */
.event-info {
  margin-bottom: 1rem;
  flex-grow: 1;
}

.event-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.event-date, .event-location {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.25rem;
}

/* Link Styling */
.group-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  align-self: flex-start;
}

.group-link:hover {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.3);
}

/* No longer needed as we've set explicit grid positioning above */

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .group-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 1rem;
    margin: 1.5rem auto;
  }
  
  /* Reset all grid positioning for mobile */
  .group-grid .group-box {
    grid-row: auto !important;
    grid-column: 1 !important;
    justify-self: stretch !important;
    width: 100% !important;
    margin-bottom: 1rem;
  }
  
  /* Ensure specific overrides for all child positions */
  .group-grid .group-box:nth-child(1),
  .group-grid .group-box:nth-child(2),
  .group-grid .group-box:nth-child(3),
  .group-grid .group-box:nth-child(4),
  .group-grid .group-box:nth-child(5) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
  
  .group-name {
    font-size: 1.25rem;
  }
  
  .event-title {
    font-size: 1rem;
  }
}

/* Small phone screens */
@media (max-width: 480px) {
  .group-grid {
    gap: 0.75rem;
    margin: 1rem auto;
  }
  
  .group-box {
    padding: 1rem;
  }
  
  .group-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .event-title {
    font-size: 0.9rem;
  }
  
  .event-date, .event-location {
    font-size: 0.8rem;
  }
  
  .group-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}