The in ﬂ uence of habitat properties on sex determination in cavity-nesting Hymenoptera

Unravelling the relationships between insect population dynamics and habitat properties is often complex. Established theoretical concepts, which predict an in ﬂ uence of available resources on sex determination, have often not been tested with quantitative ﬁ eld data. Cavity-nesting Hymenoptera are suitable to assess the in ﬂ uence of habitat properties on reproductive parameters, as haplodiploidy enables direct responses to local conditions. We hypothesize that with increasing resource availability, the population sex ratio (share of females per site), sex allocation preference per individual offspring (the probability of producing either a male or a female offspring per brood cell) and resource allocation per individual offspring will be favouring towards females. We sampled offspring of Osmia cornuta, Osmia caerulescens and Trypoxylon ﬁ gulus and their resource provisions using trap nests on 30 study sites in an agricultural landscape in southwest Germany, from March to August 2020. The potential in ﬂ uence of resource availability, landscape variables, temperature, seasonal progression, and nesting opportunities on sex and resource provisions was tested. Population sex ratio was not related to habitat properties. Sex allocation preference in the three species, however, depended on several variables including cavity size and seasonal progression, with pronounced differences amongst species. Individual resource provisioning mainly differed between sexes, as male larvae received less provisions than female larvae. As there was no in ﬂ uence of resource availability, we conclude that the sex ratio of established populations was balanced at the selected study sites by available resources in the landscape. At the individual scale, sex and resource allocation were in ﬂ uenced in species-speci ﬁ c ways. As such, sex determination and resource allocation are essential life history properties of sexually reproducing organisms


Introduction
Intensive farming, habitat fragmentation, and climate change can impair the abundance and diversity of insects (e.g. Seibold et al., 2019;. For example, more than 50% of land in Germany is subjected to agriculture (Statistisches Bundesamt, 2020), which creates a mosaic of differing habitat suitability for organisms at the landscape scale.
Different resource availability can not only influence e.g. species abundance, but also reproductive properties (Gathmann & Tscharntke, 2000;Seidelmann, Ulbrich & Mielenz, 2010). In contrast to mammals, in which sex of an offspring is determined at or near implantation (Cameron, 2004), eggs of Hymenoptera are facultatively fertilised by controlled contraction of the spermatheca of a female. Male offspring develop from unfertilised eggs and have a haploid chromosome set, whereas female offspring develop from fertilised eggs with a regular diploid chromosome set (Gerber & Klostermeyer, 1970). Thus, haplodiploid sex determination makes Hymenoptera suitable organisms for quantitative sex ratio studies, as population sex ratios (the proportion of females in a population; Wilson & Hardy, 2009) can approximate population status (Bosch, Osorio-Canadas, Sgolastra & Vicens, 2021;Gathmann & Tscharntke, 2000). By understanding sex determination and resource allocation, a better overall population assessment is possible, which may consequently improve predictions of species population fates in response to land-use changes such as intensification, one of the biggest threats for insects (Martin et al., 2019).
Sex ratios and related theories have fascinated researchers for a long time (Wilson & Hardy, 2009). Initially, Fisher (1930) predicted an equal investment in male and female offspring when their costs are similar (Fishers principle), while the optimal sex ratio hypothesis (Torchio & Tepedino, 1980) proposes that the optimal sex ratio of a population is constrained by the sex-specific per capita investment. In many Hymenoptera species, this implies a numerical shift towards males, which are often smaller than females. Therefore, male offspring requires fewer food provisions for larval development (Bosch & Vicens, 2002). Expanding on those concepts, the costs of reproduction hypothesis proposes a relationship between sex ratio and resource availability, with more males being produced in resource-poor habitats as they are the "cheaper" sex (Myers, 1978).
However, a complex interplay of trade-offs needs to be disentangled when investigating sex determination and sex ratios (Rosenheim, Nonacs & Mangel, 1996). Most studies compared contrasting habitats, investigated translocated individuals or used artificial, experimental settings (e.g. cage experiments), which all favour extreme sex ratios (Bosch, 2008;Kim, 1999;Winfree, Bartomeus & Cariveau, 2011;Zaragoza-Trello, Vil a & Bartomeus, 2021). Thus, studying sex ratios along land-use gradients in real landscapes is important to infer if and how reproductive strategy is impaired by resources. Quantifying land-use intensity itself is challenging, as components can interact and simplified categories are often not sufficient to represent habitat quality at a landscape scale (Bl€ uthgen et al., 2012;Herzog et al., 2006). In addition to land use, sex ratios in Hymenoptera can be sensitive to weather and season, as frequency of foraging is related to temperature. During seasonal progression, several habitat properties, including flower abundance and diversity, change, which is additionally expected to influence sex ratios (Bosch & Kemp, 2002;Zaragoza-Trello et al., 2021).
In this study, we combine landscape ecology with sex determination hypotheses, providing empiric data for established evolutionary theory. We test for influences of habitat properties on sex ratio at the population scale (per study site) and the individual scale (individual sex allocation and resource allocation per brood cell). The two scales (population and individual) are necessary as it has repeatedly been shown that, depending on the scale of the analysis, relationships with environmental variables can differ, which may allow inference on ecological mechanisms (Frank, 1987;Steffan-Dewenter, 2003;Tylianakis, Klein, Lozada & Tscharntke, 2006). By testing sex ratio, the general relationship of populations between differing sites and their habitat can be identified at the population scale. In turn, sex and resource allocation focuses on the influence of specific habitat properties at the individual scale, i.e. properties influencing the individual offspring. We tested for relationships with proxies for resource availability, habitat connectivity, different land-use qualities, seasonal progression, temperature, and nesting parameters.

We hypothesized that
(1) offspring in comparatively poor habitats will have a disproportionally high share of males in a population as being the less costly sex (population scale).
(2) male offspring will be more likely when resources are scarce (individual scale). (3) resources will be preferably allocated towards males in poor habitats, i.e. provisioning females will provide a relatively higher share of resources to male offspring (individual scale).
In turn, sites with more resources will show the expected equal sex ratio, an equal sex allocation preference and no preference of resource allocation.

Study sites
This study was conducted in southwest Germany in the Upper Rhine valley (47°54 0 À 48°8 0 N, 7°37 0 À 7°52 0 E) within a heterogeneous landscape dominated by various agriculture. Mean annual temperature was 11.8°C and precipitation had 836 mm (period from 1990 À 2015). July and August are the warmest months with a mean temperature of 20.9°C each (Wein et al., 2016).
Thirty study sites of different land-use intensity were selected, corresponding to different resource classes that were proxies of known habitat suitability for bees and wasps (e.g. Tscharntke, Gathmann, & Steffan-Dewenter, 1998;Westrich, 2019). "Plentiful resources" include extensive meadows, pastures with low grazing intensity and orchard meadows, "intermediate resources" include vineyards, pastures with intermediate grazing intensity and orchards, and "poor resources" include cropland and intensive meadows. The identification of ten study sites per class with a 250 m radius each (average flight or foraging distance for most solitary bees and wasps; Steffan-Dewenter, 2003;Zurbuchen et al., 2010) was initially conducted by identifying suitable study sites via high-resolution satellite images (Google Earth Pro 7.3.6.9345; Google LLC, 2020). The best possible trap placement on those 30 sites was then decided during on-site inspection (distance between site centres: 0.9 km À 39.4 km; Fig. 1).

Hymenoptera sampling
Standardised trap nests (Krombein, 1967;Staab, Pufal, Tscharntke & Klein, 2018) containing reed internodes of 20 cm length with a variety of diameters (2 À 11 mm) were used to attract nest-building females of cavity-nesting Hymenoptera. Two trap nests were mounted on a pole each in approximately 1.2 m height ("trap"). Two of the traps were then placed close to the centre of each study site, around 15 m apart from each other. One opening faced east and the other opening faced west. All traps were deployed in mid-March 2020 and were regularly inspected and maintained through August 2020. During this period, completed nests, which were distinguishable by the characteristic plug made of e.g. soil, were collected every 7 to 14 days ("collection event"). All collected reed internodes were replaced with internodes of similar diameter to avoid a bias due to different relative numbers of reed internodes throughout the season (Longair, 1981). The internodes containing nests were opened, internode diameter, brood cell length and number of brood cells per nest (proxy for nest size; Coudrain, Rittiner, Tinner, Herzog & Entling, 2016) were documented. If the offspring was still in egg stage, the resource provisions (i.e. pollen or prey arthropods) per brood cell were additionally weighted with a precision scale (to 0.0001 g). Afterwards, all individuals and their corresponding resources were placed in 48-well plates (Tissues Culture Plates, VWR, Darmstadt, Germany) regardless their developmental stage, to rear them separately from each other (Becker & Keller, 2016). To prevent the spread of parasitoid species amongst potentially infected Hymenoptera larvae (e.g. Mellitobia acasta), every opening of a well plate was sealed with adjusted Ceapren stoppers (22 mm, Greiner-Bio-One GmbH, Frickenhausen, Germany). Cells were incubated at ambient conditions and the dormant period was simulated from mid-October until mid-March 2021 in a cooling chamber at 4.8°C (K€ alte M€ uller, Freiburg, Germany). Species identification and sex determination took place in summer 2021. The bee species Osmia cornuta (196 individuals on 11 study sites), Osmia caerulescens (200 individuals on 16 study sites) and the spider-hunting wasp species Trypoxylon figulus (592 individuals on 17 study sites) were selected for statistical analysis as they contributed most hatched individuals and occurred across study sites (see Appendix A: Table 1). These three species are common generalists in Germany with different life-history traits (K€ onigsl€ ow, Klein, Staab, & Pufal, 2019;Tscharntke et al., 1998;Westrich, 2019). Individuals that did not reach adult stage were excluded from the analysis.

Variables related to resource availability
To approximate actual resource availability for the statistical analyses, resources were assessed independently of resource classes, that were only used for study site selection. Field margins were mapped in a 250 m radius around study site centres via QGIS (3.20.3; QGIS Development Team, 2009), based on aerial high-resolution satellite images (Google Earth Pro; Google LLC, 2020). Detailed information about land use (e.g. planted cultivars) were recorded on-site. In total, 28 land-use types, comprising various crops, orchards and extensive grasslands, were classified (see Appendix A: Table 2). The land-use types were then simplified into the four different land-use qualities "seminatural habitat", "pollinator-relevant land use" (mainly mass-flowering crops like oilseed rape; Holzschuh et al., 2013), "sealed area" (buildings) and "other crops" (mainly wind-pollinated crops such as cereals). Their area as well as "largest patch of seminatural habitat" and "edge length of seminatural habitat" were then calculated per site with QGIS. For these variables, the percentage of the area covered by each land-use quality was then computed in a 250 m radius.
Trees and shrubs, which provide important nesting and foraging resources for cavity-nesting Hymenoptera, were mapped via aerial high-resolution satellite images (Google Earth Pro; Google LLC, 2020) in QGIS by estimating their crown area as 2D polygons. Then, pollinator-relevant fruit trees/shrubs including willows (Haider, Dorn, Sedivy & M€ uller, 2014;Steffan-Dewenter, 2003) were identified on each study site onto species level. The selected trees and shrubs were then summarized as "pollinator-relevant trees" (see Appendix A: Table 3). Those trees characterise food resources, which are particularly relevant for O. cornuta, as this bee species forages on mass-flowering trees such as apple and cherry (Kratschmer, Petrovi c, Curto, Meimberg & Pachinger, 2020). Other trees were categorized in, respectively, "other deciduous trees", "espalier trees" (trees in an orchard whose branches are tied to frames for harvesting purposes) and "conifers". The crown areas were pooled per category per study site and the percentage of the respective area covered by each tree or bush category in a 250 m radius was computed.
Also, flower cover was estimated and flower species richness was counted once each month in April, May, June and July, with 21 subsites (each 1 m 2 ), following Keene, Malmstrom, Alexander, Wayadande and Denning (2020). Subsites were evenly spread in a distance of 0, 25, 50, 100, 175 and 250 m away from the site centre (Pellissier et al., 2013; Table 1. Results of the best fitting models that explain sex allocation preference (the probability of producing either a male or a female offspring per brood cell) (binomial GLMMs) and resource weight (linear LMMs) at the individual scale. A negative PC2 represents pollinatorrelevant land use. The standardised model estimates (+/-SE), z-/t-values and p-values are shown.  -Dewenter, 2003). To avoid clustering of the subsites, the experimental radius of 250 m was divided into four quarters (border at cardinal directions) and they were placed in a representative land-use type excluding forests, hedges, water and sealed area. In each subsite, all flowering species were assessed and an orthogonal photograph of the 1 m 2 subsite was taken (outlined with two carpenters' folding rules for standardisation). The percent flower cover per subsite was quantified from the photograph, summed per month and site and divided through the number of subsites. At the individual scale, the calculated average flower cover and flower species richness values were assigned to a collection event, depending on the lowest number of days between the collection of reed internodes containing nests and flower assessment, to account for seasonal variation (see Appendix A: Table 4; Scheper et al., 2015;Timberlake, Vaughan & Memmott, 2019). At the population scale, flower cover and flower species richness were averaged per study site over the entire sampling period in which each focal species occurred. Spider prey, i.e. spiders with a size below 10 mm (including body appendages), which constitute the prey of T. figulus, was recorded in May and July via sweep netting (6 double sweeps in a random direction covering an area of approximately 4 m 2 on the 21 subsites of the flower assessment) (Keene et al., 2020;Tscharntke et al., 1998). Total prey density was afterwards summed up per site and divided through number of subsites. At the individual scale, the calculated average prey density was assigned to a collection event, depending on the lowest number of days between collection of reed internodes containing nests and flower assessment to account for seasonal variation (see Appendix A: Table 4). At the population scale, prey density was averaged per site over the entire sampling period in which each focal species occurred.

Abiotic variables
Day temperature (excluding dusk and dawn, using R package suncalc; Thieurmel & Elmarhraoui, 2019) was measured every half hour from 22 March until 31 August 2020 via temperature loggers (HOBO Pendant, 64 K, onset, Bourne, USA). Eight study sites had partially missing temperature values (8% total) due to failure of loggers that were afterwards filled via linear regression from the data of the most similar adjacent site (Persons correlation between existing study site temperature values and values of the adjacent site > 0.94). At the individual scale, temperature was averaged over the time frame in which the nest was built ("collection period", 7 À 14 days; see Appendix A: Table 4). At the population scale, temperature was averaged over the entire sampling period in which each focal species occurred.
A more detailed overview of all explanatory variables is given in Appendix A: Table 5.

Statistical analysis
All analyses were computed with R (4.1.0, R Core Team, 2021). To find the best combination of fixed effects that are associated to the three response variables sex ratio (population scale), sex allocation preference and resource allocation weight (both individual scale), an automated model selection was conducted with the R package MuMIn (1.43.17; Barton, 2020). To reduce complexity in the full models, Principal Component Analyses (PCA) were additionally conducted amongst resource availability variables for each species and at each scale (vegan package, 2.5À7, Oksanen et al., 2020). The PCA also acted as mitigation for collinearity amongst fixed effects . Averaged day temperature, nesting, and time-related properties were not included in the PCA, as they do not describe resources in a landscape. Only the first two Principal Components (PCs), which each represented similar variable combinations amongst all species and scales, were selected for further analyses. PC1 mainly represented land-use practices with generally poor resources for Hymenoptera in contrast to large patches of extensive land use with generally plentiful resources. PC2 mainly represented edge length of seminatural habitat and sealed area (see Appendix A: Tables 6 À 8; Appendix A: 1 À 5).
Based on the respective fixed effects contained in the full models (i.e. models including all variables for the respective scale and species), candidate models for all possible combinations of fixed effects were calculated ("dredge") and ranked by lowest Akaike Information Criterion corrected for small sample sizes (AICc). A threshold of DAICc 2 was taken as selection criterion (see Appendix A: Tables 9 À 17). If two or more models were within the threshold, the model with the lowest AICc was selected as best model (Burnham & Anderson, 2002). The full models were checked for multicollinearity via variance inflation factors (VIFs, always < 7) (car package 3.0À11; Fox & Weisberg, 2019). Numerical variables were centred and standardised (mean=0, SD=1).
Sex ratios for O. cornuta, O. caerulescens and T. figulus were calculated for each study site (population scale) by dividing the number of hatched females by the number of hatched individuals (sex ratio = F/(F + M); Wilson & Hardy, 2009). The full models for testing the influence of habitat variables (namely PC1 and PC2) and average temperature per site on population sex ratio (which follows binomial distribution), were constructed with generalized linear models (GLMs) (see Appendix A: Table 18).
For testing sex allocation preference at the individual scale, i.e. calculating the probability of producing either a male or a female offspring per brood cell, all explanatory variables were adapted to the collection event in which the reed internodes containing nests were collected. The binomial zero stands for a 100% chance of the offspring being male and the binomial one for a 100% chance of the offspring being female. The full models (generalized linear mixed-effects models, GLMMs) for testing sex allocation preference included habitat variables (PC1 and PC2), collection period (time frame in which the nest was built), average temperature per study site per collection period, and nest-specific properties (amount of brood cells per internode, internode diameter). The individual reed internode nested in study site was included as random intercept to account for the hierarchy of the data (see Appendix A: Table 18). Packages lme4 (1.1À27.1; Bates, M€ achler, Bolker & Walker, 2015) and lmerTest (3.1À3; Kuznetsova, Brockhoff & Christensen, 2017) were used for the analyses.
Resource weight per brood cell, i.e. the resource allocation weight to either female or male offspring (individual scale), was tested with linear mixed-effects models (LMMs) for relationships with habitat variables (PC1 and PC2), collection period, average temperature per site per collection period, and nest specific properties (amount of brood cells per internode, internode diameter). The sex of the offspring, which was determined after full development of the egg, was added as covariate in the full model. Because untouched pollen and spider prey could not be recovered for all collection periods, explanatory variables at the individual scale were subset to collection periods with resource weight data. Individual reed internode nested in site was included as random intercept to account for the hierarchy of the data (see Appendix A: Table 18). No best fitting model had overdispersion, heteroscedasticity, outliers or zero-inflation (assessed with package DHARMa, 0.4.5; Hartig, 2021). Residuals of all LMMs were normally distributed. Potential spatial autocorrelation was tested and rejected with Morans I coefficients (ape package 5.5; Paradis & Schliep, 2019).

Osmia cornuta
In total, 196 O. cornuta individuals were successfully reared on 11 study sites with on average brood cell length of 13.2 mm and of which 49 were female (=25%). Out of these, 110 pollen balls with offspring collected in the egg stage could be analysed. At the population scale (n = 30 study sites), no fixed effect was retained in the best fitting model, whereas at the individual scale (n = 194 brood cells in 87 reed internodes from 10 study sites), sex allocation preference was influenced by internode diameter (Table 1). An increase in internode diameter favoured female offspring (z = 4.217, p<0.001; Fig. 2A). Resource weight (n = 110 brood cells in 56 reed internodes from 8 sites) at the individual scale was related to internode diameter and sex ( Table 1), suggesting that increasing internode diameter favours female offspring (t = 4.560, p<0.001; Fig. 2B). Also, females received more resource provisions than males (t = 9.344, p<0.001; Fig. 2C). No variable representing food resource availability was selected in the best fitting models.

Osmia caerulescens
Out of 200 successfully reared O. caerulescens individuals from 16 study sites with on average brood cell length of 7.5 mm, 91 individuals were female (=46%). In total, 54 pollen balls with offspring collected in the egg stage could be analysed. At the population scale (n = 30 study sites), no fixed effect was retained in the best fitting model (Table 1). At the individual scale (n = 200 brood cells in 84 reed internodes from 16 sites), sex allocation preference was related to internode diameter, collection period and PC2 (representing pollinator-relevant land use) (Table 1). Increasing internode diameter (z = 2.534, p = 0.011) and early collection period (z=À2.146, p = 0.032) favoured sex allocation towards females (Fig. 3A-B). PC2 was included in the best fitting model, albeit without being significant (z=À1.899, p = 0.058; Table 1). Resource weight (n = 54 brood cells in 29 reed internodes from 10 sites) at the individual scale was significantly related to collection period and sex (Table 1), with more resources allocated to females (t = 5.197, p<0.001,

Trypoxylon figulus
For T. figulus, the highest number of individuals (591) could be reared, with on average brood cell length of 17.3 mm and including 239 females (=40%). Of those, spider prey of 92 brood cells and with offspring collected in the egg stage could be analysed. No fixed effect was retained in the best fitting model at the population scale (n = 30 study sites, Table 1). At the individual scale (n = 591 brood cells in 310 reed internodes from 17 study sites), sex allocation preference was related to internode diameter, number of brood cells per internode and collection period (Table 1). Increasing internode diameter (z = 3.484, p<0.001, Fig. 4A) and higher number of brood cells per internode, a proxy for nest size (z = 3.339, p<0.001; Fig. 4B) favoured female offspring. Sex allocation preference towards female offspring decreased later in the season (z=À2.266 p = 0.023; Fig. 4C).
Resource weight at the individual scale (n = 92 brood cells in 62 reed internodes from 13 study sites; Table 1) was best explained by sex, i.e. females received on average more resource provisions than males (t = 6.504, p<0.001; Fig. 4D). No variable representing food resource availability was selected in the best fitting models.

Discussion
We investigated the influence of habitat properties on sex determination and resource allocation in cavity-nesting Hymenoptera. Opposed to previous studies using artificial systems (e.g. Kim, 1999), we collected data under realistic field conditions to close the gap between established theoretical concepts and quantitative research in sex determination and resource allocation. Because of the generality of the tested theoretical sex determination concepts, our findings highlight the importance of resources and their properties for reproduction. Notably, relationships varied amongst species, which may be related to species-specific life history.

Resource availability may influence individual sex and resource allocation, but not population sex ratio
At the population scale, sex ratio was not influenced by varying resource availability in all three species, which is in accordance with Fisher s principle in a broader sense (Fisher, 1930). However, deviating from the postulated 1:1 equilibrium, consistently more male than female offspring hatched from our trap nests. Such differences can be explained by the optimal sex ratio hypothesis (Torchio & Tepedino, 1980), as females in the studied species are larger, lowering  the per capita investment costs for the smaller males. Also, resource allocation showed that female offspring received on average more food than male offspring, which additionally indicates the lower investment cost for males (Bosch, 1994). The hypothesized relationship between population sex ratio and resource availability, however, which is predicted by the costs of reproduction hypothesis (Myers, 1978), was not confirmed by our data as the proportion of females in a population on a study site did not decrease with scarcer resources.
Nevertheless, depending on species, the sex allocation preference at the individual scale changed with several resource availability variables. Nesting properties were important for all three species as e.g. internode diameter constrains the maximum size of cavity-nesting Hymenoptera. Males are smaller than females, so that male eggs are preferably laid in cavities with smaller internode diameter (Bosch & Kemp, 2002;Longair, 1981). In O. cornuta, more food provisions were found in internodes with larger diameter, which may indicate that larger females also selected larger cavities for their relatively larger offspring (Bosch & Vicens, 2006). In T. figulus, sex allocation preference towards females increased with nest size (i.e. number of brood cells per internode) at the individual scale. One reason may be that males hatch earlier than females in most hymenopteran species (Krombein, 1967;Longair, 1981), which is why male offspring is preferably found in cells close to the nest opening. The outmost cells are also more susceptible to natural enemy attacks (Krombein, 1967), because they are less shielded (in the case of T. figulus by mud partitions). Regarding T. figulus, very long brood cells were measured compared to O. cornuta and O. caerulescens. Thus, fewer innermost cells with many protective layers are available for female offspring, which makes the nest size (i.e. number of brood cells per nest) essential in sex allocation decisions of T. figulus.

Seasonal progression influences individual sex and resource allocation
In addition to nesting properties, a higher individual sex allocation towards male offspring with progressing time was found in O. caerulescens and T. figulus. Additionally, O. caerulescens females provided their offspring which less resources later in the season, regardless of sex. This bee species has a partially bivoltine lifecycle, in which the first and second generation do not overlap, but the progeny produced in spring (i.e. first generation of a year) can facultatively hatch either in summer of the same year (i.e. second generation of a year) or directly enter diapause until the next year (Seger, 1983). Because the first generation cannot account for habitat changes that will shape the resource availability of the second generation, O. caerulescens is dependant on suitable foraging opportunities in proximity to the nesting site throughout the year. Suitable resources, however, are not necessarily adequately represented by flower cover or flower species richness alone: Poor nutrient composition and pollen quality reduces fitness in offspring and influences mortality of both or either female or male offspring (Eckerter, Albrecht, Herzog, & Entling, 2022;Filipiak, Denisow, Stawiarz, & Filipiak, 2022). The increased probability of male offspring over time in combination with reduced provision weight for both sexes thus points to a shortage of suitable food resources in the second generation, which might result in a preference of nest-building females to lay eggs developing into male offspring at the individual scale. As such, O. caerulescens contrasts the univoltine O. cornuta, which prefers flowering fruit trees, which are not temporarily variable and provide predictable food resources and quality for several years.
Even though the probability for female offspring decreased over time in T. figulus, as well, the life history of this spider-hunting wasp differs considerably from both Osmia species. T. figulus hunts spiders which are common and available in plenty during the whole breeding season, even in intensively managed croplands (Pekar, 2000;Persson, Mazier & Smith, 2018). The wasp species can have up to four overlapping generations per year and, according to the local mate competition hypothesis, frequent intraspecific competition for mates is expected (males of the first generation compete with males of the second overlapping generation etc.; Hamilton, 1967). To maximize reproductive success, a provisioning female would invest more into female offspring earlier in the season, because they have, in turn, higher chances to reproduce in the following generation than males, which compete with each other and might not be able to mate. Towards the end of the season, a potentially unfavourable winter period (mild or very long) may shift the advantages of male vs. female offspring for the last generation of the season again. The smaller males are more impaired by the increased metabolic costs of the winter than the larger females (Bosch & Kemp, 2004). To compensate for potential overwintering losses and to maximize reproductive success of the next generation, nest-provisioning females will most likely favour investment in males later in the season.

Perspectives and limitations
Population sex ratio and resource allocation did not systematically change amongst study sites with differing resource availability, which contrasts our initial hypotheses. The found sex allocation preference at the individual scale, however, highlighted the importance of time and pointed towards a potential influence of nutritional composition besides the known influence of internode diameter (e.g. Longair, 1981). Both time and nutritional composition offer a promising direction for future research on sex determination and resource allocation.
In this study, only realized sex ratios of individuals in adult stage were used for statistical analyses. It is unknown whether the degree of larval mortality is sex-specific, so it cannot be fully excluded that adult sex ratios do not precisely represent the initial sex ratio of the offspring as originally established by the provisioning female, which could lead to deviations from theoretical sex determination concepts. Furthermore, infections (including Wolbachia), age or inter-and intraspecific conflicts were beyond the scope of this study. These limitations all have the potential to change sex ratios at the population scale (Bosch & Vicens, 2005;Evison et al., 2012;Peterson & Roitberg, 2016). Additionally, even though the relationships revealed by us are plausible, it is unclear whether all findings can be generalized to species with different life history, as only three species, which are widespread generalists, occurred in numbers permitting quantitative analyses.

Conclusion
Sex determination and resource allocation are essential life history properties in populations of sexually reproducing organisms. Following Fisher s principle (1930) in combination with the optimal sex ratio hypothesis of Torchio and Tepedino (1980), sex ratios were unaffected in populations throughout different habitat properties. Males received less food provisions than females due to their lower investment cost. No evidence for preferential provisioning for one or the other sex depending on food resource availability could be found. Nevertheless, several habitat properties shifted the sex allocation preference at the individual scale, as predicted by the costs of reproduction hypothesis (Myers, 1978). This manuscript highlights the importance of sex determination at both the population and the individual scale, and resource allocation as essential life history properties of sexually reproducing organisms.

Funding
Michael Staab is indebted to the Baden-W€ urttemberg Foundation for the financial support of this research project by the Eliteprogramme for Postdocs (grant number 1.16101.19). We acknowledge support by the Open Access Publication Fund of the University of Freiburg.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.