/* Header compacto al hacer scroll */
.compact-header .header-logos,
.compact-header .financiado {
  display: none !important;
}
.compact-header .header-content {
  padding: 0.3rem 0.5rem 0.3rem 0.5rem !important;
}
.compact-header h1 {
  font-size: 1.1rem !important;
  margin: 0.2rem 0 0.2rem 0 !important;
}

/* Keywords destacadas en cards */
.card-keywords {
  margin: 0.3rem 0 0.7rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.keyword {
  background: linear-gradient(90deg, #003366 60%, #b3c6e6 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.18rem 0.7rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  letter-spacing: 0.5px;
  border: 1.5px solid #e0e6f0;
}
body {
  font-family: 'Inter', Arial, sans-serif;
  margin: 0;
  background: linear-gradient(120deg, #eaf0fa 0%, #f7fafd 100%);
  color: #1a2340;
}
header, .main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
  border-bottom: 2px solid #e0e0e0;
}
.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 1rem 1rem 1rem;
}
.header-logos {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.logo {
  height: 48px;
  margin: 0 10px 0 10px;
  vertical-align: middle;
  background: #fff;
  border-radius: 8px;
  padding: 0.2rem 0.7rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.logo-udep-oficial {
  height: 56px;
  max-width: 220px;
}
.logo-uc3m {
  height: 48px;
  max-width: 180px;
}
.header-titles {
  text-align: center;
}
h1 {
  margin: 0.5rem 0 0.2rem 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: #003366;
  letter-spacing: -1px;
}
.header-divider {
  border: none;
  border-top: 2px solid #e0e0e0;
  margin: 1.2rem auto 1.2rem auto;
  max-width: 420px;
}
.financiado {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0 0.5rem 0;
  font-size: 1.1rem;
  color: #003366;
}
.logo-financiado {
  height: 36px;
  background: #fff;
  border-radius: 6px;
  padding: 2px 8px;
}

/* PARTICIPANTES */
.participantes {
  max-width: 1200px;
  width: 95vw;
  margin: 2.5rem auto 2rem auto;
  background: rgba(255,255,255,0.7);
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.07);
  padding: 2.5rem 2rem 2rem 2rem;
  backdrop-filter: blur(2px);
}
.participantes h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  color: #003366;
}
.participantes-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  width: 100%;
}
.participante-card {
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 1.2rem 1rem;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1.5px solid #e0e6f0;
  margin-bottom: 0.5rem;
}
.participante-card:hover {
  transform: translateY(-7px) scale(1.04);
  box-shadow: 0 8px 32px rgba(0,51,102,0.13);
  border-color: #b3c6e6;
}
.participante-nombre {
  font-weight: 700;
  font-size: 1.18rem;
  margin-bottom: 0.3rem;
  text-align: center;
  color: #003366;
}
.participante-desc {
  color: #1a2340;
  font-size: 1.01rem;
  text-align: center;
  opacity: 0.85;
}

/* ACTIVIDADES */
.galeria {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  margin: 2.5rem 0;
  width: 100%;
}
.card {
  background: rgba(255,255,255,0.82);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,51,102,0.07);
  width: 340px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1.5px solid #e0e6f0;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.7s;
}
.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 32px rgba(0,51,102,0.13);
  border-color: #b3c6e6;
}
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #eaeaea;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.card-content {
  padding: 1.2rem 1.1rem 1.1rem 1.1rem;
  flex: 1;
}
.card-title {
  font-size: 1.22rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #003366;
}
.card-date {
  color: #4a5a7a;
  font-size: 0.98rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.card-summary {
  font-size: 1.04rem;
  color: #1a2340;
  opacity: 0.92;
}

/* DETALLE */
.detalle {
  max-width: 900px;
  width: 100%;
  margin: 2.5rem auto;
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  padding: 2.5rem 2rem 2rem 2rem;
  position: relative;
  border: 1.5px solid #e0e6f0;
  animation: fadeIn 0.7s;
  backdrop-filter: blur(2px);
}
.detalle-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.detalle-titulo {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #003366;
  font-weight: 700;
}
.detalle-fecha {
  color: #003366;
  font-weight: bold;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.detalle-descripcion {
  font-size: 1.13rem;
  margin-bottom: 1.5rem;
  color: #1a2340;
  opacity: 0.95;
}
.detalle-volver {
  display: inline-block;
  background: #003366;
  color: #fff;
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
  margin-top: 1rem;
}
.detalle-volver:hover {
  background: #0055a5;
}
.oculto {
  display: none;
}

/* GALERÍA DE IMÁGENES */
.galeria-fotos {
  width: 100%;
  max-width: 1200px;
  margin: 3rem auto 2rem auto;
  background: rgba(255,255,255,0.8);
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  padding: 2.5rem 2rem 2rem 2rem;
  backdrop-filter: blur(2px);
}
.galeria-fotos h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #003366;
  font-size: 1.5rem;
}
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.galeria-img-card {
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1.5px solid #e0e6f0;
}
.galeria-img-card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 32px rgba(0,51,102,0.13);
  border-color: #b3c6e6;
}
.galeria-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  object-fit: cover;
  transition: box-shadow 0.18s;
}

/* FOOTER */
.main-footer {
  background: #1a2340;
  color: #fff;
  text-align: center;
  padding: 2.5rem 1rem 1.5rem 1rem;
  margin-top: 2rem;
  border-top: 2px solid #e0e0e0;
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.logo-footer-alargado {
  max-width: 340px;
  width: 90vw;
  margin-bottom: 1rem;
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.footer-text {
  color: #fff;
  font-size: 1.08rem;
}
.footer-links a {
  color: #b3c6e6;
  text-decoration: none;
  margin: 0 0.3rem;
  font-weight: 600;
  transition: color 0.18s;
}
.footer-links a:hover {
  color: #fff;
}

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

@media (max-width: 900px) {
  .galeria, .galeria-fotos, .participantes, .detalle {
    padding: 1rem;
    max-width: 98vw;
  }
  .card {
    width: 98vw;
    max-width: 400px;
  }
}
@media (max-width: 600px) {
  .header-content, .footer-content {
    padding: 0.5rem;
  }
  .galeria, .galeria-fotos, .participantes, .detalle {
    padding: 0.5rem;
  }
  h1 {
    font-size: 1.2rem;
  }
}

/* MODAL GALERÍA */
.modal-galeria {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 30, 50, 0.92);
  transition: opacity 0.2s;
}
.modal-galeria.oculto {
  display: none;
}
.modal-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  background: #fff;
  padding: 0.5rem;
}
.modal-cerrar {
  position: absolute;
  top: 2.5vh;
  right: 4vw;
  color: #fff;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  text-shadow: 0 2px 8px #000;
}
.modal-prev, .modal-next {
  position: absolute;
  top: 50%;
  color: #fff;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  z-index: 10001;
  text-shadow: 0 2px 8px #000;
  padding: 0 1rem;
  border-radius: 50%;
  background: rgba(0,0,0,0.18);
  transform: translateY(-50%);
}
.modal-prev {
  left: 2vw;
}
.modal-next {
  right: 2vw;
}
@media (max-width: 600px) {
  .modal-img {
    max-width: 98vw;
    max-height: 60vh;
  }
  .modal-cerrar {
    top: 1vh;
    right: 2vw;
    font-size: 2rem;
  }
  .modal-prev, .modal-next {
    font-size: 2.2rem;
    padding: 0 0.5rem;
  }
}
