/**
 * interactive-map.css — Estilos para la sección «Diversidad Infinita» y Mapa Interactivo del Perú.
 *
 * Disposición en 2 columnas:
 *   - Izquierda: Encabezado editorial con gradiente peruano y textos descriptivos.
 *   - Derecha: Tarjeta contenedor con sub-cuadrícula de 3 columnas (4 tarjetas + mapa central + 3 tarjetas).
 *
 * @package Machupicchu_Travel_Narcy
 * @since   1.0.0
 */

/* -------------------------------------------------------------------------
 * 1. Contenedor Principal de la Sección
 * ---------------------------------------------------------------------- */
.section-diversity-map {
	position: relative;
	background-color: var(--mtn-bg, #ffffff);
	padding: clamp(60px, 6vw, 100px) 0;
	transition: background-color 0.3s ease;
	overflow: hidden;
}

.divmap-container {
	max-width: var(--mtn-header-max, 1600px);
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 48px);
}

.divmap-grid {
	display: grid;
	grid-template-columns: 1fr 1.55fr;
	gap: clamp(32px, 4.5vw, 64px);
	align-items: center;
}

/* -------------------------------------------------------------------------
 * 2. Columna Izquierda: Texto Editorial
 * ---------------------------------------------------------------------- */
.divmap-text-column {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.divmap-text-sticky {
	max-width: 540px;
}

.divmap-eyebrow {
	display: inline-block;
	font-family: var(--mtn-font-body);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--mtn-green, #1a7a3c);
	background: var(--mtn-green-light, #f0f8f2);
	padding: 5px 12px;
	border-radius: 20px;
	margin-bottom: 18px;
	transition: all 0.3s ease;
}

.divmap-main-title {
	font-family: var(--mtn-font-heading);
	font-size: clamp(30px, 3.2vw, 46px);
	font-weight: 700;
	color: var(--mtn-heading, #142016);
	line-height: 1.2;
	margin: 0 0 24px;
	letter-spacing: -0.5px;
	transition: color 0.3s ease;
}

.divmap-title-highlight {
	display: block;
	margin-top: 4px;
}

.word-la {
	color: var(--mtn-heading, #142016);
	margin-right: 6px;
	transition: color 0.3s ease;
}

.word-diversidad {
	background: linear-gradient(135deg, #c92a2a 0%, #e03131 50%, #f76707 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	font-weight: 800;
	margin-right: 6px;
}

.word-infinita {
	background: linear-gradient(135deg, #15803d 0%, #16a34a 50%, #22c55e 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	font-weight: 800;
}

.divmap-paragraphs {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 28px;
}

.divmap-lead {
	font-family: var(--mtn-font-body);
	font-size: clamp(15px, 1.1vw, 16.5px);
	line-height: 1.7;
	color: var(--mtn-text, #2c352e);
	margin: 0;
	font-weight: 500;
	transition: color 0.3s ease;
}

.divmap-desc {
	font-family: var(--mtn-font-body);
	font-size: clamp(14px, 1.05vw, 15.5px);
	line-height: 1.7;
	color: var(--mtn-muted, #5b665b);
	margin: 0;
	transition: color 0.3s ease;
}

.divmap-badges-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 8px;
}

.divmap-mini-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--mtn-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--mtn-muted, #5b665b);
	background: var(--mtn-bg-alt, #f8faf8);
	border: 1px solid var(--mtn-border, #e8ebe8);
	padding: 6px 14px;
	border-radius: 8px;
	transition: all 0.3s ease;
}

.badge-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.dot-costa {
	background: #f59f00;
	box-shadow: 0 0 6px rgba(245, 159, 0, 0.6);
}

.dot-sierra {
	background: #d9480f;
	box-shadow: 0 0 6px rgba(217, 72, 15, 0.6);
}

.dot-selva {
	background: #2b8a3e;
	box-shadow: 0 0 6px rgba(43, 138, 62, 0.6);
}

/* -------------------------------------------------------------------------
 * 3. Columna Derecha: Tarjeta Contenedora del Mapa
 * ---------------------------------------------------------------------- */
.divmap-interactive-card {
	background: var(--mtn-bg-card, #ffffff);
	border: 1px solid var(--mtn-border, #e8ebe8);
	border-radius: 24px;
	padding: clamp(20px, 2.5vw, 36px);
	box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08), 0 2px 10px -2px rgba(0, 0, 0, 0.04);
	transition: all 0.3s ease;
}

.divmap-card-header {
	margin-bottom: 24px;
}

.divmap-card-title {
	font-family: var(--mtn-font-heading);
	font-size: clamp(20px, 1.8vw, 24px);
	font-weight: 700;
	color: var(--mtn-heading, #142016);
	margin: 0 0 6px;
	letter-spacing: -0.3px;
	transition: color 0.3s ease;
}

.divmap-card-subtitle {
	font-family: var(--mtn-font-body);
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--mtn-muted, #5b665b);
	margin: 0;
	transition: color 0.3s ease;
}

/* -------------------------------------------------------------------------
 * 4. Distribución Interna en 3 Columnas (Tarjetas + Mapa + Tarjetas)
 * ---------------------------------------------------------------------- */
.divmap-interactive-layout {
	display: grid;
	grid-template-columns: 140px 1fr 140px;
	gap: 16px;
	align-items: stretch;
}

/* Subcolumnas de tarjetas */
.divmap-cards-col {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 10px;
}

.divmap-cards-left {
	justify-content: space-between;
}

.divmap-cards-right {
	justify-content: space-around;
}

/* Tarjetas de miniaturas de destino */
.divmap-thumb-card {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	background: #142016;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
				border-color 0.25s ease,
				box-shadow 0.25s ease;
	outline: none;
	height: 78px;
}

.divmap-cards-right .divmap-thumb-card {
	height: 106px;
}

.thumb-media {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.thumb-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.thumb-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.65) 100%);
	transition: background 0.25s ease;
}

.thumb-badge-title {
	position: absolute;
	bottom: 6px;
	left: 8px;
	right: 8px;
	font-family: var(--mtn-font-body);
	font-size: 11px;
	font-weight: 700;
	color: #ffffff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}

/* Efecto hover y estado activo sincronizado */
.divmap-thumb-card:hover,
.divmap-thumb-card:focus-visible,
.divmap-thumb-card.is-active {
	transform: translateY(-2px) scale(1.02);
	border-color: var(--mtn-green, #1a7a3c);
	box-shadow: 0 6px 18px rgba(26, 122, 60, 0.35);
}

.divmap-thumb-card:hover .thumb-media img,
.divmap-thumb-card.is-active .thumb-media img {
	transform: scale(1.12);
}

.divmap-thumb-card.is-active .thumb-overlay {
	background: linear-gradient(180deg, rgba(26, 122, 60, 0.1) 0%, rgba(20, 32, 22, 0.75) 100%);
}

/* -------------------------------------------------------------------------
 * 5. Escenario Central del Mapa Punteado de Perú
 * ---------------------------------------------------------------------- */
.divmap-map-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 380px;
}

.peru-map-stage {
	position: relative;
	width: 100%;
	max-width: 360px;
	aspect-ratio: 1 / 1.08;
	background: var(--mtn-bg-alt, #fafcfa);
	border: 1px solid var(--mtn-border-light, #f0f3f0);
	border-radius: 16px;
	padding: 12px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.peru-vector-svg {
	width: 100%;
	height: 100%;
	display: block;
	overflow: visible;
}

/* Color de los puntos de la matriz del mapa */
.peru-matrix-dot {
	fill: #a2b4a8;
	transition: fill 0.3s ease;
}

/* Capa de pines interactivos */
.divmap-pins-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* Botón del pin interactivo */
.divmap-pin-btn {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 24px;
	height: 24px;
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	outline: none;
	z-index: 10;
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-dot-circle {
	width: 12px;
	height: 12px;
	background: #1a7a3c;
	border: 2px solid #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	position: relative;
	z-index: 2;
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.pin-radar-wave {
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: rgba(26, 122, 60, 0.35);
	opacity: 0;
	z-index: 1;
	pointer-events: none;
	animation: pin-pulse 2.2s infinite ease-out;
}

@keyframes pin-pulse {
	0% {
		transform: scale(0.6);
		opacity: 0.8;
	}
	50% {
		opacity: 0.4;
	}
	100% {
		transform: scale(2.4);
		opacity: 0;
	}
}

/* Estado hover y activo en el pin */
.divmap-pin-btn:hover,
.divmap-pin-btn:focus-visible,
.divmap-pin-btn.is-active {
	transform: translate(-50%, -50%) scale(1.3);
	z-index: 25;
}

.divmap-pin-btn:hover .pin-dot-circle,
.divmap-pin-btn.is-active .pin-dot-circle {
	background: #25d366;
	box-shadow: 0 0 12px rgba(37, 211, 102, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.divmap-pin-btn:hover .pin-radar-wave,
.divmap-pin-btn.is-active .pin-radar-wave {
	animation-duration: 1.2s;
	background: rgba(37, 211, 102, 0.5);
}

/* Tooltip emergente del pin */
.pin-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(6px);
	background: rgba(20, 32, 22, 0.94);
	backdrop-filter: blur(6px);
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	white-space: nowrap;
	text-align: center;
	border: 1px solid rgba(255, 255, 255, 0.15);
	z-index: 30;
}

.pin-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border-width: 5px;
	border-style: solid;
	border-color: rgba(20, 32, 22, 0.94) transparent transparent transparent;
}

.pin-tooltip-title {
	display: block;
	font-family: var(--mtn-font-heading);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.3px;
	color: #ffffff;
}

.pin-tooltip-sub {
	display: block;
	font-family: var(--mtn-font-body);
	font-size: 9.5px;
	color: #a8d5b5;
	margin-top: 1px;
}

.divmap-pin-btn:hover .pin-tooltip,
.divmap-pin-btn:focus-visible .pin-tooltip,
.divmap-pin-btn.is-active .pin-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* -------------------------------------------------------------------------
 * 6. Modo Oscuro
 * ---------------------------------------------------------------------- */
[data-theme="dark"] .section-diversity-map,
.dark-mode .section-diversity-map {
	background-color: var(--mtn-bg, #101512);
}

[data-theme="dark"] .divmap-interactive-card,
.dark-mode .divmap-interactive-card {
	background-color: var(--mtn-bg-card, #18221b);
	border-color: var(--mtn-border, #233126);
	box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .peru-map-stage,
.dark-mode .peru-map-stage {
	background: #111814;
	border-color: #1c2b21;
}

[data-theme="dark"] .peru-matrix-dot,
.dark-mode .peru-matrix-dot {
	fill: #2c4434;
}

[data-theme="dark"] .divmap-mini-badge,
.dark-mode .divmap-mini-badge {
	background: #18221b;
	border-color: #233126;
	color: #8fa091;
}

[data-theme="dark"] .divmap-eyebrow,
.dark-mode .divmap-eyebrow {
	background: #15271c;
	color: #3ec774;
}

[data-theme="dark"] .pin-dot-circle,
.dark-mode .pin-dot-circle {
	border-color: #18221b;
	background: #3ec774;
}

/* -------------------------------------------------------------------------
 * 7. Responsividad
 * ---------------------------------------------------------------------- */
@media (max-width: 1200px) {
	.divmap-grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.divmap-text-sticky {
		max-width: 100%;
		text-align: center;
	}

	.divmap-eyebrow {
		margin-inline: auto;
	}

	.divmap-badges-row {
		justify-content: center;
	}
}

@media (max-width: 860px) {
	.divmap-interactive-layout {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.divmap-cards-col {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
		gap: 10px;
	}

	.divmap-thumb-card,
	.divmap-cards-right .divmap-thumb-card {
		height: 90px;
	}

	.divmap-map-wrapper {
		order: -1;
		min-height: auto;
	}

	.peru-map-stage {
		max-width: 320px;
		margin-inline: auto;
	}
}

@media (max-width: 540px) {
	.divmap-interactive-card {
		padding: 16px;
		border-radius: 18px;
	}

	.divmap-cards-col {
		grid-template-columns: 1fr 1fr;
	}

	.divmap-thumb-card,
	.divmap-cards-right .divmap-thumb-card {
		height: 80px;
	}

	.peru-map-stage {
		max-width: 270px;
	}
}
