/* ===================================================================
   historias-index.css
   Estilos para el “Índice de Historias” (biblioteca) — Tema Naranja
   =================================================================== */

/* —————— Variables de color —————— */
:root {
  /* Naranjas “biblioteca” */
  --naranja-oscuro:  #e65100;
  --naranja-medio:   #ff6f00;
  --naranja-claro:   #ffcc80;
  --naranja-suave:   #fff3e0;

  /* Neutros */
  --texto-principal:  #333333;
  --texto-secundario: #666666;
  --blanco:           #ffffff;
}

/* —————— Reset básico —————— */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* —————— Base del cuerpo —————— */
body.stories-index {
  font-family: "Georgia", serif;
  background-color: var(--naranja-suave);
  color: var(--texto-principal);
  line-height: 1.6;
}

/* —————— Contenedor general —————— */
.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* ===================================================================
   Navegación superior de la biblioteca
   =================================================================== */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  background: var(--naranja-medio);
}

/* Botones “portal” con efecto glow */
.btn-portal.glow {
  background: linear-gradient(
    135deg,
    var(--naranja-oscuro),
    var(--naranja-medio),
    var(--naranja-claro)
  );
  color: var(--blanco);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(255,111,0,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-portal.glow:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255,111,0,0.9);
}

/* ===================================================================
   Banner en índice de historias
   =================================================================== */
.main-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 400px;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.main-banner .banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  transition: transform 0.5s ease;
}

.main-banner:hover .banner-img {
  transform: scale(1.05);
}

/* ===================================================================
   Encabezado de sección
   =================================================================== */
.stories-header {
  text-align: center;
  margin-bottom: 2rem;
}
.stories-header h1 {
  font-family: "Modern Love", cursive;
  font-size: 2.8rem;
  color: var(--naranja-oscuro);
  margin-bottom: 0.5rem;
}
.stories-header p {
  color: var(--texto-secundario);
  font-size: 1.1rem;
}

/* ===================================================================
   Grid de historias
   =================================================================== */
.stories-library {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ===================================================================
   Tarjeta de historia individual
   =================================================================== */
.story-card {
  background-color: var(--blanco);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.story-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.story-card-content {
  flex: 1;
  padding: 1rem;
}
.story-card-content h3 {
  font-family: "Modern Love", cursive;
  color: var(--naranja-oscuro);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.story-card-content p {
  color: var(--texto-secundario);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ===================================================================
   Acciones de la tarjeta (Leer / Escuchar)
   =================================================================== */
.story-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  padding: 1rem;
}
.story-card-actions a {
  flex: 1 1 auto;
  text-align: center;
  background-color: var(--naranja-medio);
  color: var(--blanco);
  border: 2px solid var(--naranja-medio);
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s, color 0.2s;
}
.story-card-actions a:hover {
  background-color: var(--naranja-claro);
  color: var(--naranja-oscuro);
}

/* ===================================================================
   Footer de la sección
   =================================================================== */
.stories-footer {
  text-align: center;
  margin-top: 3rem;
}
.stories-footer p {
  color: var(--texto-secundario);
  font-size: 0.9rem;
}

/* ===================================================================
   Responsive tweaks
   =================================================================== */
@media (max-width: 576px) {
  .story-card img {
    height: 140px;
  }
  .story-card-content h3 {
    font-size: 1.2rem;
  }
}
