/* === Navigation === */
nav ul {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  flex-wrap: wrap;
}

nav a {
  display: inline-block;
  padding: 0.5em 1.2em;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  background-color: var(--accent);
  color: var(--text);
  transition: background-color 0.2s ease;
}

nav a:hover {
  background-color: var(--accent-hover);
}

/* === Responsive Navigation === */
@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    align-items: stretch; /* key to make links stretch */
    width: 100%;
    padding: 0 1rem;
  }

  nav li {
    width: 100%;
  }

  nav a {
    display: block; /* makes width 100% work */
    width: 100%;
    text-align: center;
  }
}

/* === Search Bar === */
input[type="text"],
input[type="search"] {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--muted);
  border-radius: 8px;
  background-color: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background-color: inherit;
  color: inherit;
}

th,
td {
  border: 1px solid #555;
  padding: 0.75rem;
  text-align: center;
}

tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.08);
}

/* This is for the when the table does not have a GitHub link */
.muted {
  color: #999;
  font-style: italic;
}

form fieldset {
  border: 1px solid var(--muted);
  border-radius: 6px;
  padding: 1em;
  margin-bottom: 1em;
}

/* === Buttons === */
button {
  background-color: var(--accent, #007bff);
  color: white;
  font-size: 1rem;
  padding: 0.5em 1.2em;
  margin: 0.25em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: var(--accent-hover, #005bb5);
}

button:focus-visible {
  outline: 2px solid var(--accent-hover, #005bb5);
  outline-offset: 2px;
}

/* === Utilities === */
.skip-link {
  position: absolute;
  left: -999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background-color: var(--accent);
  color: var(--text);
  padding: 0.5em 1em;
  border-radius: 5px;
  z-index: 1000;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}
