/* =============================================
   ARJONA — CSS INDEPENDIENTE
   ============================================= */

/* ── HERO ── */
.arjona-hero {
  height: 100vh; width: 100%; position: relative;
  display: flex; align-items: center; justify-content: flex-start; overflow: hidden;
}
.arjona-hero .hero-background {
  position: absolute; inset: 0;
  background-image: url('../Imagenes de alta resolucion/arjona-portada.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat; z-index: 1;
}
.arjona-hero .hero-background::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.18); z-index: 2;
}

/* ── GRID 4 ZONAS ── */
.comunidades-grid {
  display: grid !important;
  grid-template-areas: "zone1 zone2" "zone3 zone4" !important;
  gap: clamp(32px,5vw,80px) clamp(16px,3vw,48px);
  align-items: center;
}
.comunidades-grid .zone  { display: flex; align-items: center; justify-content: center; }
.comunidades-grid .zone1 { grid-area: zone1; }
.comunidades-grid .zone2 { grid-area: zone2; }
.comunidades-grid .zone3 { grid-area: zone3; }
.comunidades-grid .zone4 { grid-area: zone4; }
.comunidades-grid .zone1 .content-image-card {
  width: 100%; max-width: 856px; aspect-ratio: 5/3;
  border: 4px solid #092C44; box-shadow: 8px 8px 0 #092C44;
  background: #092C44; border-radius: 15px; overflow: hidden;
}
.comunidades-grid .zone4 .content-image-card {
  width: 100%; max-width: 856px; aspect-ratio: 5/3;
  border: 4px solid #092C44; box-shadow: -8px 8px 0 #092C44;
  background: #092C44; border-radius: 15px; overflow: hidden;
}
.content-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.comunidades-grid .zone2,
.comunidades-grid .zone3 { padding: 0 clamp(8px,2vw,24px); }
.content-text {
  font-family: 'Switzer', sans-serif;
  font-size: clamp(15px,2vw,32px); font-weight: 400; line-height: 1.5;
  color: #2D3139; text-align: left;
}
@media (max-width: 991.98px) {
  .comunidades-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas: "zone1" "zone2" "zone3" "zone4" !important;
  }
  .comunidades-grid .zone1 .content-image-card,
  .comunidades-grid .zone4 .content-image-card { max-width: 100%; box-shadow: 4px 4px 0 #092C44; }
  .content-text { text-align: center; }
}

/* ── DESCRIPTOR INTERACTIVO ── */
.interactive-image-container { position: relative; max-width: 100%; margin: 0 auto; }

/* Nombre cartografía */
.cartography-name {
  position: absolute; top: 14px; left: 14px;
  background: linear-gradient(135deg,rgba(248,175,64,0.92),rgba(230,158,54,0.92));
  color: #fff; padding: 6px 16px; border-radius: 20px;
  font-size: clamp(10px,1.1vw,15px); font-weight: 600; z-index: 10;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  max-width: calc(100% - 90px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cartography-name.visible { opacity: 1; transform: translateY(0); }

.image-viewer {
  position: relative; width: 100%;
  height: clamp(260px,35vw,450px);
  border-radius: 15px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.image-layer  { position: absolute; inset: 0; }
.hidden-layer { display: none; }
.interactive-img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }

/* Botones nav (prev/next) — dorado */
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(248,175,64,0.92); color: #fff; border: none;
  width: clamp(34px,4vw,48px); height: clamp(34px,4vw,48px);
  border-radius: 50%; cursor: pointer; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(13px,1.4vw,17px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  transition: background 0.25s ease, transform 0.25s ease;
}
.prev-btn { left: 10px; }
.next-btn { right: 10px; }
.nav-btn:hover { background: #e69e36; transform: translateY(-50%) scale(1.1); }

/* Toggle btn */
.image-toggle-container { margin-top: 18px; text-align: center; }
.toggle-btn {
  background: linear-gradient(135deg,#F8AF40,#e69e36);
  color: #fff; border: none;
  padding: clamp(7px,1vw,11px) clamp(14px,2vw,22px);
  border-radius: 22px; cursor: pointer;
  font-size: clamp(12px,1.1vw,15px); font-weight: 500;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: background 0.25s ease, transform 0.25s ease;
}
.toggle-btn:hover { background: linear-gradient(135deg,#e69e36,#F8AF40); transform: translateY(-2px); }
.toggle-icon { transition: transform 0.3s ease; }
.toggle-btn:hover .toggle-icon { transform: rotate(180deg); }

/* Indicadores */
.image-indicators { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.indicator {
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(7,42,64,0.28); cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.indicator.active  { background: #F8AF40; transform: scale(1.25); }
.indicator:hover   { background: rgba(248,175,64,0.65); }

/* ── ANIMACIÓN PULSE MARKERS ── */
@keyframes markerPulse {
  0%   { transform: translate(-50%,-50%) scale(1); }
  50%  { transform: translate(-50%,-50%) scale(1.12); }
  100% { transform: translate(-50%,-50%) scale(1); }
}
.point-marker {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #e64900; border: 2px solid #fff;
  transform: translate(-50%,-50%); z-index: 30; cursor: pointer;
  animation: markerPulse 3.5s ease-in-out infinite;
}
.point-marker-label {
  position: absolute; left: 20px; top: -6px;
  background: rgba(255,255,255,0.96); padding: 4px 9px;
  border-radius: 6px; font-size: 12px; color: #072A40;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  display: none; white-space: nowrap; pointer-events: none;
}
.point-marker:hover .point-marker-label { display: block; }

/* ── DESCRIPTOR TEXT — zona de descripción y puntos ── */
.descriptor-text { display: block !important; }

/* Descripción general de la cartografía */
.cartography-desc { margin-bottom: 14px; }
.cartography-desc strong {
  display: block; font-size: clamp(20px, 1.75vw, 24px);
  color: #072A40; margin-bottom: 5px;
}
.cartography-desc {
  font-size: clamp(16px,1.5vw,22px); color: #2D3139; line-height: 1.55; margin: 0;
}

/* Indicación para hacer clic */
.carto-hint {
  font-size: clamp(12px,1.25vw,20px); color: #6b7280;
  font-style: italic; margin-top: 10px; text-align: center;
}

/* Punto seleccionado */
.carto-point-entry {
  background: #f8f9fa; border-radius: 10px;
  padding: 12px 14px; border-left: 4px solid #F8AF40;
  display: flex; flex-direction: column; gap: 8px;
}

/* Botón volver */
.carto-back-btn { display: none !important; }

.carto-point-title {
  font-size: clamp(13px,1.2vw,15px); font-weight: 700; color: #072A40;
}
.carto-point-info {
  font-size: clamp(12px,1.05vw,14px); color: #4b5563; line-height: 1.45; margin: 0;
}
.carto-descriptors-list { display: flex; flex-direction: column; gap: 7px; }
.carto-descriptor-item  { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }

/* Badge: "Potencialidad Económica" */
.carto-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 6px; border-radius: 20px; border: 1.5px solid;
  font-size: clamp(12px,1.05vw,16px); font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
/* Miniformas dentro del badge */
.carto-badge-shape { width: 10px; height: 10px; display: inline-block; flex-shrink: 0; }
.carto-badge-shape.sym-circle   { border-radius: 50%; background: currentColor; }
.carto-badge-shape.sym-square   { background: currentColor; }
.carto-badge-shape.sym-triangle {
  width: 0; height: 0; background: transparent;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 10px solid currentColor; transform: translateY(-1px);
}
.carto-badge-shape.sym-star {
  background: currentColor;
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
}
.carto-badge-shape.sym-pin {
  width: 7px; height: 10px; background: currentColor; border-radius: 3px;
}
.carto-descriptor-info {
  font-size: clamp(12px,1.05vw,16px); color: #4b5563; line-height: 1.45; flex: 1; min-width: 0;
}

/* ── UI READ-ONLY (oculta) ── */
.floating-controls           { display: none !important; }
.cartography-description,
#pointsPanel,
#pointsList,
#pointModal                  { display: none !important; }

/* Modal (por si el editor lo usa) */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); z-index: 70; }
.modal.hidden { display: none; }
.modal-content { background: #fff; padding: 18px; border-radius: 12px; width: min(520px,95%); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-content label { color: #333; font-weight: 600; }
.modal-content input, .modal-content textarea { color: #072A40 !important; background: #fff !important; }
.modal-actions { text-align: right; margin-top: 8px; }
.symbols-container { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.descriptors-container { display: flex; flex-direction: column; }
.toggle-edit-btn { background: #f3f4f6; color: #072A40; border: 1px solid #d1d5db; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.toggle-edit-btn:hover { background: #e6e9ec; }
.export-btn { background: #072A40; color: #fff; border: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; margin-left: 8px; }

/* Tejidos (para modal editor) */
.tejido-social      { background: #2E4DA9; }
.tejido-economico   { background: #E4D22A; }
.tejido-ambiental   { background: #2EA942; }
.tejido-cultural    { background: #A9362E; }
.tejido-estructural { background: #8A602C; }
.descriptor-symbol { width: 14px; height: 14px; display: inline-block; margin-right: 8px; vertical-align: middle; color: transparent; }
.descriptor-symbol.sym-circle   { border-radius: 50%; background: currentColor; }
.descriptor-symbol.sym-square   { background: currentColor; }
.descriptor-symbol.sym-triangle { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 14px solid currentColor; display: inline-block; transform: translateY(-2px); }
.descriptor-symbol.tejido-social      { color: #2E4DA9; }
.descriptor-symbol.tejido-economico   { color: #B8A800; }
.descriptor-symbol.tejido-ambiental   { color: #2EA942; }
.descriptor-symbol.tejido-cultural    { color: #A9362E; }
.descriptor-symbol.tejido-estructural { color: #8A602C; }

/* ══════════════════════════════════════
   ESTADÍSTICAS
══════════════════════════════════════ */
.stats-section {
  padding: clamp(48px,7vw,100px) 0;
  background-color: #f8f9fa;
}
.stats-title {
  font-size: clamp(22px,3.5vw,48px); font-weight: 700;
  color: #0F4C75; margin-bottom: clamp(28px,4vw,50px); text-align: center;
}
.stats-dashboard {
  display: grid;
  grid-template-columns: 1fr clamp(80px,10vw,120px);
  gap: clamp(12px,2vw,24px);
  background: #fff; border-radius: 20px;
  padding: clamp(16px,2.5vw,24px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.stats-left {
  display: grid; grid-template-rows: auto auto auto;
  gap: clamp(12px,2vw,20px);
}

/* ── SHAPES: tarjetas sólidas de color, sin glow ── */
.stats-shapes {
  background: #e6e6e6;
  border-radius: 10px;
  padding: clamp(18px,3vw,32px) clamp(16px,2.5vw,28px);
  display: flex; align-items: stretch; justify-content: center;
  gap: clamp(12px,2.5vw,32px);
  border: 2px solid #0a1628;
}

/* Cada .shape ES la tarjeta — border-radius grande, color sólido del tejido */
.shape {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: clamp(10px,1.4vw,16px); flex: 1 1 0;
  border-radius: clamp(14px,2vw,24px);
  padding: clamp(16px,2.2vw,28px) clamp(10px,1.5vw,18px);
  background: #2E4DA9;
  transition: background 0.35s ease;
  min-height: clamp(130px,16vw,190px);
}
.shape::before { display: none !important; }
.shape-circle   { order: 1; }
.shape-triangle { order: 2; }
.shape-rect     { order: 3; }

/* .shape-wrap: solo centra la figura, sin fondo ni borde propios */
.shape-wrap {
  display: flex; align-items: center; justify-content: center;
  width:  clamp(60px,7vw,96px);
  height: clamp(60px,7vw,96px);
  background: transparent !important;
  border: none !important;
}

/* Figuras internas: blancas para contrastar con el fondo sólido */
.shape-inner-circle {
  width: clamp(40px,5vw,96px); height: clamp(40px,5vw,96px);
  border-radius: 50%; display: block;
  background: #fff;
  transition: background 0.35s ease;
}
.shape-inner-triangle {
  width: 0; height: 0;
  border-left:   clamp(18px,2.1vw,58px) solid transparent;
  border-right:  clamp(18px,2.1vw,58px) solid transparent;
  border-bottom: clamp(32px,3.8vw,80px) solid #fff;
  display: block;
  transition: border-bottom-color 0.35s ease;
}
.shape-inner-rect {
  width: clamp(40px,5vw,96px); height: clamp(40px,5vw,96px);
  border-radius: 7px; display: block;
  background: #fff;
  transition: background 0.35s ease;
}

/* Etiqueta: contrasta con el fondo de color */
.shape-label {
  font-size: clamp(11px,0.95vw,15px); font-weight: 700;
  color: #fff; text-align: center;
  white-space: pre-line; line-height: 1.3;
  max-width: clamp(68px,8vw,106px);
  transition: color 0.35s ease;
}

/* ── ESTADOS DE COLOR ──
   Fondo = color del tejido. Figuras y etiquetas en blanco.
   Excepción state-yellow (fondo claro) → contraste oscuro.
── */
#statsShapes.state-blue   .shape { background: #2E4DA9; }
#statsShapes.state-blue   .shape-inner-circle,
#statsShapes.state-blue   .shape-inner-rect       { background: #fff !important; }
#statsShapes.state-blue   .shape-inner-triangle   { border-bottom-color: #fff !important; }
#statsShapes.state-blue   .shape-label            { color: #fff; }

#statsShapes.state-yellow .shape { background: #E4D22A; }
#statsShapes.state-yellow .shape-inner-circle,
#statsShapes.state-yellow .shape-inner-rect       { background: #142139 !important; }
#statsShapes.state-yellow .shape-inner-triangle   { border-bottom-color: #142139 !important; }
#statsShapes.state-yellow .shape-label            { color: #142139; }

#statsShapes.state-green  .shape { background: #2EA942; }
#statsShapes.state-green  .shape-inner-circle,
#statsShapes.state-green  .shape-inner-rect       { background: #fff !important; }
#statsShapes.state-green  .shape-inner-triangle   { border-bottom-color: #fff !important; }
#statsShapes.state-green  .shape-label            { color: #fff; }

#statsShapes.state-red    .shape { background: #A9362E; }
#statsShapes.state-red    .shape-inner-circle,
#statsShapes.state-red    .shape-inner-rect       { background: #fff !important; }
#statsShapes.state-red    .shape-inner-triangle   { border-bottom-color: #fff !important; }
#statsShapes.state-red    .shape-label            { color: #fff; }

#statsShapes.state-brown  .shape { background: #8A602C; }
#statsShapes.state-brown  .shape-inner-circle,
#statsShapes.state-brown  .shape-inner-rect       { background: #fff !important; }
#statsShapes.state-brown  .shape-inner-triangle   { border-bottom-color: #fff !important; }
#statsShapes.state-brown  .shape-label            { color: #fff; }

/* ── PANEL DE NÚMEROS ── */
.stats-main {
  background: #e6e6e6; border-radius: 8px;
  padding: clamp(14px,2.5vw,24px) clamp(14px,2.5vw,26px);
  border: 2px solid #142139;
}
.stats-card-title {
  font-size: clamp(16px,1.2vw,24px); font-weight: 600; color: #000;
  margin-bottom: clamp(8px,1.2vw,12px); transition: opacity 0.2s ease;
}
.stats-main-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.stats-main-item { text-align: center; flex: 1 1 0; }
.stat-number { font-size: clamp(36px,5vw,64px); font-weight: 700; color: #1f2937; }
.stat-label  { font-size: clamp(14px,1.1vw,18px); color: #1f2937; margin-top: 4px; }

/* ── CARDS RESUMEN ── */
.stats-summary-cards {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: clamp(8px,1.5vw,16px);
}
.summary-card {
  background: #e6e6e6; border-radius: 8px;
  padding: clamp(12px,1.5vw,18px); border: 2px solid #142139;
  text-align: left; position: relative; min-height: clamp(90px,12vw,120px);
}
.summary-number { font-size: clamp(28px,3.5vw,44px); font-weight: 700; margin-top: clamp(16px,2vw,22px); color: #1f2937; }
.summary-label  { font-size: clamp(14px,1.05vw,18px); margin-top: 4px; color: #1f2937; }
.total-card { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; }

/* ── BOTONES CATEGORÍA ── */
.stats-right {
  display: flex; flex-direction: column;
  gap: clamp(6px,1vw,12px); align-items: stretch; justify-content: center;
}
.color-btn {
  width: 100%; border: 2px solid #142139; border-radius: 8px;
  font-size: clamp(14px,1.05vw,18px); font-weight: 600; cursor: pointer;
  box-shadow: 2px 2px 0 #142139; height: clamp(48px,7vw,72px);
  transition: filter 0.2s ease, transform 0.15s ease; color: #142139;
}
.color-btn:hover  { filter: brightness(1.07); transform: translateX(-2px); }
.color-btn:focus  { outline: 2px solid #F8AF40; }
.color-btn.active { transform: translateX(-4px); box-shadow: 4px 4px 0 #142139; }
.color-blue   { background: #2E4DA9; color: #fff; }
.color-yellow { background: #E4D22A; color: #142139; }
.color-green  { background: #2EA942; color: #fff; }
.color-red    { background: #A9362E; color: #fff; }
.color-brown  { background: #8A602C; color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 991.98px) {
  .stats-dashboard     { grid-template-columns: 1fr; }
  .stats-right         { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: stretch; }
  .color-btn           { flex: 1 1 clamp(70px,18%,120px); height: 48px; }
  .stats-summary-cards { grid-template-columns: repeat(2,1fr); }
  .stats-shapes        { gap: clamp(10px,2.5vw,24px); padding: 14px clamp(10px,2vw,20px); }
  .shape               { padding: clamp(10px,1.6vw,18px) clamp(6px,1.2vw,14px); min-height: 110px; gap: 8px; }
  .shape-wrap          { width: 52px; height: 52px; }
  .shape-inner-circle  { width: 36px; height: 36px; }
  .shape-inner-triangle { border-left-width: 14px; border-right-width: 14px; border-bottom-width: 26px; }
  .shape-inner-rect    { width: 36px; height: 36px; }
  .shape-label         { font-size: 9px; max-width: 62px; }
  .cartography-name    { font-size: 10px; padding: 5px 12px; top: 8px; left: 8px; }
  .carto-badge         { font-size: 11px; }
}
@media (max-width: 575.98px) {
  .stats-summary-cards { grid-template-columns: 1fr 1fr; }
  .image-viewer        { height: clamp(200px,52vw,300px); }
  .stats-shapes        { gap: 6px; padding: 10px 6px; overflow-x: auto; }
  .shape               { padding: 8px 5px; min-height: 88px; min-width: 72px; gap: 6px; border-radius: 12px; }
  .shape-wrap          { width: 38px; height: 38px; }
  .shape-inner-circle  { width: 28px; height: 28px; }
  .shape-inner-triangle { border-left-width: 12px; border-right-width: 12px; border-bottom-width: 20px; }
  .shape-inner-rect    { width: 28px; height: 22px; border-radius: 4px; }
  .shape-label         { font-size: 8px; max-width: 54px; line-height: 1.2; }
  .point-marker-label  { display: none !important; }
  .carto-badge         { font-size: 10px; white-space: normal; }
  .carto-descriptor-item { flex-wrap: wrap; }
}
@media (hover: none) {
  .point-marker-label { display: none !important; }
}

.align-right { text-align: right; }
.mt-8        { margin-top: 8px; }