/* =========================================================================
   Nascentes da Crise — Página de Etapa
   Tokens fiéis ao design system. Cores mapeadas para a paleta global do
   Blocksy (--theme-palette-color-*) com fallback nos hexes do design.
   Ajustar o mapeamento após ler a paleta real do Blocksy.
   ========================================================================= */

.ndc-etapa-page {
	/* Cores mapeadas para a paleta global do Blocksy (confirmada via MCP).
	   Fallback nos hexes do design system. Nenhuma cor nova é criada. */
	--ndc-teal:        var(--theme-palette-color-1, #2E7D6E); /* Teal Primário */
	--ndc-wine:        var(--theme-palette-color-2, #8A4258); /* Vinho Destaque */
	--ndc-text-body:   var(--theme-palette-color-3, #475569); /* Texto Médio */
	--ndc-text:        var(--theme-palette-color-4, #1E293B); /* Tinta Títulos */
	--ndc-border:      var(--theme-palette-color-5, #E5E7EB); /* Borda */
	--ndc-divider:     var(--theme-palette-color-6, #F1F5F9); /* Linha Fundo Sutil */
	--ndc-bg:          var(--theme-palette-color-7, #F8F9FA); /* Fundo Principal */
	--ndc-white:       var(--theme-palette-color-8, #FFFFFF); /* Branco */
	--ndc-text-2:      #64748B; /* auxiliar — fora da paleta global */
	--ndc-text-3:      #94a3b8; /* auxiliar — fora da paleta global */

	/* Tipografia — usa as fontes globais do tema quando definidas */
	--ndc-font-head: 'Sora', sans-serif;
	--ndc-font-body:   'Inter', var(--theme-font-family, sans-serif);

	max-width: 1100px;
	margin: 0 auto 80px;
	padding: 0 24px;
	font-family: var(--ndc-font-body);
	color: var(--ndc-text);
	box-sizing: border-box;
}

.ndc-etapa-page *,
.ndc-etapa-page *::before,
.ndc-etapa-page *::after {
	box-sizing: border-box;
}

/* Espaçamento padrão entre blocos */
.ndc-etapa-page > * + * {
	margin-top: 56px;
}

/* Título de bloco (Sinopse, Localização, Galeria) */
.ndc-block-title {
	font-family: var(--ndc-font-head);
	font-weight: 700;
	font-size: 24px;
	line-height: 1.2;
	color: var(--ndc-text);
	margin: 0 0 16px;
}

/* =========================================================================
   Bloco 01 — Cabeçalho
   ========================================================================= */
.ndc-etapa-header {
	border: 1px solid var(--ndc-border);
	border-radius: 20px;
	background: var(--ndc-white);
	padding: 40px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ndc-etapa-back { display: flex; width: fit-content;
	align-items: center;
	gap: 8px;
	color: var(--ndc-teal);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	margin-bottom: 24px;
	transition: opacity .2s ease;
}
.ndc-etapa-back:hover { opacity: .75; }
.ndc-etapa-back svg { width: 20px; height: 20px; }

.ndc-etapa-badge { display: block; width: fit-content; margin-left: auto; margin-right: auto;
	background: rgba(46, 125, 110, 0.1);
	color: var(--ndc-teal);
	font-weight: 700;
	font-size: 13px;
	padding: 5px 14px;
	border-radius: 9999px;
	margin-bottom: 18px;
}

.ndc-etapa-title {
	font-family: var(--ndc-font-head);
	font-weight: 800;
	font-size: 40px;
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--ndc-text);
	margin: 0 0 16px;
}

.ndc-etapa-meta {
	font-size: 15px;
	color: var(--ndc-text-2);
	font-weight: 500;
}
.ndc-etapa-meta .ndc-sep { margin: 0 6px; color: var(--ndc-text-3); }

/* =========================================================================
   Bloco 02 — Player
   ========================================================================= */
.ndc-etapa-player-frame {
	position: relative;
	padding-top: 56.25%; /* 16:9 */
	border-radius: 20px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 24px 48px -20px rgba(138, 66, 88, 0.45);
}
.ndc-etapa-player-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* =========================================================================
   Bloco 03 — Sinopse + Ficha técnica
   ========================================================================= */
.ndc-etapa-content-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 32px;
	align-items: start;
}
.ndc-etapa-sinopse { min-width: 0; }

.ndc-etapa-sinopse-text {
	font-size: 16px;
	line-height: 1.75;
	color: var(--ndc-text-body);
	margin: 0 0 24px;
}
.ndc-etapa-sinopse-text p { margin: 0 0 1em; }
.ndc-etapa-sinopse-text p:last-child { margin-bottom: 0; }

.ndc-etapa-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--ndc-teal);
	color: #fff;
	padding: 12px 24px;
	border-radius: 9999px;
	font-weight: 500;
	font-size: 15px;
	text-decoration: none;
	box-shadow: 0 10px 24px -8px rgba(46, 125, 110, 0.5);
	transition: transform .2s ease, box-shadow .2s ease;
}
.ndc-etapa-cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px -8px rgba(46, 125, 110, 0.55);
	color: #fff;
}
.ndc-etapa-cta svg { width: 18px; height: 18px; }

.ndc-etapa-ficha {
	background: var(--ndc-white);
	border: 1px solid var(--ndc-border);
	border-radius: 20px;
	padding: 24px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.ndc-etapa-ficha-title {
	font-family: var(--ndc-font-head);
	font-weight: 700;
	font-size: 15px;
	color: var(--ndc-text);
	margin: 0 0 16px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.ndc-etapa-ficha-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--ndc-divider);
}
.ndc-etapa-ficha-row:last-child { border-bottom: 0; }
.ndc-etapa-ficha-label { color: var(--ndc-text-3); font-size: 13px; }
.ndc-etapa-ficha-value {
	color: var(--ndc-text);
	font-size: 14px;
	font-weight: 600;
	text-align: right;
}

/* =========================================================================
   Bloco 04 — Mapa
   ========================================================================= */
.ndc-etapa-map-desc {
	font-size: 15px;
	line-height: 1.6;
	color: var(--ndc-text-body);
	margin: 0 0 16px;
}
.ndc-etapa-map-frame {
	position: relative;
	padding-top: 42%;
	border-radius: 20px;
	overflow: hidden;
	border: 1px solid var(--ndc-border);
	background: #dde7e4;
}
.ndc-etapa-map-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* =========================================================================
   Bloco 05 — Galeria
   ========================================================================= */
.ndc-etapa-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 16px;
}
.ndc-etapa-gallery-item { margin: 0; }
.ndc-gallery-link {
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--ndc-border);
}
.ndc-gallery-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}
.ndc-gallery-link:hover .ndc-gallery-img { transform: scale(1.04); }
.ndc-gallery-caption {
	font-size: 12px;
	color: var(--ndc-text-3);
	margin-top: 6px;
	line-height: 1.4;
}

/* =========================================================================
   Bloco 06 — Navegação anterior / próxima
   ========================================================================= */
.ndc-etapa-nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
}
.ndc-etapa-nav-card {
	border: 1px solid var(--ndc-border);
	border-radius: 16px;
	padding: 22px;
	background: var(--ndc-white);
	text-decoration: none;
	display: block;
	transition: border-color .25s ease, transform .25s ease;
}
.ndc-etapa-nav-card:hover {
	border-color: var(--ndc-teal);
	transform: translateY(-2px);
}
.ndc-etapa-nav-card.ndc-next { text-align: right; }
.ndc-nav-label {
	display: block;
	font-size: 12px;
	color: var(--ndc-text-3);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 600;
}
.ndc-nav-title {
	display: block;
	margin-top: 8px;
	font-family: var(--ndc-font-head);
	font-weight: 700;
	font-size: 17px;
	color: var(--ndc-text);
}

/* =========================================================================
   Grid de etapas — [nascentes_etapas_grid]
   ========================================================================= */
.ndc-etapas-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
	font-family: var(--ndc-font-body, 'Inter', sans-serif);
}
.ndc-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--theme-palette-color-5, #e5e7eb);
	border-radius: 18px;
	overflow: hidden;
	background: var(--theme-palette-color-8, #fff);
	text-decoration: none;
	color: inherit;
	transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.ndc-card:hover {
	border-color: var(--theme-palette-color-1, #2E7D6E);
	transform: translateY(-3px);
	box-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.25);
}
.ndc-card-thumb {
	aspect-ratio: 16 / 9;
	background: #e2e8f0;
	overflow: hidden;
}
.ndc-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ndc-card-body { padding: 18px 20px 22px; }
.ndc-card-badge {
	display: inline-block;
	background: rgba(46, 125, 110, 0.1);
	color: var(--theme-palette-color-1, #2E7D6E);
	font-weight: 700;
	font-size: 12px;
	padding: 4px 12px;
	border-radius: 9999px;
	margin-bottom: 10px;
}
.ndc-card-title {
	font-family: var(--theme-font-family, 'Sora'), sans-serif;
	font-weight: 700;
	font-size: 19px;
	line-height: 1.25;
	margin: 0 0 8px;
	color: var(--theme-palette-color-4, #1E293B);
}
.ndc-card-meta { font-size: 13px; color: #64748B; }

/* =========================================================================
   Lightbox da galeria (overlay anexado ao body — fora do escopo da página)
   ========================================================================= */
.ndc-lb-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(15, 23, 42, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
}
.ndc-lb-overlay.is-open { display: flex; }
.ndc-lb-img {
	max-width: 90vw;
	max-height: 88vh;
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.ndc-lb-close,
.ndc-lb-prev,
.ndc-lb-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: 0;
	cursor: pointer;
	border-radius: 9999px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}
.ndc-lb-close:hover,
.ndc-lb-prev:hover,
.ndc-lb-next:hover { background: rgba(255, 255, 255, 0.25); }
.ndc-lb-close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	font-size: 28px;
	line-height: 1;
}
.ndc-lb-prev,
.ndc-lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 34px;
	line-height: 1;
}
.ndc-lb-prev { left: 20px; }
.ndc-lb-next { right: 20px; }
@media (max-width: 600px) {
	.ndc-lb-prev, .ndc-lb-next { width: 42px; height: 42px; font-size: 26px; }
}

/* =========================================================================
   Responsivo
   ========================================================================= */
@media (max-width: 600px) {
	.ndc-etapa-header { padding: 28px 22px; }
	.ndc-etapa-title { font-size: 30px; }
	.ndc-etapa-nav-card.ndc-next { text-align: left; }
}


/* ---- Mapa multi-ponto (Leaflet) ---- */
.ndc-etapa-map-canvas{width:100%;height:420px;border-radius:12px;overflow:hidden;z-index:0;background:#e9eef2;}
.ndc-etapa-map-canvas .leaflet-container{font:inherit;border-radius:12px;}
.ndc-etapa-map-canvas .leaflet-popup-content{font:inherit;margin:10px 12px;line-height:1.4;}
.ndc-etapa-map-fallback{color:#666;font-style:italic;}
@media (max-width:600px){.ndc-etapa-map-canvas{height:320px;}}
