/* IMPORTAMOS LAS FUENTES:
   - Montserrat (para placeholders o nombres grandes)
   - Poppins (para descripciones y texto adicional)
*/
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Poppins&display=swap');

/* =======================================================
   PALETA DE COLORES Y VARIABLES
   ======================================================= */
:root {
  --color-bg: #e4e0d4;         /* Fondo de la web */
  --color-primary: #3f5c4e;    /* Verde grisáceo oscuro */
  --color-secondary: #00a98f;  /* Turquesa/teal */
  --color-accent: #37c7bb;     /* Turquesa más claro (opcional) */
  --color-text: #1E1E1E;       /* Texto principal */
  --color-card-bg: #FFFFFF;    /* Fondo de las tarjetas/footer */
  --color-card-shadow: rgba(0,0,0,0.1);
  --radius: 8px;               /* Radio de bordes */
}

/* =======================================================
   RESET BÁSICO
   ======================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =======================================================
   BODY
   ======================================================= */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: "Segoe UI", Arial, sans-serif;
}

/* =======================================================
   CABECERA CON IMAGEN (HEADER HERO)
   ======================================================= */
.header-hero {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Capa superpuesta semitransparente */
.header-overlay {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-content {
  display: flex;
  flex-direction: row; 
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  width: 90%;
  color: #fff;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  width: 80px;
  height: auto;
  border-radius: 50%;
}

.title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.title-block h1 {
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.subtitle {
  font-size: 1rem;
}

/* =======================================================
   CONTENEDOR PRINCIPAL (MAIN)
   ======================================================= */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* =======================================================
   SECCIONES DE REGIONES (INDEX, PAISES, CONFEDERACIONES)
   ======================================================= */
.section-regiones {
  margin-bottom: 2rem;
}

.section-regiones h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

/* =======================================================
   GRID DE TARJETAS (INDEX / RIOS)
   ======================================================= */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
/* TARJETA PARA REGIONES / RÍOS */
.region-card {
  background-color: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px var(--color-card-shadow);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.region-card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px var(--color-card-shadow);
}

/* Contenedor de la imagen (o placeholder) con relación 16:9 */
.region-image-container {
  width: 100%;
  aspect-ratio: 16/9; 
  background-color: #ccc;
  flex-shrink: 0;
}

.region-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Placeholder (gris) si no hay imagen */
.region-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  font-size: 3rem;
  font-family: 'Montserrat', sans-serif;
  color: #555;
  padding: 0.5rem;
}

/* Ajustes para dispositivos móviles */
@media (max-width: 768px) {
  .region-image-container {
    aspect-ratio: auto;
    height: 150px;
  }
  .region-image-placeholder {
    font-size: 2rem;
  }
}

/* CONTENIDO DE LA TARJETA (descripción) */
.region-content {
  padding: 1rem;
  text-align: center;
}

.region-content p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  font-family: 'Poppins', sans-serif;
}

/* =======================================================
   FOOTER
   ======================================================= */
.main-footer {
  margin-top: 2rem;
  background-color: var(--color-card-bg);
  padding: 1rem;
  box-shadow: 0 -2px 10px var(--color-card-shadow);
}

/* DISCLAIMER */
.disclaimer {
  background-color: var(--color-card-bg);
  padding: 1rem;
  border-radius: var(--radius);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.disclaimer h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.disclaimer p {
  margin-bottom: 1rem;
}

/* COPYRIGHT */
.footer-copy {
  text-align: center;
  font-size: 0.9rem;
  color: #555;
}

/* =======================================================
   ESTILOS RESPONSIVE
   ======================================================= */
@media (max-width: 768px) {
  .header-hero {
    height: 180px;
  }
  .title-block h1 {
    font-size: 1.4rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }
  .header-content {
    flex-direction: column; 
    align-items: center;
  }
}

/* =======================================================
   ESTILOS PARA TRAMOS (tramos.php)
   ======================================================= */
.section-tramos {
  margin-bottom: 2rem;
}

.section-tramos h2 {
  /* Hereda estilos globales */
}

/* Grid para las tarjetas de tramos */
.tramo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Tarjeta individual para cada tramo */
.tramo-card {
  background-color: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px var(--color-card-shadow);
  text-decoration: none;
  color: var(--color-text);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.tramo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px var(--color-card-shadow);
}

/* Nombre del tramo */
.tramo-name {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif; 
}

/* Dificultad, Distancia, Tiempo */
.tramo-difficulty,
.tramo-distance,
.tramo-time {
  margin-bottom: 0.3rem;
  font-family: 'Poppins', sans-serif; 
  font-size: 1rem;
  color: var(--color-text);
}

/* Check de "hecho" en la esquina inferior derecha */
.tramo-check {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
}

.tramo-check img {
  width: 100%;
  height: auto;
}

/* =======================================================
   DETALLE: BLOQUES Y LIGHTBOX
   ======================================================= */

/* Contenedor principal para detalle.php */
.detalle-container {
  margin-bottom: 2rem;
}

/* Bloques con fondo blanco y margen */
.detalle-block {
  background-color: var(--color-card-bg);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px var(--color-card-shadow);
}

.detalle-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

/* Historial (tabla) y Waypoints (tabla) */
.detalle-historial {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.detalle-historial th,
.detalle-historial td {
  border: 1px solid #ddd;
  padding: 0.5rem;
}

.detalle-historial thead {
  background-color: #f0f0f0;
}

/* Lightbox Overlay para imágenes */
.lb-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lb-overlay.active {
  display: flex;
}

.lb-content {
  position: relative;
  max-width: 80%;
  max-height: 80%;
}

.lb-img {
  max-width: 85%;
  max-height: 85%; /* Para que no se salga vertical */
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.lb-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: bold;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.lb-prev {
  left: 20px;
}

.lb-next {
  right: 20px;
}

/* Imágenes mini con cursor pointer (dedito) */
.detalle-images img {
  max-width: 200px;
  margin-right: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
}

.detalle-map {
  margin-bottom: 1rem;
  overflow: hidden;
}

@media (max-width: 768px) {
  .lb-prev {
    font-size: 1.5rem;
    left: -30px;
  }
  .lb-next {
    font-size: 1.5rem;
    right: -30px;
  }
  .lb-close {
    top: -30px;
    font-size: 1.5rem;
  }
}

