/* ------------------------------------------------------------------
   /milterms – military terms lookup.
   Rides on /styles.css for tokens, fonts and the header; everything
   here is the search column. Unlike the other pages it scrolls, since
   a definition can run longer than the screen.
------------------------------------------------------------------ */

body.mt {
  display: block;
  height: auto;
  min-height: 100dvh;
  overflow: hidden auto;
}

.mt-vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mt-main {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin: 0 auto;
  padding: clamp(3rem, 16vh, 9rem) 0 6rem;
}

.mt-title {
  margin: 0 0 1.6rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.mt-title em { font-style: italic; color: var(--accent); }

/* --- search ------------------------------------------------------ */

.mt-search { position: relative; }

.mt-search input {
  width: 100%;
  padding: 0.9rem 0 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  letter-spacing: 0.01em;
  outline: none;
  transition: border-color 0.3s;
  -webkit-appearance: none;
  appearance: none;
}
.mt-search input::placeholder { color: var(--ink-faint); }
.mt-search input:focus { border-bottom-color: var(--accent); }
.mt-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.mt-list {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: min(60vh, 32rem);
  overflow-y: auto;
  background: rgba(8, 9, 8, 0.97);
  border: 1px solid var(--hairline);
  border-top: 0;
}

.mt-list li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(242, 239, 230, 0.07);
  cursor: pointer;
}
.mt-list li:last-child { border-bottom: 0; }
.mt-list li[aria-selected="true"] { background: rgba(233, 194, 88, 0.12); }

.mt-sug-t {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.mt-sug-t mark { background: none; color: var(--accent); }

.mt-sug-s {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.mt-sug-x { display: block; color: var(--ink); }

.mt-list .mt-none {
  display: block;
  cursor: default;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.mt-count a { color: var(--ink-soft); border-bottom: 1px solid var(--hairline); }
.mt-count a:hover { color: var(--accent); border-color: var(--accent); }

.mt-count {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* --- definition -------------------------------------------------- */

.mt-def {
  margin-top: clamp(2.5rem, 7vh, 4rem);
  animation: mt-in 0.5s var(--ease);
}
@keyframes mt-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.mt-def-cat {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.mt-def-t {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.mt-def-x {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--ink-soft);
}

.mt-def-d {
  margin: 1.4rem 0 0;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.7;
}

.mt-def-k {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.mt-def-h {
  margin: 2rem 0 0.6rem;
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mt-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }

.mt-chips a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  transition: color 0.3s, border-color 0.3s;
}
.mt-chips a:hover,
.mt-chips a:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }

.mt-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.mt-links a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
  transition: color 0.3s, border-color 0.3s;
}
.mt-links a:hover { color: var(--accent); border-color: var(--accent); }

/* On a phone the box goes straight under the header: the keyboard
   takes half the screen as soon as it is tapped, and the suggestions
   need what is left. The site's own mobile header rules apply. */
@media (max-width: 760px) {
  .mt-main { padding-top: 1.75rem; }
  .mt-title { margin-bottom: 0.9rem; font-size: 2rem; }
  .mt-list li { grid-template-columns: 1fr; }
  .mt-list { max-height: 50vh; }
}

@media (prefers-reduced-motion: reduce) {
  .mt-def { animation: none; }
}
