/* Wunda Finder Widget CSS (robust open/close) */

/* Panel sizing via CSS variables */
.wf-panel{
  border:3px solid #d6dae1;
  background:#f2f4f7;
  max-width:var(--wf-max,520px);
  width:var(--wf-width,auto);
  padding:var(--wf-pad,10px);
  position:relative;
}
.wf-panel h2{margin:0}

/* Header + Clear button */
.wf-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.wf-clear{
  appearance:none;border:1px solid #000;background:#000;color:#fff;border-radius:9999px;
  padding:4px 10px;font:inherit;font-size:12px;line-height:1.1;cursor:pointer;
}
.wf-clear:hover{opacity:.9}
.wf-clear:focus{outline:2px solid #333;outline-offset:2px}

/* Fields */
.wf-panel select,.wf-input{
  width:100%;margin-bottom:8px;padding:3px 4px;font:inherit;color:inherit;background:#fff;
  border:1px solid #bfc5ce;border-radius:2px;box-sizing:border-box;
}

/* Results */
.wf-results{
  display:none;border:1px solid #ccc;margin-top:10px;padding:10px;background:#fff;max-width:100%;box-sizing:border-box
}
.wf-results .res-line{margin:0 0 6px;display:none}

/* Adjacent years */
.wf-adj{display:none;margin-top:10px;padding-top:8px;border-top:1px dotted #ccc;color:#666;font-size:10pt}
.wf-adj .adj{margin-bottom:10px}
.wf-adj .adj h3{margin:6px 0;font-size:10pt;font-weight:400;color:#666}
.wf-adj .res-line-light{margin:0 0 4px;color:#666}
.wf-adj strong{color:#666}

/* Combobox */
.wf-combo{position:relative;overflow:visible}
.wf-input{box-sizing:border-box}

/* Caret triangle */
.wf-caret{
  position:absolute;
  right:10px;            /* slightly more inset */
  top:8px;
  width:0;height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:6px solid #444; /* ▼ by default */
  pointer-events:auto;       /* keep it clickable */
  transition: transform .15s ease;
  transform-origin: 50% 40%;
}
.wf-combo.open .wf-caret{
  transform: rotate(180deg); /* ▲ when open */
}

/* LARGE hit area: full-height right strip, a couple pixels wider than the input edge */
.wf-caret-hit{
  position:absolute;
  top:-2px;                /* allow a bit of extra above */
  bottom:-2px;             /* …and below */
  right:-2px;              /* extend a couple of pixels past the field */
  width:30px;              /* wide target so users can click anywhere on the right */
  border:0;
  background:transparent;
  cursor:pointer;
  padding:0;
  outline:none;
  /* make sure it sits above the input but below the popup list */
  z-index:2;
}

/* The list popup */
.wf-list{
  position:absolute;left:0;right:0;max-height:220px;overflow:auto;
  border:1px solid #bfc5ce;background:#fff;z-index:999999;
  box-shadow:0 2px 6px rgba(0,0,0,.15);display:none
}
.wf-combo.open .wf-list{display:block !important}
.wf-item{padding:6px 8px;cursor:pointer}
.wf-item:hover,.wf-item.active{background:#f0f2f5}
.wf-hl{font-weight:700}

/* Tighter spacing for result lines */
.wf-results .res-line{ margin:2px 0 !important; line-height:1.25; }
.wf-adj .res-line-light{ margin:2px 0 !important; line-height:1.25; color:#666; }

/* Force grey inside Also-see block, even for auto-linked anchors */
.wf-adj .res-line-light,
.wf-adj .res-line-light *,
.wf-adj a,
.wf-adj a:link,
.wf-adj a:visited,
.wf-adj a:hover,
.wf-adj a:active { color:#666 !important; text-decoration:none !important; }

/* Ensure primary result lines are visible (JS now injects .res-line directly) */
.wf-results .res-line {
  display: block !important;
  margin: 2px 0;
  line-height: 1.25;
}
