/*
 * Community Office Finder — front-end styles
 * Override --cof-accent in your theme CSS to rebrand.
 */

.cof-wrapper {
	--cof-accent:      #e4007f;
	--cof-accent-dark: #b8006a;
	--cof-bg:          #f5f5f5;
	--cof-border:      #e0e0e0;
	--cof-text:        #1a1a1a;
	--cof-muted:       #555;
	--cof-radius:      10px;

	display: flex;
	gap: 0;
	border-radius: var(--cof-radius);
	overflow: hidden;
	background: var(--cof-bg);
	font-family: inherit;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ── Map column ──────────────────────────────────────────── */

.cof-map-col {
	flex: 1.3;
	min-width: 0;
	background: #ddd;
}

#cof-map {
	width: 100%;
	display: block;
}

/* ── Panel column ────────────────────────────────────────── */

.cof-panel-col {
	flex: 0 0 400px;
	max-width: 440px;
	overflow-y: auto;
	max-height: var(--cof-panel-height, 520px);
	scroll-behavior: smooth;
}

.cof-panel {
	padding: 28px 24px 32px;
	background: var(--cof-bg);
}

/* ── Heading ─────────────────────────────────────────────── */

.cof-heading {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--cof-text);
	margin: 0 0 10px;
	line-height: 1.3;
}

.cof-rule {
	width: 56px;
	height: 3px;
	background: var(--cof-accent);
	margin-bottom: 14px;
	border-radius: 2px;
}

.cof-description {
	font-size: 0.875rem;
	color: var(--cof-muted);
	margin: 0 0 18px;
	line-height: 1.5;
}

/* ── Search bar ──────────────────────────────────────────── */

.cof-search-row {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.cof-input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	background: #fff;
	border: 2px solid var(--cof-border);
	border-radius: 8px;
	padding: 0 12px;
	transition: border-color 0.2s;
	min-width: 0;
}

.cof-input-wrap:focus-within {
	border-color: var(--cof-accent);
}

.cof-input-icon {
	color: var(--cof-accent);
	display: flex;
	align-items: center;
	margin-right: 8px;
	flex-shrink: 0;
}

.cof-input {
	flex: 1;
	min-width: 0;
	border: none;
	outline: none;
	padding: 11px 0;
	font-size: 0.9rem;
	color: var(--cof-text);
	background: transparent;
	font-family: inherit;
}

.cof-input::placeholder {
	color: #aaa;
}

.cof-btn {
	flex-shrink: 0;
	background: var(--cof-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0 20px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.2s, opacity 0.2s;
	height: 46px;
}

.cof-btn:hover {
	background: var(--cof-accent-dark);
}

.cof-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* ── Status message ──────────────────────────────────────── */

.cof-message {
	font-size: 0.8rem;
	color: #888;
	min-height: 18px;
	margin-bottom: 4px;
}

.cof-message.cof-error {
	color: #c62828;
}

/* ── Office cards ────────────────────────────────────────── */

.cof-results {
	margin-top: 4px;
}

.cof-office {
	padding: 16px 0;
	border-bottom: 1px solid var(--cof-border);
	cursor: pointer;
	transition: background 0.15s;
	border-radius: 4px;
}

.cof-office:last-child {
	border-bottom: none;
}

.cof-office:hover,
.cof-office.is-active {
	background: rgba(228, 0, 127, 0.05);
	margin-left: -8px;
	margin-right: -8px;
	padding-left: 8px;
	padding-right: 8px;
}

.cof-office-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.cof-office-name {
	font-size: 1rem;
	font-weight: 700;
	color: var(--cof-text);
	margin: 0;
	line-height: 1.3;
}

.cof-office.is-active .cof-office-name {
	color: var(--cof-accent);
}

.cof-distance {
	flex-shrink: 0;
	background: var(--cof-accent);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 3px 9px;
	border-radius: 20px;
	white-space: nowrap;
	margin-top: 2px;
}

.cof-nearest-label {
	flex-shrink: 0;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--cof-accent);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 3px;
}

.cof-office-detail {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 0.84rem;
	color: var(--cof-muted);
	margin-bottom: 5px;
	line-height: 1.4;
}

.cof-office-detail:last-child {
	margin-bottom: 0;
}

.cof-office-detail svg {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	color: #999;
}

.cof-office-detail a {
	color: var(--cof-accent);
	text-decoration: none;
}

.cof-office-detail a:hover {
	text-decoration: underline;
}

/* ── Map markers ─────────────────────────────────────────── */

.cof-pin {
	width: 22px;
	height: 22px;
	background: var(--cof-accent, #e4007f);
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
	transition: transform 0.15s;
}

.cof-pin:hover,
.cof-pin.is-active {
	transform: scale(1.25);
}

.cof-search-pin {
	width: 18px;
	height: 18px;
	background: #1a73e8;
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Reset button ────────────────────────────────────────── */

.cof-reset {
	display: inline-block;
	font-size: 0.8rem;
	color: var(--cof-accent);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
	text-decoration: underline;
	margin-left: 6px;
}

/* ── No-results ──────────────────────────────────────────── */

.cof-no-offices {
	font-size: 0.875rem;
	color: #999;
	padding: 16px 0;
}

/* ── Leaflet popup tweak ─────────────────────────────────── */

.leaflet-popup-content-wrapper {
	border-radius: 8px !important;
	font-family: inherit;
	font-size: 0.85rem;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
	.cof-wrapper {
		flex-direction: column;
		border-radius: 8px;
		box-shadow: none;
	}

	.cof-map-col {
		border-radius: 0;
	}

	#cof-map {
		height: 280px !important;
	}

	.cof-panel-col {
    flex: none;
    max-width: 100%;
    max-height: unset !important;
    overflow-y: unset;
    height: auto;

	}

	.cof-panel {
		padding: 20px 16px 28px;
	}
}
