/* Tamraght Forum: village map, weekly souks, pin picker. Uses the shared tokens, so it follows the site theme. */

.tmf-map-lede { margin: 0; color: var(--muted); max-width: 52ch; }
.tmf-map-h2 { font-size: 1.12rem; margin: 0 0 12px; }

/* Weekly souks ---------------------------------------------------- */
.tmf-map-souks { margin-bottom: 28px; }
.tmf-souks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.tmf-souk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.tmf-souk__day { display: grid; place-items: center; width: 54px; height: 54px; border-radius: var(--r-sm); background: var(--sand-2); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; letter-spacing: .02em; text-transform: uppercase; }
.tmf-souk.is-today .tmf-souk__day { background: var(--ocean); color: var(--ocean-ink); }
.tmf-souk__body { display: grid; gap: 2px; }
.tmf-souk__body strong { font-size: 1rem; line-height: 1.25; }
.tmf-souk__meta { font-size: .9rem; color: var(--muted); }
.tmf-souk__meta b { color: var(--ink); }
.tmf-souk__note { font-size: .86rem; color: var(--muted); line-height: 1.4; }
.tmf-souk__go { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.tmf-souk__go:hover, .tmf-souk__go:focus-visible { border-color: var(--ink); }
.tmf-souk__go .tmf-ico { width: 15px; height: 15px; }
/* Inside the village info card: a plain list. */
.tmf-info-card .tmf-souks { grid-template-columns: minmax(0, 1fr); gap: 0; }
.tmf-info-card .tmf-souk { padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.tmf-info-card .tmf-souk:first-child { border-top: 0; padding-top: 0; }

/* Layout ---------------------------------------------------------- */
.tmf-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.tmf-map-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tmf-map-filters[hidden] { display: none; }
.tmf-map-filter { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 600 .86rem/1.2 var(--font-body, inherit); cursor: pointer; }
.tmf-map-filter:hover { border-color: var(--ink); }
.tmf-map-filter[aria-pressed="false"] { background: transparent; color: var(--muted); text-decoration: line-through; }
.tmf-map-filter[aria-pressed="false"] .tmf-map-filter__dot { background: var(--line); color: var(--muted); }
.tmf-map-filter__dot { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fdfbf7; }
.tmf-map-filter__dot svg { width: 14px; height: 14px; }

.tmf-map-frame { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--sand-2); }
.tmf-map, .tmf-pin-map { position: relative; z-index: 0; font: inherit; background: var(--sand-2); }
.tmf-map { width: 100%; height: min(68vh, 620px); min-height: 380px; }
.tmf-map.is-adding, .tmf-map.is-adding .leaflet-interactive { cursor: crosshair; }
.tmf-map-noscript { margin: 0; padding: 20px; }
.tmf-map .leaflet-tile-pane, .tmf-pin-map .leaflet-tile-pane { filter: saturate(.8) contrast(.97); }
body.tmf-night .tmf-map .leaflet-tile-pane, body.tmf-night .tmf-pin-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55); }
.tmf-map .leaflet-control-attribution, .tmf-pin-map .leaflet-control-attribution { font-size: 10px; }
.tmf-map .leaflet-bar a, .tmf-pin-map .leaflet-bar a { color: #1C2B33; }

/* Pins ------------------------------------------------------------ */
.tmf-pin-wrap { background: none; border: 0; }
.tmf-pin { position: relative; display: block; width: 34px; height: 40px; }
.tmf-pin::before { content: ""; position: absolute; left: 3px; top: 1px; width: 28px; height: 28px; box-sizing: border-box; background: var(--c); border: 2px solid #fdfbf7; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 5px rgba(10, 19, 48, .35); }
.tmf-pin--local::before { border-radius: 7px 7px 7px 0; }
.tmf-pin__in { position: absolute; left: 3px; top: 1px; width: 28px; height: 28px; display: grid; place-items: center; color: #fdfbf7; }
.tmf-pin__in svg { width: 15px; height: 15px; }
.tmf-pin__in b { font: 800 .84rem/1 var(--font-display, inherit); }
.tmf-pin.is-hidden::before { background: #fdfbf7; border: 2px dashed var(--c); }
.tmf-pin.is-hidden .tmf-pin__in { color: var(--c); }
.tmf-pin.is-active::before { box-shadow: 0 0 0 3px #1C2B33, 0 2px 5px rgba(10, 19, 48, .35); }

/* Popups ---------------------------------------------------------- */
.tmf-map .leaflet-popup-content-wrapper { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 6px 18px rgba(10, 19, 48, .2); }
.tmf-map .leaflet-popup-tip { background: var(--surface); }
.tmf-map .leaflet-popup-content { margin: 12px 16px 14px 14px; line-height: 1.4; font-size: .92rem; }
.tmf-map a.leaflet-popup-close-button { color: var(--muted); }
.tmf-pop { display: grid; gap: 3px; }
.tmf-pop__cat { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tmf-pop__cat::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--c); vertical-align: 1px; }
.tmf-pop__name { font-family: var(--font-display, inherit); font-size: 1.06rem; line-height: 1.2; }
.tmf-pop__when { font-size: .88rem; }
.tmf-pop p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.tmf-pop__hidden { font-style: italic; }
.tmf-pop__open { font-size: .84rem; font-weight: 600; }
.tmf-pop__open.is-open { color: var(--success); }
.tmf-pop__open.is-closed { color: var(--muted); }
.tmf-pop__logo { width: 40px; height: 40px; object-fit: cover; border-radius: var(--r-sm); }
.tmf-pop__links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.tmf-map a.tmf-pop__link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Side list ------------------------------------------------------- */
.tmf-map-side { max-height: calc(min(68vh, 620px) + 52px); overflow: auto; }
.tmf-map-group + .tmf-map-group { margin-top: 18px; }
.tmf-map-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--font-body, inherit); font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tmf-map-group .tmf-map-filter__dot { width: 20px; height: 20px; }
.tmf-map-group .tmf-map-filter__dot svg { width: 12px; height: 12px; }
.tmf-map-group.is-off { opacity: .45; }
.tmf-map-group ul { list-style: none; margin: 0; padding: 0; }
.tmf-map-group li a { display: grid; gap: 1px; margin: 0 -8px; padding: 7px 8px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.tmf-map-group li a:hover, .tmf-map-group li a:focus-visible { background: var(--sand-2); }
.tmf-map-group li a strong { font-weight: 600; font-size: .95rem; }
.tmf-map-group li a span { font-size: .84rem; color: var(--muted); }
.tmf-map-group li.is-hidden a { opacity: .6; }
.tmf-map-empty { margin: 18px 0 0; font-size: .9rem; color: var(--muted); }

/* Moderator editor ------------------------------------------------ */
.tmf-map-editor { margin-top: 16px; }
.tmf-map-editor__body { display: grid; gap: 12px; margin-top: 12px; }
.tmf-map-editor__body[hidden] { display: none; }
.tmf-map-editor__form { display: grid; gap: 12px; }
.tmf-map-editor__dirty { margin: 0 0 8px; font-weight: 600; color: var(--warning); }

/* Dashboard pin picker -------------------------------------------- */
.tmf-pin-edit { margin: 24px 0; padding: 0; border: 0; min-width: 0; }
.tmf-pin-edit legend { margin-bottom: 4px; font-weight: 600; }
.tmf-pin-map { height: 340px; margin: 8px 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.tmf-pin-status { font-size: .88rem; }

@media (max-width: 900px) {
	.tmf-map-layout { grid-template-columns: minmax(0, 1fr); }
	.tmf-map-side { max-height: none; }
	.tmf-map { height: 62vh; }
}
@media (max-width: 520px) {
	.tmf-souk { grid-template-columns: auto minmax(0, 1fr); }
	.tmf-souk__go { grid-column: 2; justify-self: start; }
	.tmf-pin-map { height: 300px; }
}
