/**
 * Pantry Map widget — looks.
 *
 * Dressed in The Pantry Look (see assets/css/pantry-look.css, which loads
 * site-wide and carries the palette, fonts, buttons, and ornaments).
 * --lcp-accent still exists as the widget's "Pin & button color" control
 * in Elementor; it defaults to the brand red.
 */

.lcp-pantry-map {
	--lcp-accent: var(--lcp-red, #d42e29);
	position: relative;
	font-family: var(--lcp-body);
	color: var(--lcp-navy);
}

/* ---- The map box: a crate-label frame ---------------------------------- */

.lcp-map-frame {
	position: relative;
	border: 2.5px solid var(--lcp-navy);
	background: var(--lcp-cream);
	padding: 9px;
}

.lcp-map-frame::after {
	content: "";
	position: absolute;
	inset: 4px;
	border: 1.5px solid var(--lcp-navy);
	pointer-events: none;
	z-index: 2;
}

.lcp-pantry-map .lcp-map {
	height: 460px; /* Elementor's "Map height" slider overrides this */
	width: 100%;
	z-index: 1; /* keep Leaflet's controls below sticky site headers */
	overflow: hidden;
}

/* Leaflet popups: little cream signs with a navy keyline */
.lcp-pantry-map .leaflet-popup-content-wrapper {
	border-radius: 2px;
	background: #fff;
	color: var(--lcp-navy);
	border: 2px solid var(--lcp-navy);
	box-shadow: 0 4px 14px rgba(25, 50, 108, 0.25);
}

.lcp-pantry-map .leaflet-popup-tip {
	background: #fff;
	border: 2.5px solid var(--lcp-navy);
	box-shadow: none;
	width: 15px;
	height: 15px;
	/* tuck up over the sign's bottom border so the outline flows around
	   the tail instead of running straight through it */
	margin: -12.5px auto 0;
}

.lcp-pantry-map .leaflet-popup-content {
	font-family: var(--lcp-body);
	font-size: 15px;
	margin: 14px 16px;
	line-height: 1.45;
}

.lcp-popup {
	display: grid;
	gap: 6px;
	justify-items: start;
	min-width: 180px;
}

.lcp-popup-name {
	font-family: var(--lcp-disp);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .02em;
	font-size: 1.05em;
	line-height: 1.15;
	color: var(--lcp-navy);
}

.lcp-popup-addr {
	color: var(--lcp-navy);
	font-weight: 400;
}

.lcp-popup-host,
.lcp-popup-sponsor {
	font-size: 13px;
	font-style: italic;
	font-weight: 400;
	line-height: 1.3;
	color: var(--lcp-navy);
}

.lcp-popup .lcp-btn {
	margin-top: 4px;
}

/* "Warm & cozy" look for the fallback OpenStreetMap tiles — the
   lightest touch of warmth over OSM's near-white base, matching the
   styled Google map's light-ivory ground */
.lcp-map--warm .leaflet-tile {
	filter: sepia(0.08) saturate(0.88) contrast(0.99) brightness(1.04);
}

/* Google's InfoWindow, dressed as the same cream sign as the Leaflet
   popup. Google renders its own bubble chrome, so this reaches into its
   gm-* classes — the standard (if slightly cheeky) way to do it. */
.lcp-pantry-map .gm-style .gm-style-iw-c {
	background: #fff;
	border: 2px solid var(--lcp-navy);
	border-radius: 2px;
	box-shadow: 0 4px 14px rgba(25, 50, 108, 0.25);
	padding: 14px 16px !important;
	font-family: var(--lcp-body);
}

.lcp-pantry-map .gm-style .gm-style-iw-d {
	overflow: auto !important;
	padding: 0 !important;
	color: var(--lcp-navy);
	font-size: 16px;
	line-height: 1.3;
}

/* The tail under the sign: rebuilt as a navy-bordered point. The visible
   lower edges carry the border; the top half (and its border) stays
   clipped, and the tail tucks up over the sign's bottom border so the
   outline reads as one continuous speech bubble. */
.lcp-pantry-map .gm-style .gm-style-iw-tc {
	width: 30px;
	height: 14px;
	left: 0;
	right: 0;
	margin: -2.5px auto 0;
	overflow: hidden;
	position: relative;
	z-index: 1;
}

.lcp-pantry-map .gm-style .gm-style-iw-tc::after {
	content: "";
	position: absolute;
	left: 50%;
	top: -10.5px;
	width: 15px;
	height: 15px;
	transform: translateX(-50%) rotate(45deg);
	background: #fff;
	border: 2.5px solid var(--lcp-navy);
	box-shadow: none;
	clip-path: none;
}

.lcp-pantry-map .gm-style .gm-style-iw-c button.gm-ui-hover-effect > span {
	background-color: var(--lcp-navy); /* the × close icon */
}

/* Google reserves a whole header strip above the content just for its ×
   button — float the button over the top-right corner instead, so the
   pantry name starts right at the top of the sign. */
.lcp-pantry-map .gm-style .gm-style-iw-chr {
	position: absolute;
	top: 4px;
	right: 4px;
	height: auto;
}

.lcp-pantry-map .gm-style .gm-style-iw-ch {
	padding-top: 0 !important;
}

.lcp-pantry-map .gm-style .gm-style-iw-chr button.gm-ui-hover-effect {
	width: 24px !important;
	height: 24px !important;
	margin: 0 !important;
}

.lcp-pantry-map .gm-style .gm-style-iw-chr button.gm-ui-hover-effect > span {
	margin: 0 !important;
	width: 18px !important;
	height: 18px !important;
}

/* …and keep long pantry names from sliding under the floated × */
.lcp-pantry-map .gm-style .lcp-popup {
	padding-right: 16px;
}

/* ---- Zoom buttons: ours on Google, restyled on Leaflet — twins -------- */

.lcp-zoom {
	display: flex;
	flex-direction: column;
	margin: 0 12px 12px 0;
	border: 2px solid var(--lcp-navy);
	background: var(--lcp-cream);
}

/* Doubled class + !importants: these are bare <button>s, so Elementor's
   global "Buttons" settings try to restyle them (radius, padding, colors).
   Everything visual is pinned here so they can never drift again. */
.lcp-zoom.lcp-zoom button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: var(--lcp-cream) !important;
	color: var(--lcp-navy) !important;
	box-shadow: none !important;
	font-family: var(--lcp-body);
	font-size: 19px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.lcp-zoom.lcp-zoom button + button {
	border-top: 2px solid var(--lcp-navy) !important;
}

.lcp-zoom.lcp-zoom button:hover {
	background: var(--lcp-navy) !important;
	color: var(--lcp-cream) !important;
}

.lcp-pantry-map .leaflet-control-zoom.leaflet-bar {
	border: 2px solid var(--lcp-navy);
	border-radius: 0;
	box-shadow: none;
}

.lcp-pantry-map .leaflet-control-zoom a {
	background: var(--lcp-cream);
	color: var(--lcp-navy);
	border-radius: 0 !important;
	border-bottom: 2px solid var(--lcp-navy);
	font-family: var(--lcp-body);
	width: 32px;
	height: 32px;
	line-height: 30px;
}

.lcp-pantry-map .leaflet-control-zoom a:last-child {
	border-bottom: none;
}

.lcp-pantry-map .leaflet-control-zoom a:hover {
	background: var(--lcp-navy);
	color: var(--lcp-cream);
}

.lcp-pantry-map .leaflet-control-attribution {
	background: rgba(245, 234, 217, 0.85);
	color: var(--lcp-navy-soft);
	font-family: var(--lcp-body);
	font-size: 10px;
}

.lcp-pantry-map .leaflet-control-attribution a {
	color: var(--lcp-navy);
}

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

.lcp-pin {
	color: var(--lcp-accent);
	background: none;
	border: none;
}

.lcp-pin svg {
	filter: drop-shadow(0 2px 3px rgba(25, 50, 108, 0.35));
}

/* The pin a visitor arrived at by QR scan: a soft pulsing halo behind it */
.lcp-pin--active::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -4px;
	width: 26px;
	height: 10px;
	transform: translateX(-50%);
	border-radius: 50%;
	background: var(--lcp-accent);
	opacity: 0.35;
	animation: lcp-pulse 1.6s ease-out infinite;
}

@keyframes lcp-pulse {
	0%   { transform: translateX(-50%) scale(0.7); opacity: 0.45; }
	70%  { transform: translateX(-50%) scale(2.1); opacity: 0;    }
	100% { transform: translateX(-50%) scale(2.1); opacity: 0;    }
}

@media (prefers-reduced-motion: reduce) {
	.lcp-pin--active::after { animation: none; }
}

/* ---- "Tap to explore" lock on phones ---------------------------------- */

.lcp-tap-lock {
	position: absolute;
	inset: 0;
	z-index: 800; /* above the map tiles */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background: rgba(245, 234, 217, 0.05);
	border: none;
	cursor: pointer;
}

.lcp-tap-lock span {
	background: var(--lcp-navy);
	color: var(--lcp-cream);
	padding: 9px 18px;
	border-radius: 2px;
	font-family: var(--lcp-body);
	font-weight: 600;
	font-size: 11px;
	letter-spacing: .18em;
	text-transform: uppercase;
}

/* ---- Welcome banner (QR arrivals): a little red announcement ----------- */

.lcp-banner[hidden] {
	display: none; /* our display:flex below would otherwise defeat "hidden" */
}

.lcp-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: space-between;
	margin: 0 0 14px;
	padding: 12px 16px;
	border-radius: 2px;
	background: var(--lcp-red);
	border: 2px solid var(--lcp-red-dark);
	color: var(--lcp-cream);
	font-weight: 500;
	line-height: 1.4;
}

.lcp-banner-close {
	background: none;
	border: none;
	color: var(--lcp-cream);
	font-size: 1.4em;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
	padding: 2px 6px;
}

.lcp-banner-close:hover {
	opacity: 1;
}

/* ---- The pantry list under the map ------------------------------------ */

.lcp-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 18px;
	margin-top: 22px;
}

/* The cards are the popups' siblings: same white sign, same navy
   keyline, same type treatment. */
.lcp-card {
	border: 2px solid var(--lcp-navy);
	border-radius: 2px;
	padding: 18px 16px 16px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(25, 50, 108, 0.25);
	font-size: 16px;
	line-height: 1.3;
	display: grid;
	gap: 6px;
	align-content: start;
}

.lcp-card-name {
	font-family: var(--lcp-disp);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .02em;
	font-size: 1.05em;
	line-height: 1.15;
	color: var(--lcp-navy);
}

.lcp-card-addr {
	color: var(--lcp-navy);
	font-weight: 400;
}

.lcp-card-host,
.lcp-card-sponsor {
	font-size: 13px;
	font-style: italic;
	font-weight: 400;
	line-height: 1.3;
	color: var(--lcp-navy);
}

.lcp-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

/* Editor-only warning when an address can't be placed */
.lcp-warn {
	margin-top: 8px;
	padding: 9px 12px;
	border-radius: 2px;
	background: #f8ecc4;
	border: 2px solid var(--lcp-gold);
	color: var(--lcp-navy);
	font-size: 0.85em;
	line-height: 1.4;
}

/* Editor-only nudge when the list is still empty */
.lcp-empty {
	padding: 40px 20px;
	border: 2px dashed var(--lcp-navy-soft);
	border-radius: 2px;
	background: var(--lcp-cream-deep);
	color: var(--lcp-navy);
	font-family: var(--lcp-body);
	text-align: center;
}

/* ---- QR sticker studio (editors only) --------------------------------- */

.lcp-qr-panel {
	margin-top: 26px;
	border: 2px dashed var(--lcp-navy-soft);
	border-radius: 2px;
	padding: 18px;
	background: var(--lcp-cream-deep);
}

.lcp-qr-head {
	display: grid;
	gap: 4px;
	margin-bottom: 16px;
}

.lcp-qr-head strong {
	font-family: var(--lcp-disp);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .02em;
	font-size: 1.05em;
	color: var(--lcp-navy);
}

.lcp-qr-head span {
	font-size: 0.88em;
	color: var(--lcp-navy-soft);
	line-height: 1.45;
}

.lcp-qr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}

.lcp-qr-item {
	background: var(--lcp-cream);
	border: 2px solid var(--lcp-navy);
	border-radius: 0;
	padding: 14px;
	display: grid;
	gap: 10px;
	justify-items: center;
	text-align: center;
}

.lcp-qr-item-name {
	font-family: var(--lcp-cond);
	font-size: 1.15em;
	letter-spacing: .04em;
	color: var(--lcp-navy);
}

.lcp-qr-canvas {
	width: 150px;
	height: 150px;
	image-rendering: pixelated; /* plain squares should stay knife-crisp */
}

.lcp-qr-link {
	font-family: monospace;
	font-size: 0.75em;
	word-break: break-all;
	color: var(--lcp-navy-soft);
}

.lcp-qr-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}
