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

body {
  font-family: Georgia, "Times New Roman", serif;
  background: #faf9f6;
  color: #1a1a1a;
  min-height: 100vh;
}

header {
  background: #2c3e50;
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

header p {
  font-size: 0.95rem;
  color: #a8b8c8;
  font-style: italic;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* Search form */

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.search-form .search-controls {
  display: flex;
  gap: 0.5rem;
}

.search-form button {
  align-self: stretch;
}

.search-form select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.search-form input[type="text"] {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex: 1;
  min-width: 0;
}


.search-form input[type="text"]:focus,
.search-form select:focus {
  outline: none;
  border-color: #2c7be5;
  box-shadow: 0 0 0 2px rgba(44,123,229,0.15);
}

.search-form button {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 1.4rem;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.search-form button:hover { background: #3d5166; }

#results { min-height: 2rem; }

.htmx-indicator {
  display: none;
  color: #666;
  font-style: italic;
  font-size: 0.9rem;
}
.htmx-request .htmx-indicator { display: block; }

/* Results */

.no-results {
  color: #666;
  font-style: italic;
  margin-top: 1rem;
}

.result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.result-count {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.entry {
  background: #fff;
  border: 1px solid #e0ddd8;
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.entry-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.primary-term {
  font-size: 1.25rem;
  font-weight: bold;
  color: #1a1a1a;
}

.derived-terms {
  font-size: 0.9rem;
  color: #555;
}

.derived-terms::before {
  content: "also: ";
  color: #999;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.badge {
  display: inline-block;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  padding: 0.18em 0.55em;
  border-radius: 3px;
  background: #eef2f7;
  color: #344;
  border: 1px solid #d0d8e4;
}

.badge-label {
  color: #7a8a9a;
  margin-right: 0.2em;
}

.description {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.5;
}

.description:empty::before {
  content: "—";
  color: #bbb;
}

/* Footer */

footer {
  border-top: 1px solid #e0ddd8;
  margin-top: 3rem;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: #666;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.footer-wip {
  font-style: italic;
  margin-bottom: 0.6rem;
}

.footer-contact {
  margin-bottom: 1rem;
}

.footer-contact a {
  color: #2c7be5;
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-share {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-share a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: #2c3e50;
  text-decoration: none;
  padding: 0.25em 0.6em;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: background 0.15s;
}

.footer-share svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
}

.footer-share a:hover {
  background: #f0f0f0;
}
