*,
*::before,
*::after {
  box-sizing: border-box;
}



html {
  scroll-padding-top: 100px; /* avoids anchor links being hidden under sticky bar */
  overflow-x: hidden;

}


body {
  font-family: sans-serif;
  margin: 2rem;
  background: #f5f5f5;
  color: #333;
}

html, body {
  max-width: 100%;
}


.session-group {
  margin-bottom: 2.5rem;
}.session-group {
  margin-bottom: 3rem;
}

.session-time-header {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.25rem;
}



h2 {
  margin-top: .5rem;
  margin-bottom: 0;
}


/* Card style with collapsed content */
.card {
  background: white;
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 8px;
  position: relative;
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  width: 100%; /* NEW: ensures card fills container */
  max-width: 100%; /* NEW: caps width to container */
  box-sizing: border-box; /* ensures padding doesn't exceed width */
  word-wrap: break-word; /* prevent long words from overflowing */
}


.card.collapsed .card-description {
  max-height: 4.5em; /* roughly 3 lines */
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-button {
  align-self: flex-start;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  background: none;
  color: #007acc;
  border: none;
  cursor: pointer;
  padding: 0;
}
.read-more-button:hover {
  text-decoration: underline;
}

.weekday {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-button {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.4rem 1rem;
  margin: 0.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.day-button:hover {
  opacity: .5;
}

.day-button.active {
  background-color: #333;
  color: white;
  border-color: #333;
}

.clear-filters-button {
  background: #eee;
  border: 1px solid #ccc;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
}

.clear-filters-button:hover {
  background: #ddd;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* optional: just a safety net */
}



.card.collapsed .card-description {
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-button {
  align-self: flex-start;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  background: none;
  color: #007acc;
  border: none;
  cursor: pointer;
  padding: 0;
}
.read-more-button:hover {
  text-decoration: underline;
}


.custom-multiselect details {
  margin-top: 1rem;
}

.custom-multiselect summary {
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
}

.custom-multiselect summary::marker {
  display: none; /* hide default disclosure arrow in some browsers */
}

.custom-multiselect div[id$="-options"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.custom-multiselect details[open] summary::after {
  content: "▲";
  margin-left: 0.5rem;
  font-size: 0.7rem;
}

.custom-multiselect summary::after {
  content: "▼";
  margin-left: 0.5rem;
  font-size: 0.7rem;
}


.custom-multiselect label {
  display: flex;
  align-items: center;
  gap: 0.2em;
margin-bottom: .5rem;
  font-size: 0.95rem;
  background-color: #e0e0e0;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}

.custom-multiselect label:hover {
 opacity: .8;
}

/* Bigger checkboxes */
.custom-multiselect input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #333;
  cursor: pointer;
}

#intro {
  max-width: 960px;
  margin: 2rem auto 1rem auto;
  text-align: center;
}

#intro h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

#intro p {
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  margin: 0.5rem 0;
}

.credits {
  font-size: 0.85rem;
  color: #888;
  margin-top: 1rem;
}

.credits a {
  color: #007acc;
  text-decoration: none;
}
.credits a:hover {
  text-decoration: underline;
}

#filters {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f5f5f5;
  padding: 1rem 0;
  border-bottom: 1px solid #ccc;
  
 

}
#filters,
#schedule,
#intro {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}


#day-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* #event-count {
  text-align: center;
  font-weight: bold;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
} */



#filter-utility-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

#event-count {
  font-weight: bold;
  margin: 0;
}

.schedule-toggle-button {
  align-self: flex-end;
  background: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.schedule-toggle-button:hover {
  background: #e0e0e0;
}

.view-toggle-button {
  background: #eee;
  border: 1px solid #ccc;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
}
.view-toggle-button:hover {
  background: #ddd;
}


@media (max-width: 768px) {
  body {
    margin: 1rem;
  }

  .card-grid {
    gap: 1rem;
    grid-template-columns: 1fr;
    justify-items: center;

  }

  #filter-utility-bar {
    gap: 1rem;
    flex-direction: column;
  }

  .card {
    max-width: 300px;
  }

  #filters {
    padding: 0.5rem 1rem;
    gap: 0.75rem;         /* was 1.5rem */
    margin-bottom: 1rem;  /* tighten up space below */
  }

  #filter-utility-bar {
    gap: 0.5rem;
    flex-direction: column;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }

  #day-buttons {
    gap: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .custom-multiselect details {
    margin-top: 0.25rem;
  }

  .clear-filters-button,
  .view-toggle-button {
    width: 100%;        /* make buttons stack cleanly */
    max-width: 300px;   /* avoid going too wide */
  }

  .day-button{
    padding: 0.4rem .5rem;
    margin: 0;
  }

  .custom-multiselect details[open] > div {
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* required for momentum scroll on iOS */
    display: block; /* force layout recalculation */
  }

  .custom-multiselect details {
    display: block;
  }
  
  

}
