/**
 * Panneau zone (fiche au clic sur une zone) — porté depuis mk-maps (Champ-eu).
 * Classes mk-* conservées telles quelles pour rester alignées sur mk-map.css.
 * Seules différences : les modificateurs du badge de probabilité suivent les
 * classes FR (faible / moderee / elevee).
 */

/* Le JS pilote l'affichage via l'attribut hidden ; il doit gagner même sur
   les éléments dont la classe pose un display (flex…). */
.mk-map-sheet [hidden],
.mk-map-detail[hidden],
.mk-map-detail [hidden] {
	display: none !important;
}

/* ---------- Panneau bas (fiche zone) ---------- */

.mk-map-sheet {
	/* Premier plan du site : fixé au viewport, au-dessus de tout (header
	   du thème compris), jamais rogné par la carte. */
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2000;
	width: min(440px, calc(100% - 16px));
	max-height: min(86vh, calc(100vh - 24px));
	overflow-y: auto;
	background: #fdfcf9;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.35);
	padding: 10px 20px 20px;
	animation: mk-sheet-up 0.3s ease;
	box-sizing: border-box;
	font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-align: left;
}

@keyframes mk-sheet-up {
	from {
		transform: translate(-50%, 30%);
		opacity: 0;
	}
	to {
		transform: translate(-50%, 0);
		opacity: 1;
	}
}

.mk-map-sheet-handle {
	width: 42px;
	height: 4px;
	border-radius: 999px;
	background: #d8d4c8;
	margin: 2px auto 12px;
}

.mk-map-sheet-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 999px;
	background: #efece3;
	color: #24312a;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.mk-map-sheet-close:hover {
	background: #e3dfd3;
}

.mk-map-sheet-kicker {
	/* position:relative : repère des bulles d'aide posées dans le kicker. */
	position: relative;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #8a887e;
}

.mk-map-sheet-title {
	margin: 2px 0 14px;
	font-size: 21px;
	line-height: 1.2;
	color: #1d2a22;
}

.mk-map-sheet-prob {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #f3efe6;
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 10px;
}

.mk-map-sheet-prob-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #6d6b60;
}

.mk-map-sheet-badge {
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-radius: 7px;
	padding: 5px 11px;
}

/* Fond jaune : texte sombre pour rester lisible. */
.mk-map-sheet-badge--faible {
	color: #4a3b00;
}

.mk-map-sheet-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.mk-map-sheet-tile {
	background: #f3efe6;
	border-radius: 10px;
	padding: 10px 14px;
}

.mk-map-sheet-tile:nth-child(odd):last-child {
	grid-column: 1 / -1;
}

.mk-map-sheet-tile-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #8a887e;
	margin-bottom: 3px;
}

.mk-map-sheet-tile-value {
	font-size: 14px;
	font-weight: 600;
	color: #1d2a22;
	line-height: 1.3;
}

/* ---------- Encart indice de pousse ---------- */

.mk-map-sheet-index {
	position: relative;
	text-align: center;
	background: #f3efe6;
	border-radius: 10px;
	padding: 14px 14px 16px;
	margin-top: 8px;
}

/* Le "i" centré verticalement avec le libellé du kicker. */
.mk-map-sheet-index > .mk-map-sheet-kicker {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.mk-map-sheet-index .mk-map-sheet-info {
	margin-left: 0;
	vertical-align: 0;
}

.mk-map-sheet-index-value {
	/* Couleur définie inline selon le niveau (rouge -> vert). */
	font-size: 38px;
	font-weight: 800;
	line-height: 1.1;
	margin: 4px 0 8px;
}

.mk-map-sheet-index-value span {
	font-size: 17px;
	font-weight: 600;
	color: #8a887e;
	margin-left: 2px;
}

.mk-map-sheet-index-chip {
	/* Fond et texte définis inline selon le niveau. */
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 5px 12px;
}

.mk-map-sheet-info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 7px;
	border: 1.5px solid #a09d92;
	border-radius: 999px;
	background: none;
	color: #a09d92;
	font-size: 10px;
	font-weight: 700;
	font-style: italic;
	font-family: Georgia, serif;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	vertical-align: -3px;
}

.mk-map-sheet-info:hover {
	border-color: #1d2a22;
	color: #1d2a22;
}

/* Bulle d'aide : posée dans le kicker, donc ancrée juste dessous et
   sortie du flux — elle se superpose au contenu au lieu de le pousser. */
.mk-map-sheet-info-pop {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	width: max-content;
	max-width: min(320px, calc(100vw - 56px));
	background: #1d2a22;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	text-transform: none;
	letter-spacing: normal;
	border-radius: 8px;
	padding: 10px 13px;
	text-align: left;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
}

.mk-map-sheet-index-loader {
	padding: 10px 0 8px;
}

.mk-map-sheet-index-loader-phrase {
	font-size: 12px;
	font-weight: 500;
	color: #5f6f66;
	min-height: 1.4em;
	margin-bottom: 9px;
}

.mk-map-sheet-index-loader-phrase.is-in {
	animation: mk-phrase-in 0.35s ease;
}

@keyframes mk-phrase-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.mk-map-sheet-index-loader-bar {
	height: 6px;
	max-width: 220px;
	margin: 0 auto;
	border-radius: 999px;
	background: #e8e5dc;
	overflow: hidden;
}

.mk-map-sheet-index-loader-bar span {
	display: block;
	height: 100%;
	width: 40%;
	border-radius: 999px;
	background: linear-gradient(to right, #2d5a3f, #4a8862);
	animation: mk-loader-slide 1.1s ease-in-out infinite;
}

@keyframes mk-loader-slide {
	from {
		transform: translateX(-110%);
	}
	to {
		transform: translateX(320%);
	}
}

/* ---------- Courbe de tendance ---------- */

/* Construction progressive de la courbe. */
.mk-trend-seg {
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	transition: stroke-dashoffset 0.22s ease-out;
}

.mk-trend-seg.is-on {
	stroke-dashoffset: 0;
}

.mk-trend-dot {
	opacity: 0;
	transition: opacity 0.18s ease;
}

.mk-trend-dot.is-on {
	opacity: 1;
}

.mk-map-sheet-trend {
	background: #f3efe6;
	border-radius: 10px;
	padding: 12px 14px;
	margin-top: 8px;
}

.mk-map-sheet-trend-body {
	position: relative;
}

.mk-map-sheet-spark {
	display: block;
	width: 100%;
	height: 96px;
	margin-top: 8px;
}

.mk-trend-hit {
	cursor: pointer;
}

.mk-trend-tip {
	position: absolute;
	transform: translate(-50%, -130%);
	display: flex;
	align-items: center;
	gap: 8px;
	background: #1d2a22;
	color: #fff;
	font-size: 12px;
	line-height: 1;
	border-radius: 7px;
	padding: 7px 11px;
	white-space: nowrap;
	pointer-events: none;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
	z-index: 3;
}

.mk-trend-tip-date {
	color: #cfdbd3;
	font-weight: 500;
}

.mk-trend-tip strong {
	font-size: 13px;
	font-weight: 800;
}

.mk-map-sheet-spark-axis {
	display: flex;
	justify-content: space-between;
	margin-top: 4px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: #8a887e;
}

/* ---------- Conditions du lieu-dit (point exact cliqué) ---------- */

.mk-map-sheet-local {
	position: relative;
	margin-top: 14px;
	padding: 12px 14px;
	background: #f7f4ec;
	border: 1px solid #e6e1d4;
	border-radius: 14px;
}

.mk-local-now {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 8px 0 10px;
}

.mk-local-emoji {
	font-size: 24px;
	line-height: 1;
}

.mk-local-temp {
	font-size: 26px;
	font-weight: 800;
	line-height: 1;
	color: #1d2a22;
}

.mk-local-cond {
	font-size: 13px;
	color: #6b6a62;
}

/* Tuiles plus serrées et plus claires que la grille du panneau : le bloc a
   déjà son propre fond, deux beiges identiques se confondraient. */
.mk-local-grid {
	gap: 6px;
}

.mk-local-grid .mk-map-sheet-tile {
	background: #fdfcf9;
	padding: 8px 12px;
}

/* ---------- Boutons d'action du panneau ---------- */

.mk-map-sheet-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin-top: 8px;
	padding: 12px 16px;
	border: 1.5px solid transparent;
	border-radius: 12px;
	background: #1d2a22;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* display:flex l'emporte sur le display:none de [hidden] : à rétablir,
   sinon le bouton Itinéraire reste visible sans point cliqué. */
.mk-map-sheet-cta[hidden] {
	display: none;
}

.mk-map-sheet-cta svg {
	flex: none;
	width: 16px;
	height: 16px;
}

.mk-map-sheet-cta:hover {
	background: #2d5a3f;
	color: #fff;
}

.mk-map-sheet-cta:focus-visible {
	outline: 2px solid #2d5a3f;
	outline-offset: 2px;
}

.mk-map-sheet-cta:disabled {
	opacity: 0.55;
	cursor: default;
}

/* Le bouton temps réel clôt le bloc indice : un cran de respiration. */
.mk-map-sheet-realtime {
	margin-top: 14px;
}

/* Actions secondaires : contour discret plutôt qu'un trait sombre, pour ne
   pas concurrencer le bouton principal quand elles sont empilées. */
.mk-map-sheet-cta--outline {
	background: none;
	border-color: #d8d4c8;
	color: #1d2a22;
}

.mk-map-sheet-cta--outline:hover {
	background: #1d2a22;
	border-color: #1d2a22;
	color: #fff;
}

/* ---------- Fiche détaillée plein écran (conditions temps réel) ---------- */

.mk-map-detail {
	position: fixed;
	inset: 0;
	z-index: 2100;
	overflow-y: auto;
	background: #fdfcf9;
	padding: 16px max(20px, calc((100vw - 560px) / 2)) 48px;
	animation: mk-detail-in 0.3s ease;
	box-sizing: border-box;
	font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-align: left;
}

@keyframes mk-detail-in {
	from {
		transform: translateY(6%);
		opacity: 0;
	}
	to {
		transform: none;
		opacity: 1;
	}
}

.mk-map-detail-title {
	margin: 2px 0 6px;
	font-size: 22px;
	line-height: 1.2;
	color: #1d2a22;
}

.mk-map-detail-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 6px 0;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #2d5a3f;
	cursor: pointer;
}

.mk-map-detail-back:hover {
	color: #1d2a22;
}

.mk-map-detail-meta {
	font-size: 12.5px;
	color: #6d6b60;
	margin: 0 0 12px;
	line-height: 1.5;
}

.mk-map-detail-meta span {
	color: #b6b2a4;
	margin: 0 2px;
}

.mk-map-detail-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 14px;
}

.mk-map-detail-action {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #fff;
	border: 1.5px solid #d8d4c8;
	border-radius: 9px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	color: #1d2a22;
	cursor: pointer;
}

.mk-map-detail-action:hover {
	background: #f3efe6;
}

.mk-map-detail-action--dark {
	background: #1d2a22;
	border-color: #1d2a22;
	color: #fff;
}

.mk-map-detail-action--dark:hover {
	background: #2d5a3f;
	border-color: #2d5a3f;
}

.mk-map-detail-save.is-saved {
	background: #2d5a3f;
	border-color: #2d5a3f;
	color: #fff;
}

/* ---------- Sections génériques de la fiche ---------- */

.mk-map-detail-section {
	margin-top: 14px;
}

.mk-map-detail-section-title {
	font-size: 15px;
	font-weight: 700;
	color: #1d2a22;
	padding-bottom: 8px;
	border-bottom: 1px solid #e8e4d8;
	margin-bottom: 12px;
}

/* ---------- Facteurs environnementaux : jauges ---------- */

.mk-sheet-factor {
	margin-bottom: 14px;
}

.mk-sheet-factor:last-child {
	margin-bottom: 0;
}

.mk-sheet-factor-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 7px;
}

.mk-sheet-factor-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a887e;
}

.mk-sheet-factor-value {
	font-size: 15px;
	font-weight: 800;
	color: #1d2a22;
}

.mk-sheet-factor-track {
	position: relative;
	height: 5px;
	border-radius: 999px;
	background: linear-gradient(to right, #e4ddcd, #d8d0ba);
}

.mk-sheet-factor-cursor {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 13px;
	height: 13px;
	border-radius: 999px;
	background: #ec5f1a;
	border: 2.5px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.mk-sheet-factor-scale {
	display: flex;
	justify-content: space-between;
	margin-top: 5px;
	font-size: 10px;
	font-weight: 600;
	color: #a09d92;
}

/* ---------- Meilleurs jours à venir ---------- */

.mk-sheet-day {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #f3efe6;
	border: 1.5px solid transparent;
	border-radius: 12px;
	padding: 11px 14px;
	margin-bottom: 8px;
}

.mk-sheet-day:last-child {
	margin-bottom: 0;
}

.mk-sheet-day.is-best {
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.mk-sheet-day-kicker {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #c98a2b;
}

.mk-sheet-day-date {
	font-size: 14px;
	font-weight: 600;
	color: #1d2a22;
	margin-top: 1px;
}

.mk-sheet-day-note {
	font-size: 11px;
	font-weight: 600;
	color: #2d8a4f;
	margin-top: 2px;
}

.mk-sheet-day-value {
	font-size: 24px;
	font-weight: 800;
}

/* ---------- Carte d'identité de l'espèce recherchée ---------- */

.mk-sheet-carousel {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #e8e4d8;
}

.mk-sheet-carousel-img {
	display: block;
	width: 100%;
	height: 230px;
	object-fit: cover;
}

.mk-sheet-carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
	color: #1d2a22;
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
	padding: 0 0 2px;
}

.mk-sheet-carousel-prev {
	left: 10px;
}

.mk-sheet-carousel-next {
	right: 10px;
}

.mk-sheet-carousel-arrow:hover {
	background: #fff;
}

.mk-sheet-carousel-dots {
	position: absolute;
	bottom: 9px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 5px;
}

.mk-sheet-carousel-dot {
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.55);
}

.mk-sheet-carousel-dot.is-on {
	background: #fff;
}

.mk-map-detail-species-name {
	margin: 12px 0 6px;
	font-size: 16px;
	color: #1d2a22;
}

.mk-map-detail-species-name em {
	font-weight: 400;
	color: #6d6b60;
}

.mk-map-detail-species-text {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: #43503f;
}
