/**
 * OCTEC Location Finder — tokens + structural CSS only.
 *
 * Leans on the theme: inherits typography, colour and spacing. Only H1 (page)
 * and H2 (modal title) set a font-family; nothing else declares a font, and no
 * body/heading text colour is set. Everything is namespaced under `octec-`.
 */

.octec-finder {
	/* Colours — remap to Blocksy palette vars if desired. */
	--octec-accent: var(--theme-palette-color-1, #0b7a5e);
	--octec-accent-dark: #103d2e;
	--octec-amber: #a86a12;
	--octec-muted: #6b7280;
	--octec-border: #e5e7eb;
	--octec-overlay: rgba(0, 0, 0, .5);
	--octec-radius: 0; /* square corners — brand */

	--octec-tag-emp-bg: #e2f0eb;
	--octec-tag-emp-text: #0b6b4f;
	--octec-tag-train-bg: #f6ecd9;
	--octec-tag-train-text: #8a5a16;
	--octec-tag-ndis-bg: #e8eef6;
	--octec-tag-ndis-text: #2c5282;

	color-scheme: light; /* keep the Places autocomplete light, never dark */
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ---- Controls ------------------------------------------------------------ */

.octec-finder__controls {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.octec-finder__search {
	position: relative;
	display: flex;
	align-items: center;
}

.octec-finder__search-icon {
	position: absolute;
	left: 14px;
	color: var(--octec-muted);
	pointer-events: none;
}

.octec-finder .octec-finder__search-input,
.octec-finder .octec-finder__pac {
	width: 100%;
	box-sizing: border-box;
}

/* !important + a wrapper class to win over the theme's aggressive form styles
   (Blocksy sets input bg transparent, a 2px border and 15px padding). */
.octec-finder .octec-finder__search-input {
	padding: 12px 14px 12px 42px !important;
	border: 1px solid var(--octec-border) !important;
	border-radius: var(--octec-radius) !important;
	background: #fff !important;
	color: inherit;
	line-height: 1.4;
}

.octec-finder .octec-finder__search-input:focus {
	outline: none;
	border-color: var(--octec-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--octec-accent) 25%, transparent);
}

/* The new Places autocomplete element, mounted on first focus. The single
   visible border lives on the host (matching the static input). On focus we
   only recolour it (constant width → no size shift), and we neutralise the
   component's own input border + absolute focus-ring so there's no inner or
   double border. ::part(input)/::part(focus-ring) reach the closed shadow. */
.octec-finder__pac {
	--gmp-mat-color-primary: var(--octec-accent);
	color-scheme: light;
	display: block;
	width: 100%;
	background: #fff;
	border: 1px solid var(--octec-border);
	border-radius: var(--octec-radius);
}

.octec-finder__pac:focus,
.octec-finder__pac:focus-within,
.octec-finder__pac:focus-visible {
	border-color: var(--octec-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--octec-accent) 25%, transparent);
	outline: none;
}

.octec-finder__pac::part(input) {
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit;
}

.octec-finder__pac::part(focus-ring) {
	border: none !important;
	box-shadow: none !important;
}

/* ---- Pills --------------------------------------------------------------- */

.octec-finder__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.octec-pill {
	padding: 7px 16px;
	border: 1px solid var(--octec-border);
	border-radius: var(--octec-radius);
	background: #fff;
	font-size: .9em;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}

/* Resting pills carry the same per-service colour as the list chips. */
.octec-pill[data-slug="employment-services"] {
	background: var(--octec-tag-emp-bg);
	color: var(--octec-tag-emp-text);
	border-color: transparent;
}

.octec-pill[data-slug="training-services"],
.octec-pill[data-slug="transition-to-work"] {
	background: var(--octec-tag-train-bg);
	color: var(--octec-tag-train-text);
	border-color: transparent;
}

.octec-pill[data-slug="ndis-employment"] {
	background: var(--octec-tag-ndis-bg);
	color: var(--octec-tag-ndis-text);
	border-color: transparent;
}

.octec-pill:hover {
	border-color: var(--octec-accent);
}

/* Active pill = solid accent (wins over the per-slug colours above). */
.octec-pill.is-active {
	background: var(--octec-accent);
	border-color: var(--octec-accent);
	color: #fff;
}

/* ---- Layout (list + optional map) --------------------------------------- */

.octec-finder__layout {
	display: grid;
	gap: 20px;
	align-items: start;
}

.octec-finder[data-map="true"] .octec-finder__layout {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.octec-finder__list {
	max-height: 70vh;
	overflow-y: auto;
	border: 1px solid var(--octec-border);
	border-radius: var(--octec-radius);
}

.octec-finder[data-map="false"] .octec-finder__list {
	border: 0;
	border-radius: 0;
	max-height: none;
}

.octec-finder__map {
	min-height: 480px;
	height: 100%;
	border-radius: var(--octec-radius);
	overflow: hidden;
	background: #eef1f0;
	position: sticky;
	top: 20px;
}

@media (max-width: 880px) {
	.octec-finder[data-map="true"] .octec-finder__layout {
		grid-template-columns: 1fr;
	}
	.octec-finder__map {
		order: -1;
		min-height: 320px;
		position: static;
	}
}

/* ---- Card ---------------------------------------------------------------- */

.octec-card {
	display: flex;
	gap: 12px;
	padding: 16px;
	border-bottom: 1px solid var(--octec-border);
}

.octec-card:last-child {
	border-bottom: 0;
}

.octec-card.is-hidden {
	display: none;
}

.octec-card.is-active {
	background: color-mix(in srgb, var(--octec-accent) 6%, transparent);
}

.octec-card__pin {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 4px;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	background: var(--octec-accent);
}

.octec-card__pin.is-head-office {
	background: var(--octec-amber);
}

.octec-card__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.octec-card__head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
}

.octec-card__name {
	margin: 0;
	font-size: 1.05em;
	line-height: 1.3;
}

.octec-card__badge {
	font-size: .68em;
	text-transform: uppercase;
	letter-spacing: .06em;
	font-weight: 600;
	color: var(--octec-amber);
	border: 1px solid currentColor;
	border-radius: var(--octec-radius);
	padding: 2px 8px;
}

.octec-card__distance {
	margin-left: auto;
	align-self: center;
	font-size: .8em;
	font-weight: 600;
	white-space: nowrap;
	color: var(--octec-accent);
}

.octec-card__address {
	margin: 0;
	color: var(--octec-muted);
	font-size: .92em;
	line-height: 1.4;
}

.octec-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}

.octec-tag {
	font-size: .75em;
	line-height: 1.2;
	padding: 3px 9px;
	border-radius: var(--octec-radius);
	background: #eef1f0;
	color: var(--octec-muted);
}

.octec-tag[data-slug="employment-services"] {
	background: var(--octec-tag-emp-bg);
	color: var(--octec-tag-emp-text);
}

.octec-tag[data-slug="training-services"],
.octec-tag[data-slug="transition-to-work"] {
	background: var(--octec-tag-train-bg);
	color: var(--octec-tag-train-text);
}

.octec-tag[data-slug="ndis-employment"] {
	background: var(--octec-tag-ndis-bg);
	color: var(--octec-tag-ndis-text);
}

.octec-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.octec-card__phone {
	font-weight: 700;
}

.octec-card__link {
	color: var(--octec-accent);
	font-weight: 600;
	white-space: nowrap;
}

/* ---- Footnote / empty state --------------------------------------------- */

.octec-finder__empty {
	padding: 24px 16px;
	margin: 0;
	color: var(--octec-muted);
	text-align: center;
}

.octec-finder__note {
	margin: 0;
	color: var(--octec-muted);
	font-size: .85em;
}

/* Radius fallback: shown when a search matched nothing within range and the
   nearest offices are listed instead. */
.octec-finder__fallback {
	margin: 0;
	padding: 10px 14px;
	background: var(--octec-tag-train-bg);
	color: var(--octec-tag-train-text);
	border-left: 3px solid var(--octec-amber);
	font-size: .9em;
}

/* In-list divider above the beyond-radius offices that top up thin results. */
.octec-finder__divider {
	margin: 4px 0;
	padding: 10px 14px;
	background: var(--octec-tag-train-bg);
	color: var(--octec-tag-train-text);
	border-left: 3px solid var(--octec-amber);
	font-size: .85em;
}

/* ---- Map info window (cloned card) -------------------------------------- */

/* The CTA's info windows live outside any .octec-finder root, and the block
   wrapping the CTA may set white text — so the wrapper re-declares the card
   tokens and pins the ink colour for the white info-window background. */
.octec-finder__iw {
	--octec-accent: var(--theme-palette-color-1, #0b7a5e);
	--octec-accent-dark: #103d2e;
	--octec-amber: #a86a12;
	--octec-muted: #6b7280;
	--octec-border: #e5e7eb;
	--octec-radius: 0;
	--octec-tag-emp-bg: #e2f0eb;
	--octec-tag-emp-text: #0b6b4f;
	--octec-tag-train-bg: #f6ecd9;
	--octec-tag-train-text: #8a5a16;
	--octec-tag-ndis-bg: #e8eef6;
	--octec-tag-ndis-text: #2c5282;
	color: #2d2d2d;
}

.octec-finder__iw .octec-card,
.octec-finder__iw .octec-card.is-active {
	border: 0;
	padding: 4px 4px 12px 0;
	max-width: 260px;
	background: transparent;
}

.octec-finder__iw .octec-finder__list {
	max-height: none;
	overflow: visible;
}

/* ==== Location CTA — [octec_locations_cta] ================================
 *
 * Background-agnostic by design: the CTA paints no background of its own and
 * inherits the wrapping block's text colour, so the same shortcode reads
 * correctly on navy, green or white. Muted tones are derived from
 * currentColor; only the brand gold accent is fixed. Tokens sampled from the
 * mockup's "Our Locations" section (accent-gold #A86800, square corners).
 */

.octec-cta {
	--octec-accent: var(--theme-palette-color-1, #0b7a5e); /* map pins (read by JS) */
	--octec-amber: #a86a12;                                /* head-office pin */
	--octec-cta-gold: #a86800;
	--octec-cta-gold-light: #e8a530;
	--octec-cta-ink: #2d2d2d;  /* text on white input & gold-light hover */
	--octec-radius: 0;         /* square corners — brand */

	color-scheme: light; /* keep the Places autocomplete light, never dark */
	display: grid;
	gap: 32px;
	align-items: center;
	background: transparent;
	color: inherit;
}

@media (min-width: 900px) {
	.octec-cta--has-map {
		grid-template-columns: 1fr 1fr;
		gap: 40px;
	}
}

/* Grid items must be allowed to shrink below their content's intrinsic
   min-width — the mounted Places element otherwise forces the whole column
   (and page) wider than a phone viewport. */
.octec-cta__content,
.octec-cta__map {
	min-width: 0;
}

/* Visually-hidden label for the search field. */
.octec-cta__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.octec-cta__eyebrow {
	margin: 0 0 12px;
	padding-left: 12px;
	border-left: 2px solid var(--octec-cta-gold);
	font-size: .875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: inherit;
}

/* Size only — the face and colour come from the theme / wrapping block. */
.octec-cta .octec-cta__heading {
	margin: 0;
	font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3rem);
	font-weight: 700;
	line-height: 1.05;
	color: inherit;
}

.octec-cta__text {
	margin: 16px 0 0;
	color: color-mix(in srgb, currentColor 80%, transparent);
	line-height: 1.5;
}

/* ---- Search row ---------------------------------------------------------- */

.octec-cta__form {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}

.octec-cta__field {
	position: relative;
	flex: 1;
	min-width: 0;
}

/* !important to win over Blocksy's aggressive form styles (transparent bg,
   2px border, 15px padding) — same technique as the finder search input. */
.octec-cta .octec-cta__input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 16px !important;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent) !important;
	border-radius: var(--octec-radius) !important;
	background: #fff !important;
	color: var(--octec-cta-ink) !important;
	font-size: .875rem;
	line-height: 1.4;
}

.octec-cta .octec-cta__input::placeholder {
	color: color-mix(in srgb, var(--octec-cta-ink) 55%, transparent);
	opacity: 1;
}

.octec-cta .octec-cta__input:focus {
	outline: none;
	border-color: var(--octec-cta-gold) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--octec-cta-gold) 30%, transparent);
}

/* The mounted Places autocomplete host — mirrors .octec-finder__pac. */
.octec-cta__pac {
	--gmp-mat-color-primary: var(--octec-cta-gold);
	color-scheme: light;
	display: block;
	width: 100%;
	min-width: 0;
	background: #fff;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: var(--octec-radius);
	color: var(--octec-cta-ink);
	font-size: .875rem;
}

.octec-cta__pac:focus,
.octec-cta__pac:focus-within,
.octec-cta__pac:focus-visible {
	border-color: var(--octec-cta-gold);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--octec-cta-gold) 30%, transparent);
	outline: none;
}

.octec-cta__pac::part(input) {
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit;
}

.octec-cta__pac::part(focus-ring) {
	border: none !important;
	box-shadow: none !important;
}

.octec-cta .octec-cta__button {
	padding: 12px 24px;
	border: none;
	border-radius: var(--octec-radius);
	background: var(--octec-cta-gold);
	color: #fff;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.octec-cta .octec-cta__button:hover {
	background: var(--octec-cta-gold-light);
	color: var(--octec-cta-ink);
}

.octec-cta .octec-cta__button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.octec-cta__link {
	display: inline-flex;
	margin-top: 16px;
	font-size: .875rem;
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	transition: color .2s;
}

.octec-cta__link:hover {
	color: var(--octec-cta-gold-light);
}

.octec-cta__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---- Map ------------------------------------------------------------------ */

.octec-cta__map {
	width: 100%;
	aspect-ratio: 3 / 2;
	min-height: 260px;
	background: color-mix(in srgb, currentColor 8%, transparent);
}
