/**
 * Atlas Arcadia - the Locations List (faceted card grid).
 *
 * Plan:   docs/plans/2026-10-11-001-feat-locations-list-redesign-plan.md (U3)
 * Design: docs/design/locations-list/Main.dc.html
 *
 * TOKENS. The design's var(--surface-*, --text-*, --font-*, --radius-*, --shadow-*)
 * are mapped onto the site's --aa-* palette (aa-design-system-assets/tokens.css),
 * aliased as --ll-* on the root with literal fallbacks equal to the design's values:
 *   surface-card -> --aa-white      surface-page -> --aa-cream     text-primary -> --aa-brown
 *   font-display -> --aa-display    font-accent  -> Righteous      font-body    -> --aa-text
 *   radius-md 16 / sm 8 / pill 999  shadow-card / card-hover -> literal (no site token)
 * --aa-orange-dark is defined by aa-points.php, not tokens.css, hence the fallback.
 *
 * SCOPING. Everything hangs off .aa-ll. The page renders without JS (details
 * dropdowns, Apply buttons, submit sort pills); .aa-ll--js is added by list.js.
 * Breakpoint: 600px (phone).
 */

.aa-ll {
	--ll-orange: var( --aa-orange, #db680b );
	--ll-orange-dark: var( --aa-orange-dark, #b8560a );
	--ll-brown: var( --aa-brown, #6a3306 );
	--ll-yellow: var( --aa-yellow, #fae905 );
	--ll-cream: var( --aa-cream, #fdf6e8 );
	--ll-white: var( --aa-white, #fff );
	--ll-muted: var( --aa-muted, #7d6f5a );
	--ll-rule: var( --aa-rule, #e2ded4 );
	--ll-display: var( --aa-display, 'Cartridge', ui-sans-serif, system-ui, sans-serif );
	--ll-accent: 'Righteous', var( --ll-display );
	--ll-body: var( --aa-text, 'Poppins', ui-sans-serif, system-ui, sans-serif );
	--ll-r-md: 16px;
	--ll-r-sm: 8px;
	--ll-pill: 999px;
	--ll-shadow: 0 2px 8px rgba( 74, 36, 4, .10 );
	--ll-shadow-hover: 0 6px 20px rgba( 74, 36, 4, .18 );

	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 22px;
	font-family: var( --ll-body );
	color: var( --ll-brown );
}

.aa-ll *,
.aa-ll *::before,
.aa-ll *::after {
	box-sizing: border-box;
}

.aa-ll [hidden] {
	display: none !important;
}

.aa-ll .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* The Apply buttons only exist for the no-JS form. */
.aa-ll--js .aa-ll__apply {
	display: none;
}

/* --- Focus ----------------------------------------------------------------- */

.aa-ll summary:focus-visible,
.aa-ll button:focus-visible,
.aa-ll input:focus-visible,
.aa-ll a:focus-visible {
	outline: 2px solid var( --ll-brown );
	outline-offset: 2px;
}

/* --- Search row ------------------------------------------------------------ */

.aa-ll__form {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.aa-ll__searchrow {
	display: flex;
	align-items: center;
	gap: 12px;
}

.aa-ll__search {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid var( --ll-rule );
	border-radius: var( --ll-pill );
	background: var( --ll-white );
	color: var( --ll-brown );
	font-family: var( --ll-body );
	font-size: 16px;
	box-shadow: none;
}

.aa-ll__search-btn {
	flex: 0 0 auto;
	height: 44px;
	margin: 0;
	padding: 0 26px;
	border: 1px solid var( --ll-orange );
	border-radius: var( --ll-pill );
	background: var( --ll-orange );
	color: var( --ll-white );
	font-family: var( --ll-display );
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.aa-ll__search-btn:hover {
	background: var( --ll-orange-dark );
	border-color: var( --ll-orange-dark );
}

/* --- Filter bar ------------------------------------------------------------ */

.aa-ll__bar {
	position: relative;
	z-index: 10;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.aa-ll__facets {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.aa-ll__facet {
	position: relative;
}

.aa-ll__facet-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var( --ll-orange-dark );
	border-radius: var( --ll-pill );
	background: var( --ll-white );
	color: var( --ll-orange-dark );
	font-family: var( --ll-display );
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.aa-ll__facet-btn::-webkit-details-marker {
	display: none;
}

.aa-ll__facet-btn::marker {
	content: '';
}

.aa-ll__facet--active > .aa-ll__facet-btn {
	background: var( --ll-orange-dark );
	color: var( --ll-white );
}

.aa-ll__caret {
	font-size: 11px;
}

.aa-ll__panel {
	position: absolute;
	top: calc( 100% + 8px );
	left: 0;
	z-index: 30;
	width: 270px;
	max-width: calc( 100vw - 32px );
	max-height: 420px;
	overflow-y: auto;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: var( --ll-white );
	color: var( --ll-brown );
	border-radius: var( --ll-r-md );
	box-shadow: var( --ll-shadow-hover );
}

.aa-ll__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 6px 0;
	font-family: var( --ll-body );
	font-size: 14px;
	line-height: 1.3;
	color: var( --ll-brown );
	cursor: pointer;
}

.aa-ll__opt input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var( --ll-orange-dark );
}

.aa-ll__opt-label {
	flex: 1 1 auto;
	min-width: 0;
}

.aa-ll__opt-count {
	flex: 0 0 auto;
	font-size: 13px;
	color: var( --ll-muted );
}

.aa-ll__opt--off {
	opacity: .45;
	pointer-events: none;
}

.aa-ll__apply {
	align-self: flex-start;
	margin: 8px 0 2px;
	height: 34px;
	padding: 0 18px;
	border: 1px solid var( --ll-orange-dark );
	border-radius: var( --ll-pill );
	background: var( --ll-orange-dark );
	color: var( --ll-white );
	font-family: var( --ll-display );
	font-size: 14px;
	cursor: pointer;
}

.aa-ll .aa-ll__clear {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 6px;
	color: var( --ll-orange-dark );
	font-family: var( --ll-body );
	font-size: 14px;
	text-decoration: none;
}

.aa-ll .aa-ll__clear:hover {
	text-decoration: underline;
}

.aa-ll__count {
	margin-left: 6px;
	font-size: 14px;
	color: var( --ll-muted );
}

/* --- Sort pills ------------------------------------------------------------ */

.aa-ll__sorts {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.aa-ll__sort-label {
	margin-right: 4px;
	font-size: 14px;
	color: var( --ll-muted );
}

.aa-ll__sort {
	display: inline-flex;
	align-items: center;
	height: 26px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var( --ll-rule );
	border-radius: var( --ll-pill );
	background: var( --ll-white );
	color: var( --ll-brown );
	font-family: var( --ll-body );
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
}

.aa-ll__sort[aria-pressed="true"] {
	background: var( --ll-brown );
	border-color: var( --ll-brown );
	color: var( --ll-white );
}

/* --- Empty state, busy ----------------------------------------------------- */

.aa-ll .aa-ll__empty {
	margin: 0;
	padding: 40px;
	text-align: center;
	font-family: var( --ll-accent );
	font-size: 20px;
	color: var( --ll-brown );
}

.aa-ll--busy .aa-ll__grid {
	opacity: .5;
	pointer-events: none;
	transition: opacity .15s;
}

/* --- Grid and cards -------------------------------------------------------- */

.aa-ll__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( min( 320px, 100% ), 1fr ) );
	gap: 35px 30px;
	align-items: start;
	margin-top: 8px;
}

.aa-ll__card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var( --ll-white );
	border-radius: var( --ll-r-md );
	box-shadow: var( --ll-shadow );
	transition: box-shadow 200ms ease;
}

/* Reveal, as the Token Vault's tiles: list.js adds is-pre and releases cards
   one at a time as they scroll in. One transition list, because a separate
   hover transition would replace the reveal's. */
.aa-ll--js .aa-ll__card {
	transition: opacity 500ms ease, transform 760ms cubic-bezier( .2, .8, .2, 1 ), box-shadow 200ms ease;
}

.aa-ll--js .aa-ll__card.is-pre:not( .is-in ) {
	opacity: 0;
	transform: translateY( 72px );
}

.aa-ll--js .aa-ll__card.is-in {
	opacity: 1;
	transform: translateY( 0 );
}

/* The lower part is one link (the name's, stretched); the photo area is not.
   Hover lifts the shadow only: the reveal owns transform. */
.aa-ll__card:has( .aa-ll__body:hover ),
.aa-ll__card:has( .aa-ll__name a:focus-visible ) {
	box-shadow: var( --ll-shadow-hover );
}

@media (prefers-reduced-motion: reduce) {
	.aa-ll__card,
	.aa-ll--js .aa-ll__card {
		transition: none;
	}
}

.aa-ll .aa-ll__photo {
	display: block;
	width: 100%;
	height: 220px;
	max-width: none;
	margin: 0;
	object-fit: cover;
	background: #fff9b8;
	border-radius: 0;
}

/* No real photo: the placeholder image, with the site's button over it
   (.aa-points__cta carries the look; these only place and size it). */
.aa-ll__media {
	position: relative;
	min-height: 220px;
	background: var( --ll-cream );
}

.aa-ll .aa-ll__add {
	position: absolute;
	right: 12px;
	bottom: 12px;
	padding: 8px 16px;
	font-size: 13px;
	text-transform: uppercase;
	color: var( --ll-white );
	box-shadow: 0 2px 6px rgba( 74, 36, 4, .25 );
}

.aa-ll .aa-ll__add:hover,
.aa-ll .aa-ll__add:focus-visible {
	color: var( --ll-white );
}

.aa-ll__body {
	position: relative;
	padding: 18px 22px 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aa-ll .aa-ll__name {
	margin: 0;
	font-family: var( --ll-display );
	font-weight: 400;
	font-size: 28px;
	line-height: 1.1;
	letter-spacing: .3px;
	overflow-wrap: anywhere;
}

.aa-ll .aa-ll__name a {
	color: var( --ll-brown );
	text-decoration: none;
}

.aa-ll .aa-ll__name a:hover,
.aa-ll .aa-ll__body:hover .aa-ll__name a {
	color: var( --ll-orange-dark );
}

/* Stretch the name link over the whole body (bounded by .aa-ll__body). */
.aa-ll .aa-ll__name a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 0 0 var( --ll-r-md ) var( --ll-r-md );
}

/* The card clips an outward ring, so the ring is drawn inside the body. */
.aa-ll .aa-ll__name a:focus-visible {
	outline: none;
}

.aa-ll .aa-ll__name a:focus-visible::after {
	outline: 2px solid var( --ll-brown );
	outline-offset: -4px;
}

.aa-ll__meta {
	font-size: 13px;
	line-height: 1.3;
	color: var( --ll-muted );
}

.aa-ll__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.aa-ll__chip {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	padding: 5px 12px;
	border-radius: var( --ll-pill );
}

.aa-ll__chip--type {
	background: var( --ll-yellow );
	color: var( --ll-brown );
}

.aa-ll__chip--tag {
	border: 1px solid var( --ll-rule );
	background: var( --ll-white );
	color: var( --ll-brown );
	font-weight: 500;
	padding: 4px 11px;
}

.aa-ll .aa-ll__excerpt {
	margin: 4px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: #6b5d49;
}

.aa-ll .aa-ll__readmore {
	position: relative;
	z-index: 1;
	align-self: flex-start;
	font-family: var( --ll-accent );
	font-size: 15px;
	line-height: 1.3;
	text-transform: uppercase;
	text-decoration: none;
	color: var( --ll-orange-dark );
}

.aa-ll .aa-ll__readmore:hover {
	color: var( --ll-brown );
}

/* --- Load more ------------------------------------------------------------- */

.aa-ll__more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
	text-align: center;
}

.aa-ll .aa-ll__showing,
.aa-ll .aa-ll__more-error {
	margin: 0;
	font-size: 14px;
	color: var( --ll-muted );
}

.aa-ll .aa-ll__more-error {
	color: #a12a0f;
}

.aa-ll__more-btn.is-loading {
	opacity: .6;
	pointer-events: none;
	cursor: default;
}

/* --- Phone ----------------------------------------------------------------- */

@media ( max-width: 600px ) {
	.aa-ll__bar {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.aa-ll__facets {
		position: relative;
	}

	.aa-ll__facet {
		position: static;
	}

	.aa-ll__facet-btn {
		min-height: 44px;
		padding: 0 18px;
	}

	.aa-ll .aa-ll__add {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.aa-ll__panel {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
		max-height: 70vh;
	}

	.aa-ll__opt {
		min-height: 44px;
		padding: 10px 0;
		font-size: 15px;
	}

	.aa-ll__opt input {
		width: 22px;
		height: 22px;
	}

	.aa-ll .aa-ll__clear {
		min-height: 44px;
		padding: 0 12px;
	}

	.aa-ll__sort-label {
		flex: 0 0 100%;
		margin: 0;
	}

	.aa-ll__sort {
		min-height: 44px;
		padding: 0 16px;
		font-size: 14px;
	}

	.aa-ll__apply {
		min-height: 44px;
	}

	.aa-ll__searchrow {
		gap: 8px;
	}

	.aa-ll__search-btn {
		padding: 0 18px;
	}

	.aa-ll__grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.aa-ll .aa-ll__name {
		font-size: 26px;
	}
}
