/* To format the Event List in the right rail appropriately */
.eventlist {
  font-family: 'Ubuntu', 'Arial', sans-serif;
  font-size: 16px;
  text-align: center;
 }
.subform {
  font-family: 'Ubuntu', 'Arial', sans-serif;
  font-size: 26px;
  color: orange
}

/* These make the youtube videos on various pages responsive */

.youtube-video-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.youtube-video-container::after {
  display: block;
  content: "";
  padding-top: 56.25%;
}

.youtube-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Main container for all sponsor groups, arranged in a single row */
.all-sponsors-combined-row-container {
  display: flex; /* Arrange groups in a row */
  flex-wrap: wrap; /* Allow groups to wrap to the next line on smaller screens */
  justify-content: center; /* Center the entire row of groups */
  gap: 30px; /* Space between the group columns (Gold, Silver, Bronze) */
  margin: 40px auto; /* Center the wrapper on the page */
  max-width: 1200px; /* Limit overall width for better readability on very wide screens */
  padding: 0 15px; /* Add some padding on the sides for smaller screens */
}

/* Styling for each individual group column (Gold, Silver, Bronze) */
.sponsor-group-column {
  flex-grow: 1; /* Allow columns to grow */
  flex-shrink: 1; /* Allow columns to shrink */
  flex-basis: 30%; /* Default flexible basis for each column */
  /* This will be overridden for specific widths on desktop in media query below */

  padding: 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Shadow for the group box */
  text-align: center; /* Center the H3 and logos within the column */
  box-sizing: border-box; /* Include padding and border in the element's total width */
}

.sponsor-group-column h3 {
  font-size: 1.6em;
  margin-bottom: 25px;
  color: #333;
}

/* Inner container for logos within each group */
.sponsor-group-inner-container {
  display: flex;
  flex-wrap: wrap; /* Allows individual logos to wrap within their group */
  justify-content: center; /* Center logos within their group */
  gap: 15px; /* Space between individual logo items */
}

/* Individual sponsor item styling (the logo box) */
.sponsor-item {
  padding: 15px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Shadow for individual logo box */
  box-sizing: border-box;

  /* Global max-width for all logos */
  max-width: 200px; /* Max width for the logo item box */
  min-width: 100px; /* Allow shrinking down to this size before wrapping */
  flex-basis: auto; /* Let content determine initial flex basis */

  /* Flexbox for vertical alignment of logo within its box */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.sponsor-item img {
  max-width: 100%; /* Image will scale down to fit sponsor-item's max-width */
  height: auto; /* Maintain aspect ratio */
  display: block;
}

.sponsor-item p {
  font-size: 0.9em;
  color: #555;
  font-weight: bold;
  margin-top: 10px; /* Space above the text if present */
}

/* --- Responsive Adjustments --- */

/* Desktop Layout: Groups in a row with flexible width */
@media (min-width: 769px) {
  .sponsor-group-column {
    /* Adjust flex-basis to allow columns to fit nicely.
       Using a percentage that, when combined with gaps,
       allows 3 columns to fit. Approx 30-32% is good depending on gap. */
    flex-basis: calc(33.33% - 20px); /* 3 columns, accounting for gap */
    max-width: calc(33.33% - 20px);
  }
}

/* Tablet and Mobile Layout: Groups stack vertically */
@media (max-width: 768px) {
  .all-sponsors-combined-row-container {
    flex-direction: column; /* Stack the groups vertically */
    align-items: center; /* Center the stacked groups */
  }

  .sponsor-group-column {
    width: 95%; /* Make each group take almost full width on mobile */
    max-width: 400px; /* Prevent them from becoming too wide on larger phones/small tablets */
    margin-bottom: 30px; /* Add space between stacked groups */
  }

  /* Adjust individual logo item sizes for mobile stacking */
  .sponsor-item {
    max-width: 150px; /* Logos can be smaller on mobile */
    min-width: 80px; /* Ensure they don't get too small */
    padding: 10px;
  }
}

/* Further adjustments for very small screens */
@media (max-width: 480px) {
  .sponsor-group-column h3 {
    font-size: 1.4em;
    margin-bottom: 15px;
  }
  .sponsor-item {
    max-width: 120px;
    min-width: 70px;
  }
}