/* ==========================================================================
   Material Academy — Certification finder
   --------------------------------------------------------------------------
   Its own file because the component appears on two pages that load different
   stylesheet sets: index.php via theme-head.php, certifications.php via
   head.php. One definition, loaded by both.
   Requires tokens.css.
   ========================================================================== */

/* ==========================================================================
   18. Certification finder
   --------------------------------------------------------------------------
   Sits between the trust strip and the certifications. Was a bare input that
   submitted to registration.php - searching for a course landed you on the
   signup form - and it lived inside the hero with its heading orphaned in a
   separate block above the form.
   ========================================================================== */
.finder {
  background: var(--paper-sunken);
  border-bottom: 1px solid var(--rule);
  padding-block: var(--space-9);
}
@media (min-width: 48rem) { .finder { padding-block: var(--space-10); } }

.finder__inner {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}
.finder__heading {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--brand-800);
  margin-bottom: var(--space-6);
}
@media (min-width: 48rem) { .finder__heading { font-size: var(--text-3xl); } }

/* ---------- The field ---------------------------------------------------
   One bordered shell holding both controls, so it reads as a single object
   rather than an input parked next to a button.                            */
.finder__form {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
  background: var(--paper-raised);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-pill);
  padding: var(--space-2);
  transition: border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.finder__form:hover { border-color: var(--ink-600); }
.finder__form:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(51, 102, 156, 0.16);
}

.finder__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding-inline: var(--space-5);
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-900);
  border-radius: var(--radius-pill);
}
.finder__input:focus { outline: none; }   /* the shell shows the focus instead */
.finder__input::placeholder { color: var(--ink-400); }
.finder__input::-webkit-search-cancel-button { cursor: pointer; }

.finder__submit {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding-inline: var(--space-6);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-800);
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background-color 220ms var(--ease-out);
}
.finder__submit:hover { background: var(--accent-700); }
.finder__arrow { transition: transform 220ms var(--ease-out); }
.finder__submit:hover .finder__arrow { transform: translateX(3px); }

/* ---------- Discipline chips -------------------------------------------- */
.finder__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}
.finder__chips-label {
  width: 100%;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-600);
  margin-bottom: var(--space-2);
}
.finder__chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: var(--space-4);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  color: var(--brand-800);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background-color 200ms var(--ease-out),
              color 200ms var(--ease-out),
              transform 200ms var(--ease-out);
}
.finder__chip:hover {
  background: var(--brand-800);
  border-color: var(--brand-800);
  color: #fff;
  transform: translateY(-2px);
}

@media (max-width: 30rem) {
  /* Below this the two controls cannot share a pill without crushing both. */
  .finder__form { flex-direction: column; border-radius: var(--radius-lg); }
  .finder__input, .finder__submit { border-radius: var(--radius); }
  .finder__submit { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .finder__chip:hover { transform: none; }
  .finder__submit:hover .finder__arrow { transform: none; }
}
