:root {
  --color-primario: #1a5d1a;
  --color-secundario: #2C3E50;
  --color-terciario: #d4af37;
  --color-fondo: #f0f8f0;
  --color-texto: #333;
  --color-texto-claro: #F5F5F0;
  --color-borde: #cccccc;
  --color-picks: #e74c3c;
  --color-bonos: #2ecc71;
  --color-estrategias: #3498db;
  --color-partidos: #9b59b6;
  --sombra: 0 4px 12px rgba(0, 0, 0, 0.1);
  --sombra-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
  --radio-borde: 12px;
  --radio-borde-peq: 6px;
}

/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--color-fondo);
  color: var(--color-texto);
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== CABECERA ===== */
.cabecera {
  text-align: center;
  background: linear-gradient(135deg, 
      #0f172a 0%,
      #1e293b 50%,
      #334155 100%
  );
  color: #f1f5f9;
  font-family: 'Montserrat', sans-serif;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.cabecera::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
      transparent,
      #3b82f6,
      #8b5cf6,
      #3b82f6,
      transparent
  );
  animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.cabecera h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.5px;
}

.subtitulo {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  opacity: 0.9;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  margin-top: 0.5rem;
}

/* ===== NAVEGACIÓN ===== */
.navegacion {
  background-color: var(--color-secundario);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 15px rgba(0,0,0,0.15);
}

.lista-nav {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.lista-nav li {
  margin: 0;
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.lista-nav a {
  display: block;
  padding: clamp(0.9rem, 2vw, 1.1rem) clamp(1rem, 3vw, 1.5rem);
  color: var(--color-texto-claro);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  height: 100%;
}

.lista-nav a:hover {
  background-color: rgba(212, 175, 55, 0.1);
  border-bottom-color: var(--color-terciario);
  color: var(--color-terciario);
}

.lista-nav a.active {
  background-color: var(--color-primario);
  border-bottom-color: var(--color-terciario);
  font-weight: 600;
}

/* ===== CONTENIDO PRINCIPAL ===== */
main {
  flex: 1;
  width: 100%;
}

#titulo-posts {
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  background-color: white;
  color: var(--color-primario);
  padding: 1.5rem;
  margin: 2rem auto 1.5rem;
  max-width: 1200px;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra);
  border-left: 5px solid var(--color-terciario);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

/* ===== POSTS CONTAINER ===== */
#posts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ===== POST INDIVIDUAL CLICKEABLE ===== */
.post {
  background-color: white;
  border-radius: var(--radio-borde);
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.post:hover {
  transform: translateY(-8px);
  box-shadow: var(--sombra-hover);
}

/* ENLACE PRINCIPAL */
.post-link {
  text-decoration: none;
  color: inherit;
  display: block;
  flex-grow: 1;
}

/* CONTENEDOR DE IMAGEN */
.post-image-container {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.post-imagen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post:hover .post-imagen {
  transform: scale(1.05);
}

/* BADGE DE CATEGORÍA */
.post-categoria-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--color-picks);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  z-index: 2;
}

/* SIN IMAGEN */
.sin-imagen {
  height: 200px;
  background: linear-gradient(135deg, #1a237e 0%, #00C853 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sin-imagen-texto {
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
  text-shadow: 0 2px 5px rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

/* CONTENIDO DEL POST */
.post-content {
  padding: 1.8rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-content h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.4rem;
  margin: 0 0 1rem 0;
  color: var(--color-secundario);
  line-height: 1.3;
  font-weight: 700;
  transition: color 0.3s;
}

.post:hover .post-content h3 {
  color: var(--color-primario);
}

.post-excerpt {
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* META INFO PREVIEW */
.post-meta-preview {
  display: flex;
  gap: 15px;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  color: #777;
}

.post-author, .post-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* BOTÓN LEER MÁS */
.leer-mas-btn {
  display: inline-block;
  color: var(--color-primario);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 0;
  border-top: 2px solid #f0f0f0;
  margin-top: auto;
  transition: all 0.3s;
  text-align: center;
}

.post:hover .leer-mas-btn {
  color: var(--color-terciario);
  border-top-color: var(--color-terciario);
  transform: translateX(5px);
}

/* FOOTER DEL POST */
.post-footer {
  padding: 1.2rem 1.8rem;
  background: linear-gradient(to right, #f9f9f9, #f0f8f0);
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-stats {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: #666;
}

.post-likes, .post-views {
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  padding: 5px 12px;
  border-radius: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* TAGS */
.post-tags {
  display: flex;
  gap: 8px;
}

.post-tag {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== MENSAJES ESPECIALES ===== */
.post-loading {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.no-posts {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra);
  grid-column: 1 / -1;
}

.no-posts h3 {
  color: var(--color-secundario);
  margin-bottom: 10px;
}

.no-posts p {
  color: #666;
}

.error-loading {
  text-align: center;
  padding: 60px 20px;
  background: #fee;
  border: 1px solid #f99;
  border-radius: var(--radio-borde);
  grid-column: 1 / -1;
}

.error-loading h3 {
  color: #c00;
  margin-bottom: 10px;
}

/* ===== ELEMENTOS DE CONTENIDO ENRIQUECIDO ===== */

/* Subtítulos dentro del post (en línea) */
.subtitulo-post {
  color: var(--color-primario);
  border-left: 4px solid var(--color-terciario);
  padding-left: 15px;
  margin: 30px 0 15px 0;
  font-size: 1.4rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* Imágenes dentro del post */
.imagen-post {
  margin: 25px 0;
  text-align: center;
}

.imagen-post img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto;
}

.leyenda-imagen {
  color: #666;
  font-size: 0.9rem;
  margin-top: 8px;
  font-style: italic;
}

/* Botones de afiliado */
.btn-afiliado {
  display: inline-block;
  padding: 12px 25px;
  margin: 20px 0;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.btn-verde {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
}

.btn-naranja {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white;
}

.btn-azul {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.btn-rojo {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.btn-afiliado:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Contenedor de botones centrados */
.contenedor-botones {
  text-align: center;
  margin: 30px 0;
}

/* ===== FOOTER GLOBAL ===== */
footer {
  background-color: var(--color-secundario);
  color: var(--color-texto-claro);
  text-align: center;
  padding: 2.5rem 1rem;
  margin-top: auto;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer-content a {
  color: var(--color-terciario);
  text-decoration: none;
  margin: 0 10px;
  transition: opacity 0.3s;
}

.footer-content a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-advertencia {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 1.2rem auto 0;
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.2rem;
  max-width: 600px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  #posts-container {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .lista-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .lista-nav::-webkit-scrollbar {
    height: 4px;
  }
  
  .lista-nav::-webkit-scrollbar-thumb {
    background: var(--color-terciario);
    border-radius: 2px;
  }
  
  .lista-nav a {
    white-space: nowrap;
    padding: 0.8rem 1rem;
  }
  
  #posts-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    padding: 0 1rem 2rem;
  }
  
  .post-image-container,
  .sin-imagen {
    height: 180px;
  }
  
  .post-content {
    padding: 1.4rem;
  }
  
  .post-footer {
    padding: 1rem 1.4rem;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  /* Contenido enriquecido responsive */
  .subtitulo-post {
    font-size: 1.2rem;
  }
  
  .btn-afiliado {
    display: block;
    width: 100%;
    margin: 15px 0;
  }
}

@media (max-width: 480px) {
  .cabecera {
    padding: 1.5rem 1rem;
  }
  
  .cabecera h1 {
    font-size: 1.6rem;
  }
  
  .subtitulo {
    font-size: 0.9rem;
  }
  
  #posts-container {
    grid-template-columns: 1fr;
    padding: 0 1rem 2rem;
  }
  
  #titulo-posts {
    margin: 1.5rem auto 1rem;
    padding: 1.2rem;
    font-size: 1.3rem;
  }
  
  .post-content h3 {
    font-size: 1.2rem;
  }
}
