/*
Theme Name: LaCareBean
Theme URI: https://lacarebean.com/
Author: UreseQure LLC
Description: LaCareBean: care for everyone, close to home. A searchable map of free and low-cost community services from government offices, nonprofits and local businesses. Includes a resource manager with map pin placement, opening hours and verification dates, a public "suggest a resource" form with a review queue, English/Spanish interface, and 24 optional sample listings.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lacarebean
Tags: one-column, custom-logo, custom-menu, translation-ready
*/

/* Layout: compact header, filter bar, results list beside a sticky street map (tabs on phones). */
:root {
	--bg: #f2f5f4;
	--surface: #ffffff;
	--fg: #16221e;
	--muted: #56665f;
	--line: #d6dfdb;
	--accent: #0b6470;
	--accent-ink: #ffffff;
	--accent-soft: #d8eef0;
	--care: #d9434f;
	--focus: #1f6feb;
	--note-bg: #fff3d1;
	--note-fg: #5f4300;
	--ok: #147346;
	--closed: #8c3f3f;
	--pin-ring: #ffffff;
	--shadow: 0 1px 2px rgba(16, 34, 30, .06), 0 6px 18px rgba(16, 34, 30, .07);
	--c-food: #c2410c;
	--c-housing: #1d4ed8;
	--c-health: #be123c;
	--c-jobs: #7c3aed;
	--c-legal: #3f4b5e;
	--c-seniors: #a85d06;
	--c-youth: #0e7490;
	--c-bills: #8a6a00;
	--c-tech: #047857;
	--font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
	--font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
	--radius: 12px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1614; --surface: #17211e; --fg: #e5eeea; --muted: #9aaca5; --line: #2a3833;
		--accent: #4fd1c9; --accent-ink: #052224; --accent-soft: #133a3d; --care: #ff8a70; --focus: #79b0ff;
		--note-bg: #3a2f12; --note-fg: #f3dc9c; --ok: #5fd39a; --closed: #f09a9a; --pin-ring: #0f1614;
		--shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
		--c-food: #fb8a52; --c-housing: #7ea6ff; --c-health: #fb7193; --c-jobs: #b79bff; --c-legal: #aab6c8;
		--c-seniors: #f2ad4e; --c-youth: #4fc9e3; --c-bills: #e3c552; --c-tech: #43d19f;
		color-scheme: dark;
	}
	.leaflet-tile-pane { filter: brightness(.72) invert(1) contrast(.9) hue-rotate(200deg) saturate(.35); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg); color: var(--fg);
	font-family: var(--font-body); font-size: 15px; line-height: 1.5;
	padding-left: max(16px, env(safe-area-inset-left, 0px));
	padding-right: max(16px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip:focus { position: fixed !important; left: 12px; top: 12px; width: auto; height: auto; clip: auto; background: var(--surface); padding: 10px 14px; border-radius: 8px; z-index: 1000; }
body.admin-bar .map-col { top: 44px; }

.shell { max-width: 1320px; margin: 0 auto; padding-block: 16px 32px; display: flex; flex-direction: column; gap: 14px; }

/* Header */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 320px; text-decoration: none; color: inherit; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; flex: none; }
.brand-mark img { width: 52px; height: 52px; display: block; }
.care { color: var(--care); }
.brand-logo img { width: 44px; height: 44px; object-fit: contain; display: block; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.brand-tag { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary[disabled] { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--muted); }
.btn svg { width: 18px; height: 18px; }
.btn-icon { padding: 9px; }

.note { background: var(--note-bg); color: var(--note-fg); border-radius: 10px; padding: 9px 14px; font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.app { display: flex; flex-direction: column; gap: 14px; }

/* Filters */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1 1 320px; min-width: 0; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 11px 12px 11px 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.near { display: flex; gap: 8px; align-items: center; flex: 0 1 auto; flex-wrap: wrap; }
.near label { font-weight: 600; font-size: .88rem; color: var(--muted); }
.near select, .near input { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.near input { width: 7.5em; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px 6px 8px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.chip .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--cc, var(--accent)) 16%, transparent); color: var(--cc, var(--accent)); }
.chip .dot svg { width: 14px; height: 14px; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip[aria-pressed="true"] .dot { background: var(--bg); }
.toggles { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.toggles .group-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: .92rem; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.sep { width: 1px; height: 22px; background: var(--line); }

/* Main */
.tabs { display: none; }
.main { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 16px; align-items: start; }
.list-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.summary { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); min-height: 1.4em; }
.summary strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.cards { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.card.sel { border-color: var(--accent); box-shadow: var(--shadow); }
.card-head { width: 100%; text-align: left; background: none; border: 0; padding: 14px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; cursor: pointer; border-radius: var(--radius); }
.ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 15%, transparent); color: var(--cc); }
.ic svg { width: 22px; height: 22px; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; line-height: 1.25; margin: 0 0 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; }
.pill { border-radius: 999px; padding: 2px 9px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.pill.open { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill.shut { color: var(--closed); border-color: color-mix(in srgb, var(--closed) 35%, transparent); background: color-mix(in srgb, var(--closed) 8%, transparent); }
.pill.cost { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.where { color: var(--muted); font-size: .86rem; margin-top: 6px; display: block; }
.desc { margin: 6px 0 0; font-size: .92rem; }
.prov { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; display: block; }
.details { padding: 0 14px 14px 66px; display: grid; gap: 12px; font-size: .9rem; }
.details h4 { margin: 0 0 3px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.details p { margin: 0; }
.hours { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours td { padding: 2px 0; }
.hours td:last-child { text-align: right; }
.hours tr.today td { font-weight: 700; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions code { font-family: var(--font-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.mini { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 5px 10px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.mini.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .8rem; background: var(--bg); border-radius: 6px; padding: 2px 8px; color: var(--muted); }
.checked { font-size: .8rem; color: var(--muted); }
.sample { font-size: .76rem; color: var(--note-fg); background: var(--note-bg); border-radius: 6px; padding: 2px 8px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 18px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* Map */
.map-col { position: sticky; top: max(12px, env(safe-area-inset-top, 0px)); min-width: 0; }
.map-wrap { position: relative; height: calc(100vh - 32px); max-height: 820px; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
#map { position: absolute; inset: 0; }
.leaflet-container { font-family: var(--font-body); background: var(--bg); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 12px 14px; font-size: .86rem; line-height: 1.4; }
.leaflet-popup-content strong { font-family: var(--font-display); display: block; font-size: .98rem; margin: 2px 0 4px; }
.leaflet-popup-content .mini { margin-top: 8px; }
.leaflet-bar a { background: var(--surface); color: var(--fg); border-color: var(--line); }
.leaflet-control-attribution { font-size: 10px; }
.legend { position: absolute; left: 12px; bottom: 26px; z-index: 500; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .78rem; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 340px; box-shadow: var(--shadow); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); display: inline-block; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(8, 16, 14, .55); display: grid; place-items: center; padding: 16px; z-index: 2000; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: 100%; overflow: auto; padding: 20px; box-shadow: var(--shadow); }
.modal form, .success { display: grid; gap: 14px; }
.modal h2 { font-family: var(--font-display); margin: 0; font-size: 1.3rem; }
.modal p { margin: 0; color: var(--muted); font-size: .9rem; }
.field { display: grid; gap: 5px; }
.field label { font-weight: 600; font-size: .88rem; }
.field input, .field select, .field textarea { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.err, .form-error { color: var(--closed); font-size: .85rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.success { justify-items: start; }
.ok-badge { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ok-badge svg { width: 24px; height: 24px; }

/* Footer and plain pages */
.site-footer { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.page { display: flex; flex-direction: column; gap: 16px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 40px); max-width: 780px; }
.entry h1, .entry h2 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin-top: 0; }
.entry-content { max-width: 65ch; }

@media (max-width: 860px) {
	.main { grid-template-columns: minmax(0, 1fr); }
	.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); align-self: flex-start; }
	.tabs button { border: 0; background: none; padding: 8px 18px; font-weight: 600; cursor: pointer; color: var(--muted); }
	.tabs button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
	.main[data-view="list"] .map-col { display: none; }
	.main[data-view="map"] .list-col { display: none; }
	.map-col { position: static; }
	.map-wrap { height: 70vh; min-height: 380px; }
	.details { padding-left: 14px; }
	.sep { display: none; }
}
@media (max-width: 480px) {
	.two { grid-template-columns: 1fr; }
	.brand-name { font-size: 1.2rem; }
	.near { width: 100%; }
	.near select { flex: 1 1 auto; min-width: 0; }
	.legend { display: none; }
	.top-actions { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
