/* ========================
   RESET Y VARIABLES BLANCO/NEGRO/GRIS
   ======================== */
:root {
  --bg: #ffffff;
  --primary: #1a1a1a;
  --accent: #4a6fa5;
  --muted: #6c757d;
  --card: #f8f9fa;
  --border: #e9ecef;
  --shadow: rgba(0, 0, 0, 0.05);
  --hover: rgba(74, 111, 165, 0.08);
  --sidebar-bg: #ffffff;
  --sidebar-text: #1a1a1a;
  --sidebar-hover: rgba(74, 111, 165, 0.05);
  
  /* Degradados sutiles */
  --gradient-primary: linear-gradient(135deg, #4a6fa5 0%, #5a86c5 100%);
  --gradient-subtle: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --gradient-dark: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
  --gradient-accent: linear-gradient(135deg, #4a6fa5 0%, #6c8bc7 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg);
  color: var(--primary);
  display: flex;
  min-height: 100vh;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================
   SIDEBAR BLANCO/NEGRO CON ESTRUCTURA JERÁRQUICA
   ======================== */
.sidebar {
  width: 320px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 2.5rem 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1100;
  background: var(--primary);
  border: none;
  border-radius: 4px;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: #333333;
}

.sidebar h2 {
  font-weight: 700;
  margin-bottom: 3rem;
  color: transparent;
  background: var(--gradient-dark);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 1.8rem;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

.sidebar nav ul {
  list-style: none;
}

/* Elementos del menú */
.sidebar nav ul li {
  margin: 0.8rem 0;
  cursor: pointer;
  padding: 12px 15px;
  border-radius: 4px;
  background: transparent;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.sidebar nav ul li:hover {
  background: var(--sidebar-hover);
  transform: translateX(5px);
  border-left-color: var(--accent);
}

.sidebar nav ul li a {
  color: var(--sidebar-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0.3rem 0;
  transition: all 0.3s ease;
  font-size: 1rem;
  line-height: 1.4;
  width: 100%;
}

/* Secciones principales (sin iconos) */
.sidebar nav ul li:not(.menu-padre) a {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.05rem;
}

/* Secciones con submenús */
.menu-padre > a {
  font-weight: 600;
  color: var(--primary);
  position: relative;
}

/* Línea que se extiende al abrir el menú */
.menu-padre::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: all 0.3s ease;
}

.menu-padre.abierto::before {
  background: var(--gradient-accent);
}

/* Submenús con estilo jerárquico */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 1.5rem;
  list-style: none;
  margin-top: 8px;
}

.submenu li {
  background: transparent;
  margin: 6px 0;
  padding: 10px 15px;
  border-radius: 4px;
  border-left: 1px solid var(--border);
  transition: all 0.3s ease;
}

.submenu li:hover {
  background: var(--sidebar-hover);
  border-left-color: var(--accent);
  transform: translateX(5px);
}

.submenu li a {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  padding-left: 0;
}

.submenu li a:hover {
  color: var(--primary);
}

/* Indicador de sección abierta */
.menu-padre.abierto {
  background: var(--sidebar-hover);
  border-left-color: var(--accent);
}

.menu-padre.abierto > a {
  color: var(--primary);
}

.menu-padre.abierto .toggle-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.toggle-icon {
  margin-left: auto;
  font-size: 0.9rem;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  color: var(--accent);
}

/* Scrollbar personalizado para sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ========================
   CONTENIDO PRINCIPAL
   ======================== */
.contenido {
  margin-left: 320px;
  padding: 2.5rem;
  flex: 1;
  max-width: 1400px; /* Aumentado para más flexibilidad */
  margin: 0 auto;
  padding-left: 340px;
  transition: margin-left 0.3s ease;
}

.sidebar-oculto + .contenido {
  margin-left: 0;
  width: 100%;
  padding-left: 2.5rem;
}

/* ========================
   MOSAICO FLEXIBLE - AHORA ADMITE CUALQUIER NÚMERO DE ELEMENTOS
   ======================== */
.mosaic-container {
  width: 100%;
  margin: 3rem 0;
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Flexible */
  grid-auto-rows: 1fr;
  gap: 24px;
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
  transition: grid-template-columns 0.3s ease;
}

.mosaic-item {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2; /* Mantiene ratio fijo */
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 220px; /* Altura mínima */
}

.mosaic-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.mosaic-item:hover::before {
  opacity: 1;
}

.mosaic-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.mosaic-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

/* Contenedor Swiper dentro del mosaico */
.mosaic-content .mosaic-swiper {
  width: 100%;
  height: 100%;
}

.mosaic-content .mosaic-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
}

.mosaic-content .mosaic-swiper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.mosaic-item:hover .mosaic-swiper img {
  transform: scale(1.03);
}

/* Overlay minimalista */
.mosaic-content .mosaic-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: white;
  padding: 20px 15px 15px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
}

.mosaic-item:hover .mosaic-overlay {
  opacity: 1;
  transform: translateY(0);
}

.mosaic-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: white;
}

.mosaic-description {
  font-size: 0.85rem;
  opacity: 0.9;
  color: #eee;
  line-height: 1.4;
}

/* Controles del carrusel - solo mostrar al hover */
.mosaic-swiper .swiper-button-next,
.mosaic-swiper .swiper-button-prev {
  color: white;
  background: rgba(0,0,0,0.6);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: none;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.mosaic-swiper .swiper-button-next:after,
.mosaic-swiper .swiper-button-prev:after {
  font-size: 14px;
  font-weight: bold;
}

.mosaic-item:hover .swiper-button-next,
.mosaic-item:hover .swiper-button-prev {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mosaic-swiper .swiper-button-next:hover,
.mosaic-swiper .swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.9);
  opacity: 1;
  transform: scale(1.1);
}

.mosaic-swiper .swiper-pagination-bullet {
  background: white;
  opacity: 0.5;
  width: 7px;
  height: 7px;
}

.mosaic-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--accent);
  transform: scale(1.2);
}

/* Badge de categoría (minimalista) */
.mosaic-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gradient-accent);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.mosaic-item:hover .mosaic-counter {
  opacity: 0.9;
  transform: scale(1.1);
}

/* ========================
   ENCABEZADOS Y CONTENIDO CON DEGRADADO
   ======================== */
.epoca {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.epoca h1 {
  font-size: 2.8rem;
  color: transparent;
  background: var(--gradient-dark);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 1rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

.epoca h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.epoca .autor {
  text-align: left;
  font-style: normal;
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.epoca .intro {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 2.5rem;
  padding: 0;
}

.epoca h2 {
  color: transparent;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  margin: 2.5rem 0 1.5rem 0;
  font-weight: 600;
  font-size: 1.8rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.epoca h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, #4a6fa5, transparent);
  border-radius: 1px;
}

.epoca p {
  margin-bottom: 1.2rem;
  color: #555;
  max-width: 65ch;
}

/* ========================
   SECCIONES DESTACADAS
   ======================== */
.section-highlight {
  background: var(--gradient-subtle);
  padding: 2.5rem;
  border-radius: 12px;
  margin: 2.5rem 0;
  border-left: 4px solid #4a6fa5;
}

.gradient-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.gradient-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
  background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
}

/* ========================
   GALERÍAS CON SIMPLELIGHTBOX
   ======================== */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 2.5rem 0;
}

.galeria a {
  display: block;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
}

.galeria a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 5px 15px var(--shadow);
}

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

/* SimpleLightbox personalizado */
.sl-overlay {
  background: rgba(0, 0, 0, 0.95) !important;
}

.sl-wrapper .sl-close,
.sl-wrapper .sl-navigation button {
  color: white !important;
}

.sl-wrapper .sl-counter {
  color: white !important;
}

/* ========================
   REPRODUCTOR DE AUDIO MINIMALISTA
   ======================== */
.audio-container {
  margin: 3rem 0;
  background: var(--card);
  border-radius: 4px;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px var(--shadow);
}

.audio-player {
  max-width: 700px;
  margin: 0 auto;
}

.audio-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.audio-title {
  font-weight: 500;
  color: var(--primary);
  font-size: 1.1rem;
}

.audio-time {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.control-btn {
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.control-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(74, 111, 165, 0.2);
}

.progress-container {
  flex: 1;
  position: relative;
  height: 25px;
  display: flex;
  align-items: center;
  margin: 0 1.5rem;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 1.5px;
  cursor: pointer;
}

.progress {
  position: absolute;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 1.5px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.2s ease;
}

.progress-bar:hover .progress-handle {
  opacity: 1;
}

.volume-controls {
  display: flex;
  align-items: center;
  position: relative;
}

.volume-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--muted);
}

.volume-btn:hover {
  background: var(--hover);
  color: var(--primary);
}

.volume-slider-container {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 15px 10px;
  border-radius: 25px;
  box-shadow: 0 5px 20px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  z-index: 100;
  border: 1px solid var(--border);
}

.volume-controls:hover .volume-slider-container {
  opacity: 1;
  visibility: visible;
}

.volume-slider {
  width: 6px;
  height: 80px;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.volume-level {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  height: 80%;
  transition: height 0.1s linear;
}

/* Estados del reproductor */
.audio-player.playing .play-icon {
  display: none;
}

.audio-player.playing .pause-icon {
  display: block;
}

.audio-player.muted .volume-high {
  display: none;
}

.audio-player.muted .volume-mute {
  display: block;
}

/* ========================
   BOTONES CON DEGRADADO
   ======================== */
.btn-gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 111, 165, 0.2);
  background: linear-gradient(135deg, #5a86c5 0%, #6c8bc7 100%);
}

/* ========================
   CONTENEDORES SIN RECUADROS
   ======================== */
.contenedor-marco {
  background: transparent;
  border: none;
  padding: 0;
  margin: 3rem 0;
  box-shadow: none;
}

/* ========================
   INFORMACIÓN ADICIONAL
   ======================== */
.info-adicional {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-adicional h3 {
  color: #2d3748;
  font-weight: 600;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 15px;
}

.info-adicional h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.info-adicional ul {
  list-style: none;
}

.info-adicional li {
  margin: 0.5rem 0;
  color: #555;
  display: flex;
}

.info-adicional strong {
  min-width: 180px;
  color: var(--primary);
  font-weight: 500;
}

/* ========================
   UTILIDADES
   ======================== */
.text-muted {
  color: var(--muted);
}

.text-primary {
  color: var(--primary);
}

.text-accent {
  color: var(--accent);
}

.border-bottom {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.spacing-lg {
  margin: 3rem 0;
}

.spacing-md {
  margin: 2rem 0;
}

/* ========================
   ANIMACIONES SUTILES
   ======================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.audio-player.playing .control-btn.play-pause {
  animation: pulse 2s infinite;
}

.mosaic-item {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

/* Animación escalonada para los items del mosaico (ahora dinámica) */
.mosaic-item {
  animation-delay: calc(var(--item-index, 0) * 0.05s);
}

/* ========================
   SWIPER GALERÍA (principal + thumbs)
   Integrado con tu paleta de variables
   ======================== */

.galeria-carrusel {
  max-width: 920px;
  margin: 2.5rem auto;
}

/* Imagen grande (top) */
.swiper.gallery-top {
  width: 100%;
  height: clamp(320px, 45vw, 520px); /* responsivo */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 6px 18px var(--shadow);
}

.swiper.gallery-top .swiper-slide {
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
}

.swiper.gallery-top img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition: transform .4s ease;
  cursor: zoom-in;
}

.swiper.gallery-top .swiper-slide-active img {
  transform: scale(1.02);
}

/* Thumbs (miniaturas) */
.swiper.gallery-thumbs {
  margin-top: 14px;
  height: 96px;
  box-sizing: border-box;
  padding: 6px 6px;
}

.swiper.gallery-thumbs .swiper-slide {
  width: 110px;
  height: 84px;
  opacity: 0.6;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--card);
}

.swiper.gallery-thumbs .swiper-slide img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.swiper.gallery-thumbs .swiper-slide-thumb-active {
  opacity: 1;
  transform: translateY(-4px);
  border: 2px solid var(--accent);
  box-shadow: 0 6px 18px var(--shadow);
}

/* Botones navegación personalizados (opcionales) */
.swiper-button-next, .swiper-button-prev {
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25));
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  --swiper-navigation-size: 44px;
}

@media (max-width: 700px) {
  .swiper.gallery-thumbs { height: 84px; }
  .swiper.gallery-thumbs .swiper-slide { width: 84px; height: 64px; }
}

/* Ajustes visuales para el link dentro del slide (para GLightbox) */
.gallery-top a { display: block; width:100%; height:100%; }
.gallery-top a img { display:block; }

/* Quitar foco feo y mejorar accesibilidad */
.swiper :focus { outline: 2px solid var(--accent); outline-offset: 3px; }

/* =========================
   LIGHTBOX ESTILOS
   ========================= */
.lightbox {
  display: none; /* oculto por defecto */
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  padding: 24px;
  gap: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox-stage {
  max-width: min(1200px, 96%);
  width: 100%;
  max-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  background: #111;
}

/* Caption */
.lightbox-caption {
  margin-top: 10px;
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform .12s ease, background .12s ease;
  backdrop-filter: blur(4px);
}

.lightbox-close { position: absolute; top: 18px; right: 18px; z-index: 2010; width:48px; height:48px; border-radius:50%; font-size:1.6rem; }
.lightbox-prev { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); z-index:2010; }
.lightbox-next { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); z-index:2010; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { transform: translateY(-2px) scale(1.02); background: rgba(255,255,255,0.12); }

@media (max-width: 700px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.2rem; left: 8px; right:8px; }
  .lightbox-close { top: 12px; right: 12px; width:40px; height:40px; }
  .lightbox-stage { max-height: calc(100vh - 120px); }
}

/* Mejoras para enlaces/miniaturas */
.galeria a { display:block; }
.galeria img { cursor: zoom-in; }

/* ========================
   SWIPER MOSAICO - ESTILOS FALTANTES
   ======================== */

/* Contenedor Swiper dentro del mosaico */
.mosaic-content .mosaic-swiper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.mosaic-content .mosaic-swiper .swiper-wrapper {
  display: flex;
  height: 100%;
  width: 100%;
  transition-timing-function: ease-out;
}

.mosaic-content .mosaic-swiper .swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fade effect para transiciones */
.mosaic-swiper .swiper-slide {
  opacity: 0 !important;
  transition: opacity 0.5s ease !important;
}

.mosaic-swiper .swiper-slide-active,
.mosaic-swiper .swiper-slide-duplicate-active {
  opacity: 1 !important;
}

/* Asegurar que las imágenes llenen el slide */
.mosaic-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Paginación para mosaico */
.mosaic-swiper .swiper-pagination {
  bottom: 10px !important;
  left: 0;
  width: 100%;
  z-index: 10;
}

.mosaic-swiper .swiper-pagination-bullet {
  background: white;
  opacity: 0.5;
  width: 6px;
  height: 6px;
  margin: 0 3px !important;
}

.mosaic-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--primary);
}

/* Navegación para mosaico - solo mostrar al hover */
.mosaic-swiper .swiper-button-next,
.mosaic-swiper .swiper-button-prev {
  color: white;
  background: rgba(0, 0, 0, 0.5);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: none;
  transition: all 0.3s ease;
}

.mosaic-swiper .swiper-button-next:after,
.mosaic-swiper .swiper-button-prev:after {
  font-size: 14px;
  font-weight: bold;
}

.mosaic-swiper:hover .swiper-button-next,
.mosaic-swiper:hover .swiper-button-prev {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mosaic-swiper .swiper-button-next:hover,
.mosaic-swiper .swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* ========================
   ESTILOS ESPECÍFICOS PARA INTRO Y CORREOS
   ======================== */
.intro-principal {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #444;
  max-width: 850px;
  margin: 0 auto 2rem auto;
  text-align: justify;
  padding: 0 10px;
}

.intro-principal h3 {
  font-size: 1.1rem;
  margin-top: 1.8rem;
}

.intro-principal p {
  margin-bottom: 1rem;
}

.correo {
  color: inherit;
  text-decoration: none;
  font-style: inherit;
}

.correo:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* ========================
   RESPONSIVE DESIGN FLEXIBLE
   ======================== */
@media (max-width: 1600px) {
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    max-width: 1300px;
  }
}

@media (max-width: 1400px) {
  .sidebar {
    width: 300px;
  }
  
  .contenido {
    margin-left: 300px;
    padding-left: 320px;
    max-width: 1200px;
  }
  
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    max-width: 1100px;
  }
}

@media (max-width: 1200px) {
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    max-width: 1000px;
  }
  
  .mosaic-item {
    min-height: 200px;
  }
  
  .sidebar h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 1024px) {
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    max-width: 900px;
  }
  
  .contenido {
    padding-left: 300px;
    padding-right: 2rem;
  }
}

@media (max-width: 900px) {
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    max-width: 700px;
  }
  
  .mosaic-item {
    min-height: 180px;
  }
  
  .mosaic-overlay {
    padding: 15px 12px 12px;
  }
  
  .mosaic-title {
    font-size: 1rem;
  }
  
  .mosaic-description {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    border-right: none;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  .sidebar.mostrado {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  .contenido {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 80px;
    padding-left: 1.5rem;
    max-width: 100%;
  }
  
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-width: 100%;
  }
  
  .mosaic-item {
    aspect-ratio: 3/2;
    min-height: 160px;
  }
  
  .epoca {
    padding: 0;
  }
  
  .epoca h1 {
    font-size: 2.2rem;
  }
  
  .epoca h2 {
    font-size: 1.5rem;
  }
  
  .section-highlight {
    padding: 1.5rem;
  }
  
  .gradient-card {
    padding: 1.5rem;
  }
  
  .galeria {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Ajustes específicos para móvil */
  .mosaic-counter {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    top: 8px;
    right: 8px;
  }
  
  .mosaic-overlay {
    padding: 12px 10px 10px;
    opacity: 0.9; /* Más visible en móvil */
  }
  
  .mosaic-title {
    font-size: 0.95rem;
  }
  
  .mosaic-description {
    font-size: 0.75rem;
  }
}

@media (max-width: 640px) {
  .mosaic-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  
  .mosaic-item {
    min-height: 140px;
  }
  
  .audio-container {
    padding: 1.5rem;
  }
  
  .audio-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .audio-time {
    align-self: flex-end;
  }
  
  .epoca h1 {
    font-size: 1.8rem;
  }
  
  .progress-container {
    margin: 0 1rem;
  }
  
  .galeria {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .mosaic-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .mosaic-item {
    min-height: 200px; /* Más alto en móvil para mejor visibilidad */
    max-width: 100%;
  }
  
  .mosaic-title {
    font-size: 1rem;
  }
  
  .mosaic-description {
    font-size: 0.85rem;
  }
  
  .control-btn {
    width: 45px;
    height: 45px;
  }
  
  .volume-btn {
    width: 35px;
    height: 35px;
  }
  
  .intro-principal {
    text-align: left; /* Mejor lectura en móvil */
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .mosaic-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .mosaic-item {
    min-height: 180px;
  }
  
  .contenido {
    padding: 1rem;
    padding-top: 70px;
  }
}

/* ========================
   AJUSTES PARA NÚMEROS IMPARES DE ELEMENTOS
   ======================== */
.mosaic-grid:has(.mosaic-item:only-child) {
  grid-template-columns: 1fr;
  max-width: 500px;
}

.mosaic-grid:has(.mosaic-item:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
  max-width: 700px;
}

/* ========================
   MEJORAS DE ACCESIBILIDAD
   ======================== */
@media (prefers-reduced-motion: reduce) {
  .mosaic-item,
  .control-btn,
  .sidebar nav ul li,
  .toggle-icon,
  .gradient-card,
  .mosaic-swiper img {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  
  .audio-player.playing .control-btn.play-pause {
    animation: none;
  }
}

/* Focus states para accesibilidad */
.mosaic-item:focus,
.galeria a:focus,
.control-btn:focus,
.sidebar nav ul li a:focus,
.btn-gradient:focus,
.swiper-button-next:focus,
.swiper-button-prev:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.3);
}

/* Mejor contraste para texto */
.mosaic-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.6), transparent);
}

/* Clase para ocultar visualmente pero mantener accesibilidad */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================
   MEJORAS DE RENDIMIENTO
   ======================== */
.mosaic-swiper img {
  will-change: transform;
  backface-visibility: hidden;
}

/* ========================
   ESTADOS DE CARGA
   ======================== */
.mosaic-item.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================
   ESTILOS PARA CATEGORÍA EN OVERLAY
   ======================== */
.mosaic-category {
  font-size: 0.7rem !important;
  margin-top: 5px !important;
  opacity: 0.8 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  letter-spacing: 0.3px;
}
#sidebarToggle {
    display: none !important;
}