/* === ESTILOS GENERALES === */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Montserrat", sans-serif;
  background: #fafafa;
  color: #000;
  display: flex;
  flex-direction: column;
}

.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.margenes {
  margin: 0 auto;
  padding: 20px 20px 0 20px;
}

/* === HEADER === */

header, .galeria-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: sticky;
  width: 100%;
  color: white;
  box-sizing: border-box;
  z-index: 10;
  background: transparent;
}

.titulo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

h1 {
  font-size: 2em;
  font-weight: normal;
  margin: 0;
  color: #dd1417;
}

h4 {
  font-weight: normal;
  margin: 0;
  color: #dd1417;
}

.logo {
  cursor: pointer;
  flex-shrink: 0;
}

.logo i {
  font-size: 24px !important;
  color: #dd1417;
  cursor: pointer;
}

.text-left {
  font-weight: 200;
  line-height: 1.5;
  text-align: left;
  padding: 10px;
}

/* === FOOTER === */

footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 20px;
  background-color: #fafafa;
  color: #000;
  box-sizing: border-box;
}

.social-icons {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  flex: 1;
}

.social-icons i {
  font-size: 24px;
  margin-left: 10px;
  color: #dd1417;
  transition: color 0.3s ease;
}

.social-icons i:hover {
  color: #000;
}

/* === MENÚ INTERACTIVO === */

#menu-icon {
  color: #dd1417;
  cursor: pointer;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  #menu-icon {
    font-size: 30px;
  }
}

.fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.fullscreen-menu.show {
  opacity: 1;
  display: flex;
}

.fullscreen-menu.hide {
  opacity: 0;
}

.close-menu {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 30px;
  color: #dd1417;
  cursor: pointer;
}

.menu_svg {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
}

/* === SECCIÓN GESTIÓN Y CURADURÍA === */

.texto-gestion {
  max-width: 80vw;
  margin: 0 auto 30px auto;
  text-align: left;
  padding: 0 20px;
  font-weight: 200;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease-out forwards;
}

.carousel {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  max-width: 1200px;
  flex-wrap: wrap;
  gap: 20px;
}

.carousel-inner {
  overflow: hidden;
  display: flex;
}

.carousel-item {
  flex: 0 0 100%;
  max-width: 100%;
  transition: transform 0.5s ease;
}

/* === CONTROLES DEL CARRUSEL === */

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  width: auto;
  height: auto;
  z-index: 10;
  filter: invert(28%) sepia(92%) saturate(5668%) hue-rotate(0deg) brightness(90%) contrast(95%);
  margin-inline: -60px;
}

.carousel-control-prev {
  transform: translate(-20%, -40%);
}

.carousel-control-next {
  transform: translate(20%, -40%);
}

/* === IMÁGENES === */

.image-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  max-height: 80vh;
}

.image-container img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.image-vertical {
  height: auto;
  max-height: 100%;
  width: auto;
  max-width: 80%;
  object-fit: contain;
}

/* === FIGURE Y CAPTION === */

.figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
}

.figure-caption {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #000;
  margin-top: 8px;
  padding: 0 10px;
  max-width: 90%;
}

.figure-caption strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

/* === ANIMACIONES === */

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.titulo h1, .titulo h4 {
  opacity: 0;
  animation: fadeInText 1.5s ease-out forwards;
}

.titulo h4 {
  animation-delay: 0.4s;
}

@keyframes fadeInText {
  to {
    opacity: 1;
  }
}

/* === RESPONSIVE === */

@media (max-width: 768px) {

  .carousel-control-prev,
  .carousel-control-next {
    display: none;
  }

  .image-container {
    margin-bottom: 20px;
  }

  .image-container img {
    width: 90%;
    height: auto;
    margin: 0 auto;
  }

  .figure-caption {
    font-size: 0.75em;
    padding-inline: 0;
  }

  .titulo {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: 1.5em;
  }

  .logo {
    padding-left: 2px;
  }

  footer {
    margin-top: 20px;
  }
}

@media (max-width: 576px) {
  .figure-caption {
    font-size: 0.7rem;
    margin-top: 0.3rem;
  }
}

/* --- FIX FIGCAPTION VISIBLE --- */
.figure {
  display: block;
  width: 100%;
  text-align: center;
  margin: 0;
  padding: 0;
}

.image-container {
  position: relative;
  width: 100%;
  max-height: none !important; /* elimina la restricción de altura */
  overflow: visible !important; /* evita que se corte el caption */
}

.image-container img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.figure-caption {
  display: block;
  position: relative;
  text-align: center;
  color: #000;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 8px;
  padding: 0 10px;
  z-index: 2; /* asegura que quede sobre cualquier imagen */
}

.figure-caption strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
