/* ───────────────────────────────────────────────────────────────────────────
   Morocco Exploration Portfolio
   --------------------------------------------------------------------------- */

:root {
	--mexp-primary:   #0f766e;
	--mexp-primary-d: #0b5f59;
	--mexp-accent:    #ffb400;
	--mexp-onshore:   #16a34a;
	--mexp-offshore:  #1d4ed8;
	--mexp-basin:     #0f766e;
	--mexp-bg:        #f8fafc;
	--mexp-card:      #ffffff;
	--mexp-border:    #e2e8f0;
	--mexp-text:      #0f172a;
	--mexp-muted:     #64748b;
	--mexp-radius:    12px;
	--mexp-shadow:    0 6px 20px rgba(15, 23, 42, .08);
}

.mexp-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--mexp-text);
	background: var(--mexp-bg);
	padding: 16px;
	box-sizing: border-box;
}

.mexp-wrap *, .mexp-wrap *::before, .mexp-wrap *::after { box-sizing: border-box; }

/* ── Top section: filters + map ─────────────────────────────────────────── */
.mexp-top {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 16px;
	align-items: start;
}

/* ── Filters panel ─────────────────────────────────────────────────────── */
.mexp-filters {
	background: var(--mexp-card);
	border-radius: var(--mexp-radius);
	box-shadow: var(--mexp-shadow);
	overflow: hidden;
}

.mexp-filters-toggle {
	display: none;
	width: 100%;
	background: var(--mexp-primary);
	color: #fff;
	border: 0;
	padding: 12px 14px;
	font-weight: 600;
	cursor: pointer;
	align-items: center;
	gap: 8px;
}

.mexp-filters-body { padding: 18px; }

.mexp-filters-hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.mexp-filters-hd h3 {
	font-size: 15px;
	margin: 0;
	color: var(--mexp-primary-d);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.mexp-reset-btn {
	background: transparent;
	border: 1px solid var(--mexp-border);
	color: var(--mexp-muted);
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .15s;
}
.mexp-reset-btn:hover { background: var(--mexp-bg); color: var(--mexp-text); }

.mexp-field { margin-bottom: 14px; }

.mexp-field > label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--mexp-muted);
	text-transform: uppercase;
	letter-spacing: .4px;
	margin-bottom: 6px;
}

.mexp-field select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--mexp-border);
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
	color: var(--mexp-text);
	cursor: pointer;
	transition: border-color .15s;
}
.mexp-field select:focus { outline: none; border-color: var(--mexp-primary); }

.mexp-checks, .mexp-layers {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.mexp-checks label, .mexp-layers label:not(:first-child) {
	font-size: 13px;
	color: var(--mexp-text);
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	text-transform: none;
	letter-spacing: 0;
}
.mexp-checks input[type=checkbox], .mexp-layers input[type=checkbox] {
	accent-color: var(--mexp-primary);
}

.mexp-download-all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background: var(--mexp-accent);
	color: #1f2937;
	border: 0;
	padding: 10px 12px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	margin-top: 6px;
	transition: filter .15s;
}
.mexp-download-all:hover { filter: brightness(.95); }

/* ── Map stage ─────────────────────────────────────────────────────────── */
.mexp-stage {
	position: relative;
	border-radius: var(--mexp-radius);
	overflow: hidden;
	box-shadow: var(--mexp-shadow);
	min-height: 500px;
}

.mexp-stage .onhym-map-wrapper {
	border-radius: var(--mexp-radius);
}

/* Top-right layer control */
.mexp-layer-ctrl {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 6;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: blur(6px);
	border-radius: 10px;
	padding: 12px 14px;
	box-shadow: var(--mexp-shadow);
	min-width: 170px;
	font-size: 13px;
}
.mexp-layer-ctrl strong {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--mexp-muted);
	margin-bottom: 6px;
}
.mexp-layer-ctrl label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 0;
	cursor: pointer;
	color: var(--mexp-text);
	font-size: 12px;
}
.mexp-layer-ctrl input { accent-color: var(--mexp-primary); }

/* Legend sections */
.mexp-legend-section {
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--mexp-border);
}
.mexp-legend-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

.mexp-legend-item {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 2px 0;
	font-size: 12px;
	color: var(--mexp-text);
}

/* Dot legend (location / data types) */
.mexp-ld-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

/* Status badge legend dots */
.mexp-ld-badge {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}
.mexp-ld-badge--active { background: #15803d; }
.mexp-ld-badge--open   { background: #92400e; }
.mexp-ld-badge--recon  { background: #64748b; }

/* Hide the onhym-map legend panel — replaced by our custom legend */
.mexp-wrap .onhym-legend-panel,
.mexp-wrap .onhym-legend-btn { display: none !important; }
.mexp-sw {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	flex-shrink: 0;
}
.mexp-sw--basin   { background: var(--mexp-basin);    opacity: .55; }
.mexp-sw--block   { background: linear-gradient(90deg, var(--mexp-onshore) 50%, var(--mexp-offshore) 50%); }
.mexp-sw--data    { background: var(--mexp-accent); border-radius: 50%; }

/* ── Popup ─────────────────────────────────────────────────────────────── */
.mapboxgl-popup.mexp-popup .mapboxgl-popup-content {
	border-radius: 10px;
	padding: 14px 16px;
	box-shadow: var(--mexp-shadow);
	font-size: 13px;
	color: var(--mexp-text);
	min-width: 220px;
}
.mexp-popup-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--mexp-primary-d);
	margin: 0 0 8px;
}
.mexp-popup-row { margin-bottom: 4px; }
.mexp-popup-row strong { color: var(--mexp-muted); font-weight: 600; margin-right: 6px; }
.mexp-popup-pdf {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 8px;
	background: var(--mexp-primary);
	color: #ffffff !important;
	text-decoration: none !important;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	transition: background .15s ease;
}
.mexp-popup-pdf:hover,
.mexp-popup-pdf:focus { background: #0b5b54; color: #ffffff !important; }
.mexp-popup-pdf svg { stroke: #ffffff !important; fill: none; }

/* ── Mapbox popup close button — green X, no background ──────────────── */
.mapboxgl-popup.mexp-popup .mapboxgl-popup-close-button {
	background: transparent !important;
	border: 0;
	color: var(--mexp-primary);
	font-size: 18px;
	line-height: 1;
	padding: 4px 6px;
	cursor: pointer;
	border-radius: 4px;
	transition: color .15s;
}
.mapboxgl-popup.mexp-popup .mapboxgl-popup-close-button:hover {
	background: transparent !important;
	color: var(--mexp-primary-d);
}

/* ── Table section ─────────────────────────────────────────────────────── */
.mexp-table-section {
	margin-top: 16px;
	background: var(--mexp-card);
	border-radius: var(--mexp-radius);
	box-shadow: var(--mexp-shadow);
	overflow: hidden;
}
.mexp-table-hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--mexp-border);
}
.mexp-table-hd h3 {
	margin: 0;
	font-size: 15px;
	color: var(--mexp-primary-d);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.mexp-count {
	font-size: 12px;
	color: var(--mexp-muted);
	background: var(--mexp-bg);
	padding: 4px 10px;
	border-radius: 999px;
}

.mexp-table-scroll {
	width: 100%;
	overflow-x: auto;
	max-height: 480px;
	overflow-y: auto;
}
.mexp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	min-width: 1000px;
}
.mexp-table thead th {
	background: var(--mexp-bg);
	color: var(--mexp-muted);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .4px;
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid var(--mexp-border);
	position: sticky;
	top: 0;
	z-index: 1;
}
.mexp-table tbody td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--mexp-border);
	vertical-align: middle;
}
.mexp-table tbody tr {
	transition: background .12s;
	cursor: pointer;
}
.mexp-table tbody tr:hover { background: #f1f5f9; }
.mexp-table tbody tr.is-active {
	background: rgba(15, 118, 110, .08);
	box-shadow: inset 3px 0 0 var(--mexp-primary);
}

.mexp-empty {
	text-align: center;
	padding: 28px;
	color: var(--mexp-muted);
	font-style: italic;
}

/* Status badges */
.mexp-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .3px;
	white-space: nowrap;
}
.mexp-badge--active   { background: #dcfce7; color: #15803d; }
.mexp-badge--open     { background: #fef3c7; color: #92400e; }
.mexp-badge--recon    { background: #e2e8f0; color: #475569; }
.mexp-badge--default  { background: #e2e8f0; color: #475569; }

.mexp-loc {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 600;
	font-size: 12px;
}
.mexp-loc::before {
	content: '';
	width: 8px; height: 8px;
	border-radius: 50%;
	display: inline-block;
}
.mexp-loc--onshore  { color: var(--mexp-onshore); }
.mexp-loc--onshore::before  { background: var(--mexp-onshore); }
.mexp-loc--offshore { color: var(--mexp-offshore); }
.mexp-loc--offshore::before { background: var(--mexp-offshore); }

/* PDF button — ALWAYS visible (no hover-reveal behaviour) */
.mexp-pdf-btn,
.mexp-tbody .mexp-pdf-btn,
.mexp-popup .mexp-pdf-btn {
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	align-items: center;
	gap: 5px;
	background: #0f766e;
	color: #fff;
	text-decoration: none;
	border: 0;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease;
}
.mexp-pdf-btn:hover,
.mexp-pdf-btn:focus { background: #0b5b54; color: #fff; }
.mexp-pdf-btn[disabled] { background: #cbd5e1; color: #fff; cursor: not-allowed; pointer-events: none; }

/* Hide ALL default pins / markers / cluster bubbles coming from the
   onhym-map plugin so that only the basins/blocks rendered by this
   plugin remain visible on the shared Mapbox instance. */
.mexp-wrap ~ * .mapboxgl-marker,
.onhym-map-wrapper .mapboxgl-marker,
.mapboxgl-map .mapboxgl-marker:not(.mexp-marker) {
	display: none !important;
}
/* Hide bottom cluster carousel that the onhym-map shows for its own pins */
.mexp-wrap ~ * .onhym-cluster-carousel,
.onhym-map-wrapper .onhym-cluster-carousel { display: none !important; }

/* ── Hide Mining / Hydrocarbons / Midstream toolbar buttons ─────────────── */
/* Only scoped to the exploration portfolio context so the standalone
   onhym_map shortcode is not affected elsewhere on the site.            */
.mexp-wrap .onhym-layer-toggles,
.mexp-wrap .onhym-tb-divider { display: none !important; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.mexp-top { grid-template-columns: 260px 1fr; }
}
@media (max-width: 820px) {
	.mexp-top { grid-template-columns: 1fr; }
	.mexp-filters-toggle { display: flex; }
	.mexp-filters-body { display: none; padding: 14px; }
	.mexp-filters.is-open .mexp-filters-body { display: block; }
	.mexp-stage { min-height: 420px; }
	.mexp-layer-ctrl { top: 8px; right: 8px; padding: 10px; min-width: 140px; font-size: 12px; }
}
@media (max-width: 480px) {
	.mexp-wrap { padding: 8px; }
	.mexp-stage { min-height: 360px; }
}
