/*
 * Ian's Pizza Anywhere — store locator.
 *
 * Approved against the project's "no new CSS without approval" rule, decision
 * D-013. Scoping rules, same as the stack scene:
 *
 *   - every selector starts with .ipa-locator
 *   - custom properties sit on .ipa-locator, never :root
 *   - no bare element selectors, so nothing here can reach the rest of the page
 *
 * Theme classes do the work wherever they exist: .btn / .btn-primary /
 * .btn-outline for buttons, .card for the result cards, .display-h2 /
 * .display-h4 for headings, .bg-tan for the section, .content-container for the
 * gutter, .list-reset for lists. What is below covers only what the theme has
 * no pattern for.
 */

.ipa-locator {
	--ipa-gap: 1.5rem;
	/* 22px, to match the theme's own .card — the location cards on the front
	   page and the menu cards all use it, and a locator result is the same
	   kind of object. */
	--ipa-radius: 22px;
	--ipa-rule: rgba(66, 50, 61, .18);
	--ipa-muted: #6b5c66;
	--ipa-ink: #42323D;

}

.ipa-locator__subhead {
	max-width: 38em;
	margin-top: .25em;
}

/* ---------- Search ----------
   One bar: the ZIP field and its button joined as a single pill, so it is
   plain which button runs the search. "Use my location" sits under it as a
   text action, an alternative to typing, not a rival button. */

.ipa-locator__search {
	margin: 1.5rem 0 .5rem;
	max-width: 40rem;
}

.ipa-locator__label {
	display: block;
	font-weight: 700;
	margin-bottom: .4em;
}

.ipa-locator__bar {
	display: flex;
	align-items: stretch;
	border: 2px solid var(--ipa-ink);
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
}

.ipa-locator__bar:focus-within {
	outline: 3px solid var(--ipa-ink);
	outline-offset: 2px;
}

.ipa-locator__bar input {
	flex: 1 1 auto;
	min-width: 0;
	padding: .75em 1.1em;
	border: 0;
	background: transparent;
	color: var(--ipa-ink);
	font: inherit;
	font-size: 1.0625rem;
}

.ipa-locator__bar input:focus {
	outline: none;   /* the bar carries the ring */
}

/* Autofill (iOS especially) paints the field pale yellow, which left a white
   button sitting in a yellow bar. Keep the field white, like the bar. The
   inset shadow is the one way to cover the autofill background. */
.ipa-locator__bar input:-webkit-autofill,
.ipa-locator__bar input:-webkit-autofill:hover,
.ipa-locator__bar input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 1000px #fff inset;
	box-shadow: 0 0 0 1000px #fff inset;
	-webkit-text-fill-color: var(--ipa-ink);
	caret-color: var(--ipa-ink);
}

.ipa-locator__bar input:autofill {
	background: #fff;
}

/* The theme's .btn-primary, squared into the end of the pill. */
.ipa-locator__bar .ipa-locator__submit {
	flex: none;
	min-height: 48px;
	margin: 3px;
	padding-inline: 1.25rem;
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.ipa-locator__geo {
	/* The same sans serif as the "Find slices" button. */
	font-family: 'Work Sans', sans-serif;
	display: inline-flex;
	align-items: center;
	gap: .4em;
	min-height: 44px;
	margin-top: .35rem;
	padding: 0 .25rem;
	border: 0;
	background: none;
	color: var(--ipa-ink);
	font-size: .9375rem;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: .2em;
	cursor: pointer;
}

.ipa-locator__geo:hover {
	text-decoration-thickness: 2px;
}

.ipa-locator__geo:focus-visible {
	outline: 3px solid var(--ipa-ink);
	outline-offset: 2px;
	border-radius: 6px;
}

.ipa-locator__geo[disabled] {
	cursor: progress;
	opacity: .7;
	text-decoration: none;
}

.ipa-locator__call-btn {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* The theme gives links a pointer but not buttons. */
	cursor: pointer;
}

.ipa-locator__status {
	min-height: 1.5em;
	line-height: 1.45;
	margin: .25em 0 0;
	color: var(--ipa-muted);
	font-style: italic;
}

.ipa-locator__status[data-state="error"] {
	color: #9c2226;
	font-style: normal;
	font-weight: 700;
}

/* ---------- Far-away banner ---------- */

/* Plain text, not a card (2026-10-05, D-042): boxed, it read as another
   store. The message takes the theme's .display-h4 .has-large-font-size. */
.ipa-locator__far {
	margin: 1.25rem 0;
}

.ipa-locator__far-message {
	margin: 0 0 .75em;
}

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

.ipa-locator__layout {
	display: grid;
	/* minmax(0, …), never a bare 1fr: 1fr means "at least as wide as the
	   content", and the Google map writes fixed pixel widths into its own
	   markup once it draws, which pushed the column off the right edge of a
	   phone. */
	grid-template-columns: minmax(0, 1fr);
	gap: var(--ipa-gap);
	margin-top: 1.5rem;
	align-items: start;
}

@media screen and (min-width: 860px) {
	.ipa-locator__layout {
		/* The list is the product, so it gets the larger share. */
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	}

	.ipa-locator__map-wrap {
		position: sticky;
		top: 1.5rem;
	}
}

/* No map key means no second column. The result cards then read better in a
   couple of columns than as one very wide stack. */
.ipa-locator__layout--single {
	grid-template-columns: minmax(0, 1fr);
}

.ipa-locator__results,
.ipa-locator__map-wrap {
	min-width: 0;
}

/* The UFO sticker is positioned against the map box. Sticky on desktop is a
   containing block already (and must not be overridden); relative covers the
   stacked phone layout. */
@media screen and (max-width: 859px) {
	.ipa-locator__map-wrap {
		position: relative;
	}
}

.ipa-locator__map {
	max-width: 100%;
	overflow: hidden;
}

@media screen and (min-width: 860px) {
	.ipa-locator__layout--single {
		grid-template-columns: minmax(0, 1fr);
	}

	.ipa-locator__layout--single .ipa-locator__list {
		grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	}
}

.ipa-locator__results-heading {
	margin-top: 0;
}

.ipa-locator__list {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
}

/* ---------- Result card ---------- */

/* .card supplies the 22px radius and the padding. It does NOT supply a
   background — in the theme the white comes from `.card.hover-yellow` — so a
   bare .card on the tan section would be an invisible box. Hence the ground
   and the hairline here.

   .card also sets `display:grid`, `align-items:center` and its own vertical
   margins, all of which fight a grid of equal-height cards. Overridden. */
.ipa-locator__item {
	/* A column, so Directions can be pushed to the bottom and line up across a
	   row whose addresses wrap to different numbers of lines. */
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-height: 0;
	margin: 0;
	padding: 1.25rem 1.4rem;
	background: #fff;
	border: 2px solid transparent;
	box-shadow: 0 1px 0 rgba(66, 50, 61, .08);
	scroll-margin-top: 1.5rem;
}

/* Set when the matching marker is hovered or clicked. */
.ipa-locator__item.is-active {
	border-color: var(--ipa-ink);
}

.ipa-locator__name {
	margin: 0 0 .15em;
	font-size: 1.25rem;
	line-height: 1.2;
}

.ipa-locator__address {
	margin: 0 0 .35em;
	line-height: 1.45;
	color: var(--ipa-muted);
}

.ipa-locator__distance {
	margin: 0 0 .9em;
	font-weight: 700;
}

.ipa-locator__call {
	margin: 0;
}

.ipa-locator__call-helper {
	margin: .5em 0 1em;
	line-height: 1.45;
	font-size: .9375rem;
	color: var(--ipa-muted);
}

.ipa-locator__directions {
	margin: auto 0 0;      /* auto top margin pins it to the bottom of the card */
	padding-top: .75em;
	border-top: 1px solid var(--ipa-rule);
}

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

.ipa-locator__map {
	width: 100%;
	/* A fixed aspect keeps the column from collapsing before the API loads. */
	aspect-ratio: 4 / 3;
	min-height: 320px;
	border: 2px solid var(--ipa-ink);
	border-radius: var(--ipa-radius);
	background: rgba(66, 50, 61, .06);
}

.ipa-locator__map-note {
	margin: .5em 0 0;
	font-size: .9375rem;
	color: var(--ipa-muted);
}

/* ---------- Directory ---------- */

.ipa-locator__directory {
	margin-top: 3rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--ipa-rule);
}

.ipa-locator__directory > summary {
	cursor: pointer;
	font-weight: 700;
	padding: .35em 0;
}

.ipa-locator__directory > summary:focus-visible {
	outline: 3px solid var(--ipa-ink);
	outline-offset: 2px;
}

.ipa-locator__directory-state {
	margin-top: 1rem;
}

/* The /locations tile, as-is; only spacing between tiles is added here. */
.ipa-locator__cities > li {
	margin-bottom: 1.5rem;
}

.ipa-locator__tile + .ipa-locator__tile {
	margin-top: .85rem;
}

.ipa-locator__tile .card {
	color: var(--ipa-ink);
}

/* The phone stays tappable above the full-card directions link. */
.ipa-locator__tile-phone {
	position: relative;
	z-index: 2;
	margin-top: .25em;
}

/* ---------- Empty state ---------- */

.ipa-locator__empty {
	max-width: 34em;
	margin-top: 1rem;
}

/* ---------- Editor-only placeholder ---------- */

.ipa-form-placeholder {
	padding: .75em 1em;
	border: 1px dashed currentColor;
	border-radius: var(--ipa-radius);
	opacity: .75;
}

/* Editor-only stand-in for the map, while no browser key is configured. */
.ipa-locator__map--placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: 1.5rem;
	text-align: center;
	border-style: dashed;
	background: repeating-linear-gradient(
		45deg,
		rgba(66, 50, 61, .04),
		rgba(66, 50, 61, .04) 10px,
		transparent 10px,
		transparent 20px
	);
}

.ipa-locator__map--placeholder p {
	margin: 0;
	font-weight: 700;
}

.ipa-locator__map-placeholder-note {
	max-width: 30ch;
	font-weight: 400 !important;
	font-size: .8125rem;
	opacity: .7;
}

/* ---------- Map markers ----------
   Rendered by the script inside the map, which lives inside .ipa-locator,
   so these stay scoped. */

/* Pins and clusters are the theme's slice and pie markers (the same as the
   restaurant locations map); the search dot is an SVG from the script. Their
   text is Google's marker label, which these classes turn into Kalamata
   pills. */
.ipa-locator .ipa-locator__cluster-count {
	min-width: 1.6em;
	padding: .15em .45em;
	border-radius: 999px;
	background: #42323D;
	box-shadow: 0 0 0 2px #fff;
	text-align: center;
}
.ipa-locator .ipa-locator__origin-label {
	padding: .2em .6em;
	border-radius: 999px;
	background: #42323D;
	box-shadow: 0 1px 4px rgba(30, 20, 28, .3);
	white-space: nowrap;
}

.ipa-locator .ipa-locator__info {
	font-size: .875rem;
	line-height: 1.45;
	color: #42323D;
}

.ipa-locator .ipa-locator__info a {
	font-weight: 700;
}

/* ---------- Phones with a map: map instead of cards ----------
   A search on a phone shows its results on the map; tapping a pin opens the
   store's card in a bottom sheet (locator.js, .has-map-sheet). The list stays
   in the page for screen readers, just not on screen. With no map key the
   class is never set and phones keep the cards. */

@media screen and (max-width: 859px) {
	.ipa-locator.has-map-sheet .ipa-locator__list {
		position: absolute !important;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
		border: 0;
	}

	.ipa-locator.has-map-sheet .ipa-locator__map {
		aspect-ratio: auto;
		height: 65vh;
		min-height: 340px;
	}
}

/* The card inside the store sheet: the sheet is the panel, so no second box. */
.ipa-locator__sheet .ipa-locator__item {
	border: 0;
	padding: 0;
	margin: 0;
	background: none;
	box-shadow: none;
	min-height: 0;
}

.ipa-locator__sheet .ipa-locator__name {
	padding-right: 3rem;   /* clear of the close button */
}

