/* THC Range Finder — uses the child theme's palette tokens (same fallbacks as THC Search).
   The child theme may restyle any .thc-rf* class. */

.thc-rf {
  --thc-rf-canvas: var(--wp--preset--color--base, #f7f1e4);
  --thc-rf-raised: var(--wp--preset--color--accent-5, #fcf8ef);
  --thc-rf-muted: var(--wp--preset--color--accent-4, #ece4d9);
  --thc-rf-border: var(--wp--preset--color--accent-6, #d9d0bc);
  --thc-rf-text: var(--wp--preset--color--contrast, #332d25);
  --thc-rf-leaf: var(--wp--preset--color--accent-1, #5e7d53);
  --thc-rf-deep: var(--wp--preset--color--accent-3, #3f5c3b);
  --thc-rf-sage: var(--wp--preset--color--accent-2, #a8b79a);
  --thc-rf-stroke: var(--wp--preset--color--control-stroke, #8a7f66);
  --thc-rf-radius: 12px;
  --thc-rf-doc: #3f5c3b;
  --thc-rf-exp: #8a7f2e;
  --thc-rf-near: #7d6b8f;
  --thc-rf-rep: #a0522d;
  --thc-rf-hist: #8a7f66;
  --thc-rf-venom: #a63d2f;
  color: var(--thc-rf-text);
  margin-block: var(--wp--preset--spacing--md, 1rem) 0;
}
.thc-rf__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thc-rf__lead { margin: 0 0 var(--wp--preset--spacing--md, 1rem); font-size: var(--wp--preset--font-size--large, 1.25rem); }

/* ---------- form ---------- */
.thc-rf__form { background: var(--thc-rf-raised); border: 1px solid var(--thc-rf-border); border-radius: var(--thc-rf-radius); padding: var(--wp--preset--spacing--lg, 1.5rem); }
.thc-rf__row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.thc-rf__row--alt { margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--thc-rf-border); align-items: center; }
.thc-rf__field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1 1 12rem; }
.thc-rf__field--zip { flex: 0 1 10rem; }
.thc-rf__field--group { flex: 1 1 16rem; }
.thc-rf__label { font-size: var(--wp--preset--font-size--small, .875rem); font-weight: 600; color: var(--thc-rf-deep); }
.thc-rf__or { font-style: italic; color: var(--thc-rf-deep); }
.thc-rf input[type="text"], .thc-rf input[type="search"], .thc-rf input[type="email"], .thc-rf select, .thc-rf textarea {
  font: inherit; color: inherit; background: var(--thc-rf-canvas); border: 1px solid var(--thc-rf-stroke); border-radius: 10px; padding: .55em .8em; min-width: 0; width: 100%; box-sizing: border-box;
}
.thc-rf input:focus-visible, .thc-rf select:focus-visible, .thc-rf textarea:focus-visible, .thc-rf button:focus-visible { outline: 2px solid var(--thc-rf-leaf); outline-offset: 2px; }
.thc-rf__go, .thc-rf__btn {
  font: inherit; font-weight: 600; border: 1px solid var(--thc-rf-leaf); background: var(--thc-rf-leaf); color: #fff; border-radius: 999px; padding: .6em 1.3em; cursor: pointer; white-space: nowrap;
}
.thc-rf__go:hover, .thc-rf__btn:hover { background: var(--thc-rf-deep); border-color: var(--thc-rf-deep); color: #fff; }
.thc-rf__btn--ghost, .thc-rf__locate { background: transparent; color: var(--thc-rf-deep); border: 1px solid var(--thc-rf-stroke); font: inherit; font-weight: 600; border-radius: 999px; padding: .55em 1.1em; cursor: pointer; white-space: nowrap; }
.thc-rf__btn--ghost:hover, .thc-rf__locate:hover { background: var(--thc-rf-muted); color: var(--thc-rf-deep); }
.thc-rf__status { margin: .8rem 0 0; min-height: 1.4em; font-size: var(--wp--preset--font-size--small, .875rem); color: var(--thc-rf-deep); }
.thc-rf__status.is-error { color: var(--thc-rf-venom); }
.thc-rf__hp { position: absolute; left: -9999px; }

/* ---------- results ---------- */
.thc-rf__results { margin-top: var(--wp--preset--spacing--lg, 1.5rem); scroll-margin-top: 5rem; }
.thc-rf__beta { margin: 0 0 1rem; padding: .7em 1em; border-radius: 10px; background: color-mix(in srgb, var(--thc-rf-sage) 35%, var(--thc-rf-raised)); border: 1px solid var(--thc-rf-sage); font-size: var(--wp--preset--font-size--small, .875rem); }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .thc-rf__beta { background: #e8ecdf; } }
.thc-rf__head { margin-bottom: var(--wp--preset--spacing--md, 1rem); }
.thc-rf__title { margin: 0 0 .3em; overflow-wrap: anywhere; }
.thc-rf__summary { margin: 0 0 .5em; color: var(--thc-rf-deep); }
.thc-rf__zipnote { margin: 0 0 .75em; font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-rf__chip { font: inherit; font-size: .9em; border: 1px solid var(--thc-rf-border); background: var(--thc-rf-raised); color: inherit; border-radius: 999px; padding: .15em .7em; cursor: pointer; margin: .15em .1em; }
.thc-rf__chip span { color: var(--thc-rf-deep); font-size: .85em; }
.thc-rf__chip:hover { border-color: var(--thc-rf-stroke); background: var(--thc-rf-muted); }
.thc-rf__tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.thc-rf__filter { flex: 1 1 18rem; }

/* tiers */
.thc-rf__tier { border: 1px solid var(--thc-rf-border); border-radius: var(--thc-rf-radius); background: var(--thc-rf-raised); margin-bottom: var(--wp--preset--spacing--md, 1rem); }
.thc-rf__tier > summary { cursor: pointer; padding: .9rem 1.25rem; font-weight: 700; font-size: var(--wp--preset--font-size--large, 1.25rem); display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em; list-style: none; }
.thc-rf__tier > summary::-webkit-details-marker { display: none; }
.thc-rf__tier > summary::before { content: "▸"; font-size: .8em; color: var(--thc-rf-deep); }
.thc-rf__tier[open] > summary::before { content: "▾"; }
.thc-rf__count { font-weight: 400; color: var(--thc-rf-deep); font-size: .85em; }
.thc-rf__tierhelp { flex-basis: 100%; font-weight: 400; font-size: var(--wp--preset--font-size--small, .875rem); color: var(--thc-rf-deep); line-height: 1.4; }
.thc-rf__family { margin: 0; padding: .5rem 1.25rem; font-size: var(--wp--preset--font-size--small, .875rem); letter-spacing: .02em; text-transform: uppercase; color: var(--thc-rf-deep); background: var(--thc-rf-muted); border-top: 1px solid var(--thc-rf-border); border-bottom: 1px solid var(--thc-rf-border); }
.thc-rf__list { list-style: none; margin: 0; padding: 0; }
.thc-rf__sp { padding: .9rem 1.25rem; border-bottom: 1px solid var(--thc-rf-border); }
.thc-rf__sp:last-child { border-bottom: 0; }
.thc-rf__sp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35em .6em; }
.thc-rf__sp-name { font-weight: 700; font-size: 1.08em; }
.thc-rf__sp-sci { color: var(--thc-rf-deep); }
.thc-rf__sp-aka { margin: .25em 0 0; font-size: var(--wp--preset--font-size--small, .875rem); display: flex; flex-direction: column; gap: .15em; }
.thc-rf__aka--mis { color: var(--thc-rf-rep); }
.thc-rf__aka--former, .thc-rf__subs { color: var(--thc-rf-deep); }
.thc-rf__sp-ev { margin: .4em 0 0; font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-rf__sp-links { margin: .4em 0 0; font-size: var(--wp--preset--font-size--small, .875rem); display: flex; flex-wrap: wrap; align-items: center; gap: .2em .35em; }
.thc-rf__sp-links a { color: var(--thc-rf-deep); font-weight: 600; text-decoration: none; }
.thc-rf__sp-links a:hover { text-decoration: underline; }
.thc-rf__sep { color: var(--thc-rf-border); }
.thc-rf__linkbtn { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: var(--thc-rf-rep); cursor: pointer; text-decoration: none; }
.thc-rf__linkbtn:hover { text-decoration: underline; }
.thc-rf__dot { display: inline-block; width: .65em; height: .65em; border-radius: 50%; margin-right: .45em; vertical-align: baseline; background: var(--thc-rf-stroke); }
.thc-rf__dot--documented { background: var(--thc-rf-doc); }
.thc-rf__dot--expected { background: var(--thc-rf-exp); }
.thc-rf__dot--nearby { background: var(--thc-rf-near); }
.thc-rf__dot--reported { background: var(--thc-rf-rep); }
.thc-rf__dot--historical { background: var(--thc-rf-hist); }
.thc-rf__empty { padding: 1rem 1.25rem; background: var(--thc-rf-raised); border: 1px solid var(--thc-rf-border); border-radius: var(--thc-rf-radius); }
.thc-rf__foot { margin-top: var(--wp--preset--spacing--md, 1rem); font-size: var(--wp--preset--font-size--small, .875rem); color: var(--thc-rf-deep); }
.thc-rf__foot p { margin: 0; }
.thc-rf__how { margin-top: var(--wp--preset--spacing--lg, 1.5rem); font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-rf__how summary { cursor: pointer; font-weight: 600; color: var(--thc-rf-deep); }
.thc-rf__how ul { padding-left: 1.2em; }

/* badges (same shape as THC Search) */
.thc-rf .thc-badge { display: inline-block; padding: .1em .6em; border-radius: 999px; border: 1px solid var(--thc-rf-border); background: var(--thc-rf-muted); color: var(--thc-rf-text); font-weight: 600; font-size: .78em; line-height: 1.4; white-space: nowrap; vertical-align: middle; }
.thc-rf .thc-badge--venom { background: var(--thc-rf-venom); border-color: var(--thc-rf-venom); color: #fff; }
.thc-rf .thc-badge--exotic { background: #f1e2b3; border-color: #d8c27a; color: #5a4a12; }

/* dialog */
.thc-rf__dialog { border: 1px solid var(--thc-rf-border); border-radius: var(--thc-rf-radius); background: var(--thc-rf-raised); color: var(--thc-rf-text); padding: 1.5rem; width: min(32rem, calc(100vw - 2rem)); }
.thc-rf__dialog::backdrop { background: rgba(0,0,0,.35); }
.thc-rf__report h3 { margin: 0 0 .4em; }
.thc-rf__report label { display: block; margin: .8em 0 0; font-weight: 600; font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-rf__report label input, .thc-rf__report label select, .thc-rf__report label textarea { margin-top: .3em; font-weight: 400; }
.thc-rf__dialog-context { margin: 0; color: var(--thc-rf-deep); font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-rf__dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }
.thc-rf__dialog-status { margin: .6em 0 0; font-size: var(--wp--preset--font-size--small, .875rem); color: var(--thc-rf-deep); min-height: 1.2em; }

/* small screens */
@media (max-width: 600px) {
  .thc-rf__form { padding: var(--wp--preset--spacing--md, 1rem); }
  .thc-rf__field--zip { flex-basis: 100%; }
  .thc-rf__go { width: 100%; }
  .thc-rf__tier > summary, .thc-rf__sp, .thc-rf__family { padding-inline: .9rem; }
}

/* print: a clean checklist */
/* frog calls */
.thc-rf__call { margin: .4em 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35em .6em; font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-rf .thc-badge--calling { background: var(--thc-rf-leaf); border-color: var(--thc-rf-leaf); color: #fff; }
.thc-rf .thc-badge--calling-some { background: color-mix(in srgb, var(--thc-rf-sage) 60%, var(--thc-rf-raised)); border-color: var(--thc-rf-sage); color: var(--thc-rf-deep); }
.thc-rf__call-peak { color: var(--thc-rf-deep); }
.thc-rf__play { font: inherit; font-size: var(--wp--preset--font-size--small, .875rem); font-weight: 700; padding: .3em .9em; border-radius: 999px; border: 1px solid var(--thc-rf-deep); background: var(--thc-rf-raised); color: var(--thc-rf-deep); cursor: pointer; }
.thc-rf__play:hover, .thc-rf__play[aria-expanded="true"] { background: var(--thc-rf-deep); color: #fff; }
.thc-rf__player { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .3em .8em; }
.thc-rf__player audio { width: 100%; max-width: 420px; height: 36px; }
.thc-rf__credit { color: var(--thc-rf-deep); }
.thc-rf__credit a { color: inherit; font-weight: 600; }

@media print {
  .thc-rf__form, .thc-rf__tools, .thc-rf__sp-links, .thc-rf__how, .thc-rf__beta, .thc-rf__tierhelp, .thc-rf__dialog, .thc-rf__play, .thc-rf__player { display: none !important; }
  .thc-rf__tier { border: 0; break-inside: avoid; }
  .thc-rf__tier > summary::before { content: ""; }
  .thc-rf__sp { padding: .3rem 0; break-inside: avoid; }
  .thc-rf__sp-head::before { content: "☐ "; }
  .thc-rf__sp-ev, .thc-rf__sp-aka { font-size: .8em; }
  details.thc-rf__tier:not([open]) > *:not(summary) { display: block; }
}

/* calls mode */
.thc-rf--calls .thc-rf__field--group { display: none; }
.thc-rf__toggle { display: inline-flex; align-items: center; gap: .4em; font-size: var(--wp--preset--font-size--small, .875rem); font-weight: 600; color: var(--thc-rf-deep); }
.thc-rf__toggle input { width: 1.1em; height: 1.1em; margin: 0; accent-color: var(--thc-rf-leaf); }
.thc-rf__list--calls { border: 1px solid var(--thc-rf-border); border-radius: var(--thc-rf-radius); background: var(--thc-rf-raised); }
.thc-rf .thc-badge--tier { background: transparent; color: var(--thc-rf-deep); }
.thc-rf .thc-badge--tier-expected { border-style: dashed; }

/* subspecies */
.thc-rf__subs strong { font-weight: 700; color: var(--thc-rf-deep); }
.thc-rf__subs-all { font-size: var(--wp--preset--font-size--small, .875rem); color: var(--thc-rf-deep); }
.thc-rf__subs-all > summary { cursor: pointer; font-weight: 600; list-style: none; display: inline-block; }
.thc-rf__subs-all > summary::before { content: '▸ '; }
.thc-rf__subs-all[open] > summary::before { content: '▾ '; }
.thc-rf__subs-all > span { display: block; margin-top: .2em; }
