#sitio img[src*="/mini/"] { cursor: zoom-in; }

#visor[hidden] { display: none; }

#visor {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(6px, 2vw, 20px);
  padding: clamp(12px, 3vw, 32px);
  background: rgba(20, 16, 13, .93);
  backdrop-filter: blur(6px);
  animation: visorEntra .18s ease-out;
}

@keyframes visorEntra { from { opacity: 0; } to { opacity: 1; } }

#visor-lienzo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-height: 100%;
}

#visor-imagen {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

#visor-pie {
  margin: 0;
  text-align: center;
  color: #F5EDE3;
  font-family: Newsreader, serif;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.3;
  text-wrap: pretty;
}

#visor-pie span {
  display: block;
  margin-top: 4px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  color: rgba(245, 237, 227, .62);
}

#visor button {
  flex-shrink: 0;
  border: 1px solid rgba(245, 237, 227, .24);
  background: rgba(245, 237, 227, .08);
  color: #F5EDE3;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}

#visor button:hover { background: rgba(245, 237, 227, .2); }
#visor button:focus-visible { outline: 2px solid #E9DCCB; outline-offset: 2px; }

#visor-anterior, #visor-siguiente {
  width: clamp(38px, 6vw, 52px);
  height: clamp(38px, 6vw, 52px);
  font-size: clamp(22px, 3vw, 30px);
  padding-bottom: 4px;
}

#visor-cerrar {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  width: 42px;
  height: 42px;
  font-size: 24px;
  padding-bottom: 3px;
}

@media (max-width: 560px) {
  #visor { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #visor-lienzo { grid-row: 1; }
  #visor-anterior { grid-row: 2; justify-self: start; }
  #visor-siguiente { grid-row: 2; justify-self: end; }
  #visor-imagen { max-height: calc(100vh - 220px); }
}

#menu-boton {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  width: 42px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid rgba(32, 27, 22, .16);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

#menu-boton span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #201B16;
  transition: transform .22s ease, opacity .22s ease;
}

header[data-menu-abierto] #menu-boton span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
header[data-menu-abierto] #menu-boton span:nth-child(2) { opacity: 0; }
header[data-menu-abierto] #menu-boton span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@keyframes llamadaMenu {
  0%   { box-shadow: 0 0 0 0 rgba(122, 18, 38, .42); }
  70%  { box-shadow: 0 0 0 11px rgba(122, 18, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(122, 18, 38, 0); }
}

#menu-boton[data-llamada] {
  border-color: rgba(122, 18, 38, .55);
  animation: llamadaMenu 1.9s ease-out 3;
}

#menu-boton[data-llamada] span { background: #7A1226; }

@media (prefers-reduced-motion: reduce) {
  #menu-boton[data-llamada] { animation: none; }
}

#menu-boton:focus-visible { outline: 2px solid #7A1226; outline-offset: 2px; }

@media (max-width: 700px) {
  #menu-boton { display: flex; order: -1; }

  #menu-principal + div { margin-left: auto !important; }

  #menu-principal {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 6px clamp(18px, 4vw, 40px) 12px !important;
    overflow-x: visible !important;
    background: #FAF6F0;
    border-bottom: 1px solid rgba(32, 27, 22, .12);
    box-shadow: 0 18px 34px rgba(32, 27, 22, .16);
  }

  header[data-menu-abierto] #menu-principal { display: flex !important; }

  #menu-principal a {
    padding: 14px 2px !important;
    font-size: 16.5px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(32, 27, 22, .08);
  }

  #menu-principal a:last-child { border-bottom: 0; }
}
