RESUMEN
Chromosomal inversions can play an important role in divergence and reproductive isolation by building and maintaining distinct allelic combinations between evolutionary lineages. Alternatively, they can take the form of balanced polymorphisms that segregate within populations until one arrangement becomes fixed. Many questions remain about how inversion polymorphisms arise, how they are maintained over the long term, and ultimately, whether and how they contribute to speciation. The long-snouted seahorse (Hippocampus guttulatus) is genetically subdivided into geographic lineages and marine-lagoon ecotypes, with shared structural variation underlying lineage and ecotype divergence. Here, we aim to characterize structural variants and to reconstruct their history and suspected role in ecotype formation. We generated a near chromosome-level genome assembly and described genome-wide patterns of diversity and divergence through the analysis of 112 whole-genome sequences from Atlantic, Mediterranean, and Black Sea populations. By also analysing linked-read sequencing data, we found evidence for two chromosomal inversions that were several megabases in length and showed contrasting allele frequency patterns between lineages and ecotypes across the species range. We reveal that these inversions represent ancient intraspecific polymorphisms, one likely being maintained by divergent selection and the other by pseudo-overdominance. A possible selective coupling between the two inversions was further supported by the absence of specific haplotype combinations and a putative functional interaction between the two inversions in reproduction. Lastly, we detected gene flux eroding divergence between inverted alleles at varying levels for the two inversions, with a likely impact on their dynamics and contribution to divergence and speciation.