/*
 * Browse Taxonomy — A-Z listing with filter and definitions.
 * Shared by types, styles, and materials browse pages.
 */

/* =============================================
   Container
   ============================================= */

.browse-taxonomy {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

/* =============================================
   Intro text
   ============================================= */

.browse-taxonomy__intro {
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

.browse-taxonomy__intro .browse-taxonomy__info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background-color: #014360;
  color: #fff;
  font-size: 0.8em;
  font-style: normal;
  vertical-align: middle;
}

/* =============================================
   Alphabetical navigation
   ============================================= */

.browse-taxonomy__alpha-nav {
  background-color: #e8f4f8;
  border-radius: 6px;
  padding: 1.25rem 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.browse-taxonomy__alpha-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
}

.browse-taxonomy__alpha-link {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.35rem;
  color: #014360;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.15s, color 0.15s;
}

.browse-taxonomy__alpha-link:hover,
.browse-taxonomy__alpha-link:focus {
  background-color: #014360;
  color: #fff;
  outline-offset: 2px;
}

.browse-taxonomy__alpha-link[aria-current="true"] {
  background-color: #014360;
  color: #fff;
}

.browse-taxonomy__alpha-link--empty {
  color: #999;
  cursor: default;
}

.browse-taxonomy__alpha-link--empty:hover,
.browse-taxonomy__alpha-link--empty:focus {
  background-color: transparent;
  color: #999;
}

/* =============================================
   Text filter
   ============================================= */

.browse-taxonomy__filter {
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.browse-taxonomy__filter-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #014360;
  margin-bottom: 0.15rem;
}

/* Persistent hint, replacing the old placeholder. #4a5a63 measures 6.92:1 on
   the #fbfbfb page background — the placeholder it replaces was #888 at
   roughly 3.5:1, under the 4.5:1 floor. */
.browse-taxonomy__filter-hint {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #4a5a63;
}

.browse-taxonomy__filter-row {
  display: flex;
  align-items: stretch;
  border: 2px solid #014360;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

/* Focus ring moves to the row so the whole control lights up as one unit —
   the input's own outline would otherwise sit inside the border, leaving the
   icon looking detached from the focused field. */
.browse-taxonomy__filter-row:focus-within {
  outline: 3px solid #238fb5;
  outline-offset: 1px;
}

/* Scoped to the row (0,2,0) so it outranks Olivero's form-text.css, which
   sets padding: 0 var(--sp) on [type="search"] at equal specificity and loads
   later. Only the inline padding is declared — block padding is left to
   Olivero, where the field's height already comes from line-height. */
.browse-taxonomy__filter-row .browse-taxonomy__filter-input {
  flex: 1;
  border: none;
  padding-inline: 1rem 0.25rem;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  color: #333;
}

.browse-taxonomy__filter-input:focus {
  outline: none;
}

/* Trailing to match the front/search page search buttons, but a quiet inline
   adornment rather than a copy of them: no fill, muted stroke, and padding too
   narrow to read as a hit target. The filled treatment is reserved for the
   real submit buttons (.sah-front__search-btn, .sah-search-bar__btn) so that
   "filled block at the end of a field" keeps meaning "clickable". */
.browse-taxonomy__filter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.25rem 0.85rem;
  color: #5a6b73;
  flex: none;
}

.browse-taxonomy__filter-status {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #555;
  min-height: 1.25em;
}

/* =============================================
   Term listing
   ============================================= */

.browse-taxonomy__list {
  column-gap: 3rem;
}

.browse-taxonomy__letter-group {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

.browse-taxonomy__letter-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #014360;
  border-bottom: 2px solid #c3e8f3;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.browse-taxonomy__letter-heading:focus {
  outline: 2px solid #238fb5;
  outline-offset: 2px;
}

.browse-taxonomy__terms {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 2rem;
}

@media (min-width: 48rem) {
  .browse-taxonomy__terms {
    columns: 4;
  }
}

.browse-taxonomy__term {
  padding: 0.2rem 0;
  line-height: 1.4;
  break-inside: avoid;
}

.browse-taxonomy__term::before {
  content: '–';
  display: inline-block;
  width: 1em;
  color: #999;
}

.browse-taxonomy__term-link {
  color: #014360;
  text-decoration: none;
  font-size: 0.88rem;
}

.browse-taxonomy__term-link:hover,
.browse-taxonomy__term-link:focus {
  color: #137b9a;
  text-decoration: underline;
}

.browse-taxonomy__term-count {
  color: #888;
  font-size: 0.8rem;
  margin-left: 0.15em;
}

/* =============================================
   Info button & definition panel
   ============================================= */

.browse-taxonomy__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  border: none;
  background-color: #014360;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 0.25rem;
  padding: 0;
  transition: background-color 0.15s;
}

.browse-taxonomy__info-btn:hover,
.browse-taxonomy__info-btn:focus {
  background-color: #238fb5;
  outline: 2px solid #014360;
  outline-offset: 2px;
}

.browse-taxonomy__info-btn[aria-expanded="true"] {
  background-color: #238fb5;
}

.browse-taxonomy__definition {
  background-color: #014360;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.browse-taxonomy__definition p {
  margin: 0 0 0.5rem;
}

.browse-taxonomy__definition p:last-child {
  margin-bottom: 0;
}

.browse-taxonomy__getty-link {
  color: #5acaeb;
  text-decoration: none;
  font-size: 0.85rem;
}

.browse-taxonomy__getty-link:hover,
.browse-taxonomy__getty-link:focus {
  color: #c3e8f3;
  text-decoration: underline;
}
