/* === Search Section === */
.search-section {
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 18px 60px 18px 20px;
  font-size: 16px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-icon {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
}
/* === Hero Section === */
.hero {
  margin-top: 20px;
  padding: 10px 10px;
  text-align: center;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}


/* Gallery Section */
.gallery-section {
  padding: 20px 20px;
  margin-bottom: 60px;
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  background: white;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  margin-bottom: 0px;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

/* === NUEVO: Card Wrapper - Contenedor expandible === */
.card-wrapper {
  position: relative;
  transition: all 0.5s ease;
}

.card-wrapper.expanded {
  margin-bottom: 200px;
}

/* Gallery Item - Contenedor Padre */
.gallery-item {
  border: 5px outset #754fa7;
  position: relative;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s ease;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  background: linear-gradient(135deg, rgba(118, 75, 162, 0.6) 0%, rgba(15, 15, 25, 0.7) 100%);
}

.gallery-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(118, 75, 162, 0.6) 0%, rgba(15, 15, 25, 0.7) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  text-align: center;
  padding: 20px;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h3 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.gallery-overlay p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

/* === NUEVO: Conexión Visual - Box Shadow === */
.connection-line {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #764ba2 0%, rgba(118, 75, 162, 0.3) 100%);
  transform: translateX(-50%);
  opacity: 0;
  transition: all 0.5s ease;
  box-shadow: 0 0 20px rgba(118, 75, 162, 0.8);
}

.card-wrapper.expanded .connection-line {
  height: 40px;
  opacity: 1;
}

/* === NUEVO: Contenedores Hijos === */
.children-container {
  position: absolute;
  top: calc(100% + 40px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s ease 0.2s;
}

.card-wrapper.expanded .children-container {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.child-card {
  height: 150px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
  border: 3px outset #754fa7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 15px;
  text-align: center;
  box-shadow: 0px -22px 1660px 5px rgba(118, 75, 162, 0.504);  
}

.child-card:hover {
  transform: translateY(-5px) scale(1.05);
  background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
}

.child-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.child-card p {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* === NUEVO: Responsive para cards hijos === */
@media (max-width: 768px) {
  .children-container {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .card-wrapper.expanded {
    margin-bottom: 390px;
  }

  .child-card {
    height: 100px;
  }
}

/*VIDEO OCULTO */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.95);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.video-modal iframe {
  width: 100%;
  height: 100%;
  max-width: 544px;
  max-height: 960px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  z-index: 2100;
}

/* === Modal Artículo === */
.article-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(15px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.article-content {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  color: #fff;
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 25px rgba(102, 126, 234, 0.3);
  animation: fadeIn 0.3s ease;
}

.article-content img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 15px;
}

.article-content h2 {
  font-size: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.article-content p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.close-article {
  height: 56px;
  width: 45px;
  padding: 8px;
  border-radius: 5px;
  background-color: black;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  color: #ff3333;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.3s ease;
}

.close-article:hover {
  color: #ff5555;
  transform: scale(1.1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
