/* Lee Fairclough — "find the nearest Canada Post" finder (/vote).
   Scoped to .lf-po so it can sit inside the vote guide's white column. */

.lf-po {
  margin: 0 0 26px;
  --lf-po-maroon: var(--lf-maroon, #960018);
  --lf-po-ink: #262222;
  --lf-po-yellow: #fbec5d;
  --lf-po-cream: #f4f0ec;
  --lf-po-line: #e2d7cf;
}

.lf-po * {
  box-sizing: border-box;
}

.lf-po__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  background: var(--lf-po-yellow);
  color: var(--lf-po-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.lf-po__toggle:hover {
  text-decoration: underline;
}

.lf-po__toggle:focus-visible,
.lf-po__submit:focus-visible,
.lf-po__geo:focus-visible,
.lf-po__input:focus-visible {
  outline: 3px solid var(--lf-po-maroon);
  outline-offset: 3px;
}

.lf-po__toggle-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.lf-po__panel {
  margin-top: 16px;
  padding: 20px;
  background: #fbf8f5;
  border: 1px solid var(--lf-po-line);
  border-top: 3px solid var(--lf-po-maroon);
}

.lf-po__panel[hidden] {
  display: none;
}

.lf-po__label {
  display: block;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lf-po__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lf-po__input {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c9bab0;
  background: #fff;
  color: var(--lf-po-ink);
  font: inherit;
  font-size: 17px;
  text-transform: uppercase;
}

.lf-po__input::placeholder {
  text-transform: none;
  color: #8a7c74;
}

.lf-po__submit {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  background: var(--lf-po-maroon);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.lf-po__submit:hover {
  background: #7d0014;
}

.lf-po__or {
  margin: 18px 0 0;
  font-size: 15px;
}

.lf-po__geo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lf-po-maroon);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lf-po__geo svg {
  width: 15px;
  height: 15px;
}

.lf-po__status {
  margin: 16px 0 0;
  font-size: 15px;
}

.lf-po__status:empty {
  display: none;
}

.lf-po__status--error {
  color: #a10018;
}

.lf-po__map {
  height: 220px;
  margin: 18px 0 0;
  background: #eae3dc;
  border: 1px solid var(--lf-po-line);
}

.lf-po__map[hidden] {
  display: none;
}

/* The northern fallback uses OSM raster tiles; mute them to sit beside the
   vector basemap rather than fighting it. */
.lf-po__map--raster .maplibregl-canvas {
  filter: grayscale(0.75) contrast(0.95) brightness(1.04);
}

.lf-po__results {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: lf-po-hit;
}

.lf-po .lf-po__hit {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 34px;
  border-top: 1px solid var(--lf-po-line);
  list-style: none;
}

.lf-po .lf-po__hit:first-child {
  border-top: 0;
  padding-top: 4px;
}

.lf-po .lf-po__hit--active {
  background: #fff5c9;
  box-shadow: 0 0 0 8px #fff5c9;
}

.lf-po__rank {
  position: absolute;
  left: 0;
  top: 15px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lf-po-maroon);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.lf-po .lf-po__hit:first-child .lf-po__rank {
  top: 5px;
}

.lf-po__name {
  display: block;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.lf-po__dist {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--lf-po-cream);
  color: #5c4a44;
  font-size: 13px;
  font-weight: 600;
  vertical-align: 2px;
  white-space: nowrap;
}

.lf-po__postal {
  white-space: nowrap;
}

.lf-po__addr,
.lf-po__hours {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.45;
}

.lf-po__hours {
  color: #5c4a44;
}

.lf-po__open {
  color: #1d6b3a;
  font-weight: 600;
}

.lf-po__closed {
  color: #8a2c22;
  font-weight: 600;
}

.lf-po__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 15px;
}

.lf-po__actions a,
.lf-po__more {
  padding: 0;
  border: 0;
  background: none;
  color: var(--lf-po-maroon);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lf-po__more {
  cursor: pointer;
}

.lf-po__more:focus-visible {
  outline: 3px solid var(--lf-po-maroon);
  outline-offset: 3px;
}

.lf-po__week {
  margin: 10px 0 0;
  padding: 0;
  font-size: 14px;
  list-style: none;
}

.lf-po__week[hidden] {
  display: none;
}

.lf-po .lf-po__week li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 2px 0;
  color: #5c4a44;
}

.lf-po .lf-po__week li[data-today='true'] {
  color: var(--lf-po-ink);
  font-weight: 700;
}

.lf-po__note {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #5c4a44;
}

.lf-po__fallback {
  margin: 14px 0 0;
  font-size: 15px;
}


/* Numbered map pin */
.lf-po__pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--lf-po-maroon);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.lf-po__pin--you {
  background: #1f6feb;
  cursor: default;
}

.lf-po .maplibregl-map {
  font: inherit;
  background: #eae3dc;
}

.lf-po__attrib {
  position: relative;
  margin: 0 6px 6px 0 !important;
}

.lf-po__attrib-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #5c4a44;
  font: italic 700 12px/1 Georgia, serif;
  cursor: pointer;
}

.lf-po__attrib-panel {
  position: absolute;
  right: 0;
  bottom: 28px;
  width: min(280px, 74vw);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #3f3631;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
}

.lf-po__attrib-panel[hidden] {
  display: none;
}

/* The Focus theme styles every `form` and `form input[...]` on the page
   (white card, 50px padding, 20px input padding, 8px radius). The widget owns
   its own controls, so reset them with a specificity the theme cannot beat. */
.lf-po form {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
}

.lf-po .lf-po__input,
.lf-po .lf-po__submit,
.lf-po .lf-po__toggle,
.lf-po .lf-po__geo,
.lf-po .lf-po__more {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  box-shadow: none;
  font-family: inherit;
  line-height: 1.3;
}

.lf-po .lf-po__input {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c9bab0;
  background: #fff;
  color: var(--lf-po-ink);
  font-size: 17px;
  text-transform: uppercase;
}

.lf-po .lf-po__submit {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  background: var(--lf-po-maroon);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.lf-po .lf-po__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  background: var(--lf-po-yellow);
  color: var(--lf-po-ink);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 480px) {
  .lf-po__panel {
    padding: 16px;
  }

  .lf-po__toggle {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    justify-content: center;
    text-align: center;
    text-wrap: balance;
  }

  .lf-po__map {
    height: 190px;
  }
}
