/* Postcode finder widget */
.auk-pcf {
  position: relative;
  width: 100%;
}

.auk-pcf__input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  line-height: 1.5;
  border: 2px solid var(--color-border-tertiary, #d1d5db);
  border-radius: 8px;
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #1a1a2e);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auk-pcf__input:focus {
  outline: none;
  border-color: var(--color-accent, #0057b8);
  box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.15);
}

.auk-pcf__input::placeholder {
  color: var(--color-text-tertiary, #9ca3af);
}

.auk-pcf__list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--color-background-primary, #fff);
  border: 1px solid var(--color-border-tertiary, #d1d5db);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auk-pcf__item {
  padding: 12px 16px;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.95rem;
  color: var(--color-text-primary, #1a1a2e);
  transition: background-color 0.15s;
}

.auk-pcf__item:hover,
.auk-pcf__item--active {
  background: var(--color-background-secondary, #f3f4f6);
}

.auk-pcf__item strong {
  font-weight: 700;
  white-space: nowrap;
}

.auk-pcf__meta {
  color: var(--color-text-secondary, #6b7280);
  margin-left: 4px;
}

.auk-pcf__no-match {
  padding: 16px;
  text-align: center;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.9rem;
  line-height: 1.5;
}

.auk-pcf__no-match a {
  color: var(--color-accent, #0057b8);
  text-decoration: underline;
}

/* Task294: persistent visible name for every postcode combobox. */
.auk-pcf__label {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
}

/* Task294: forced colours suppress shadows; retain the active suggestion cue
   without changing layout. System colours preserve the user's chosen palette. */
@media (forced-colors: active) {
  .auk-pcf .auk-pcf__item--active,
  .auk-pcf .auk-pcf__item:hover {
    forced-color-adjust: none;
    background: Highlight !important;
    color: HighlightText !important;
    box-shadow: none !important;
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
  .auk-pcf .auk-pcf__item--active .auk-pcf__meta,
  .auk-pcf .auk-pcf__item:hover .auk-pcf__meta {
    color: HighlightText !important;
  }
}

/* Task380 (A352-01/02/03, cache-compatible successor to Task369): the
   no-match message is a panel beside the listbox, with one visually hidden
   status region. The script also gives the panel the installed auk-pcf__list
   class, its links the auk-pcf__contact-link class and the status region its
   own inline hiding styles, so a browser that still holds the older
   stylesheet shows the same result. These rules repeat that presentation for
   current browsers. Task97's ":is(.auk-page-hero, ...) a:not([class])"
   (0,2,1; :visited/:hover/:focus-visible 0,3,1) would paint classless links
   white on the white panel, so the accent colour is restored at 0,4,1 / 0,5,1
   for classless links (the installed script's list item markup) and classed
   links alike. */
.auk-pcf .auk-pcf__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 4px 0 0;
  padding: 20px 16px;
  background: var(--color-background-primary, #fff);
  border: 1px solid var(--color-border-tertiary, #d1d5db);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.auk-pcf .auk-pcf__panel[hidden] {
  display: none;
}

.auk-pcf .auk-pcf__list .auk-pcf__no-match a:not([class]),
.auk-pcf .auk-pcf__list .auk-pcf__no-match a:not([class]):visited,
.auk-pcf .auk-pcf__list .auk-pcf__no-match a:not([class]):hover,
.auk-pcf .auk-pcf__list .auk-pcf__no-match a:not([class]):focus-visible,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a:not([class]),
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a:not([class]):visited,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a:not([class]):hover,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a:not([class]):focus-visible,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a.auk-pcf__contact-link,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a.auk-pcf__contact-link:visited,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a.auk-pcf__contact-link:hover,
.auk-pcf .auk-pcf__panel.auk-pcf__no-match a.auk-pcf__contact-link:focus-visible {
  color: var(--color-accent, #0057b8);
}

.auk-pcf .auk-pcf__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
