/* Campground Data Engine - works on top of any theme; colours via variables. */
:root {
	--cde-accent: #2f6b3a;
	--cde-accent-ink: #fff;
	--cde-border: #d9ded6;
	--cde-soft: #f4f6f2;
	--cde-muted: #5b625a;
	--cde-yes: #1f6f2e;
	--cde-no: #9a2b1f;
	--cde-unk: #6b6b6b;
	--cde-warn-bg: #fff4d6;
}

.cde-btn { display: inline-block; border: 1px solid var(--cde-accent); background: #fff; color: var(--cde-accent); border-radius: 6px; padding: .55em 1em; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.cde-btn--primary { background: var(--cde-accent); color: var(--cde-accent-ink); }
.cde-btn--small { padding: .35em .7em; font-size: .9em; }
.cde-btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.cde-btn:focus-visible, .cde-chip:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

.cde-note { color: var(--cde-muted); font-size: .92em; }
.cde-why { background: var(--cde-soft); border-left: 4px solid var(--cde-accent); padding: .6em .9em; }
.cde-actions { display: flex; flex-wrap: wrap; gap: .6em; margin: 1em 0 1.5em; }

.cde-amenities { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: .4em 1.2em; }
.cde-amenities li { display: flex; justify-content: space-between; gap: .5em; border-bottom: 1px solid var(--cde-border); padding: .35em 0; }
.cde-tri { font-weight: 600; white-space: nowrap; }
.cde-tri--yes { color: var(--cde-yes); }
.cde-tri--no { color: var(--cde-no); }
.cde-tri--unknown { color: var(--cde-unk); font-weight: 400; }

.cde-facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: .3em 1em; }
.cde-facts dt { font-weight: 600; }
.cde-facts dd { margin: 0; }
.cde-feetext summary { cursor: pointer; font-weight: 600; }
.cde-sources { width: 100%; border-collapse: collapse; font-size: .92em; }
.cde-sources th, .cde-sources td { border-bottom: 1px solid var(--cde-border); padding: .35em .5em; text-align: left; }

/* Never wider than the screen: long URLs and words wrap, tables scroll inside their box. */
.cde-cg, .cde-search, .cde-results, .cde-budget, .cde-compare { max-width: 100%; overflow-wrap: anywhere; }
.cde-cg > *, .cde-budget > *, .cde-amenities > li, .cde-facts > * { min-width: 0; }
.cde-sources { display: block; overflow-x: auto; }
.cde-budget__field input { box-sizing: border-box; }

/* Search */
.cde-search__panel { border: 1px solid var(--cde-border); border-radius: 8px; padding: .8em 1em; margin-bottom: 1.2em; }
.cde-search__panel summary { font-weight: 700; cursor: pointer; }
.cde-search label { display: block; margin: .6em 0; }
.cde-search input[type="search"], .cde-search input[type="number"], .cde-search select { display: block; width: 100%; max-width: 320px; padding: .45em; }
.cde-search fieldset { border: 0; padding: 0; margin: .8em 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: .2em 1em; }
.cde-search legend { font-weight: 600; margin-bottom: .3em; }
.cde-check { margin: .2em 0 !important; }
.cde-results { list-style: none; padding: 0; display: grid; gap: .8em; }
.cde-card { border: 1px solid var(--cde-border); border-radius: 8px; padding: .8em 1em; }
.cde-card h3 { margin: 0 0 .2em; font-size: 1.1em; }
.cde-card__meta { margin: 0 0 .4em; color: var(--cde-muted); }
.cde-partial { margin-top: 1.5em; }
.cde-partial summary { cursor: pointer; font-weight: 600; }
.cde-pager { display: flex; gap: .4em; flex-wrap: wrap; margin: 1em 0; }
.cde-pager a, .cde-pager span { padding: .3em .7em; border: 1px solid var(--cde-border); border-radius: 4px; }
.cde-pager span { background: var(--cde-accent); color: #fff; }

/* Compare */
.cde-compare { overflow-x: auto; }
.cde-compare table { border-collapse: collapse; width: 100%; }
.cde-compare th, .cde-compare td { border-bottom: 1px solid var(--cde-border); padding: .45em .6em; text-align: left; vertical-align: top; }
.cde-compare tr.cde-diff { background: #fffbea; }
@media (max-width: 640px) {
	.cde-compare thead { display: none; }
	.cde-compare tr { display: block; border: 1px solid var(--cde-border); border-radius: 6px; margin-bottom: .6em; padding: .3em .5em; }
	.cde-compare th[scope="row"] { display: block; border: 0; padding: .2em 0; }
	.cde-compare td { display: flex; justify-content: space-between; gap: 1em; border: 0; padding: .15em 0; }
	.cde-compare td::before { content: attr(data-label); color: var(--cde-muted); }
}

.cde-comparebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; display: flex; gap: .6em; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .5em .8em; background: #fff; border-top: 1px solid var(--cde-border); box-shadow: 0 -2px 8px rgba(0, 0, 0, .08); }
.cde-comparebar[hidden] { display: none; }
.cde-comparebar__names { display: flex; gap: .4em; flex-wrap: wrap; }
.cde-chip { border: 1px solid var(--cde-border); background: var(--cde-soft); border-radius: 999px; padding: .2em .7em; font: inherit; font-size: .88em; cursor: pointer; }

/* Budget */
.cde-budget { border: 1px solid var(--cde-border); border-radius: 8px; padding: 1em; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: .6em 1.2em; }
.cde-budget__field span { display: block; font-weight: 600; }
.cde-budget__field input { width: 100%; padding: .45em; }
.cde-budget__hint { display: block; color: var(--cde-muted); }
.cde-budget .cde-btn, .cde-budget__result, .cde-budget__note { grid-column: 1 / -1; }
.cde-budget .cde-btn { justify-self: start; }
.cde-budget__lines { display: grid; grid-template-columns: max-content max-content; gap: .2em 1.2em; font-size: 1.05em; }
.cde-budget__lines dd { margin: 0; }
.cde-budget__errors { color: var(--cde-no); }
.cde-badge--warn { background: var(--cde-warn-bg); border-radius: 4px; padding: .1em .4em; font-size: .85em; }

@media print {
	.cde-comparebar, .cde-actions .cde-btn:not(.cde-btn--primary), .cde-budget .cde-btn { display: none !important; }
}

/* Climate */
.cde-climate table { border-collapse: collapse; width: 100%; max-width: 520px; font-size: .95em; }
.cde-climate th, .cde-climate td { border-bottom: 1px solid var(--cde-border); padding: .3em .5em; text-align: right; }
.cde-climate th[scope="row"], .cde-climate thead th:first-child { text-align: left; }
.cde-climate tr.cde-climate__hit { background: #eaf4e4; }
.cde-climate__helper input { width: 4.5em; padding: .2em; }

/* State map (relief image + clickable dots) */
.cde-map { margin: 1em 0 1.5em; }
.cde-map__grid { display: grid; gap: 1em; }
.cde-map--multi .cde-map__grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: end; }
.cde-map__title { margin: 0 0 .3em; font-weight: 700; }
.cde-rmap { position: relative; width: 100%; border-radius: 6px; overflow: hidden; border: 1px solid var(--cde-border); }
.cde-rmap img, .cde-rmap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cde-map__city { fill: #1e2420; }
.cde-map__citylabel { font: 700 26px/1 system-ui, sans-serif; fill: #1e2420; paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-width: 6px; }
.cde-map__pt { fill: #b5651d; stroke: #fff; stroke-width: 3; }
.cde-map__pt--electric { fill: #2f6b3a; }
.cde-rmap a:hover .cde-map__pt, .cde-rmap a:focus .cde-map__pt { r: 16; stroke: #1e2420; }
.cde-rmap a:focus { outline: none; }
.cde-map__key { display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: #b5651d; vertical-align: -1px; }
.cde-map__key--electric { background: #2f6b3a; }

/* Topic links */
.cde-topics { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: .4em 1.2em; }
.cde-topics a { font-weight: 600; }
