Regional differences of functional and taxonomic bird diversity in tropical agroforests of Peru

Diversity and functionality of bird communities in tropical agroforests are shaped by their surrounding landscape, particularly the extent and type of natural forest. However, most evidence comes from tropical rainforest landscapes, whereas the bearing of such trends in other forest types remains understudied. We compared functional and beta diversity of bird communities in 23 cacao agroforests embedded in landscapes of two contrasting Peruvian regions: seasonally‐dry tropical forests and subtropical rainforests from the Andean foothills. Strong climatic seasonality affects both landscapes, but forest vegetation structure and complexity differ. We found higher bird species richness (n = 179 spp) and higher species turnover in the subtropical forest than in the dry forest landscape (n = 64 spp). Only in the dry forest landscape, distance from forest increased dissimilarity driven by species loss, that is, the nestedness component of beta diversity. This points to the importance of conserving dry tropical forests within the broader landscape matrix, with known benefits for pest control and cacao yield. Functional diversity indices were not influenced by forest distance in either landscape, but the proportion of insects in birds' diet decreased by 27% along a 1 km distance gradient from forest in the subtropical forest landscape. In the dry forest landscape, however, it decreased by only 3% across the same distance gradient. Far from forest (≥1 km), forest specialization decreased by ~33% and 20% in the subtropical and dry forest landscapes, respectively. These differences indicate that regionally‐adapted agroforest management is paramount for conserving bird diversity and ecosystem services as pest control. Procuring high‐canopy shade trees and adequate microhabitats for insectivorous species is essential to maintain biocontrol services in the subtropical forest. Conversely, in the dry forest enhancing low‐canopy vegetation with a focus on frugivores and ensuring forest closeness to agroforests may maximize bird diversity and their ecosystem services. A complete version of this article is translated to Spanish in the supplements.

agroforest management is paramount for conserving bird diversity and ecosystem services as pest control.Procuring high-canopy shade trees and adequate microhabitats for insectivorous species is essential to maintain biocontrol services in the subtropical forest.Conversely, in the dry forest enhancing low-canopy vegetation with a focus on frugivores and ensuring forest closeness to agroforests may maximize bird diversity and their ecosystem services.A complete version of this article is translated to Spanish in the supplements.
beta diversity, cacao agroforestry, community composition, ecosystem services, forest type, functional diversity, landscape structure, regionally-adapted management

| INTRODUCTION
Tropical agroforestry systems, such as cacao agroforests, can maintain high levels of bird diversity, provided adequate management techniques, and well-conserved natural vegetation in the landscape (e.g., Bennett et al., 2021;De Beenhouwer et al., 2013;Faria et al., 2006;Harvey & Gonz alez Villalobos, 2007).However, the value of agroforests for birds and different functional guilds among them is known to vary geographically (Bennett et al., 2021;De Beenhouwer et al., 2013).Cacao production has expanded from the species' region of origin in the Amazonian rainforest (Thomas et al., 2012) to areas dominated by different forest types throughout the tropics (Quesada & Stoner, 2019;Rolim & Chiarello, 2004).Yet there is still limited evidence about the dynamics and functionality of bird fauna in agroecosystems in such expansion areas (Harvey & Gonz alez Villalobos, 2007;Karp et al., 2012;Ocampo-Ariza et al., 2022).
The diversity and functionality of bird communities within tropical agroforests has been found to be shaped by their surrounding landscape.Larger, well-connected and conserved nearby forests favor higher species richness (e.g., Cabral et al., 2021;Faria et al., 2006;Morante-Filho et al., 2015) and higher functional diversity of bird communities in cacao agroforests (Rocha et al., 2019) than landscapes with degraded forests.Moreover, bird species loss and replacement across forests and agroforests is non-random and relates to the resource needs of different taxonomic and functional bird groups.Forest specialists and specialized insectivores are considered to be most sensitive to land-use change in agroforestry landscapes and are often replaced by generalist species (De Beenhouwer et al., 2013;Jarrett et al., 2021;Kupsch et al., 2019;Sekercioglu, 2012).The disappearance of specialized birds threatens the provision of key ecosystem services such as insect pest control, seed dispersal and pollination (e.g., Araújo-Santos et al., 2021;Hadley et al., 2018;Jarrett et al., 2021) with negative consequences for ecosystem stability, resilience to disturbance (Hautier et al., 2017) and hence the income of smallholding farmers.The most dominant and threatened bird functional groups and guilds are known to vary latitudinally, longitudinally, and across different ecosystems (e.g., Maas et al., 2016).Therefore, understanding and accounting for these variations may increase the success of biodiversity-friendly agroforestry design in novel and understudied ecosystems.
Achieving biodiversity-friendly tropical agriculture requires an integrated approach involving the effective conservation of remaining forests, improvements in the spatial configuration of agricultural landscapes, and adequate management of agricultural areas to enhance biodiversity in them (e.g., Melo et al., 2013).In the case of cacao, agroforests may be managed by maintaining and diversifying shade trees that accompany the crop, with known benefits for cacao yield, pest control, and biodiversity (Clough et al., 2011;Maas et al., 2020;Tscharntke et al., 2011).The complex vegetation structure of cacao agroforests is known to be beneficial for conserving avifauna (e.g., Jarrett et al., 2021;Morante-Filho et al., 2015;Ocampo-Ariza et al., 2022), but advantages vary according to the characteristics of shade trees, including their age, origin and the resources each species may provide (Bennett et al., 2021;Rend on-Sandoval et al., 2020).Therefore, identifying the local resource needs of bird communities and accounting for them in the design and management of agroforestry systems has large potential to increase the success of biodiversity conservation in these agroecosystems.
In Latin America, cacao production has expanded in the megadiverse inter-Andean valleys and even into drier ecosystems, such as the Atlantic Forest (e.g., Gama-Rodrigues et al., 2021;Morante-Filho et al., 2015) and tropical dry forests (e.g., Harvey & Gonz alez Villalobos, 2007;Karp et al., 2012;Ocampo-Ariza et al., 2022).In tropical dry forests, seasonality plays a key role in shaping biodiversity, since rainfall may be limited up to only a couple of months per year.This is reflected in a lower height of tree canopies than in more humid forests, lower densities of herbaceous and shrubby vegetation, and higher levels of endemism and specialization of flora and fauna (Linares-Palomino et al., 2011;Linares-Palomino & Alvarez, 2005).Limited rainfall in these areas often obliges farmers to irrigate cacao agroforests to secure yield.Consequently, it is likely that irrigated cacao agroforests pose different challenges and opportunities for local avifauna in comparison to other regions (e.g., Cassano et al., 2016;Ocampo-Ariza et al., 2022).
In this study, we compare bird diversity in landscapes from two Peruvian regions dominated by contrasting forest types: seasonally-dry tropical forests in the department of Piura, and seasonally-dry subtropical rainforests in the department of Cusco.We focus on patterns of taxonomic beta diversity and functional diversity of bird communities across native cacao agroforests and adjacent forests.Beta diversity analyses, which evaluate the dissimilarity in species composition among communities (Anderson et al., 2011), serve as a valuable tool to identify biotic homogenization in agricultural landscapes (Mori et al., 2018).However, analyses of changes in taxonomic composition do not necessarily capture functional diversity loss, which may threaten ecosystem function and service provision at shorter temporal and spatial scales (Flynn et al., 2009).Therefore, comparing patterns of taxonomic and functional diversity of bird communities in tropical agroforests may help prioritize conservation strategies that maximize both ecosystem service provision and biodiversity (Marcacci et al., 2021).We evaluated how functional and beta diversity within each landscape varied along a gradient of distance from forest and whether these patterns differed between landscapes.We hypothesized that bird communities in the subtropical forest region would be more diverse and retain a higher functional diversity given the habitat complexity and land-use diversity present in the inter-Andean valleys-where the recent orogenic history has promoted the diversification of multiple plant and animal taxa, including birds (e.g., Kattan et al., 2004;Särkinen et al., 2011).We use these differences between landscapes to suggest landscape-specific conservation management strategies at agroforest and landscape scales to maximize the preservation of avian biodiversity and related ecosystem services.

| Study area
We conducted research in two landscapes with contrasting forest types in Peru (Figure 1): (1) a landscape dominated by seasonally-dry tropical forests in Piura (hereafter dry forest landscape), and (2) a landscape dominated by subtropical rainforests in Cusco (hereafter subtropical forest landscape).
The study area in the dry forest landscape was located in Northern Peru, between 250 and 480 m.a.s.l., around the rural community of La Quemaz on (5 18'48.03"S,79 43'12.02"W), in Piura.The landscape is subject to strong climate seasonality, with a rainy season concentrated in 4 months (January to April), followed by a welldefined dry season (May to December).Dry forests in Piura are part of the largest continuous dry forest remnant in South America, and are characterized by the dominance of leguminous shrubs and trees and of cacti (Linares-Palomino, 2006).We selected four points in tropical dry forests, and 12 irrigated organic smallholder cacao agroforests, ranging in size between 0.4 and 1.92 ha (0-1250 m from nearest secondary forest, Figure A1 A).These agroforests did not include the farmers' home, or any other crop than cacao.
The study area in the subtropical forest landscape was located between 580 and 920 m.a.s.l. in the inter-Andean valley of La Convenci on around the towns of Quillabamba (12 52'6.08"S,72 41'31.13"W)and Kiteni (12 38'50.65"S,73 2'55.12"W), in Cusco.The climate can be classified as tropical humid, with an annual precipitation between 500 and 1000 mm, 70% of which is concentrated between October and March (Sanabria et al., 2014).The vegetation is characterized by subtropical montane deciduous and evergreen forests, including a mixture of several types of Yungas forests, rainforests (MINAM, 2018).The landscape also includes a large diversity of mixed-crops and agroforests, such as coffee, cacao, and diverse orchards.Here, we selected eight points in subtropical forest and 11 points in smallholder farms spanning 0.5-8 ha.Unlike plantations in the dry forest, these farms normally include the house of farmers, as well as crops other than cacao.Cacao agroforestry areas in these 11 farms ranged in size between 0.5 and 2 ha (35-720 m from nearest secondary forest; Figure 1b).
We measured the distance of each study point to the nearest forest in ArcGIS Desktop 10.6.1, using the map of ecosystems of Peru (MINAM, 2018), and a land use map of Piura (Otivo-Barreto, 2010a).We updated forest edges using ("Google Earth Pro Version 7.3"; Google, 2019) and ground-truthing at the end of our surveys in 2019.Only one study point in the dry forest landscape was located at a distance of 0 m from the forest, as it was right in front of the edge of the forest.However, it was still embedded in an agricultural matrix comparable to that of other study points in the landscape (see Figure 1a).

| Bird surveys
We assessed the local bird communities in all study points through 50 m fixed-radius point-count surveys (Sutherland et al., 2004).We visited each plot eight times on non-rainy days between November 2018 and December 2019, covering both the rainy and dry season in each study area.All point-count surveys lasted 20 min and were performed between 5:30 a.m. and 11:00 a.m. by one expert observer per landscape (dry forests: COA; subtropical forests: JNC).We recorded the species and abundance of all birds seen or heard, excluding raptors, as their large home ranges make point-count surveys inadequate to sample them (García-Navas et al., 2020).We also excluded aquatic species since our habitats of interestforests and cacao agroforests-are unsuitable to assess their abundance.We acknowledge that vegetation differences in agroforests and forests may have affected bird detectability (Ruiz-Gutiérrez & Zipkin, 2011), but are confident that in our case detectability was little affected within the narrow radius we used, and the multiple visits (n = 8) to each of our study points.

| Beta diversity
To assess the dissimilarity in species composition between bird communities from each landscape, we calculated pairwise dissimilarity indices based both on presence-absence (i.e., incidence) information of bird species (Sørensen index), or their relative abundances (Bray-Curtis index).These indices compare the taxonomic composition of bird communities from all possible pairs of study points in each landscape, and range between 0 and 1, with increasing values as communities become more dissimilar.Beta diversity indices may reflect two different phenomena, which explain dissimilarity between communities: Turnover and nestedness.Comparing two bird communities in different study points, turnover refers to cases in which species present in one study points are replaced by other species in the second point.By contrast, nestedness refers to cases in which one community can be considered a subset of the second.These two components can be calculated separately and inform of the possible ecological factors that determine species distribution at the landscape scale (Baselga, 2010;Soininen et al., 2018).
We then evaluated whether beta diversity changed contingent on difference in distance from forest between pairs of points.For this analysis, we incorporated all potential pairs of points, including comparisons among points in the forest (distance = 0) to account for potential heterogeneity within natural habitats.Moreover, we included comparisons among all agroforests to assess whether their location in the landscape affected the composition of bird communities in the same type of agroecosystem.The analyses were performed using distance-decay models in "betapart::decay.model".Distance-decay relationships analyze changes in dissimilarity between communities in function of their environmental differences (G omez-Rodríguez & Baselga, 2018), fitting negative-exponential generalized linear models, with a log-link function and a Gaussian error distribution.This allows the use of a matrix as a response variable, but limits the regression to a single predictor.Therefore, we ran separate models for each landscape.As distance from forest had no significant effects in the subtropical forest landscape, the differences between landscapes are discussed based on comparisons of the dissimilarity values.
Considering the higher amount of forest study points in the subtropical forest (n = 8) than in the dry forest (n = 4), we confirmed whether assessing only an equal number of study points changed the patterns observed for beta-diversity indices.To do so, we generated 12 subsets of the dataset from the subtropical forests, each of which included only four study points in the forests.We selected these 12 subsets within the 70 possible combinations, making sure they all include points around the two clusters of agroforests in Quillabamba and Kiteni research sites (Figure 1), and at least one forest point nearby each cacao agroforests.Moreover, since the subtropical forest landscape encompassed a larger geographic area than the dry forest, and included exceptionally large farms of up to 8 ha, we tested whether the dissimilarity patterns remained when testing only plots at similar distances and sizes than those in the dry forest landscape.To do so, we subset only farms (n = 8) and forest points (n = 3) located nearby (maximum distance between plots = 5.5 km), and with a mean cacao agroforest size of 0.54 ± 0.14 ha, which corresponded to the study points located nearby the city of Quillabamba (Figure 1b).We then repeated the calculations of beta diversity indices and distance-decay models for these 13 datasets.Since we found no visible changes in the patterns of beta-diversity along the gradient of distance from forest between the 13 subset combinations and the complete dataset (Appendix 1), we retained the 8 forest plots and all cacao agroforests for the results reported in this manuscript.
As mentioned previously, the distance to forest gradient in the tropical dry forest landscape was much larger (0-1250 m) than in the subtropical forest landscape (0-700).Therefore, we evaluated whether the results of distance-decay models changed when analyzing only the study points in the tropical dry forest that were at ≤700 m away from the forest (see Appendix 1 for a summary table).We discuss the differences between the whole datasets and the subsets we created from both landscapes in the discussion section.

| Functional diversity
We obtained data for four functional traits of all recorded bird species using the Birds of the World (Billerman et al., 2020) and the Elton Traits database (Wilman et al., 2014): First, body mass in grams as an indicator of body size and resource needs (Rocha et al., 2019).Second, diet composition, assessed as the proportion of four different types of food reported by the literature in each species' diet (insects, fruit, seeds, and nectar).These four types of food serve as indicators of ecosystem service provision in agroforests, including biological pest control, seed dispersal, and pollination.The third trait was habitat preference, defined as an ordinal variable of forest specialization, defined categorically as: 0 = open-land species; 0.5 = habitat generalists, or 1 = forest specialists.Finally, we selected preferred foraging strata of birds as the fourth trait, quantified as the percentage spent by each species on the ground, understory, mid-height and canopy-level vegetation (Wilman et al., 2014).To evaluate functional diversity inside the bird communities, diet and foraging strata were considered as fuzzy traits, that is, traits composed by multiple columns in our datasets, in this case the three vegetation strata and the four food categories previously mentioned, whereas body mass and habitat preference were defined as quantitative traits (i.e., traits composed by a single numerical variable in our dataset; Magneville, 2023).
We evaluated functional diversity using "mFD" (Magneville et al., 2022), which allows the inclusion of functional traits measured in different units (e.g., percentages, grams and categories as in our case).The package calculates a multivariate space using the combination of traits of all the species in a community.Each community (here, bird communities in each of our study areas) is composed by a set of assemblages (i.e., each of our study points), and the size of the multivariate space expands as species in the community are more functionally dissimilar.The rarer a species' traits are within the community, the closer such species is to the edge of the multivariate space.We calculated three functional diversity indices for each of our study points, following Magneville (2023): (1) Functional richness, which indicates the proportion of the functional space from the whole bird community covered by each bird assemblage.This proportion increases with species richness and functional dissimilarity among them.(2) Functional evenness, which evaluates the regularity in the distribution of species and individuals in the functional space covered by the community.This index increases as functional traits are shared by more species and/or individuals, and decreases as fewer species "dominate" certain traits.(3) Functional divergence, which serves as an overall indicator of the functional similarity among all species in the community.This index grows when the proportion of birds and individuals with rare functional traits increases.By contrast, as the index decreases, the functionality of all species becomes more similar, pointing to higher chance of competition and redundance among them (Mouillot et al., 2013;Schleuter et al., 2010;Villéger et al., 2008).All indices were scaled between 0 and 1 to facilitate interpretation.For every plot, we calculated the community weighted means (CWMs) of each functional trait, using the "dplyr::weighted.mean"(Wickham et al., 2014).CWM calculate the average values of each functional trait accounting for the number of species that have the trait and their relative abundance (Ricotta & Moretti, 2011).
We used the three functional diversity indices, as well as the CWM in generalized linear models to evaluate the effect of distance from forest, landscape and their interaction on the functional diversity of bird communities.We used Gaussian distributions for the models and adapted non-normal distributions to gamma distributions, and we report the results of the models using "sjplot::tab_model".For all regression models, we defined the level of significance at p = .05,and regression lines in figures are shown exclusively in the case of significant patterns.

| Standardized effect sizes
Functional and beta diversity indices are known to vary in function of alpha diversity (i.e., species richness) in each study point (e.g., Chase et al., 2011;Flynn et al., 2009).This complicates distinguishing whether dissimilarities are caused by the effect of environmental variables or by stochastic sampling.An alternative to quantify this stochastic variability is the assessment of standardized effect sizes (SESs; Gotelli & Mccabe, 2002).SES quantify the difference between studied bird communities and a set of simulated communities of the same size.If patterns of functional or beta diversity indices are derived from the effect of environmental variables, rather than pure chance, we would expect the real community to differ-at least partly-from the simulated communities.If no large differences are identified, it would be incorrect to conclude a causality between a predictor variable and the dissimilarity values assessed through an index.
We calculated SES in each of our landscapes through 1000 community matrix simulations generated with "vegan::permatswap".The function uses a quasi-swap algorithm to create new matrices that maintain the number of filled cells (e.g., species richness) and the bird abundances per study point, but swap the relative abundance and identity of bird species in each community (Oksanen et al., 2007).For each simulation, we calculated all beta-and functional-diversity indices and then obtained SESs, by comparing the indices from our bird communities with those from simulations (Gotelli & Mccabe, 2002): where I obs is the observed index and I sim the mean from the 1000 simulated indices.SES equal zero indicate no differences between the studied community and the null expectation of stochastic sampling.SES > 0 indicate that communities are more divergent than expected by chance and SES < 0 that they converge more than expected.We plotted the distribution of SES per index and landscape (Appendix 2) and use these results to discuss the implications of stochastic sampling for the conclusions drawn from our analyses.All means are reported ± SE.All data and code for this manuscript are available at osf.io/7d35z (Ocampo-Ariza et al., 2021).

| RESULTS
We recorded 4273 birds during our point-count surveys in all plots in the tropical dry forest landscape, corresponding to 64 bird species, with an average of 31.66 ± 1.34 individuals and 10.45 ± 0.32 species per pointcount survey.There were fewer birds recorded in the subtropical forest landscape (3453 birds), yet corresponding to more species (n = 179), with an average of 22.30 ± 0.87 individuals and 12.02 ± 0.34 species per pointcount survey in this landscape.

| Beta diversity
The average beta diversity in the subtropical forest landscape (β sor = 0.572 ± 0.012; β BC = 0.668 ± 0.011) was higher than in the dry forest (β sor = 0.329 ± 0.007; β BC = 0.442 ± 0.011).In the dry forest landscape, both the Sørensen and Bray-Curtis indices increased significantly along the gradient of distance from forest (Figure 2a, c; Appendix 3), meaning that agroforest bird communities became more dissimilar from forest communities at higher distances from the forest.These tendencies of increased dissimilarity remained significant when we separately analyzed only the study points at a distance from forest of ≤700 m (Appendix 1).By contrast, we did not find a significant change in the Sørensen (Figure 2b) or Bray-Curtis (Figure 2d) index along the gradient of distance from forest in the subtropical forest landscape (Appendix 3), with the variation in species composition of bird communities remaining high but comparable along this gradient.
In the dry forest landscape, species turnover decreased with increasing distance from forest, whereas nestedness increased (Figure 3a, b), indicating that bird communities in agroforests further from forests were a subset of those found in and close to the forest.We did not observe a significant decrease in species turnover when analyzing only study points at ≤700 m from forest (Appendix 1).Moreover, we found a significant positive effect of distance from forest on the abundance-based nestedness and turnover in the dry forest landscape.These changes indicate that individuals from some species present in the forest are replaced by individuals from other species along the distance from forest gradient.Such a turnover in species' abundance was already significant at short distances from the forest (Appendix 1).By contrast, we found no significant changes in turnover or nestedness due to forest distance in subtropical forests (Figure 3c, d, g, h).However, turnover (β Sim = 0.511 ± 0.012; β bal = 0.610 ± 0.012) had much larger values than nestedness (β sne = 0.074 ± 0.004; β gra = 0.068 ± 0.005), representing large replacement of individuals of some species by other species between the bird communities in this landscape.

| Functional diversity
Against our expectations, we found no effect of distance from forest on functional diversity indices (Table 1).
Functional richness was significantly lower in the dry forest landscape than in the subtropical forest, but functional evenness and divergence remained comparable between landscapes (Table 1).
The CWM of bird communities' body mass in the subtropical forest landscape (93.85 ± 4.56 g) was 33.5% higher (t = À2.038;p = 0.049) than in dry forests (70.26 ± 8.59 g; Figure 5a).Body mass of birds did not change significantly in either landscape along the gradient of distance from forest (Appendix 4).Of all the observed species in subtropical forests, 61.5% were forest specialists, compared to only 25.4% in the dry forest landscape.However, there was no significant difference in the CWM of forest specialization between landscapes (Appendix 4).As expected, forest specialization decreased with increasing forest distance in both landscapes, but the decrease T A B L E 1 Results of models evaluating the effect of distance from forest on functional diversity indices of bird communities in forests and cacao agroforests of Peru, and differences in the patterns between two landscapes: dry forest and subtropical forest.was significantly steeper in the subtropical forest (Appendix 4).

Predictors
In both landscapes, insects represented on average half of birds' diets (subtropical forest: 52.46 ± 2.27%; dry forest: 51.06 ± 1.17%; Figure 4a).Insect consumption decreased along the gradient of distance from forest in both landscapes.However, the decline was of only ca.3% in the dry forest (from ca.53% within the forest to 50% at 1 km of distance); whereas in the subtropical forest there was a steep decline from ca. 57% in the forest to >30% in agroforests 1 km away from the forest (Figure 4e, Appendix 4).Between the two landscapes frugivory was higher in the subtropical forest (28.96 ± 5.48%; Figure 4b), and it increased with forest distance in this landscape.In contrast, fruit consumption in the dry forest (18.07 ± 4.23%) decreased with forest distance (Figure 4f, Appendix 4).Seed consumption represented on average less than 15% of the diet of birds in both landscapes, but it increased significantly with forest distance only in the subtropical forest (Figure 4c, g).Nectar consumption was significantly higher in the dry forest (Figure 4d), and increased with forest distance in both landscapes (Figure 4h, Appendix 4).In both forest and agroforests, bird communities foraged significantly more on the ground in the dry forest (Figure 5a); whereas foraging in mid-height and canopy strata were significantly higher in the subtropical forest (Figure 5c, d).The proportion of foraging in the mid-height stratum increased with forest distance in the subtropical forest, whereas it decreased significantly along this gradient in the dry forest (Figure 5g, Appendix 4).

| DISCUSSION
Our study highlights the impact of forest types on the role of cacao agroforests for bird diversity.We corroborate the known benefits of cacao agroforestry for bird diversity conservation, with ca.8.8% of all bird species from Peru recorded in the 23 agroforests of our study landscapes (n = 163 spp.) (Schulenberg et al., 2010).However, we found large differences between the subtropical forest and the dry forest landscapes regarding the effect of forest distance on bird community composition.Previous research has identified significant changes in bird communities in cacao agroforests related to the amount of forest in the landscape (Faria et al., 2006;Rocha et al., 2019).However, comparisons between landscapes located in distinct tropical forest types are rare.We found that while distance from forest had no effect on functional diversity indices, it did affect single functional traits differently in each landscape, as well as the F I G U R E 4 Effects of landscape (dry forest = blue, triangles; subtropical forest = turquoise, circles) and their interaction on the community weighted means of the percentage of four food items on birds' diets.Stars indicate significant differences between landscapes (ad), and lines in scatterplots (e-h) indicate significant effects of distance from forest or its interaction with landscape ***< 0.001.levels of community dissimilarity in the dry forest landscape.Based on these results, we suggest alternative strategies for shade tree management in cacao agroforests from each landscape, which may maximize biodiversity and support the most threatened ecological functions, and related ecosystem services such as seed dispersal and biocontrol.
Our analyses of beta diversity showed that bird communities in cacao agroforests and adjacent secondary forests were more dissimilar in the subtropical forest than in the dry forest landscape, and the dissimilarity remained with increasing distance from forest.These contrasts are related to the natural vegetation characteristics from each landscape, which condition the availability of resources for birds (Karp et al., 2012).In the subtropical forest, the high vegetation complexity and land-use diversity may support higher taxonomic and functional diversity of bird communities, by offering diverse food and refuge resources for birds with different ecological needs (Martínez-Núñez et al., 2023;Zellweger et al., 2017).By contrast, dry forest landscapes have a simpler vegetation structure, and agricultural areas are dominated by annual monocrops avoided by forest bird species, such as rice and soy (Endenburg et al., 2019;Otivo-Barreto, 2010b;Pennington et al., 2000).Therefore, the high dissimilarity of bird communities in subtropical forests may reflect a higher landscape resilience, in which different biodiversityfriendly land cover types maximize landscape-level diversity, maintaining species richness along the forest distance gradient.Similarly, subtropical forests in our study area seem to be fragmented in smaller patches and more disconnected from primary forest than those in the dry forest landscape (Figure 1; MINAM, 2018), which is known to increase the probability of high betadiversity values at the landscape scale (Jones et al., 2021;Püttker et al., 2015).Therefore, maintaining such landscape mosaic and the unique communities in small forest patches should be a priority for bird conservation in this region, to prevent the disappearance of species and traits that rely on certain habitats to persist.
We confirmed through multiple analyses that the high turnover values found in the subtropical landscape were non-random and independent from the sample size and size of agroforests in the study area.On the one hand, most SES for the beta diversity indices from the subtropical forest landscape were different from zero, indicating that the dissimilarities differed from those expected by chance (Chase et al., 2011;Appendix 2).On the other hand, through re-calculations of beta diversity indices on subsets of the dataset, we found that analyses using the same forest plots in both landscapes, or excluding the most distant study points from the subtropical forest still led to high dissimilarity values and no significant changes along the forest distance gradient (Appendix 1).However, excluding the most distant study points within the subtropical forest decreased turnover values from a maximum of 0.9 (Figure 2) to a maximum of 0.6 (Appendix 1).Whereas this may support our previous conclusion that a large diversity of habitat types is driving high dissimilarities among bird assemblages in the subtropical forest landscape, it may also point to the known influence of geographic distance on beta diversity values, contingent on the range of distribution of species (e.g., Morante-Filho et al., 2016).
In contrast to the subtropical forest, SES for betadiversity indices in the dry tropical forest were closer to, or lower than zero (Appendix 2), indicating that the communities had similar or higher homogeneity than expected by chance.Considering the information gap about dynamics of bird communities in dry forest areas, it remains to be confirmed whether this low dissimilarity is generalizable to other tropical dry forest landscapes.Frishkoff et al. (2015) found that species adapted to warmer environments are also more resistant to deforestation and land-use change.Therefore, lower dissimilarity values for communities in the dry forest area may be related to a higher ability of birds in this landscape to make use of anthropogenic habitats, such as agroforests, in comparison to birds from the subtropical forest landscape.Indeed, previous research showed that bird communities in Costa Rican agricultural areas were more similar to communities in dry tropical forests than in wet forests (Frishkoff et al., 2015;Karp et al., 2018).Nevertheless, the increase in nestedness with distance from forest in the dry forest landscape may still indicate a process of biotic homogenization, in which forest specialists disappear at increasing forest distances, making bird assemblages far from forest more similar among themselves.We found that already at distances of up to 700 m from the nearest dry forest bird communities in agroforests were increasingly different from those nearby the forest (Appendix 1).However, the increased nestedness was only significant at larger distances.Therefore, conserving and restoring dry forests at a minimum distance of 700 m from agroforestry areas should be a focus of conservation initiatives, as to maximize bird conservation in the broader landscape, including agroforestry systems (Fremout et al., 2020).
Beyond species loss, our combined analyses of beta diversity and functional diversity allowed us to identify the functional traits that were most resilient and vulnerable in each landscape.While the lack of changes in community dissimilarity in the subtropical forest may have been related to the narrow gradient of forest distance (0-700 m) in comparison to the dry forest (0-1250 m), we did identify dramatic decreases in certain functional traits, such as forest specialization and the proportion of insects in birds' diets.In the dry forest landscape, the percentage of insects in birds diets remained high along the gradient of distance to forest, likely due to the higher offer of resources for insects in irrigated agroecosystems (Ocampo-Ariza et al., 2022).In contrast, it is likely that in the subtropical rainforest specialized insectivores relying on, for example, complex understory vegetation fail to find an adequate microhabitat in agroforestry areas (e.g., Ocampo-Ariza et al., 2019;Powell et al., 2015).Considering that biocontrol services by insectivorous birds are known to contribute significantly to cacao yield in Peru and elsewhere in the tropics, (Ferreira et al., 2023;Maas et al., 2013;Vansynghel et al., 2022), cacao agroforestry in subtropical forest landscapes should prioritize enhancing microhabitat conditions for insectivores to maintain their benefits for cacao productivity.
Contrary to insects, all other food types in birds' diets analyzed in this study increased along the forest distance gradient in the subtropical forest landscape.The increase in the proportion of frugivorous and nectivorous birds in agricultural areas is linked to the higher availability of fruits and flowers in agroecosystems in comparison to nearby forests (Peña et al., 2023;Tscharntke et al., 2008).However, in the dry forest landscape the pattern was opposite, and fruit in birds' diets significantly decreased with forest distance.Possibly, frugivorous species in the dry forest specialize on native fruiting trees that are absent in cacao agroforests (Almaz an-Núñez et al., 2015), which may result in local extinction of bird species within agroforests as indicated by the increased nestedness component of beta-diversity at increasing forest distances.Preventing the loss of frugivorous and forest specialized birds likely requires the integration of local fruit trees in the agricultural matrix, and the enhancement of mid-height vegetation complexity, as indicated by the patterns of species who forage in this stratum (Figure 5g).
The differences we found between the two landscapes in the preferred foraging strata of bird communities may be a reflection of the vegetation complexity in natural forests from each region.Canopy foraging was significantly higher in bird communities of the subtropical forest, whereas ground foraging dominated in the dry forest (Figure 4a, d).Dry forests from northern Peru are characterized by a dominance of low and mid-height vegetation up to 5 m high, with few species reaching the high canopy; whereas more humid tropical forests are characterized by a denser high canopy (Fremout et al., 2023;Linares-Palomino & Alvarez, 2005).Moreover, cacao agroforests in the subtropical forest landscape were characterized by a high variance in shade tree height, which may support diverse foraging preferences for birds (Hanf-Dressler, 2020).Based on these differences in the dominant foraging stratum of bird communities, we argue that the value of biodiversity-friendly management strategies in cacao agroforests can be enhanced by adapting to the local biodiversity needs.Preserving high shade trees may support bird communities most in the subtropical forest landscape, while also contributing to decreased impact of cacao diseases (Blaser-Hart et al., 2021).In contrast, strengthening mid-height vegetation and resources close to the ground should not pose a threat to phytosanitary issues in the dry forest given low air humidity, and would be most successful to retain forest-associated bird species.
According to our expectations, we found that forest specialization decreased with distance from forest in both landscapes.This is expected since forest-specialists often lack key resources in anthropogenic habitats, where they tend to be rarely encountered (Morante-Filho et al., 2015).Forest species are often considered most affected by habitat-homogenization associated with agricultural expansion, and they are thought to be replaced by generalist species which may fill the empty niche (Jones et al., 2021;McKinney & Lockwood, 1999).However, similar to other neotropical research (Rocha et al., 2019), we found that species replacement in our study was not paired with the maintenance of ecological functions.Instead, key foraging traits were lost as forest specialists disappeared with increasing forest distance.Therefore, forest conservation must remain a priority in tropical agroforestry landscapes in order to maintain ecological functions associated with bird communities in agroecosystems.
In conclusion, our study highlights the relevance of accounting for forest types when driving conclusions about the value of agroforestry systems for biodiversity.Recent literature aimed to summarize the contribution of cacao and coffee agroforestry for conserving tropical biodiversity, for example, through global meta-analyses (Bennett et al., 2021;De Beenhouwer et al., 2013) still has shortcomings in this respect.Whereas the research encompassed in these studies acknowledges relevant sources of variation, such as geographical location and forest amount in the landscape (De Beenhouwer et al., 2013;Rocha et al., 2019), generalizations are still biased towards studies in tropical rainforest areas.We found that conservation priorities in agroforestry systems within other forest matrices, such as tropical dry forests, are largely different.At the agroforestry scale, in the subtropical rainforest landscape conserving high shade-tree canopies and microhabitat conditions for insectivorous birds should be prioritized, whereas in the tropical dry forest landscape, conservation priorities should be geared towards species foraging in low vegetation strata.At the landscape scale, management in the dry forest landscape should focus on forest restoration and connectivity, which promote the persistence of forest-dependent birds in areas dominated by agroforestry.In the subtropical forest landscape, management may focus on conserving forest complexity and agroforestry heterogeneity, which guarantee a space for a highly diverse bird community.Accounting for these local differences may help increase the success of conservation measurements in agroforestry landscapes.

F
I G U R E 1 Study areas in two contrasting landscapes with different dominant forest types in Peru: (a) Seasonally dry tropical forest around La Quemaz on, Piura, and (b) subtropical rainforests forest around two towns (Kiteni and Quillabamba) in Cusco.Pictures on the left show a view of the landscape during the dry season.Maps on the right show the precise position of all study points in cacao agroforests (brown circles), and adjacent forests (yellow diamonds).The extension and distribution of different land cover types (primary forest, secondary forests, agricultural and urban areas) are modified from (MINAM, 2018).
Changes in the Sørensen and Bray-Curtis dissimilarity indices of bird community composition in function of difference in distance from forest, in two landscapes with different forest type (Tropical dry forest: [a, c] and subtropical forest: [b, d]).Stars indicate the significance of the predictor's effect obtained from distance-decay models: *0.1-0.05;**0.05-0.01;***< 0.01.
Distance-decay models showing changes in the components of beta-diversity (Sørensen (a, b, e, f) andBray-Curtis (c, d, g, h)   dissimilarity indices), in function of increasing differences in forest distance between study points in each of two study landscapes (Blue = tropical dry forest; turquoise = subtropical forest).Stars indicate the significance of the predictor's effect obtained from distancedecay models: *0.1-0.05;**0.05-0.01;***< 0.01.

F
I G U R E 5 Effects of distance from forest, landscape (dry forest = blue, circles; subtropical forest = turquoise, triangles) and their interaction on the community weighted means of the percentage time that birds forage in four vegetation strata.Stars indicate significant differences between landscapes (a-d), and lines in scatterplots (e-h) indicate significant effects of distance from forest or its interaction with landscape ***< 0.001.