/* ==========================================================================
   ESTILOS: SUCESOS ECOSENSACIONALES - MAPA 3D INTERACTIVO UDEA (REDISEÑO PERIÓDICO)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary-green: #10b981;
  --primary-green-dark: #059669;
  --accent-emerald: #047857;
  --accent-lime: #84cc16;
  --dark-bg: rgba(15, 23, 42, 0.92);
  --glass-border: rgba(16, 185, 129, 0.25);
  --glass-shadow: 0 20px 40px -15px rgba(16, 185, 129, 0.2);
  --text-light: #f8fafc;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: #0b0f19;
  color: var(--text-light);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
}

/* ─── Contenedor del Mapa ─── */
#map {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ─── Header Flotante Glassmorphism ─── */
.map-header {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  background: var(--dark-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-light);
}

.map-title-box h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}

.map-title-box p {
  font-size: 0.85rem;
  margin: 2px 0 0 0;
  color: #94a3b8;
}

.map-controls-group {
  display: flex;
  gap: 10px;
}

.btn-map-control {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-map-control:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #4ade80;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.select-map-control {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  border-radius: 50px;
  padding: 8px 36px 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}

.select-map-control:hover,
.select-map-control:focus {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: #4ade80;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.select-map-control option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 10px;
  font-weight: 500;
}

/* ─── Tooltips y Marcadores 3D ─── */
.marker-3d-badge {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.marker-3d-badge:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, #10b981, #059669);
}

/* ─── Modal Horizontal Estilo Periódico/Revista (SIN SCROLL) ─── */
.slide-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}

.slide-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-modal-card {
  width: 94vw;
  max-width: 1280px;
  height: 85vh;
  max-height: 740px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(16, 185, 129, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #f8fafc;
  transform: scale(0.94) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slide-modal-backdrop.active .slide-modal-card {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.slide-modal-header {
  padding: 16px 28px;
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.building-meta h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 10px;
}

.building-meta span {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

.btn-qr-header {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #4ade80;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-qr-header:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #4ade80;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* ─── MODAL SECUNDARIO DE CÓDIGO QR ─── */
.qr-modal-backdrop {
  z-index: 200;
}

.qr-modal-card {
  width: 90vw;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #f8fafc;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qr-modal-backdrop.active .qr-modal-card {
  transform: scale(1) translateY(0);
}

.qr-modal-body {
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.qr-image-wrapper {
  width: 210px;
  height: 210px;
  margin: 0 auto 16px auto;
  background: #ffffff;
  padding: 12px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 3px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-instruction-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0;
}

.qr-modal-footer {
  padding: 16px 24px;
  background: rgba(30, 41, 59, 0.9);
  border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-eco-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 50px;
  border: none;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-eco-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
  color: #ffffff;
}

/* Modal Body / Slide Visualizer (SIN SCROLL & ALINEACIÓN CORRECTA) */
.slide-modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 20px 28px;
  overflow: hidden;
  /* CERO SCROLLBARS */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

#slide-container {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.slide-content-view {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  animation: fadeIn 0.4s ease-in-out;
  overflow: hidden;
}

/* ─── DESPLIEGUE HORIZONTAL TIPO PERIÓDICO / REVISTA ─── */
.newspaper-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

/* Columna Izquierda: Redacción & Destacados (CON SCROLL VERTICAL SI ES NECESARIO) */
.newspaper-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.4) rgba(15, 23, 42, 0.4);
}

.newspaper-left::-webkit-scrollbar {
  width: 6px;
}

.newspaper-left::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 10px;
}

.newspaper-left::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.4);
  border-radius: 10px;
}

.newspaper-left::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.8);
}

.newspaper-epigraph {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 50px;
  color: #4ade80;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.newspaper-headline {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  font-weight: 800;
  line-height: 1.18;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.newspaper-subtitle {
  font-size: 0.9rem;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

.newspaper-body-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Tarjeta de Destacado / Callout (Estilo home.html glass-info-card) */
.newspaper-callout {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 4px solid #10b981;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
}

.newspaper-callout-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #4ade80;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.newspaper-callout-desc {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.45;
  margin: 0;
}

/* Fichas de Métricas en Fila */
.newspaper-metrics-row {
  display: flex;
  gap: 12px;
}

.newspaper-metric-card {
  flex: 1;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #4ade80;
  line-height: 1.1;
}

.metric-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Columna Derecha: Galería Multimagen & Medios */
.newspaper-right {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 12px;
  overflow: hidden;
}

.gallery-hero-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.gallery-hero-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-hero-wrapper:hover img {
  transform: scale(1.03);
}

.gallery-caption-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, transparent 100%);
  color: #fff;
}

.gallery-caption-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: #ffffff;
}

.gallery-caption-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin: 0;
}

.gallery-thumbs-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  height: 125px;
}

.gallery-thumb-item {
  position: relative;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gallery-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.85);
  font-size: 0.75rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal Footer / Controls */
.slide-modal-footer {
  padding: 14px 28px;
  background: rgba(30, 41, 59, 0.9);
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-slide-nav {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #fff;
  padding: 8px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-slide-nav:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #4ade80;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-slide-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slide-dots-container {
  display: flex;
  gap: 8px;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
}

.slide-dot.active {
  background: #4ade80;
  width: 24px;
  border-radius: 10px;
  box-shadow: 0 0 8px #4ade80;
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsividad Móvil & Tablet */
@media (max-width: 768px) {
  .map-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 10px 14px;
    border-radius: 16px;
  }

  .map-title-box h1 {
    font-size: 1.15rem;
  }

  .map-title-box p {
    font-size: 0.75rem;
    margin-top: 1px;
  }

  .map-controls-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .select-map-control {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    font-size: 0.82rem;
    padding: 7px 32px 7px 12px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .btn-map-control {
    flex: 1;
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .newspaper-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    overflow-y: auto;
  }

  .slide-modal-card {
    width: 96vw;
    height: 90vh;
    max-height: none;
    border-radius: 20px;
  }

  .slide-modal-body {
    height: auto;
    max-height: none;
    padding: 14px 16px;
    overflow-y: auto;
  }
}

@media (max-width: 576px) {
  .newspaper-headline {
    font-size: 1.25rem;
  }

  .map-title-box p {
    display: none;
  }
}