body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  padding: 20px;
}

h1 {
  text-align: center;
}

#grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.card {
      flex: 1 1 300px;   /* base 300px, se achican y envuelven */
  max-width: 360px; /* evita que se estiren demasiado */
  background: white;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  height: 100%;
}
@media (max-width: 480px) {
  .card {
    max-width: 100%;
  }
}
/* Imagen uniforme */
.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

/* Botón ver imagen */
.btn-imagen {
  margin: 10px 0;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: #444;
  color: white;
  cursor: pointer;
}

/* Contenido flexible */
.contenido {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contenido h3 {
  margin: 6px 0;
  font-size: 18px;
}

.direccion {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 6px;
}

/* Texto largo controlado */
.descripcion {
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

/* Botón votar siempre abajo */
.btn-votar {
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #c62828;
  color: white;
  cursor: pointer;
}

/* Visor fullscreen */
.visor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.visor img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 10px;
}

#cerrar {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

.oculto {
  display: none;
}
.votos {
  margin-top: 10px;
  font-size: 15px;
  font-weight: bold;
  color: #2e7d32;
  text-align: center;
}
.btn-votar:disabled {
  background: #aaa;
  cursor: not-allowed;
}
.descripcion {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Estado CORTO */
.descripcion.corta {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* Estado LARGO (explícito) */
.descripcion.larga {
  overflow: visible;
  display: block;
  -webkit-line-clamp: unset;
}

/* Botón leer más */
.btn-leer-mas {
  margin-top: 6px;
  padding: 6px;
  background: none;
  border: none;
  color: #1565c0;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.btn-leer-mas:hover {
  text-decoration: underline;
}
