/* Add styles for grid container and items */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 100%;
  overflow-x: hidden;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.grid-item,
article {
  background-color: var(--bg-alt);
  border-radius: var(--standard-border-radius);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1rem;
}

.dark {
  background-color: var(--bg);
}

.left {
  float: left;
}

.center {
  float: none;
  margin: 0 auto;

}

.grid-item h2,
article h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: var(--mid-font-weight);
}

.grid-item iframe {
  width: 100%;
  border-radius: var(--standard-border-radius);
}

/* Add styles for expanded grid item */
.grid-item.expanded {
  grid-column: span 2;
  grid-row: span 2;
}

.grid-item p,
article p,
.grid-item img {
  height: auto;
  white-space: wrap;
  text-align: justify;
  text-justify: inter-word;
}

.grid-item.expanded p,
.grid-item.expanded img {
  display: block;
}

.grid-item img.large {
  width: 100%;
  height: auto;
}

.light {
  color: var(--text-light);
  border-color: var(--text-light);
  background-color: var(--accent-bg-light);
}

.grayList {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  /* Ensures items fill the parent width */
  gap: 0.5rem;
  /* Adds space between rows when wrapping */
  padding: 0;
  margin: 0;
}

.grayList li {
  list-style-type: none;
  flex: 1 1 calc(25% - 1rem);
  max-width: calc(25% - 1rem);
  padding: 0;
  margin: 0;
}

.grayList img {
  filter: grayscale(100%);
  margin: 0;
  padding: 0;
  /* Removes fixed margins for flexible alignment */
  transition: filter 0.3s, transform 0.1s;
}

.grayList img:hover {
  filter: grayscale(0%);
  transform: scale(0.98);
  /* Shrinks the image slightly without moving */
}

.sidenav {
  width: var(--sidenav-width);
  background-color: var(--accent-bg);
  overflow-x: hidden;
  padding-inline: 0.5rem;
  white-space: nowrap;
  overflow-y: auto;
  /* Allow scrolling if content overflows */
}

.sidenav a {
  text-decoration: none;
  color: var(--text-light);
  display: block;
}

.sidenav a:hover {
  color: var(--text);
}

.sidenav a.active {
  color: var(--sub-accent);
  font-weight: bold;
  
}

.news {
  position: sticky;
  top: 0;
  width: 100%;
  color: var(--accent-bg);
  background-color: var(--text-light);
  border-bottom: 1px solid;
  flex-wrap: nowrap;
  justify-content: center;
  font-size: 1.1rem;
  user-select: none;
  z-index: 1;
  margin: 0;
  height: auto; /* Adjusts height to fit content */
}

.news p {
  margin: 0;
  padding: 0.25rem;
  text-align: center;
}

.news:empty {
  visibility: collapse;
}

.sections-container {
  margin: 0;
  padding: 0;
}

.green {
  color: var(--sub-accent);
}

.green a,
.green a:visited {
  color: var(--sub-accent);
  text-decoration: none;
}

.green a:hover {
  color: var(--text-light);
  text-decoration: underline;
}

.smaller {
  font-size: 0.8rem;
}
.bigger {
  font-size: 1.6rem;
}

.lefty {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}


.leftyList {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  /* Ensures items fill the parent width */
  max-width: fit-content;
  padding: 0;
  margin: 0;
}

.leftyList li {
  list-style-type: none;
  min-width: 30px;
  padding: 0;
  margin: 0;
  width: auto;
}

.noPad {
  padding: 0;
}

.noMargin {
  margin: 0;
}

.fit {
  max-width: fit-content;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: flex-start;
  /* Ensures items in both columns align at the top */
}
.full {
  /* Makes the popup span the full width of the content */
  max-width: 100%;
  /* Centers the popup horizontally */
  padding: 1rem;
  /* Optional: Adds padding for better spacing */
  box-sizing: border-box;
  /* Ensures padding is included in the width */
  place-items: center;
  background-color: var(--bg);
}

/* Add theme toggle button styles */
.theme-toggle {
  background: none;
  border: 1px solid var(--text-light);
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.2rem;
  border-radius: var(--standard-border-radius);
  margin-top: 1rem;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  background-color: var(--accent-bg);
  color: var(--text-light);
}

/* More specific selector to override components.css button styles */
.theme-toggle.dark:hover {
  background-color: var(--accent-bg) !important;
  color: var(--text) !important;
  border-color: var(--text) !important;
}

/* Ensure theme transitions are smooth */
* {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}