/* Reminiscence Map — front end.
   The list is visible by default and only hidden once the map actually
   initialises, so a script failure leaves something usable behind. */

.rm-map__canvas {
	display: none;
	width: 100%;
	border-radius: 4px;
	overflow: hidden;
	background: #e9e6e1;
}

.rm-map--ready .rm-map__canvas { display: block; }
.rm-map--ready .rm-map__list   { display: none; }

.rm-map__admin-notice {
	padding: 10px 14px;
	margin: 0 0 16px;
	border-left: 4px solid #dba617;
	background: #fcf9e8;
	font-size: 0.9em;
}

.rm-map__list-heading { margin-top: 0; }
.rm-map__places,
.rm-map__place-items { list-style: none; margin: 0; padding: 0; }
.rm-map__place { margin: 0 0 1.25em; }
.rm-map__place-name { margin: 0 0 0.25em; font-size: 1.05em; }
.rm-map__place-items li { margin: 0 0 0.2em; }
.rm-map__who { color: #6b6b6b; font-size: 0.9em; }
.rm-map__who::before { content: " — "; }

/* --- markers --- */

/* Markers live in Google's overlay DOM, outside .rm-map, so these cannot be
   scoped to the plugin's wrapper and compete directly with theme rules that
   load later. Dimensions are forced: god-grace sets min-height:38px on every
   button-ish element, which turned round pins into ovals. */
.rm-pin {
	box-sizing: border-box !important;
	display: flex !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	border: 2px solid #fff !important;
	border-radius: 50% !important;
	background: var( --rm-pin-color, #8c4a2f );
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.4 );
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: filter 0.12s ease, transform 0.12s ease;
}

/* Brightness rather than a second colour, so any chosen colour gets a sensible
   hover state without the plugin doing colour arithmetic. */
.rm-pin:hover { filter: brightness( 1.18 ); transform: scale( 1.15 ); }

.rm-pin--multi {
	width: 26px !important;
	height: 26px !important;
}

.rm-pin__count {
	color: var( --rm-pin-count-color, #fff ) !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	font-family: inherit;
}

/* Clusters: same hue as the pins so the map reads as one visual language, but
   larger and haloed, because a cluster means "several places, zoom in" while a
   numbered pin means "several reminiscences, one spot". */
.rm-cluster {
	box-sizing: border-box !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 2px solid #fff !important;
	border-radius: 50% !important;
	background: var( --rm-cluster-color, var( --rm-pin-color, #8c4a2f ) );
	box-shadow:
		0 0 0 6px var( --rm-cluster-halo, rgba( 140, 74, 47, 0.25 ) ),
		0 1px 5px rgba( 0, 0, 0, 0.35 );
	color: var( --rm-cluster-text, #fff ) !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	font-family: inherit;
	cursor: pointer;
	transition: transform 0.12s ease, filter 0.12s ease;
}

.rm-cluster:hover { filter: brightness( 1.15 ); transform: scale( 1.08 ); }

/* --- modal --- */

.rm-modal[hidden] { display: none; }

.rm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 16px;
	overflow-y: auto;
}

.rm-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba( 20, 16, 12, 0.6 );
}

.rm-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 680px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.3 );
	padding: 28px 32px 32px;
}

/* Fully reset rather than merely styled: god-grace applies
   `padding: 0 20px; min-height: 38px; border-radius: 20px` to every button,
   which turned the hover state into a wide rounded rectangle. Scoped under
   .rm-map so it outranks the theme's element selector without !important. */
.rm-map .rm-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-width: 0;
	min-height: 0;
	max-width: none;
	padding: 0;
	margin: 0;
	font-size: 24px;
	font-weight: 400;
	line-height: 1;
	background: none;
	border: 0;
	border-radius: 50%;
	color: #555;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.rm-map .rm-modal__close:hover,
.rm-map .rm-modal__close:focus-visible { background: #f0efed; color: #000; }

.rm-modal__header { margin: 0 40px 18px 0; border-bottom: 1px solid #e6e3df; padding-bottom: 12px; }
.rm-modal__place { margin: 0; font-size: 1.4em; }
.rm-modal__count { margin: 4px 0 0; color: #6b6b6b; font-size: 0.9em; }

.rm-reminiscence + .rm-reminiscence { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e6e3df; }
.rm-reminiscence__title { margin: 0 0 4px; font-size: 1.15em; }
.rm-reminiscence__meta { margin: 0 0 12px; color: #6b6b6b; font-size: 0.9em; }
.rm-reminiscence__decades::before { content: " · "; }
.rm-reminiscence__field,
.rm-reminiscence__terms { margin: 12px 0 0; font-size: 0.95em; }

.rm-label {
	display: block;
	font-size: 0.75em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #8a8a8a;
	margin-bottom: 2px;
}

.rm-term {
	display: inline-block;
	margin: 0 4px 4px 0;
	padding: 2px 9px;
	background: #f2efec;
	border-radius: 11px;
	font-size: 0.85em;
	text-decoration: none;
}

.rm-term:hover { background: #e4dfd9; }
.rm-reminiscence__permalink { margin: 16px 0 0; font-size: 0.9em; }

/* --- the full transcription, collapsed --- */

.rm-story {
	margin: 14px 0 0;
	border-top: 1px solid #ece8e3;
	padding-top: 12px;
}

.rm-map .rm-story__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.95em;
	color: var( --rm-pin-color, #8c4a2f );
	list-style: none;
	padding: 2px 0;
}

.rm-map .rm-story__toggle::-webkit-details-marker { display: none; }

.rm-map .rm-story__toggle::before {
	content: "";
	width: 0;
	height: 0;
	border-left: 6px solid currentColor;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform 0.15s ease;
}

.rm-map details[open] > .rm-story__toggle::before { transform: rotate( 90deg ); }
.rm-map .rm-story__toggle:hover { text-decoration: underline; }

.rm-story__body {
	margin-top: 10px;
	padding-left: 14px;
	border-left: 3px solid #ece8e3;
}

.rm-story__body > *:first-child { margin-top: 0; }
.rm-story__body > *:last-child { margin-bottom: 0; }

/* --- fields appended to a reminiscence's own page --- */

.rm-single { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e6e3df; }
.rm-single__description { margin-bottom: 18px; }
.rm-single__fields { margin: 0; }
.rm-single__fields dt {
	font-size: 0.75em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #8a8a8a;
	margin-top: 14px;
}
.rm-single__fields dd { margin: 3px 0 0; }
.rm-single .rm-term {
	display: inline-block;
	margin: 0 4px 4px 0;
	padding: 2px 9px;
	background: #f2efec;
	border-radius: 11px;
	font-size: 0.85em;
	text-decoration: none;
}

body.rm-modal-open { overflow: hidden; }

.rm-map .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

@media ( max-width: 600px ) {
	.rm-modal { padding: 0; }
	.rm-modal__panel { border-radius: 0; min-height: 100vh; padding: 24px 18px 32px; }
}
