/* Map Locations — Displays ([mlp_list], [mlp_location]). Inherits the theme's fonts and text colour. */
.mlp-d--list {
	--mlp-cols: 4;
	display: grid;
	grid-template-columns: repeat(var(--mlp-cols), minmax(0, 1fr));
	gap: 2em 2.5em;
}
@media (max-width: 900px) {
	.mlp-d--list { grid-template-columns: repeat(min(var(--mlp-cols), 2), minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.mlp-d--list { grid-template-columns: minmax(0, 1fr); }
}
.mlp-d-item { min-width: 0; overflow-wrap: anywhere; }
.mlp-d-title { margin: 0 0 0.6em; line-height: 1.3; color: var(--mlp-accent, inherit); }
.mlp-d--list .mlp-d-title { font-size: 1.1em; }
.mlp-d-title a { color: inherit; text-decoration: none; }
.mlp-d-title a:hover, .mlp-d-title a:focus-visible { text-decoration: underline; }
.mlp-d--inherit .mlp-d-title { color: inherit; }
.mlp-d-block + .mlp-d-block { margin-top: 1.1em; }
.mlp-d-heading { margin: 0 0 0.3em; font-size: 1em; }
.mlp-d .mlp-row { margin: 0; }
.mlp-d .mlp-row-label { font-weight: 700; }
.mlp-d .mlp-image { display: block; max-width: 100%; height: auto; margin: 0.3em 0; }
.mlp-d .mlp-content > *:first-child { margin-top: 0; }
.mlp-d .mlp-button {
	display: inline-block;
	margin-top: 0.4em;
	padding: 0.8em 1.6em;
	min-width: 10em;
	background: var(--mlp-accent, #1d2327);
	color: var(--mlp-btn-text, #fff) !important;
	font-weight: 700;
	font-size: 0.85em;
	line-height: 1.3;
	text-align: center;
	text-decoration: none !important;
}
.mlp-d .mlp-button:hover, .mlp-d .mlp-button:focus-visible { filter: brightness(0.92); }
.mlp-d--inherit .mlp-button { background: #1d2327; color: #fff !important; }
.mlp-d-link { color: var(--mlp-accent, inherit); }
.mlp-d--inherit .mlp-d-link { color: inherit; }
.mlp-notice { padding: 12px; border-left: 4px solid #dba617; background: #fcf9e8; }

/* Accordions in displays (colours from the layer's popup colours in Map Design) */
.mlp-d-accordion { margin-top: 1.1em; }
.mlp-d-accordion + .mlp-d-accordion { margin-top: 0.4em; }
.mlp-d-accordion-btn {
	display: flex; align-items: center; justify-content: space-between; gap: 0.6em;
	min-height: 2.6em; padding: 0.55em 0.9em; border-radius: 6px; cursor: pointer; list-style: none;
	background: var(--mlp-acc-bg, #e4edf7); color: var(--mlp-acc-text, #1d2327);
	font-weight: 700; font-size: 0.85em; letter-spacing: 0.05em; text-transform: uppercase;
}
.mlp-d-accordion-btn::-webkit-details-marker { display: none; }
.mlp-d-accordion-btn:hover { background: var(--mlp-acc-hover, #d2dbe5); }
.mlp-d-accordion-btn:focus-visible { outline: 2px solid var(--mlp-accent, currentColor); outline-offset: 2px; }
.mlp-d-accordion[open] > .mlp-d-accordion-btn { border-radius: 6px 6px 0 0; }
.mlp-d-accordion .mlp-accordion-icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform 0.15s; }
.mlp-d-accordion[open] .mlp-accordion-icon { transform: rotate(180deg); }
.mlp-d-accordion-body { padding: 0.8em 0.9em; border: 1px solid var(--mlp-acc-bg, #e4edf7); border-top: 0; border-radius: 0 0 6px 6px; }
.mlp-d--inherit .mlp-d-accordion-btn { background: rgba(127, 127, 127, 0.15); color: inherit; }
.mlp-d--inherit .mlp-d-accordion-body { border-color: rgba(127, 127, 127, 0.25); }

/* Boxed sections */
.mlp-d-box { margin-top: 1.1em; padding: 0.9em 1em; border-radius: 6px; }
.mlp-d-box--outline { border: 1px solid var(--mlp-acc-bg, rgba(127, 127, 127, 0.35)); }
.mlp-d-box--filled { background: var(--mlp-acc-bg, rgba(127, 127, 127, 0.12)); color: var(--mlp-acc-text, inherit); }
.mlp-d--inherit .mlp-d-box--outline { border-color: rgba(127, 127, 127, 0.35); }
.mlp-d--inherit .mlp-d-box--filled { background: rgba(127, 127, 127, 0.12); color: inherit; }
.mlp-d-box-title { margin: 0 0 0.5em; font-size: 1em; color: var(--mlp-accent, inherit); }
.mlp-d--inherit .mlp-d-box-title { color: inherit; }
.mlp-d-box .mlp-d-block + .mlp-d-block, .mlp-d-accordion-body .mlp-d-block + .mlp-d-block { margin-top: 0.8em; }
.mlp-d-item > :first-child:is(.mlp-d-accordion, .mlp-d-box), .mlp-d--single > :first-child:is(.mlp-d-accordion, .mlp-d-box) { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .mlp-d-accordion .mlp-accordion-icon { transition: none; } }

/* Columns. Each location's area is a size container, so columns stack when the
   space is narrow (a phone, or one column of a footer), not just on small screens. */
.mlp-d-item, .mlp-d--single, .mlp-d-box, .mlp-d-accordion-body { container-type: inline-size; }
.mlp-d-cols { display: grid; gap: 1.2em 2em; grid-template-columns: var(--mlp-cols-tpl); margin-top: 1.1em; }
.mlp-d-cols--2 { --mlp-cols-n: 2; }
.mlp-d-cols--3 { --mlp-cols-n: 3; }
.mlp-d-cols--4 { --mlp-cols-n: 4; }
.mlp-d-col { min-width: 0; }
.mlp-d-col > :first-child, .mlp-d-col > :first-child:is(.mlp-d-accordion, .mlp-d-box) { margin-top: 0; }
.mlp-d-item > .mlp-d-cols:first-child, .mlp-d--single > .mlp-d-cols:first-child, .mlp-d-title + .mlp-d-cols { margin-top: 0.4em; }
/* Automatic stacking: when the narrowest column would get too small (uneven splits stack
   sooner). A display with its own "Stack columns when narrower than" setting skips these. */
@container (max-width: 400px) { .mlp-d:not(.mlp-d--stack-custom) .mlp-d-cols--2 { display: flex; flex-direction: column; } }
@container (max-width: 520px) { .mlp-d:not(.mlp-d--stack-custom) :is(.mlp-d-cols--2.mlp-d-cols--uneven, .mlp-d-cols--3) { display: flex; flex-direction: column; } }
@container (max-width: 680px) { .mlp-d:not(.mlp-d--stack-custom) :is(.mlp-d-cols--3.mlp-d-cols--uneven, .mlp-d-cols--4) { display: flex; flex-direction: column; } }
.mlp-d .mlp-row--phone .mlp-row-value { white-space: nowrap; } /* Never split a phone number. */

/* Image fields with a set height fill their area's width, cropped to fit. */
.mlp-d img.mlp-image--fill { display: block; width: 100% !important; max-width: none; object-fit: cover; object-position: center; }

/* Label beside value, unless the value wouldn't fit beside it on one line:
   then the value drops to its own line under the label (pure CSS, no measuring). */
.mlp-d .mlp-row:not(.mlp-row--above) { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.35em; }
.mlp-d .mlp-row:not(.mlp-row--above) > .mlp-row-label { flex: none; }
.mlp-d .mlp-row:not(.mlp-row--above) > .mlp-row-value { flex: 1 1 auto; min-width: 0; }

/* Equal-height boxes: a box that ends a column stretches to the bottom of the row,
   so boxed columns side by side line up. (Columns already share the row's height.) */
.mlp-d-col { display: flex; flex-direction: column; }
.mlp-d-col > .mlp-d-box:last-child { flex-grow: 1; }

/* Equal heights across a row of listings: each listing already fills the row's height,
   so its last part (a set of columns, or a box) stretches to the bottom; boxes ending
   a column then stretch with it. */
.mlp-d--list .mlp-d-item { display: flex; flex-direction: column; }
.mlp-d--list .mlp-d-item > :is(.mlp-d-cols, .mlp-d-box):last-child { flex-grow: 1; }
.mlp-d-cols > .mlp-d-col:last-child { flex-grow: 1; } /* Stacked columns: the last one takes any spare height. */
