/* ============================
   Estilos Recetario BioGranja 51
   ============================ */

/* Hero Recetario */
.hero-recetario {
  background: url("/img/recetario-hero.jpg") center/cover no-repeat;
  color: white;
  text-align: center;
  padding: 80px 20px;
  height: 30vh;
}

.hero-recetario h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.hero-recetario h4 {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Texto introductorio */
.texto-recetario {
  text-align: center;
  margin: 60px auto 40px auto;
  max-width: 800px;
  padding: 0 20px;
}

.texto-recetario h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--verde);
}

.texto-recetario p {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
}

/* Grid de recetas */
.recetas-grid {
  display: grid;
  grid-template-columns: repeat(3, 320px); /* exactamente 3 columnas de 320px */
  gap: 28px;
  padding: 20px;
  justify-content: center;   /* centra las columnas dentro del contenedor */
  align-items: start;
  max-width: 1200px;         /* ancho máximo para mantener lectura cómoda */
  margin: 0 auto 80px auto;  /* centra todo el grid en la página */
  box-sizing: border-box;
}

/* Ajustes responsivos */
@media (max-width: 1024px) {
  .recetas-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr)); /* 2 columnas en tablets/portátiles pequeños */
    max-width: 920px;
    gap: 22px;
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .recetas-grid {
    grid-template-columns: 1fr; /* 1 columna en móviles */
    max-width: 520px;
    padding: 12px;
    gap: 18px;
  }
}

/* Card receta — aspecto más profesional */

/* Card receta */
/* Card receta — aspecto más profesional */
.receta-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(10, 10, 10, 0.06);
  transition: transform 0.28s cubic-bezier(.2,.9,.3,1), box-shadow 0.28s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.04);
  min-height: 100%;
}

.receta-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(10, 10, 10, 0.10);
}


.receta-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.receta-card-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.receta-card-content h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--negro);
  line-height: 1.2;
}

.receta-card-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.45;
}

.receta-card .preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  pointer-events: none;
}

.btn-receta {
  margin-top: 12px;
  align-self: start;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--verde);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s;
  box-shadow: 0 6px 18px rgba(22, 160, 83, 0.08);
}

.btn-receta:hover {
  transform: translateY(-2px);
  background: #3aa05a;
}

/* Modal Receta */
/* --- Modal: mostrar cuando tenga la clase .show --- */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  overflow-y: auto;
  padding: 40px 20px;
  align-items: center;
  justify-content: center;
}

/* cuando el modal tenga .show se muestra como flex centrado */
.modal.show {
  display: flex;
}

/* contenido del modal con scroll si es muy alto */
.modal .modal-content {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

/* close estilizado */
.modal .close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 28px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal .close:hover {
  color: #c0392b;
}

/* ajustes para imagen dentro del modal */
#modal-imagen {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* asegúrate de que la card use la clase coincidente */
.receta-card .receta-card-content {
  padding: 15px;
}

.modal .modal-content h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.6rem;
  color: var(--verde);
}
.modal .modal-content h3 {
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--negro);
  font-size: 1.05rem;
}


.close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 28px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: var(--rojo);
}

/* Animación modal */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
