/* home.css -- the homepage's own parts: photo strip, heading, language
   search and its results. The top bar, footer, colours and fonts come from
   site.css, which every page loads first.
   Uses "inline-start/end" instead of left/right so right-to-left text works. */

/* ---- Photo strip ---------------------------------------------------------- */
.hero-montage { width: 100%; height: clamp(130px, 20vw, 280px); overflow: hidden; }
.hero-montage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Anchor the crop to the left so the Earth tile at the start of the
     strip stays visible; the overflow is trimmed from the right. */
  object-position: left center;
  display: block;
}

/* ---- Heading, lede, counts ------------------------------------------------ */
.wrap { max-width: var(--page); margin-inline: auto; }
.hero-intro { padding: 3rem 1rem 2.75rem; }
.hero-intro h1 { line-height: 1.2; }
.hero-lede { color: var(--muted); max-width: 40rem; line-height: 1.7; margin-block-end: .875rem; }
.hero-counts { color: var(--muted); font-size: .95rem; margin-block-end: 1.75rem; }

/* ---- Language search ------------------------------------------------------ */
.finder-plain { max-width: 30rem; }
.finder-label { font-size: .82rem; margin-block-end: .5rem; }
.lang-combobox { position: relative; }
.lang-input {
  width: 100%; padding: .75rem 1rem;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  transition: border-color .18s;
}
.lang-input:focus { border-color: #000; }
/* The list of matching languages that drops down under the box. */
.lang-listbox {
  position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 10;
  max-height: 280px; overflow-y: auto;
  list-style: none; margin: 0; padding: 6px; text-align: start;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 32px rgba(0,0,0,.14);
}
.lang-listbox li { padding: .6rem .75rem; border-radius: 5px; cursor: pointer; font-size: .95rem; }
.lang-listbox li:hover, .lang-listbox li.active { background: #f2f2f2; }
.lang-listbox li.no-match { color: var(--muted); cursor: default; font-size: .88rem; }
.lang-listbox li.no-match:hover { background: none; }
.lang-listbox li.no-match a { color: #000; }

/* ---- Results: the translations in the chosen language --------------------- */
.results { background: #f7f7f7; border-block-start: 3px solid #000; padding: 3rem 1rem 3.5rem; }
.results-wrap { max-width: 56.25rem; margin-inline: auto; }
.results h2 { font-size: 1.6rem; line-height: 1.2; color: var(--navy-dark); margin-block: 0 .4rem; }
.results-meta { color: var(--muted); font-size: .88rem; margin-block-end: 1.75rem; }
.results-list { display: flex; flex-direction: column; gap: 1rem; }
.results-none { color: var(--muted); font-size: .97rem; padding-block: 1.5rem; }
.translation-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.4rem; background: #fff; border: 1px solid #e0e4ea; border-radius: 12px;
  color: inherit; text-decoration: none;
  transition: box-shadow .18s, border-color .18s, transform .15s;
}
.translation-card:hover {
  color: inherit; border-color: var(--navy);
  box-shadow: 0 4px 18px rgba(26,58,92,.10); transform: translateY(-2px);
}
.tc-titles { flex: 1; min-width: 0; }
.tc-vernacular, .tc-english { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-vernacular { font-weight: 600; color: var(--navy-dark); }
.tc-english { font-size: .82rem; color: var(--muted); margin-block-start: 2px; }
/* The two labels say in words what you may do; colour only backs them up. */
.badge-free, .badge-restricted {
  flex-shrink: 0; padding: 3px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.badge-free { background: #e6f4ea; color: #1a7a35; }
.badge-restricted { background: #fef3e2; color: #a05800; }
.tc-arrow { flex-shrink: 0; color: var(--navy); font-size: 1.1rem; }
/* An arrow that points the way the text runs. */
.arrow::after { content: "\2192"; }                 /* → */
[dir="rtl"] .arrow::after { content: "\2190"; }     /* ← */
.results-browse-all {
  display: inline-flex; align-items: center; gap: 6px; margin-block-start: 1.5rem;
  color: var(--navy); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.results-browse-all:hover { text-decoration: underline; color: var(--navy); }

/* On a narrow phone the label drops under the title instead of squeezing it. */
@media (max-width: 30em) {
  .translation-card { flex-wrap: wrap; row-gap: .4rem; }
  .tc-titles { flex-basis: 100%; }
  .tc-vernacular, .tc-english { white-space: normal; overflow-wrap: anywhere; }
}

@media (min-width: 48em) {
  .hero-intro, .results { padding-inline: 1.5rem; }
}
