/**
 * GrainCorp Store Finder - frontend styles.
 *
 * Palette is defined once as custom properties, and every rule below reads
 * a colour through one of these tokens rather than a hardcoded hex value.
 * --gcsf-primary and --gcsf-accent are the two a site owner actually sets,
 * on the Settings screen ("Brand colours") - GCSF_Shortcode::render()
 * writes them out as an inline style on the .gcsf element itself, which
 * overrides the fallback values below for any theme/site that has
 * configured its own brand. The values here only apply if that setting is
 * ever missing entirely (a very old cached page, a direct API read, etc).
 */

.gcsf {
	--gcsf-primary: #1b2340;
	/* A lighter tint of whatever --gcsf-primary actually is, computed
	   automatically so gradients/hovers stay on-brand even when a site sets
	   a completely different primary colour - not a second colour a site
	   owner has to separately keep in sync. */
	--gcsf-primary-light: color-mix(in srgb, var(--gcsf-primary) 78%, white);
	--gcsf-accent: #d4af37;
	--gcsf-text: #333333;
	--gcsf-text-muted: #6b7280;
	--gcsf-border: #e2e4e9;
	--gcsf-card-bg: #f4f5f7;
	--gcsf-white: #ffffff;

	/*
	 * Type scale.
	 *
	 * Five deliberate steps, in px so nothing inherits the theme's inflated
	 * fluid root size. Every rule below uses one of these tokens and never a
	 * one-off value, which is what keeps the UI visually consistent:
	 *
	 *   xs  uppercase micro-labels, badges, buttons, distance, hours meta
	 *   sm  secondary body text: addresses, counters, radio labels, hours
	 *   md  primary interactive text: search field, filter headings, actions
	 *   lg  store names
	 *   xl  the results section heading
	 */
	--gcsf-fs-xs: 13px;
	--gcsf-fs-sm: 14px;
	--gcsf-fs-md: 15px;
	--gcsf-fs-lg: 17px;
	--gcsf-fs-xl: 21px;
	--gcsf-fs-icon: 19px;

	box-sizing: border-box;
	color: var(--gcsf-text);
	width: 100%;

	/* Keep the theme's typeface; control only the sizing. */
	font-family: inherit;
	font-size: var(--gcsf-fs-md);
	line-height: 1.5;

	/*
	 * Breathing room below the whole locator, so whatever the theme places
	 * next (a footer, another block) doesn't sit flush against the map -
	 * a popup card that runs to the very bottom edge of the map (its
	 * "bottom crop") would otherwise look like it collides with that next
	 * section rather than simply being clipped by the map's own edge.
	 */
	margin-bottom: 40px;
}

.gcsf *,
.gcsf *::before,
.gcsf *::after {
	box-sizing: inherit;
}

/*
 * Form controls do not inherit font-family by default, so they would fall back
 * to the browser UI font and look foreign next to the theme's type.
 *
 * Only font-family is reset here. Setting font-size in this rule would give it
 * higher specificity than the component rules below (.gcsf button beats
 * .gcsf-card__stv), so a <button> would ignore its own size while a sibling
 * <a> honoured it, making paired controls render at different sizes.
 */
.gcsf input,
.gcsf button,
.gcsf select,
.gcsf textarea,
.gcsf summary {
	font-family: inherit;
}

/*
 * Remove the browser's default focus outline, which renders as a hard black
 * box on radios, summaries and buttons. Every interactive element below
 * defines a softer :focus-visible ring instead, so keyboard focus stays clear.
 */
.gcsf :focus {
	outline: none;
}

.gcsf summary {
	outline: none;
}

.gcsf summary:focus-visible {
	box-shadow: 0 0 0 3px rgba(27, 35, 64, 0.18);
	border-radius: 4px;
	outline: none;
}

/*
 * Full width inside a block theme.
 *
 * Block themes constrain layout with a rule of the form
 *   :where(.is-layout-constrained) > :where(:not(.alignfull)...) {
 *       max-width: <content-size>; margin-left: auto !important; ... }
 * which targets DIRECT CHILDREN of the layout container. Shortcode output is
 * wrapped in an anonymous element at an unpredictable depth, so styling .gcsf
 * alone cannot escape: its wrapper stays centred. Un-constraining that wrapper
 * lets the locator fill the width its parent already provides. The
 * gcsf-has-locator body class scopes this to locator pages, and !important is
 * required to override the theme's own !important margins.
 */
.gcsf-has-locator main .entry-content > *,
.gcsf-has-locator main .wp-block-post-content > * {
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none !important;
}

/*
 * Remove the content area's own inner gutter only.
 *
 * Do NOT zero the padding on ancestors. .entry-content carries alignfull, and
 * block themes pull alignfull elements out with negative margins exactly equal
 * to the ancestor's global padding. Removing that padding leaves the negative
 * margins overshooting, which pushes the block off the left edge and creates a
 * horizontal scrollbar.
 */
.gcsf-has-locator main .entry-content,
.gcsf-has-locator main .wp-block-post-content {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/*
 * Hide the theme's page title, which would otherwise duplicate the hero
 * heading rendered by the shortcode.
 */
.gcsf-has-locator .wp-block-post-title,
.gcsf-has-locator .entry-title {
	display: none;
}

/* ---------- Hero ---------- */

.gcsf-hero {
	align-items: center;
	background: linear-gradient(135deg, var(--gcsf-primary) 0%, var(--gcsf-primary-light) 100%);
	border-bottom: 4px solid var(--gcsf-accent);
	display: flex;
	justify-content: center;
	min-height: 200px;
	padding: 32px 20px;
}

.gcsf-hero__title {
	color: var(--gcsf-white);
	/* px-based so it does not inherit the theme's inflated root size. */
	font-size: clamp(22px, 3.2vw, 34px);
	font-weight: 800;
	line-height: 1.2;
	margin: 0;
	text-align: center;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- Layout ---------- */

.gcsf-layout {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	min-height: 640px;
	/*
	 * Side inset so the sidebar and map sit clear of the viewport edge, the
	 * same as the page's other sections (a footer, page content) - the
	 * locator is deliberately full-width (see the .gcsf-has-locator rules
	 * above), but "full width" should still mean "matches the page's own
	 * gutter", not edge-to-edge with no margin at all.
	 */
	padding: 0 20px;
}

.gcsf-sidebar {
	background: var(--gcsf-white);
	border-right: 1px solid var(--gcsf-border);
	display: flex;
	flex-direction: column;
	/* Fixed track so the map always takes the remaining width and never wraps. */
	flex: 0 0 380px;
	max-height: 800px;
	overflow-y: auto;
	padding: 0;
}

.gcsf-mapwrap {
	flex: 1 1 auto;
	min-height: 480px;
	/* min-width:0 lets a flex item shrink below its content width. */
	min-width: 0;
	position: relative;
}

/* Soft inner edge so the map reads as a panel rather than a raw tile grid. */
.gcsf-mapwrap::after {
	box-shadow: inset 0 0 0 1px rgba(27, 35, 64, 0.08);
	content: '';
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 400;
}

.gcsf-map {
	height: 100%;
	min-height: 480px;
	width: 100%;
}

.gcsf-map--unavailable {
	align-items: center;
	background: var(--gcsf-card-bg);
	color: var(--gcsf-text-muted);
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 24px;
	text-align: center;
}

/* Extra breathing room at the viewport edge on wide screens. */
@media (min-width: 1200px) {
	.gcsf-layout {
		padding: 0 32px;
	}

	.gcsf-sidebar {
		flex-basis: 420px;
	}
}

@media (max-width: 860px) {
	.gcsf-layout {
		flex-direction: column;
		flex-wrap: wrap;
		min-height: 0;
		padding: 0 12px;
	}

	.gcsf-sidebar {
		border-right: none;
		border-bottom: 1px solid var(--gcsf-border);
		flex: 1 1 auto;
		max-width: none;
		max-height: none;
		order: 2;
	}

	.gcsf-mapwrap {
		order: 1;
		min-height: 360px;
	}

	.gcsf-map {
		min-height: 360px;
	}
}

/* ---------- Search bar ---------- */

.gcsf-searchbar {
	align-items: center;
	border-bottom: 1px solid var(--gcsf-border);
	display: flex;
	gap: 10px;
	padding: 16px;
}

.gcsf-search__input {
	background: var(--gcsf-white);
	border: 1px solid var(--gcsf-border);
	border-radius: 6px;
	color: var(--gcsf-text);
	flex: 1 1 auto;
	font-size: var(--gcsf-fs-md);
	min-width: 0;
	padding: 11px 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gcsf-search__input::placeholder {
	color: #9aa0ab;
}

.gcsf-search__input:focus {
	border-color: var(--gcsf-primary);
	box-shadow: 0 0 0 3px rgba(27, 35, 64, 0.12);
	outline: none;
}

.gcsf-geolocate {
	align-items: center;
	background: none;
	border: 1px solid transparent;
	border-radius: 6px;
	color: var(--gcsf-primary);
	cursor: pointer;
	display: flex;
	flex: 0 0 auto;
	font-size: var(--gcsf-fs-icon);
	height: 40px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	transition: background 0.15s ease, border-color 0.15s ease;
	width: 40px;
}

.gcsf-geolocate:hover {
	background: var(--gcsf-card-bg);
	border-color: var(--gcsf-border);
}

.gcsf-geolocate:focus-visible {
	box-shadow: 0 0 0 3px rgba(27, 35, 64, 0.15);
	outline: none;
}

.gcsf-geolocate__icon {
	display: block;
	height: 20px;
	width: 20px;
}

/* Location lookup in progress. */
.gcsf-geolocate.is-busy .gcsf-geolocate__icon {
	animation: gcsf-spin 1s linear infinite;
	opacity: 0.6;
}

/* Location currently applied to the results. */
.gcsf-geolocate.is-active {
	background: var(--gcsf-primary);
	border-color: var(--gcsf-primary);
	color: var(--gcsf-white);
}

@keyframes gcsf-spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gcsf-geolocate.is-busy .gcsf-geolocate__icon {
		animation: none;
	}
}

/* ---------- Counter ---------- */

.gcsf-counter {
	align-items: flex-start;
	border-bottom: 1px solid var(--gcsf-border);
	display: flex;
	font-size: var(--gcsf-fs-sm);
	gap: 12px;
	justify-content: space-between;
	padding: 14px 16px;
}

/* Explicit colour: themes colour text inside .entry-content, which otherwise
   tints the counter with the theme's link palette. The span rule covers the
   count and total, which would otherwise keep the theme's accent colour. */
.gcsf .gcsf-counter,
.gcsf .gcsf-counter__text {
	color: var(--gcsf-text);
}

.gcsf .gcsf-counter span {
	color: inherit;
	font-size: inherit;
	font-weight: 600;
}

/*
 * Themes style content links with rules like `.entry-content a`, which has
 * higher specificity than a single class and was overriding both the colour and
 * the size of these links. The extra .gcsf qualifier wins that contest, so
 * "Show All" and "Clear All" match the counter text they sit beside.
 */
.gcsf a.gcsf-link {
	color: var(--gcsf-primary);
	font-family: inherit;
	font-size: var(--gcsf-fs-sm);
	font-weight: 500;
	line-height: 1.5;
	text-decoration: none;
}

.gcsf a.gcsf-link:hover {
	color: var(--gcsf-primary-light);
	text-decoration: underline;
}

/* Same protection for the link-styled text inside cards. */
.gcsf a.gcsf-card__value,
.gcsf .gcsf-card__cta,
.gcsf .gcsf-card__stv {
	color: var(--gcsf-primary);
}

.gcsf .gcsf-card__cta:hover,
.gcsf .gcsf-card__stv:hover {
	color: var(--gcsf-white);
}

/* ---------- Filters ---------- */

.gcsf-filter {
	border-bottom: 1px solid var(--gcsf-border);
}

.gcsf-filter__toggle {
	align-items: center;
	background: none;
	border: none;
	color: var(--gcsf-text);
	cursor: pointer;
	display: flex;
	font-size: var(--gcsf-fs-md);
	font-weight: 500;
	justify-content: space-between;
	padding: 16px;
	text-align: left;
	width: 100%;
}

.gcsf-filter__chevron {
	border-bottom: 2px solid var(--gcsf-text-muted);
	border-right: 2px solid var(--gcsf-text-muted);
	display: inline-block;
	height: 8px;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
	width: 8px;
}

.gcsf-filter__toggle[aria-expanded="true"] .gcsf-filter__chevron {
	transform: rotate(-135deg);
}

.gcsf-filter__body {
	padding: 0 16px 16px;
}

.gcsf-radio {
	align-items: center;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	font-size: var(--gcsf-fs-sm);
	gap: 10px;
	padding: 7px 6px;
	transition: background 0.15s ease;
}

.gcsf-radio:hover {
	background: var(--gcsf-card-bg);
}

/*
 * Custom radio control. The browser default renders a square focus/checked
 * artifact around the round control on some platforms, which reads as a visual
 * defect; this replaces it with a clean ring that uses the brand colour.
 */
.gcsf-radio input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	background: var(--gcsf-white);
	border: 1.5px solid #c7cad1;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	flex: 0 0 auto;
	height: 18px;
	margin: 0;
	/* No default outline: the focus-visible ring below replaces it. */
	outline: none;
	padding: 0;
	transition: border-color 0.15s ease, border-width 0.1s ease, box-shadow 0.15s ease;
	width: 18px;
}

.gcsf-radio input[type="radio"]:hover {
	border-color: var(--gcsf-primary-light);
}

/* A thick border reads as a filled ring, with no inner pseudo-element needed. */
.gcsf-radio input[type="radio"]:checked {
	border-color: var(--gcsf-primary);
	border-width: 5.5px;
}

.gcsf-radio input[type="radio"]:focus-visible {
	box-shadow: 0 0 0 3px rgba(27, 35, 64, 0.18);
	outline: none;
}

.gcsf-radio span {
	line-height: 1.4;
}

/* The last filter panel needs a little breathing room before the results. */
.gcsf-filter:last-of-type {
	margin-bottom: 8px;
}

/* ---------- Results ---------- */

.gcsf-results__title {
	font-size: var(--gcsf-fs-xl);
	font-weight: 400;
	margin: 8px 0 4px;
	padding: 0 16px;
}

.gcsf-list {
	padding: 8px 16px 24px;
}

.gcsf-empty {
	color: var(--gcsf-text-muted);
	font-size: var(--gcsf-fs-sm);
	padding: 8px 0;
}

.gcsf-card {
	background: var(--gcsf-card-bg);
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
	padding: 18px 20px;
	position: relative;
	transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.gcsf-card:hover {
	background: var(--gcsf-white);
	border-color: var(--gcsf-border);
	box-shadow: 0 4px 14px rgba(27, 35, 64, 0.09);
	transform: translateY(-1px);
}

.gcsf-card:focus-visible {
	background: var(--gcsf-white);
	border-color: var(--gcsf-primary);
	box-shadow: 0 0 0 3px rgba(27, 35, 64, 0.15);
	outline: none;
}

/* The card currently open on the map. */
.gcsf-card.is-active {
	background: var(--gcsf-white);
	border-color: var(--gcsf-primary);
	box-shadow: 0 4px 14px rgba(27, 35, 64, 0.12);
}

.gcsf-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.gcsf-card__title {
	color: var(--gcsf-primary);
	font-size: var(--gcsf-fs-lg);
	font-weight: 700;
	margin-bottom: 6px;
}

.gcsf-card__address,
.gcsf-card__value,
.gcsf-card__desc {
	color: var(--gcsf-text-muted);
	font-size: var(--gcsf-fs-sm);
	line-height: 1.5;
	overflow-wrap: break-word;
}

.gcsf-card__desc {
	margin-top: 8px;
}

.gcsf-card__distance {
	color: var(--gcsf-primary-light);
	font-size: var(--gcsf-fs-xs);
	font-weight: 600;
	margin-top: 4px;
}

.gcsf-card__label {
	color: var(--gcsf-primary);
	font-size: var(--gcsf-fs-xs);
	font-weight: 700;
	letter-spacing: 0.05em;
	margin-top: 12px;
	text-transform: uppercase;
}

a.gcsf-card__value {
	color: var(--gcsf-primary);
	display: inline-block;
	text-decoration: underline;
}

.gcsf-card__hours {
	margin-top: 12px;
}

.gcsf-card__hours summary {
	color: var(--gcsf-primary);
	cursor: pointer;
	font-size: var(--gcsf-fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Structured hours: a fixed two-column layout, identical for every store. */
.gcsf-hours {
	margin-top: 8px;
}

.gcsf-hours__row {
	display: flex;
	font-size: var(--gcsf-fs-sm);
	gap: 12px;
	justify-content: space-between;
	line-height: 1.7;
}

.gcsf-hours__day {
	color: var(--gcsf-text);
	flex: 0 0 auto;
	font-weight: 600;
}

.gcsf-hours__time {
	color: var(--gcsf-text-muted);
	flex: 1 1 auto;
	text-align: right;
}

.gcsf-hours__note {
	color: var(--gcsf-text-muted);
	font-size: var(--gcsf-fs-xs);
	font-style: italic;
	margin: 8px 0 0;
}

/*
 * Actions sit side by side as equal columns, separated by a hairline, and stack
 * only on very narrow screens where two columns would wrap awkwardly.
 */
.gcsf-card__actions {
	border-top: 1px solid var(--gcsf-border);
	display: flex;
	flex-direction: row;
	margin-top: 16px;
	padding-top: 12px;
}

/*
 * Street View is a <button> so it can open the panorama in place rather than
 * navigating away, while Get Directions stays an <a> to Google Maps in a new
 * tab. Both must look identical, so the button's native chrome is reset.
 */
/*
 * One <a> and one <button> that must be visually identical, so every property
 * that differs between the two element defaults is set explicitly here.
 */
.gcsf-card__cta,
.gcsf-card__stv {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	border-radius: 4px;
	color: var(--gcsf-primary);
	cursor: pointer;
	display: block;
	flex: 1 1 50%;
	font-family: inherit;
	font-size: var(--gcsf-fs-sm);
	font-style: normal;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.4;
	margin: 0;
	min-width: 0;
	padding: 9px 6px;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.gcsf-card__stv {
	border-left: 1px solid var(--gcsf-border);
}

.gcsf-card__cta:hover,
.gcsf-card__stv:hover {
	background: var(--gcsf-primary);
	color: var(--gcsf-white);
	text-decoration: none;
}

.gcsf-card__cta:focus-visible,
.gcsf-card__stv:focus-visible {
	box-shadow: 0 0 0 2px rgba(27, 35, 64, 0.25);
	outline: none;
}

@media (max-width: 420px) {
	.gcsf-card__actions {
		flex-direction: column;
		gap: 4px;
	}

	.gcsf-card__stv {
		border-left: none;
		border-top: 1px solid var(--gcsf-border);
		padding-top: 8px;
	}
}

/* ---------- MapLibre: brand-matched pins, controls and popup ---------- */

/* Teardrop pin drawn entirely in CSS, so there is no image sprite to load. */
.gcsf-pin {
	background: none;
	border: 0;
}

.gcsf-pin .gcsf-pin__label {
	align-items: center;
	background: var(--gcsf-primary);
	border: 2px solid var(--gcsf-white);
	border-radius: 50% 50% 50% 0;
	box-shadow: 0 3px 8px rgba(27, 35, 64, 0.35);
	color: var(--gcsf-white);
	display: flex;
	font-size: var(--gcsf-fs-xs);
	font-weight: 700;
	height: 28px;
	justify-content: center;
	line-height: 1;
	transform: rotate(-45deg);
	transform-origin: center;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	width: 28px;
}

/* Counter-rotate the text so the letter stays upright in the rotated pin. */
.gcsf-pin .gcsf-pin__text {
	display: block;
	transform: rotate(45deg);
}

.gcsf-pin:hover .gcsf-pin__label {
	background: var(--gcsf-primary-light);
	box-shadow: 0 5px 14px rgba(27, 35, 64, 0.45);
	transform: rotate(-45deg) scale(1.12);
}

/* The pin whose card is currently open, in the brand accent. */
.gcsf-pin.is-active .gcsf-pin__label {
	background: var(--gcsf-accent);
	border-color: var(--gcsf-white);
	box-shadow: 0 6px 18px rgba(27, 35, 64, 0.5);
	color: var(--gcsf-primary);
	transform: rotate(-45deg) scale(1.2);
}

/* Custom image marker: same interaction feedback as the built-in pin. */
.gcsf-pin-image {
	filter: drop-shadow(0 3px 6px rgba(27, 35, 64, 0.35));
	transition: transform 0.15s ease, filter 0.15s ease;
	transform-origin: bottom center;
}

.gcsf-pin-image:hover {
	filter: drop-shadow(0 5px 12px rgba(27, 35, 64, 0.45));
	transform: scale(1.1);
}

.gcsf-pin-image.is-active {
	filter: drop-shadow(0 6px 16px rgba(27, 35, 64, 0.55));
	transform: scale(1.2);
}

/*
 * Popup chrome matched to the card styling.
 *
 * MapLibre's popup DOM is a single .maplibregl-popup-content element holding
 * both the close button and whatever was passed to setDOMContent() - unlike
 * some libraries there is no separate outer "wrapper" class to style.
 */
.gcsf-mapwrap .maplibregl-popup-content {
	border-radius: 10px;
	box-shadow: 0 10px 34px rgba(27, 35, 64, 0.28);
	min-width: 360px;
	padding: 0;
}

.gcsf-mapwrap .maplibregl-popup-content .gcsf-card__body {
	padding: 22px 24px 20px;
}

/* Roomier typography inside the popup than in the narrow sidebar cards. */
.gcsf-mapwrap .maplibregl-popup-content .gcsf-card__title {
	font-size: var(--gcsf-fs-xl);
	line-height: 1.25;
	margin-bottom: 8px;
	margin-right: 24px;
}

.gcsf-mapwrap .maplibregl-popup-content .gcsf-card__address {
	font-size: var(--gcsf-fs-md);
}

.gcsf-mapwrap .maplibregl-popup-content .gcsf-card__value,
.gcsf-mapwrap .maplibregl-popup-content .gcsf-card__desc {
	font-size: var(--gcsf-fs-sm);
}

.gcsf-mapwrap .maplibregl-popup-content .gcsf-card__actions {
	margin-top: 18px;
	padding-top: 14px;
}

/* Long email addresses should wrap rather than force the popup wider. */
.gcsf-mapwrap .maplibregl-popup-content a.gcsf-card__value {
	overflow-wrap: anywhere;
	word-break: break-word;
}

.gcsf-mapwrap .maplibregl-popup-tip {
	display: none;
}

.gcsf-mapwrap .maplibregl-popup-close-button {
	color: var(--gcsf-text-muted) !important;
	font-size: 20px;
	height: 28px;
	padding: 4px 0 0 0;
	width: 28px;
}

.gcsf-mapwrap .maplibregl-popup-close-button:hover {
	color: var(--gcsf-primary) !important;
}

.gcsf-mapwrap .maplibregl-map {
	font-family: inherit;
	font-size: var(--gcsf-fs-sm);
}

/*
 * Zoom controls restyled to match the sidebar buttons.
 *
 * The compass button is disabled at creation (showCompass: false), so only
 * the zoom in/out buttons appear in the control group.
 */
.gcsf-mapwrap .maplibregl-ctrl-group {
	border: none;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(27, 35, 64, 0.18);
	overflow: hidden;
}

.gcsf-mapwrap .maplibregl-ctrl-group button {
	background: var(--gcsf-white);
	border: none;
	border-bottom: 1px solid var(--gcsf-border);
	color: var(--gcsf-primary);
	height: 34px;
	transition: background 0.15s ease;
	width: 34px;
}

.gcsf-mapwrap .maplibregl-ctrl-group button:last-child {
	border-bottom: none;
}

.gcsf-mapwrap .maplibregl-ctrl-group button:hover {
	background: var(--gcsf-card-bg);
}

/* The +/- glyphs are drawn as background-images with currentColor masking. */
.gcsf-mapwrap .maplibregl-ctrl-icon {
	filter: none;
}

/* Attribution kept legible but unobtrusive. It is a licence requirement (the
   OpenFreeMap/OpenStreetMap/OpenMapTiles credit) and must not be hidden. */
.gcsf-mapwrap .maplibregl-ctrl-attrib {
	background: rgba(255, 255, 255, 0.85);
	border-radius: 4px 0 0 0;
	font-size: 11px;
}

.gcsf-mapwrap .maplibregl-ctrl-attrib a {
	color: var(--gcsf-primary);
}

.gcsf-mapwrap .maplibregl-ctrl-attrib.maplibregl-compact {
	background-color: rgba(255, 255, 255, 0.85);
}

/* Transient message shown over the map, e.g. no Street View coverage. */
.gcsf-map-notice {
	background: rgba(27, 35, 64, 0.94);
	border-radius: 6px;
	bottom: 24px;
	color: var(--gcsf-white);
	font-size: var(--gcsf-fs-sm);
	left: 50%;
	max-width: 80%;
	padding: 10px 16px;
	position: absolute;
	text-align: center;
	transform: translateX(-50%);
	z-index: 5;
}

/* ---------- Info window ---------- */

/*
 * Popup content width.
 *
 * A max-width here would cap the popup regardless of the map engine's own
 * maxWidth option, which is what previously forced the title, address and
 * email onto separate lines. The min-width gives the card room to breathe.
 */
.gcsf-info {
	max-width: none;
	min-width: 360px;
}

.gcsf-info .gcsf-card__body {
	padding: 4px;
}

/* On narrow screens let the popup shrink to fit the viewport. */
@media (max-width: 520px) {
	.gcsf-info {
		min-width: 0;
	}

	.gcsf-mapwrap .maplibregl-popup-content {
		min-width: 0 !important;
	}
}

.gcsf-info .gcsf-card__hours-text {
	max-height: 160px;
	overflow-y: auto;
}

/* Screen reader helper, in case the theme does not provide one. */
.gcsf .screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

