:root {
  --primary-blue: #00818f;
  --light-blue: #a3d3d7;
  --yellow: #F9CD56;
  --gray-bg: #f4f7f6;
  --color-texto: #383737;
  --fondo-azul: hsla(186, 100%, 28%, 0.1);
  --primary-color: #0c7575;
  --bg-teal: #C1E1E1;
  --header-teal: #A0CECE;
  --bg-white: #FFFFFF;
  --accent-yellow: #F7C653;
  --text-dark: #333333;
  --text-muted: #666666;
  --border-gray: #E0E0E0;
  --footer-bg: #F8F9FA;
  --font-main: 'Lato', sans-serif;
  --font-cursive: 'Cookie', cursive; }

body {
  font-family: 'Lato', sans-serif;
  margin: 0;
  background-color: #fff; }

.container { 
  width: 90%; 
  max-width: 90%; 
  margin: auto; 
  padding: 40px 0; }

/* Banner */
.hero-banner {
  height: 300px;
  background: url('/sites/default/files/descubre_calpe/2026-04/banner_100_anos_historia_calp.png') center/cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45vh; }

.titles {
  display: flex;
  flex-direction: column;
  align-items: center; 
  gap: 10px; }

.title-top, .title-bottom {
  background-color: var(--yellow); 
  color: var(--color-texto);      
  margin: 0;
  width: fit-content;
  font-family: 'Cookie', sans-serif;
  font-weight: 400;
  line-height: 1; }

.title-top {
  padding: 5px 100px;
  font-size: 5em; }

.title-bottom {
  padding: 10px 40px;  
  font-size: 5.5em; }

.subtitulo{
  font-size: 1.8em;
  font-family: "Lato", sans-serif;
  font-weight: 600;
  color: var(--primary-blue); }

/* Estilos TimelineJS */
.tl-headline {
  color: var(--primary-blue) !important;
  font-family: "Lato", sans-serif !important; }

.tl-headline:hover {
    /* color: var(--bg-white) !important; */
}

.timeline-embed-wrapper {
  position: relative; }

.timeline-context-actions {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none; }

.timeline-media-btn {
  pointer-events: auto;
  padding: 7px 12px;
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.82em;
  line-height: 1.2;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer; }

.timeline-media-btn:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
  cursor: pointer; }

.tl-timemarker-content-container:hover .tl-timemarker-content,
.tl-timemarker-content-container:hover .tl-timemarker-content * {
  background-color: var(--primary-blue) !important;
  color: white !important; }

.tl-timegroup .tl-timegroup-message{
  color: var(--primary-blue) !important; }

/* Tabs */
.filter-tabs { 
  display: flex; 
  justify-content: center;
  gap: 15px; 
  margin-bottom: 30px; 
  flex-wrap: wrap; } /* Permite saltar a la siguiente fila si falta espacio */

.tab {
  padding: 12px 100px;
  border: 2px solid var(--primary-blue);
  border-radius: 30px;
  background: none;
  color: var(--primary-blue);
  cursor: pointer;
  font-family: "Lato", sans-serif;
  font-size: 1.2em; }

.historia-main-tabs .tab,
.historia-sub-tabs .tab {
  padding: 12px 36px;
  min-width: 170px; }

.tab.active { 
  background: var(--primary-blue); 
  color: white; }

/* Timeline */
.timeline-container {
  position: relative;
  padding: 40px 0;
  margin-bottom: 20px; }

.timeline-line {
  height: 2px;
  background: lightgrey;
  width: 94%;
  position: absolute;
  top: 23.5%;
  margin-left: 3%; }

.timeline-points {
  display: flex;
  justify-content: space-between;
  position: relative; }

.point {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 150px;
  position: relative;
  cursor: pointer;
  align-items: center; }

.point span:first-child {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--primary-blue);
  margin-bottom: 5px; }

.point span.texto:first-child {
  width: 100%;
  border-bottom: 4px dotted var(--light-blue);
  padding-bottom: 5px;
  margin-bottom: 10px; }

.point span:nth-child(2) {
  font-size: 1.8em;
  color: var(--primary-blue);
  line-height: 1.2;
  margin-bottom: 15px; }

.dot {
  align-self: center; }

.point::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  background: var(--yellow);
  border-radius: 50%;
  margin: -10px auto 10px;
  order: 3; 
  margin: 15px auto 0; }

.point:hover::before,
.point.active::before {
  background: var(--primary-blue);
  transform: scale(1.2);
  transition: all 0.3s ease; }

.year-detail {
  background: var(--fondo-azul);
  padding: 30px;
  margin-top: 40px; }

/* Estilos del carrusel mini (Detalles) */
.carousel-container {
  position: relative; /* Para posicionar flechas absolutas */
  width: 95%;
  margin: 20px auto;
  text-align: center; }

.image-gallery-mini {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  justify-content: flex-start; } /* Alineación inicial */

.image-gallery-mini::-webkit-scrollbar { 
  display: none; } /* Chrome/Safari */

/* Estilos para etiquetas dinámicas (Hover) y Botón de compartir */
.gallery-item-photo, .doc-item, .card-image-placeholder, .period-media-item {
  position: relative;
  overflow: hidden;
  cursor: pointer; }
.photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 129, 143, 0.9);
  color: white;
  padding: 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  font-family: var(--font-main);
  pointer-events: none;
  z-index: 2; }
.gallery-item-photo:hover .photo-overlay, .doc-item:hover .photo-overlay, .card-image-placeholder:hover .photo-overlay, .period-media-item:hover .photo-overlay {
  transform: translateY(0); }

.share-btn-overlay {
  position: absolute;
  top: 10px; right: 10px;
  background: white;
  color: var(--primary-blue);
  width: 35px; height: 35px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

.gallery-item-photo:hover .share-btn-overlay, .doc-item:hover .share-btn-overlay, .card-image-placeholder:hover .share-btn-overlay, .period-media-item:hover .share-btn-overlay {
  opacity: 1; }

.carousel-img {
  width: calc((100% - 30px) / 3); /* 3 fotos en escritorio (restando gaps) */
  flex-shrink: 0; /* Evita que se encojan */
  height: 300px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer; }

/* Puntos del mini carrusel */
/* Ocultar en escritorio si hay pocas fotos (clase añadida por JS) */
.hide-dots-desktop .mini-carousel-dots {
  display: none; }

.mini-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px; }

.mini-dot {
  width: 10px;
  height: 10px;
  background-color: #ccc;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease; }

.mini-dot.active { 
  background: var(--primary-blue); 
  transform: scale(1.2); }

.placeholder-img { 
  height: 150px; 
  background: #ccc; 
  border-radius: 5px; }

/* Multimedia Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px; }

.gallery-item { 
  height: 200px; 
  background: var(--light-blue); }

/* Lógica para ocultar/mostrar pestañas */
.tab-content {
  display: none; }

.tab-content.active {
  display: block; }

.timeline-line {
  top: auto;
  bottom: 48px;
  width: 0;
  left: 0;
  margin-left: 0;
  pointer-events: none; }

.texto{
  font-size: 1.5em;
  font-family: "Lato", sans-serif;
  color: var(--primary-blue); }

.textoanos{
  font-size: 2.5em;
  font-family: "Lato", sans-serif;
  color: var(--primary-blue);
  padding: 0px !important;
  font-weight: bold;
  border-bottom: 5px dotted var(--light-blue); }

.detalles{
  font-size: 1.2em;
  font-family: "Lato", sans-serif;
  font-weight: 400; }

.cajadetalles{
  width: 95%; 
  margin: 10px auto; 
  display: flex;
  flex-direction: column; /* Para que el texto no se ponga uno al lado de otro */
  justify-content: center;
  align-items: center; }

.detail-header {
  display: flex;  
  justify-content: space-between; 
  align-items: center;       
  width: 100%; }

.btn-download{
  background-color: transparent;
  border-radius: 30px;
  border:solid lightgray 1px;
  font-size: 1.2em;
  font-family: "Lato", sans-serif;
  padding: 0.5% 2%; }

.btn-download:hover{
  background-color: var(--yellow);
  border-color: black; }

.testimonio {
  width: 85%; 
  padding: 2%; 
  background-color: #8DC9CF;
  margin: 20px auto; 
  display: flex;
  flex-direction: column;
  border-radius: 4px; }

.textotestimonio{
  font-style: italic;
  font-family: "Lato", sans-serif; }

/* Puntos de navegación */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px; }

.dot-item {
  width: 12px;
  height: 12px;
  background-color: #ccc;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer; }

.dot-item.active {
  background-color: var(--primary-blue); } /* El azul de tu proyecto */

.subtituloh3{
  font-family: "Lato", sans-serif;
  font-size: 1.5em; }

/* Contenedor del Carrusel */
.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center; }

.carousel-container-cards {
  display: flex;
  gap: 30px;
  overflow-x: auto; /* Permite scroll horizontal */
  scroll-behavior: smooth;
  scrollbar-width: none; /* Oculta scroll en Firefox */
  width: 100%; } /* Asegura que el contenedor ocupe todo el ancho disponible */

.periodo-card {
  flex: 0 0 auto;
  width: 380px;
  max-width: 380px;
  background-color: #e0f0f1; /* Fondo azul muy claro de la imagen */
  padding: 25px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  position: relative; }

.periodo-card .card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; } /* Permite que el flex-item se encoja */

.periodo-card .card-divider {
  margin: 10px 0; }

.periodo-card .card-list {
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 15px;
  padding-right: 5px;
  min-height: 0; }

.periodo-card .card-list li::before {
  content: unset; } /* jperles */

.carousel-container-cards::-webkit-scrollbar { 
  display: none; } /* Oculta scroll en Chrome/Safari */

.card-image-placeholder {
  width: 100%;
  height: 190px;
  background-color: #8dc9cf; 
  background-size: cover; 
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 12px; }

/* Cabecera de la tarjeta */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  color: var(--primary-blue); }

.card-title-group h3 {
  margin: 0;
  font-size: 1.2em;
  letter-spacing: 1px; }

.card-title-group .subtitle {
  margin: 5px 0 0 0;
  font-style: italic;
  font-size: 1.1em; }

.card-divider {
  border-top: 2px dotted var(--primary-blue);
  margin: 10px 0;
  width: 100%; }

/* Lista de puntos */
.card-list {
  list-style: none;
  padding: 0;
  margin-bottom: 25px; }

.card-list li {
  display: flex;
  align-items: flex-start; /* Alinea el punto arriba */
  gap: 15px;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.95em; }

.card-list li p {
  margin: 0;
  line-height: 1.35; }

.list-dot {
  width: 10px;
  height: 10px;
  background-color: var(--primary-blue);
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  margin-top: 0.45em; }

/* Botones de la tarjeta */
.card-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
  margin-top: auto;
  flex-shrink: 0; }

.card-buttons .btn-full {
  grid-column: auto;
  width: 100%;  
  margin: 0 auto; }

.btn-outline {
  background: white;
  border: 1.5px solid #555;
  border-radius: 20px;
  padding: 7px 10px;
  font-size: 0.82em;
  cursor: pointer;
  color: #333;
  transition: 0.3s; }

.btn-outline:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue); }

/* Flechas */
.carousel-arrow {
  background: none;
  border: none;
  font-size: 2em;
  cursor: pointer;
  color: #999;
  padding: 10px;
  z-index: 10;
  display: none; } /* Ocultar por defecto en escritorio */

.period-scrollbar-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 20px 0 0 0;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; }

.period-scrollbar {
  width: 95%;
  max-width: 930px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-blue) 35%, #d8d8d8 35%, #d8d8d8 100%);
  appearance: none;
  outline: none;
  cursor: pointer; }

.period-scrollbar::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-blue);
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  margin-top: -4px; }

.period-scrollbar::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-blue);
  box-shadow: 0 0 4px rgba(0,0,0,0.2); }

/* Contenedor de Controles (Buscador y Pastillas) */
.gallery-controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px; }

/* Oculta por completo el párrafo que contiene el select */
.gallery-controls p {
  display: none; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 83%; } /* O el ancho que prefieras */

.search-box input {
  width: 100%;
  padding: 12px 20px 12px 45px; /* 45px a la izquierda para dejar sitio al icono */
  border-radius: 30px;
  border: 2px solid var(--primary-blue);
  outline: none;
  font-family: "Lato", sans-serif;
  font-size: 1em; }

.search-icon {
  position: absolute;
  left: 15px;      /* Espacio desde el borde izquierdo */
  display: flex;
  align-items: center;
  width: 20px;     /* Tamaño del icono */
  height: 20px;
  pointer-events: none; } /* Para que al hacer clic en el icono se active el input */

.search-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--primary-blue); } /* Usa tu variable de color azul */

/* Filtros tipo "Pill" */
.filter-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Crea 4 columnas iguales */
  gap: 15px;
  width: 100%; }

.pill {
  padding: 10px 40px;
  border-radius: 30px;
  border: 2px solid var(--primary-blue);
  background: white;
  color: var(--primary-blue);
  font-family: "Lato", sans-serif;
  cursor: pointer; }

.pill:hover{
  background-color: var(--primary-blue) !important;
  color: white !important; }

.pill.active {
  background: var(--primary-blue);
  color: white; }

/* Grid de 4 columnas como en la imagen */
.gallery-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px; }

.gallery-item-photo {
  height: 250px;
  background-color: var(--light-blue);
  border-radius: 6px;
  transition: transform 0.3s ease; }

.gallery-item-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block; }

.gallery-item-photo:hover {
  transform: scale(1.02); }

/* Paginación redondeada */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px; }

.page-num, .page-nav {
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: 5px 15px;
  border-radius: 20px;
  font-family: "Lato", sans-serif;
  cursor: pointer;
  font-size: 0.9em; }

.page-num.active {
  background: var(--primary-blue);
  color: white; }

.page-dots {
  color: var(--primary-blue); }

.page-nav {
  background: white;
  min-width: 80px; }

.page-nav:hover {
  background: var(--gray-bg); }

.controls-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding-top: 25px; 
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 450px;
  z-index: 10; }

.controls-container.align-right {
  left: auto;
  right: -10px;
  transform: none; }

.controls-container.align-left {
  left: -10px;
  transform: none; }

.btn-detalles{
  background-color: transparent; 
  border-radius: 30px; 
  border:solid lightgray 1px; 
  font-size: 1em; 
  font-family: 'Lato', sans-serif; 
  padding: 1.5% 8%; }

.btn-detalles:hover{
  border:solid lightgray 1px; }

#btn-contacto:hover {
  background: var(--primary-blue);
  color: white !important;
  border-color: var(--primary-blue) !important; }

#docs-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto; /* Soporta scroll horizontal incluso con más de 4 elementos */
  scroll-behavior: smooth;
  padding: 15px 5px;
  align-items: center;
  scroll-snap-type: x mandatory; /* Comportamiento de carousel consistente */
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  scrollbar-width: none; } /* Oculta barra nativa en Firefox */

#docs-grid::-webkit-scrollbar {
  display: none; } /* Oculta barra nativa en Chrome/Safari */

.doc-item {
  flex: 0 0 calc(25% - 15px); 
  max-width: calc(25% - 15px);
  aspect-ratio: 3/4; 
  background-color: #f0f0f0;
  border-radius: 6px;
  transition: transform 0.3s ease; }

.doc-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block; }

.doc-item:hover {
  transform: scale(1.03); }

.dots-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px; }

.video-container-main {
  width: 100%;
  aspect-ratio: 16 / 9; /* Proporción de video estándar */
  background-color: #93c9ce; /* El color azulado de tus capturas */
  border-radius: 8px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative; }

#audio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px; }

/* --- Modal de Cronología --- */
.modal-overlay {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6); /* Fondo oscuro semitransparente */
  backdrop-filter: blur(2px); }

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 30px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  position: relative; }

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer; }

.close-modal:hover,
.close-modal:focus {
  color: var(--primary-blue);
  text-decoration: none;
  cursor: pointer; }

/* Visor Lightbox */
#lightbox-visor {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center; }

#lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  border: 3px solid white;
  border-radius: 4px;
  object-fit: contain; }

.cronologia-list {
  margin-top: 20px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px; }

.crono-item {
  margin-bottom: 25px;
  border-bottom: 1px dotted var(--light-blue);
  padding-bottom: 15px; }

.crono-year {
  color: var(--primary-blue);
  font-family: "Lato", sans-serif;
  font-size: 2.1em;
  display: block;
  margin-bottom: 5px; 
  text-align: center:}

.crono-events {
  list-style: none;
  padding: 0; }

.crono-events li {
  font-family: "Lato", sans-serif;
  font-size: 1.1em;
  margin-bottom: 8px;
  position: relative;
  padding-left: 20px;
  color: var(--color-texto); }

.crono-events li::before {
  content: "•";
  color: var(--yellow);
  font-weight: bold;
  position: absolute;
  left: 0;
  font-size: 1.2em; }

.period-media-modal .modal-content {
  max-width: 1100px; }

.period-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px; }

.period-media-subtitle {
  color: var(--text-muted);
  font-size: 0.95em;
  margin-bottom: 14px; }

.period-media-sections {
  display: flex;
  flex-direction: column;
  gap: 18px; }

.period-media-section {
  border-top: 1px dotted var(--light-blue);
  padding-top: 14px; }

.period-media-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px; }

.period-media-section-title {
  margin: 0;
  color: var(--primary-blue);
  font-size: 1.1em;
  font-family: var(--font-main); }

.period-media-toggle {
  display: none;
  border: 1px solid var(--border-gray);
  background: #fff;
  color: var(--primary-blue);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.85em;
  cursor: pointer; }

.period-media-section-hint {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 8px; }

.period-media-slider {
  position: relative; }

.period-media-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 8px;
  scrollbar-width: none; }

.period-media-track::-webkit-scrollbar {
  display: none; }

.period-media-item {
  flex: 0 0 calc((100% - 42px) / 4);
  max-width: calc((100% - 42px) / 4);
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  background: #d4e8ea;
  cursor: pointer; }

.period-media-item img {
  width: 100%;
   height: 100%;
  object-fit: cover;
  display: block; }

.period-media-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-gray);
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15); }

.period-media-arrow.left {
  left: -8px; }

.period-media-arrow.right {
  right: -8px; }

.period-media-arrow.hidden {
  display: none; }

.period-media-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px; }

.period-media-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c4c4c4;
  cursor: pointer; }

.period-media-dot.active {
  background: var(--primary-blue); }

@media screen and (max-width: 1366px) {
  .period-media-item {
    flex: 0 0 calc((100% - 14px) / 2);
    max-width: calc((100% - 14px) / 2); }
}

@media screen and (max-width: 768px) {
  .period-media-modal .modal-content {
    width: 95%;
    margin: 8% auto;
    padding: 14px; }

  .timeline-context-actions {
    right: 10px;
    top: 10px;
    left: auto; }

  .timeline-media-btn {
    padding: 6px 10px;
    font-size: 0.78em; }

  .period-media-item {
    flex: 0 0 100%;
    max-width: 100%; }

  .period-media-arrow {
    width: 32px;
    height: 32px; }

  .period-media-section.collapsible .period-media-section-body {
    display: none; }

  .period-media-section.collapsible.open .period-media-section-body {
    display: block; }

  .period-media-toggle {
    display: inline-flex; }
}

/* Controles móviles integrados en el punto (Ocultos por defecto en escritorio) */
.mobile-controls {
  display: none; }

/* --- Estilos Formulario de Contacto --- */
.form-group {
  margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: 'Lato', sans-serif;
  color: var(--primary-blue);
  font-weight: 600; }

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 1em;
  box-sizing: border-box; }

.form-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px var(--light-blue); }

.btn-submit {
  background-color: var(--primary-blue);
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 30px;
  font-size: 1.1em;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background-color 0.3s; }

.btn-submit:hover {
  background-color: #006670; } /* Un tono más oscuro del azul primario */

/* --- Tablas de Estadísticas --- */
.stats-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    font-family: 'Lato', sans-serif;
    font-size: 1.1em;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stats-table th, .stats-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.stats-table th {
    background-color: var(--primary-blue);
    color: white;
    font-weight: 600;
}

.stats-table tr:hover td {
    background-color: var(--gray-bg);
}

.stats-table .total-row td {
    font-weight: bold;
    background-color: var(--light-blue);
    color: var(--color-texto);
    border-top: 2px solid var(--primary-blue);
}

/* --- RESPONSIVE MEDIA QUERIES --- */

@media screen and (max-width: 1024px) {
    .container { width: 95%; max-width: 100%; padding: 20px 10px; }
    
    /* Títulos Tablet */
    .title-top { font-size: 3.5em; padding: 5px 40px; }
    .title-bottom { font-size: 4em; padding: 10px 20px; }
    
    /* Grid de fotos a 2 columnas en Tablet */
    .gallery-photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
    /* --- Tipografía y Banner --- */
    .hero-banner { min-height: 30vh; height: auto; padding: 40px 0; }
    .title-top { font-size: 2.5em; padding: 5px 20px; width: 90%; text-align: center; }
    .title-bottom { font-size: 3em; padding: 5px 10px; width: 95%; text-align: center; }
    .subtitulo { font-size: 1.5em; text-align: center; }
    .subtituloh3 { text-align: center; }

    /* --- Tabs (Pestañas) --- */
    .filter-tabs {
flex-wrap: wrap;
gap: 10px;
justify-content: center;
    }
    .tab, .pill {
width: auto; /* Se adapta al espacio disponible */
min-width: 120px;
max-width: calc(50% - 10px);
padding: 10px;
text-align: center;
box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
flex: 1 1 auto; /* Crece y encoge según el espacio */
    }

    /* Pestañas de Documentos y Audiovisuales en responsive (auto-ajuste) */
    #tabs-documentos .tab, #tabs-audiovisuales .tab {
width: auto;
max-width: 100%;
min-width: 120px;
    }

    /* --- Timeline (Cronología) --- */
    .timeline-line { display: none !important; }
    .point::before { display: none !important; }
    .point span.texto:first-child { border-bottom: none !important; }
    
    .timeline-points {
flex-direction: column;
gap: 30px;
align-items: center;
    }

    .point {
width: 100%;
align-items: center;
text-align: center;
min-width: auto;
margin-bottom: 20px;
    }

    .point span.texto:first-child {
width: auto;
border-bottom: none; /* Quitamos la línea punteada individual */
margin-bottom: 5px;
    }

    /* Controles Timeline (Botones ver detalle) */
    .controls-container { display: none !important; }

    /* Mostrar controles móviles solo en el punto activo */
    .point.active .mobile-controls {
display: flex;
flex-direction: column;
gap: 8px; /* Espacio entre botones */
width: 100%;
margin-top: -5px; /* Margen negativo para acercarlo al título */
padding-bottom: 10px;
    }
    
    .btn-detalles {
width: 80%;
margin: 0 auto;
display: block;
    }

    /* --- Detalles del Año --- */
    .year-detail { padding: 15px; }
    .detail-header {
flex-direction: column;
align-items: center;
gap: 15px;
text-align: center;
    }
    .textoaños { border-bottom: none; font-size: 2em; }
    
    .btn-download {
width: 100%;
padding: 10px;
margin-top: 5px;
    }
    
    /* Carrusel de imágenes mini en móvil (1 foto) */
    .image-gallery-mini {
flex-direction: row !important; /* Forzar fila para scroll lateral */
overflow-x: auto;
scroll-snap-type: x mandatory;
justify-content: flex-start !important;
gap: 0 !important; /* Sin espacio para que ocupe todo */
    }
    .carousel-img { 
width: 100% !important; /* 1 foto ocupa todo el ancho */
min-width: 100%;
height: 250px !important; 
margin-bottom: 0 !important; 
scroll-snap-align: center;
    }

    /* Restaurar puntos en móvil aunque tengan la clase de ocultar en escritorio */
    .hide-dots-desktop .mini-carousel-dots {
display: flex !important;
    }
    
    /* --- Carrusel de Periodos (Tarjetas grandes) --- */
    .periodo-card {
min-width: 85vw !important;
width: 85vw !important;
max-width: 85vw;
padding: 20px;
flex: 0 0 auto;
scroll-snap-align: start;
height: 610px;
    }

    .periodo-card .card-buttons {
display: grid !important;
grid-template-columns: 1fr;
    }
    .periodo-card .card-buttons .btn-full { grid-column: auto; }
    
    /* --- Reducción de elementos internos en móvil (Más pequeño y ordenado) --- */
    .card-image-placeholder {
height: 100px; /* Imagen más baja */
height: 180px;
margin-bottom: 10px;
    }
    .card-title-group h3.texto { font-size: 0.85em; } /* Título reducido */
    .card-title-group p.texto { font-size: 0.75em !important; } /* Subtítulo reducido */
    
    .card-list { margin-bottom: 10px; }
    .card-list li { margin-bottom: 5px; gap: 8px; }
    .card-list li .texto { font-size: 0.7em !important; }
    .list-dot { width: 15px; height: 15px; }
    
    .card-buttons {
gap: 8px; margin-bottom: 5px;
gap: 8px; 
margin-bottom: 5px;
grid-template-columns: 1fr;
    }
    .card-buttons .btn-full {
width: 100% !important;
grid-column: auto;
margin: 0;
    }
    .btn-outline {
font-size: 0.7em;
padding: 5px 2px;
    }
    
    /* Asegurar que el contenedor permita scroll táctil */
    .carousel-container-cards {
gap: 10px; /* Menos espacio entre cartas */
padding-right: 10px; 
-webkit-overflow-scrolling: touch;
scroll-snap-type: x mandatory;
    }

    /* --- Galería y Buscador --- */
    .gallery-controls { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .filter-pills { justify-content: center; width: 100%; }
    
    #photo-gallery-wrapper .gallery-photo-grid {
display: grid;
grid-template-columns: repeat(2, 1fr); /* 2 columnas para una cuadrícula 2x2 */
gap: 15px;
    }

    /* --- Documentos --- */
    .doc-item {
flex: 0 0 100%; /* 1 documento ocupando todo el ancho */
max-width: 100%;
scroll-snap-align: center; /* Centrar al deslizar */
    }

    #docs-grid {
scroll-snap-type: x mandatory; /* Efecto carrusel (imán) */
overflow-x: auto; /* IMPORTANTE: Permite deslizar con el dedo */
    }
    
    /* --- Modales --- */
    .modal-content { width: 95%; margin: 10% auto; padding: 15px; }
    .crono-year { font-size: 1.8em; }
    
    .container {
padding: 8%; /* 8% en todos los lados */
    }
    
    .nav-links { display: none; }
    .card-body, .layout-left, .layout-right { flex-direction: column; }
    .card-image { max-width: 100%; width: 100%; }
    .footer-top, .footer-middle, .footer-logos { flex-direction: column; align-items: center; text-align: center; }
    .timeline-card { display: none; }
    .timeline-card.active { display: flex; margin-top: 20px; }
    .mobile-period-controls { display: flex; gap: 15px; justify-content: center; padding-bottom: 20px; margin-top: -20px; }
    .mobile-btn { padding: 10px 25px; border: 2px solid var(--primary-color); background: transparent; color: var(--primary-color); border-radius: 25px; font-family: var(--font-main); font-weight: 700; cursor: pointer; transition: all 0.3s ease; }
    .mobile-btn:hover, .mobile-btn.active { background: var(--primary-color); color: white; }
    .period-header .tl-container { text-align: center !important; }
}

/* Tablet Horizontal (hasta 1366px) */
@media screen and (max-width: 1366px) {
    .container {
width: 100%;
max-width: 100%;
padding: 4% 6%;
box-sizing: border-box;
    }

    #docs-grid {
overflow-x: auto;
scroll-snap-type: x mandatory;
    }

    .doc-item {
flex: 0 0 calc(50% - 10px);
max-width: calc(50% - 10px);
scroll-snap-align: start;
    }
    
    /* Timeline en Tablet Horizontal */
    .timeline-line { display: none !important; }
    .point::before { display: none !important; }

    .periodo-card {
width: 380px;
min-width: 380px;
max-height: 84vh;
    }

    .periodo-card .card-list {
max-height: calc(84vh - 205px);
    }
    .point span.texto:first-child { border-bottom: none !important; }
    .timeline-points { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; justify-items: center; }
    .point { align-items: center; text-align: center; margin-bottom: 20px; width: 100%; min-width: auto; }
    .controls-container { display: none !important; } 
    .point.active .mobile-controls { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: -5px; padding-bottom: 10px; align-items: center; }

    /* Mostrar flechas en Tablet y Móvil (flotantes sobre el carrusel) */
    .carousel-arrow {
display: flex !important;
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 20;
background: rgba(255, 255, 255, 0.9);
border-radius: 50%;
width: 35px;
height: 35px;
align-items: center;
justify-content: center;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    .carousel-arrow.left { left: 0; }
    .carousel-arrow.right { right: 0; }
    
    /* Restaurar puntos en tablet/móvil para la galería mini */
    .hide-dots-desktop .mini-carousel-dots {
display: flex !important;
    }
}

/* Restaurar vista de 1 columna para móviles (para que no se vean 2 columnas en pantallas muy pequeñas) */
@media screen and (max-width: 768px) {
    .timeline-points { display: flex; flex-direction: column; align-items: center; }
    
    /* --- Estilos específicos para Tablas en Móvil --- */
    .chart-container { display: none !important; } /* Ocultar gráficas en móvil */
    .chart-controls { display: none !important; } /* Ocultar botones de control de gráficas */
    .mobile-table-container { display: block !important; } /* Mostrar tablas */
}

/* Estilos base de la tabla móvil (oculta en escritorio) */
.mobile-table-container { display: none; width: 100%; overflow-x: auto; margin-top: 20px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9em; font-family: 'Lato', sans-serif; }
.data-table th, .data-table td { border: 1px solid #ddd; padding: 10px 8px; text-align: center; }
.data-table th { background-color: var(--primary-blue); color: white; position: sticky; top: 0; }
.data-table tr:nth-child(even) { background-color: #f2f2f2; }
.data-table tr:hover { background-color: #e6f7f8; }
.table-note { font-size: 0.8em; color: #666; font-style: italic; display: block; margin-top: 4px; }

/* --- ESTILOS UNIFICADOS DEL TIMELINE --- */
.timeline-page-body a { text-decoration: none; color: inherit; }
.timeline-page-body ul { list-style: none; margin: 0; padding: 0; }
.tl-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.timeline-navbar { background-color: #fff; border-bottom: 1px solid var(--border-gray); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 60px; object-fit: contain; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--text-dark); text-transform: uppercase; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--primary-color); }
.lang-switch { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.hero { height: 350px; background: url('/sites/default/files/descubre_calpe/2026-04/banner_100_anos_historia_calp.png') center/cover; background-size: cover; background-position: center; position: relative; display: flex; justify-content: center; align-items: center; }
.hero::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.3); z-index: 1; }
.hero-content { position: relative; z-index: 2; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cursive-box { background-color: var(--accent-yellow); padding: 5px 30px; display: inline-block; box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.2); clip-path: polygon(2% 0%, 100% 0%, 98% 100%, 0% 100%); }
.cursive-text { font-family: var(--font-cursive); font-size: 5em; color: #4a4a4a; line-height: 1; }
.box-large .cursive-text { font-size: 5.5em; }
.box-large { padding: 10px 40px; }
.intro-section { padding: 40px 0 20px 0; }
.title-main { color: var(--primary-color); font-size: 2.5em; font-family: var(--font-main); font-weight: 700; margin-bottom: 5px; }
.subtitle-main { color: var(--text-muted); font-size: 1rem; }
.timeline-page-wrapper { display: flex; flex-direction: column; }
.period-row { padding: 40px 0; }
.bg-white { background-color: var(--bg-white); }
.bg-teal { background-color: var(--bg-teal); background-image: url('/sites/default/files/2026-03/100_anos_historia_calp.png'); background-size: cover; background-position: center; background-blend-mode: overlay; }
.period-header { background-color: var(--header-teal); color: #333; display: block; padding: 10px 0; font-size: 2.5em; font-family: var(--font-main); font-weight: 700; margin-bottom: 40px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.period-header.align-left .tl-container { text-align: left; }
.period-header.align-right .tl-container { text-align: right; }
.timeline-card { background: transparent; display: flex; flex-direction: column; gap: 20px; }
.bg-teal .timeline-card { background-color: var(--header-teal); padding: 30px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.card-body { display: flex; gap: 50px; align-items: center; }
.layout-left { flex-direction: row; }
.layout-right { flex-direction: row; }
.card-image { flex: 1; max-width: 50%; }
.card-image img { width: 100%; height: 300px; object-fit: cover; display: block; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); background-color: transparent; }
.card-image .img-sepia { filter: sepia(0.5); }
.card-image .img-grayscale { filter: grayscale(0.8); }
.card-image .img-logo-contain { object-fit: contain; background: white; padding: 20px; border: 1px solid #eee; }
.card-content { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.year-badge { background-color: var(--accent-yellow); display: inline-block; padding: 8px 25px; font-size: 2.5em; font-family: var(--font-main); font-weight: 700; color: #333; align-self: flex-start; box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.15); transform: rotate(-1deg); position: relative; }
.card-text { display: flex; flex-direction: column; gap: 15px; }
.card-text p { font-size: 1.2em; font-family: var(--font-main); color: #2c2c2c; line-height: 1.5; }
.progress-bar { width: 100%; height: 4px; background-color: var(--border-gray); margin-top: 10px; border-radius: 2px; position: relative; overflow: hidden; }
.progress-fill { height: 100%; background-color: var(--accent-yellow); border-radius: 2px; }
.float-right { float: right; }
.site-footer { background-color: var(--footer-bg); padding: 50px 0 20px; border-top: 1px solid var(--border-gray); margin-top: 20px; }
.footer-top { display: flex; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap; gap: 20px; }
.footer-links-left { display: flex; flex-direction: column; gap: 10px; }
.footer-links-left a { font-size: 0.9rem; color: var(--text-dark); }
.footer-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-footer { border: 1px solid var(--border-gray); padding: 8px 20px; font-size: 0.85rem; text-align: center; border-radius: 20px; color: var(--text-dark); background: white; transition: all 0.3s; }
.btn-footer:hover { background: #f0f0f0; }
#lb-share-btn { cursor: pointer; }
.footer-middle { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.footer-legal { font-size: 0.85rem; color: var(--text-muted); }
.footer-legal a { color: var(--text-muted); }
.footer-social { display: flex; gap: 15px; }
.footer-social a { color: var(--primary-color); font-size: 1.2rem; }
.footer-logos { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-gray); padding-top: 30px; flex-wrap: wrap; gap: 20px; }
.logo-ayto { height: 60px; }
.logo-center-group { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.logo-text { font-size: 0.75rem; color: var(--text-muted); }
.logo-ue { height: 50px; }
