/* ==========================================================================
   1. FUENTES, VARIABLES Y RESET GENERAL
   ========================================================================== */
@font-face {
  font-family: 'CocogooseProTrial';
  src: url('../fonts/CocogooseProTrial.woff2') format('woff2'),
       url('../fonts/CocogooseProTrial.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg-dark: #091912;
  --bg-card: rgba(255, 255, 255, 0.05);
  --border-card: rgba(255, 255, 255, 0.12);
  --accent-brown: #c98026;
  --accent-green: #18672E;
  --accent-orange: #d9822b;
  --text-main: #ffffff;
  --text-muted: #a0aec0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
}

body {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Tipografía de Encabezados Generales */
h1, h2, h3 {
  font-family: 'CocogooseProTrial', sans-serif;
  font-weight: 800;
  color: #0d1b2a;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================================
   2. NAVBAR SUPERIOR & COMPONENTE HEADER
   ========================================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  background-color: var(--accent-green);
  border-bottom: 2px solid var(--accent-orange);
}

.logo img {
  max-height: 150px;
}

.logo1 img {
  max-height: 40px;
}

.nav-links {
  display: flex;
  gap: 25px;
  list-style: none;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 5px;
  position: relative;
  transition: color 0.3s ease;
  font-family: 'Century Gothic', sans-serif;
}

.nav-links a:hover {
  color: var(--accent-brown);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-brown);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Botón Menú exclusivo para móvil (oculto en escritorio) */
.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   3. INICIO (INDEX.HTML / HOME PAGE)
   ========================================================================== */
body.home-page {
  background: url('../assets/C0022T01.jpg') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  flex-grow: 1;
}

.hero-content {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.subheading {
  color: #ffffff;
  letter-spacing: 2px;
  font-size: 14px;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Tarjeta Glass del Mockup */
.glass-card {
  background: rgba(235, 238, 242, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 25px 20px;
  width: 100%;
  text-align: center;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.glass-card .logo img {
  max-width: 210px;
  height: auto;
}

.card-divider {
  border: none;
  height: 2px;
  background-color: var(--accent-green);
  margin: 14px auto;
  width: 90%;
}

.glass-card p {
  color: #1a202c;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

/* Botón de Acción Principal */
.btn-main {
  background-color: var(--accent-orange);
  color: #ffffff;
  border: none;
  padding: 16px 28px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 28px;
  width: 100%;
  max-width: 320px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  font-family: 'CocogooseProTrial', sans-serif;
}

.btn-main:hover {
  background-color: var(--accent-green);
  transform: translateY(-2px);
}

/* Tarjeta Inferior Oscura */
.bottom-info-card {
  background-color: #1e2533;
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.bottom-info-card .card-tag {
  color: var(--accent-orange);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  display: block;
  margin-bottom: 8px;
}

.bottom-info-card h2 {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.bottom-info-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

/* Dock Inferior Flotante */
.bottom-dock-trigger {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 82px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  pointer-events: none;
}

.bottom-dock {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
}

.bottom-dock.active {
  transform: translateY(0);
}

.dock-btn {
  display: inline-block;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.dock-btn img {
  height: 82px;
  display: block;
  border-radius: 6px;
}

.dock-btn:hover {
  transform: scale(1.15);
}

/* ==========================================================================
   4. MAPA Y SERIE DOCUMENTAL (MAPA-SERIE.HTML)
   ========================================================================== */
body.map-page {
  background-color: #0f172a;
  color: #ffffff;
}

body.map-page .logo img, 
body.map-page .logo1 img {
  max-height: 40px;
}

.territorio-section { 
  position: relative; 
  display: block; 
  width: 100%; 
  min-height: calc(100vh - 72px); 
}

.map-container { 
  width: 100%; 
  height: calc(100vh - 72px); 
  min-height: 600px; 
  padding: 0; 
  border-right: 4px solid #8b5a2b; 
  overflow: hidden; 
  display: block; 
  position: relative;
  background-color: #0f172a;
}

.mapa-svg-wrapper {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: calc(100% - 380px) !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: #F8F8F8;
}

.mapa-svg-wrapper > svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  background: #F8F8F8;
}

.mapa-fondo-real { 
  display: none; 
}

.mapa-svg-wrapper svg a {
  cursor: pointer;
  text-decoration: none;
}

.mapa-svg-wrapper svg path {
  fill: #E8E2D8;
  stroke: #8B7355;
  stroke-width: 1;
  transition: fill 0.3s ease, filter 0.3s ease;
}

.mapa-svg-wrapper svg a:hover path {
  fill: var(--accent-orange);
  fill-opacity: 0.45;
}

.mapa-provincia-label {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25px;
  fill: #5A4636;
  stroke: #F8F8F8;
  stroke-width: 3px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
}

/* Buscador Flotante */
.search-wrapper {
  width: 50%;
  max-width: 500px;
  min-width: 280px;
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background-color: rgba(23, 33, 50, 0.9);
  backdrop-filter: blur(8px);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box {
  display: flex;
  background-color: #172132;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.search-box input {
  background: transparent;
  border: none;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 14px;
  width: 100%;
  outline: none;
}

.search-box button {
  background-color: var(--accent-orange);
  color: #ffffff;
  border: none;
  padding: 0 16px;
  font-family: 'CocogooseProTrial', sans-serif;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.search-box button:hover {
  background-color: #b86b1f;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover, .pill.active {
  background-color: var(--accent-orange);
  color: #ffffff;
  border-color: var(--accent-orange);
}

.btn-regresar {
  position: absolute;
  top: 25px;
  right: 400px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.2s ease;
  z-index: 100;
}

.btn-regresar img {
  height: 55px;
  width: auto;
  display: block;
}

.btn-regresar:hover {
  transform: scale(1.08);
}

/* Lateral de Historias */
.stories-sidebar {
  position: absolute; 
  z-index: 20; 
  right: 0; 
  top: 0; 
  height: 100%; 
  width: 380px; 
  background-color: #111827;
  padding: 30px 20px;
  overflow-y: auto;
  border-left: 4px solid var(--accent-brown) !important;
}

.stories-sidebar h2 {
  color: #82c91e;
  font-size: 20px;
  margin-bottom: 5px;
}

.stories-sidebar p.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.divider {
  border-bottom: 1px dashed #334155;
  margin-bottom: 20px;
}

.story-card {
  background-color: #1a2332;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.story-card:hover {
  transform: translateX(-4px);
  background-color: #222d3f;
}

.story-thumb {
  width: 90px;
  height: 70px;
  background-color: var(--accent-green);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.story-thumb .play-dot {
  width: 16px;
  height: 16px;
  background-color: #ef4444;
  border-radius: 50%;
}

.story-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge {
  background-color: var(--accent-orange);
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
}

.story-info h3 {
  font-size: 15px;
  color: #ffffff;
}

.story-info span {
  font-size: 10px;
  color: #ffffff;
}

.marker-pulse {
  fill: #ef4444;
  stroke: #ffffff;
  stroke-width: 2;
  animation: pulse-animation 1.5s infinite ease-in-out;
  transform-origin: center;
  pointer-events: none;
}

@keyframes pulse-animation {
  0% { r: 6; opacity: 1; stroke-width: 2; }
  50% { r: 12; opacity: 0.4; stroke-width: 4; }
  100% { r: 6; opacity: 1; stroke-width: 2; }
}

/* ==========================================================================
   5. PATRIMONIO FOTOGRÁFICO (GALERIA.HTML)
   ========================================================================== */
body.gallery-page {
  background-color: var(--bg-dark);
  background-image: 
    url('../assets/textura_fondo.png'), 
    radial-gradient(circle at 50% 30%, rgba(24, 103, 46, 0.25) 0%, transparent 70%);
  background-repeat: repeat, no-repeat;
  background-size: 1200px 800px, auto;
  background-blend-mode: overlay;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 50px;
  overflow-x: hidden;
}

body.gallery-page h1,
body.gallery-page h2,
body.gallery-page h3 {
  color: var(--text-main);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.top-dock-wrapper {
  display: flex;
  justify-content: center;
  padding: 25px 0 15px 0;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 30px;
}

.top-dock {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.section-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 25px;
}

body.gallery-page .filter-bar {
  position: static;
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.btn-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-filter.active, 
.btn-filter:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #ffffff;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.featured-right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-featured-main { min-height: 360px; }
.card-featured-sub { min-height: 170px; }

.card {
  pointer-events: auto;
  cursor: pointer;
}

.card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-4px);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: #0f231a;
  flex-grow: 1;
}

.bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.card-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(9, 25, 18, 0.95) 15%, transparent 85%);
  z-index: 2;
}

.badge-wrapper {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 3;
}

.badge-orange { 
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 3;
}

.card-text h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: #ffffff;
}

.card-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-arrow {
  background: var(--accent-green);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.card:hover .btn-arrow {
  background: var(--accent-orange);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-grid .card {
  height: 260px;
}
/* Manejo de Scroll en Body */
body.modal-open {
  overflow: hidden !important;
}

/* ==========================================
   MODAL / POPUP PANTALLA COMPLETA FIJO
   ========================================== */
/* ==========================================
   MODAL / POPUP DE GALERÍA
   ========================================== */

.modal {
    display: none;
    position: fixed !important;

    inset: 0;

    width: 100vw;
    height: 100vh;

    background-color: rgba(0, 0, 0, 0.88);

    z-index: 999999;

    align-items: center;
    justify-content: center;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 30px 20px;

    box-sizing: border-box;
}

.modal.active {
    display: flex !important;
}

.modal-body {
    position: relative;

    width: min(900px, 100%);

    max-height: calc(100vh - 60px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    margin: auto;
}

.modal-content {
    display: block;

    max-width: 100%;
    width: auto;

    max-height: 65vh;

    object-fit: contain;

    border-radius: 8px;
}

.modal-caption {
    margin-top: 15px;

    color: #ffffff;

    font-size: 1.1rem;

    text-align: center;
}

.modal-close {
    position: fixed;

    top: 20px;
    right: 25px;

    color: #ffffff;

    font-size: 35px;
    font-weight: bold;

    cursor: pointer;

    z-index: 1000000;
}
}
@media (max-width: 768px) {
  .modal-dock-wrapper .dock-btn img {
    height: 28px;
  }
}
@media (max-width: 768px) {
    .modal-dock-wrapper .top-dock .dock-btn {
        display: none !important;
    }

    .modal-dock-wrapper .top-dock .dock-btn:last-child {
        display: flex !important;
    }
}

.about-hero-banner {
  width: 100%;
  height: 260px;
  background-image: url('../assets/C0022T01.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 2px solid var(--accent-brown);
}

.about-hero-banner .hero-logo {
  max-width: 380px;
  width: 80%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* ==========================================================================
   6. VISTA DE REPRODUCCIÓN DE VIDEO
   ========================================================================== */
body.video-page {
  background-color: #181d29;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

body.video-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/textura_fondo.png');
  background-repeat: repeat;
  background-size: 1280px auto;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

mi-header, .top-dock-container, .main-content {
  position: relative;
  z-index: 1;
}

.top-dock-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 20px 10px 20px;
}

.dock-card img { height: 60px; width: auto; transition: transform 0.2s ease; }
.dock-cardb img { height: 45px; width: auto; transition: transform 0.2s ease; }
.dock-card:hover img, .dock-cardb:hover img { transform: translateY(-3px); }

.main-content {
  width: 90%;
  max-width: 1300px;
  margin: 30px auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: center;
}

.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.player-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 24px;
}

.play-btn {
  background-color: var(--accent-orange);
  color: #ffffff;
  border: none;
  padding: 16px 32px;
  font-family: 'CocogooseProTrial', sans-serif;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.06);
  background-color: var(--accent-green);
}

.info-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.city-title {
  color: var(--accent-orange);
  font-size: 2.8rem;
  font-weight: bold;
  margin: 0 0 20px 0;
}

.subtitle-box {
  background-color: #212837;
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 360px;
}

.subtitle-box p { color: #ffffff; font-size: 1.1rem; }

.orange-bar {
  height: 5px;
  width: 200px;
  background-color: var(--accent-orange);
  border-radius: 3px;
  margin-bottom: 25px;
}

.description-box {
  background-color: #212837;
  border-radius: 10px;
  padding: 18px 22px;
  width: 100%;
  max-width: 420px;
}

.description-box p { color: #c5cbd3; font-size: 1rem; line-height: 1.5; }

/* ==========================================================================
   7. RESPONSIVE / MEDIA QUERIES (UNIFICADO)
   ========================================================================== */

/* Tablets y pantallas medianas (Pantallas < 900px) */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .stories-sidebar { 
    width: 300px; 
  }

  .mapa-svg-wrapper {
    width: calc(100% - 300px) !important;
  }

  .btn-regresar {
    right: 320px;
  }
}

@media (max-width: 850px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

/* Dispositivos móviles principales (Pantallas < 768px) */
@media (max-width: 768px) {
  /* Navbar Móvil con botón de imagen */
  .navbar {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo img { max-height: 60px; }
  .logo1 img { max-height: 30px; }

  .nav-links {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease;
    
    /* MODIFICACIONES PARA CORRER A LA DERECHA */
    margin-left: auto;  /* Empuja el elemento hacia el extremo derecho del contenedor */
    margin-right: -40px; /* Ajusta este valor (ej. 0px, -5px, 10px) para acercarlo más al borde */
}

  .mobile-menu-btn img {
    height: 36px;
    width: auto;
    display: block;
  }

  .mobile-menu-btn:active {
    transform: scale(0.95);
  }

  /* Vista de Mapa en Móvil */
  .territorio-section {
    display: flex;
    flex-direction: column;
  }

  .map-container {
    height: 50vh;
    min-height: 350px;
    border-right: none;
    border-bottom: 4px solid #8b5a2b;
  }

  .mapa-svg-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
  }

  .search-wrapper {
    width: calc(100% - 20px);
    left: 10px;
    top: 10px;
  }

  .stories-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 50vh;
    border-left: none !important;
    border-top: 4px solid var(--accent-brown) !important;
  }

  .btn-regresar {
    top: 10px;
    right: 15px;
  }

  .btn-regresar img {
    height: 40px;
  }

  .about-hero-banner {
    height: 180px;
  }

  .about-hero-banner .hero-logo {
    max-width: 260px;
  }
}

/* Pantallas de Teléfonos Pequeños (Pantallas < 480px) */
@media (max-width: 480px) {
  .hero-content {
    padding: 0 10px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-width: 95%;
  }

  .dock-btn img {
    height: 55px;
  }
}
/* PARRILLA DE BOTONES FIJA SUPERIOR */
    .top-dock-wrapper {
      display: flex;
      justify-content: center;
      padding: 25px 0 15px 0;
      border-bottom: 1px solid var(--border-card);
      margin-bottom: 30px;
    }

    .top-dock {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .dock-btn {
      transition: transform 0.2s ease;
      cursor: pointer;
    }

    .dock-btn img {
      height: 55px;
      display: block;
      border-radius: 6px;
    }

    .dock-btn:hover {
      transform: scale(1.08);
    }
.dock-btnd img {
      height: 40px;
      display: block;
      border-radius: 6px;
    }

    .dock-btnd:hover {
      transform: scale(1.08);
    }
    
     /* FUENTES PERSONALIZADAS Y BASE */
    @font-face {
      font-family: 'CocogooseProTrial';
      src: url('fonts/CocogooseProTrial.woff2') format('woff2'),
           url('fonts/CocogooseProTrial.ttf') format('truetype');
      font-weight: normal;
      font-style: normal;
    }

    :root {
      --bg-dark: #091912;
      --bg-card: rgba(255, 255, 255, 0.05);
      --border-card: rgba(255, 255, 255, 0.12);
      --accent-brown: #c98026;
      --accent-green: #18672E;
      --accent-orange: #d9822b;
      --text-main: #ffffff;
      --text-muted: #a0aec0;
      --card-bg-dark: #121c24;
      --card-inner-player: #0b1319;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
    }

    body {
      background-color: var(--bg-dark);
      background-image: 
        url('assets/textura_fondo.png'), 
        radial-gradient(circle at 50% 30%, rgba(24, 103, 46, 0.25) 0%, transparent 70%);
      background-repeat: repeat, no-repeat;
      background-size: 1200px 800px, auto;
      background-blend-mode: overlay;
      color: var(--text-main);
      min-height: 100vh;
      padding-bottom: 50px;
      overflow-x: hidden;
    }

    a {
      text-decoration: none;
      color: inherit;
    }

    h1, h2, h3 {
      font-family: 'CocogooseProTrial', sans-serif;
    }

    /* NAVBAR SUPERIOR */
    .navbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 50px;
      background-color: var(--accent-green);
      border-bottom: 2px solid var(--accent-orange);
    }

    .logo1 img {
      max-height: 40px;
      display: block;
    }

    .nav-links {
      display: flex;
      gap: 25px;
      list-style: none;
    }

    .nav-links a {
      color: #ffffff;
      font-weight: 500;
      transition: color 0.3s ease;
      font-size: 0.95rem;
    }

    .nav-links a:hover {
      color: var(--accent-brown);
    }

    /* CONTENEDOR PRINCIPAL */
    .container {
      width: 90%;
      max-width: 1200px;
      margin: 0 auto;
    }

    /* PARRILLA DE BOTONES FIJA SUPERIOR */
    .top-dock-wrapper {
      display: flex;
      justify-content: center;
      padding: 25px 0 15px 0;
      border-bottom: 1px solid var(--border-card);
      margin-bottom: 30px;
    }

    .top-dock {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .dock-btn {
      transition: transform 0.2s ease;
      cursor: pointer;
    }

    .dock-btn img {
      height: 55px;
      display: block;
      border-radius: 6px;
    }

    .dock-btn:hover {
      transform: scale(1.08);
    }
.dock-btnd img {
      height: 40px;
      display: block;
      border-radius: 6px;
    }

    .dock-btnd:hover {
      transform: scale(1.08);
    }
    /* HEADER DE SECCIÓN & FILTROS */
    .section-header h1 {
      font-size: 2rem;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .section-header p {
      color: var(--text-muted);
      font-size: 0.95rem;
      margin-bottom: 25px;
    }

    .filter-bar {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 35px;
    }

    .btn-filter {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid var(--border-card);
      color: var(--text-main);
      padding: 10px 22px;
      border-radius: 20px;
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .btn-filter.active, .btn-filter:hover {
      background: var(--accent-orange);
      border-color: var(--accent-orange);
    }

    /* === GRID DE TARJETAS DE AUDIO / PODCAST === */
    .audio-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 25px;
      margin-bottom: 40px;
    }

    .card-audio {
      background: var(--card-bg-dark);
      border: 1px solid var(--border-card);
      border-radius: 20px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      transition: transform 0.3s ease, border-color 0.3s ease;
    }

    .card-audio:hover {
      transform: translateY(-4px);
      border-color: var(--accent-orange);
    }

    /* RECTÁNGULO ILUSTRATIVO SUPERIOR DE LA TARJETA */
    .audio-thumb-box {
      width: 100%;
      height: 180px;
      border-radius: 14px;
      position: relative;
      padding: 14px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      background: linear-gradient(135deg, #18432a 0%, #0d2618 100%);
      background-size: cover;
      background-position: center;
      overflow: hidden;
    }

    .audio-thumb-box::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0, 0, 0, 0.35);
      z-index: 1;
    }

    .badge-category {
      z-index: 2;
      background: rgba(10, 20, 15, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.15);
      padding: 6px 14px;
      border-radius: 14px;
      font-size: 0.72rem;
      font-weight: bold;
      letter-spacing: 0.5px;
      color: var(--accent-orange);
    }

    .badge-time {
      z-index: 2;
      background: rgba(0, 0, 0, 0.85);
      padding: 5px 12px;
      border-radius: 12px;
      font-size: 0.8rem;
      font-weight: bold;
      color: #ffffff;
    }

    /* DETALLES Y TEXTO DEL AUDIO */
    .audio-details {
      padding: 0 4px;
    }

    .audio-details h3 {
      font-size: 1.15rem;
      margin-bottom: 6px;
      color: #ffffff;
    }

    .audio-details .location {
      font-size: 0.82rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 4px;
    }

    /* REPRODUCTOR PERSONALIZADO DE AUDIO */
    .player-box {
      background: var(--card-inner-player);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 14px;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .play-btn-circle {
      width: 40px;
      height: 40px;
      background-color: var(--accent-orange);
      border: none;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: #ffffff;
      font-size: 1rem;
      flex-shrink: 0;
      transition: transform 0.2s ease, background-color 0.2s ease;
    }

    .play-btn-circle:hover {
      transform: scale(1.08);
      background-color: #e08b30;
    }

    /* BARRA DE PROGRESO Y TIEMPOS */
    .progress-container {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex-grow: 1;
    }

    .progress-bar-bg {
      width: 100%;
      height: 6px;
      background-color: rgba(255, 255, 255, 0.15);
      border-radius: 4px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }

    .progress-bar-fill {
      height: 100%;
      width: 0%;
      background-color: var(--accent-orange);
      border-radius: 4px;
      transition: width 0.1s linear;
    }

    .time-display {
      display: flex;
      justify-content: space-between;
      font-size: 0.72rem;
      color: var(--text-muted);
    }
    
    

/* ==========================================================================
   AJUSTE RESPONSIVE DEL MAPA Y LISTADO DE HISTORIAS
   Fuerza que el listado quede debajo del mapa en pantallas pequeñas.
   ========================================================================== */
@media screen and (max-width: 768px) {
  .territorio-section {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .territorio-section > .map-container {
    position: relative !important;
    display: block !important;
    flex: 0 0 50vh !important;
    width: 100% !important;
    height: 50vh !important;
    min-height: 350px !important;
    max-height: 560px !important;
    overflow: hidden !important;
    border-right: 0 !important;
    border-bottom: 4px solid #8b5a2b !important;
  }

  .territorio-section > .map-container .mapa-svg-wrapper {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .territorio-section > .stories-sidebar {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 24px 16px 32px !important;
    overflow: visible !important;
    background-color: #111827 !important;
    border-left: 0 !important;
    border-top: 4px solid var(--accent-brown) !important;
  }

  .stories-sidebar .story-card {
    width: 100%;
    min-width: 0;
  }

  .stories-sidebar .story-info {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .stories-sidebar .story-info h3 {
    line-height: 1.35;
  }

  .btn-regresar {
    z-index: 1100 !important;
  }
}

@media screen and (max-width: 380px) {
  .stories-sidebar .story-card {
    gap: 10px;
    padding: 10px;
  }

  .stories-sidebar .story-thumb {
    width: 66px;
    height: 60px;
  }

  .stories-sidebar .story-info h3 {
    font-size: 13px;
  }
}

/* Corrección final: en móvil el listado debe ocupar su propio espacio
   debajo del mapa, nunca superponerse sobre él. */
@media screen and (max-width: 768px) {
  section.territorio-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
  }

  section.territorio-section > div.map-container {
    order: 1 !important;
    position: relative !important;
    flex: none !important;
    width: 100% !important;
    height: 50vh !important;
    min-height: 350px !important;
    max-height: 560px !important;
  }

  section.territorio-section > aside.stories-sidebar {
    order: 2 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    float: none !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }
}

/* Ocultar el menú superior de botones solo en versión móvil */
@media (max-width: 768px) {
  .top-dock-wrapper,
  .top-dock-container {
    display: none !important;
  }
}
/* Oculta únicamente el input de texto y los filtros en móvil */
@media (max-width: 768px) {
  .search-wrapper .search-box,
  .search-wrapper .category-pills,
  .search-wrapper input[type="text"] {
    display: none !important;
  }

  /* El botón se mantiene visible */
  .search-wrapper button,
  .search-trigger-btn {
    display: flex !important;
  }
}
/* Mantener el encabezado por encima del contenido */
mi-header {
  display: block;
  position: relative;
  z-index: 2000 !important;
}

/* Mantener el contenido de la sección debajo del encabezado */
.territorio-section {
  position: relative;
  z-index: 1;
}
/* Evitar que el contenido quede debajo del encabezado */
mi-header {
  display: block;
  position: relative;
  z-index: 2000 !important;
}

/* Dar espacio al contenido de las páginas de historias */
body {
  scroll-padding-top: 100px;
}

/* Separar el título del encabezado */
.city-title {
  margin-top: 30px;
}
@media (min-width: 768px) {
  .stories-sidebar {
    margin-top: 70px; /* Incrementa o disminuye este valor según la altura de tu header */
  }
}


/* ==========================================
   TRANSICIÓN ENTRE PÁGINAS 
   ========================================== */


body {
    opacity: 0;
    transition: opacity 0.45s ease;
    background-color: #ffffff;
}

body.page-loaded {
    opacity: 1;
}

body.page-exit {
    opacity: 0;
}

/* ==========================================
   REDUCIR ANIMACIONES
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    body {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
/* El menú móvil no usa la transición global */
html.menu-page body {
    opacity: 1;
    transform: none;
    transition: none;
}