Mechanistic and modeling insights into caffeine adsorption on triazole and terephthalic acid functionalized Mg–Zn–Fe layered double hydroxides Authors: Rehab Mahmoud, Seham M. Hamed, Omkulthom Al kamaly, Ahmed A. Allam, Dina A. Mohammed, Samar M. Mahgoub Published: 2026 ABSTRACT The pervasive presence of caffeine in water bodies demands efficient remediation strategies. This study developed novel triazole (TZ)- and terephthalic acid (PDC)-functionalized Mg–Zn–Fe layered double hydroxides (LDHs) for caffeine (CFN) adsorption. Composites were characterized (FTIR, XRD, BET, TGA, FESEM) and process variables optimized via Box–Behnken design/RSM. Adsorption followed pseudo-second-order kinetics and the Langmuir isotherm, indicating chemisorption-driven monolayer uptake. Advanced statistical physics modeling provided deeper mechanistic insight, revealing a multi-dentate adsorption geometry (n = 0.64–0.81), governed by π–π interactions, hydrogen bonding, and complexation (ΔE = 12.37–16.53 kJ mol−1). The process was spontaneous, endothermic, and exhibited excellent reusability (>61% capacity after 5 cycles) with strong resilience to humic acid and competing ions. A scaling cost-analysis projected operational expenses as low as $0.124–$1.421 per 100 L of treated water. The novelty resides in the first simultaneous use of nitrogen-heterocyclic (TZ) and aromatic dicarboxylate (PDC) ligands within a ternary Mg–Zn–Fe LDH framework, integrated with the Advanced Monolayer statistical physics model, RSM optimization, and techno-economic analysis in a unified caffeine remediation study. In conclusion, TZ- and PDC-functionalized Mg–Zn–Fe LDHs are highly effective, economical, and scalable adsorbents for caffeine removal, offering a promising solution grounded in tunable chemistry and multi-scale mechanistic understanding. Introduction Global water resources are increasingly threatened by contamination from a diverse array of micropollutants categorized as emerging contaminants. This group includes pharmaceuticals, personal care products, and endocrine-disrupting compounds, which enter aquatic environments primarily through domestic, medical, and agricultural waste streams1,2. Due to their high aqueous solubility, resistance to biodegradation, and insufficient removal by conventional water treatment plants, these substances persist in the environment and pose significant ecological risks3,4. Chronic exposure to pharmaceutical residues has been linked to sublethal and long-term adverse effects on aquatic ecosystems and human health.5 Among these contaminants, caffeine (CFN), which is a psychotropic alkaloid widely consumed in beverages, pharmaceuticals, and food products, has become a pervasive environmental pollutant due to its substantial global discharge.6 CFN exhibits dose-dependent toxicity, with adverse health effects reported at daily intakes exceeding 400 mg.7 Its environmental persistence, attributable to slow degradation rates, has led to its detection in various water matrices worldwide. Reported concentrations range from 159 ng L−1 in China (2018) to 6.2 µg L−1 in Pakistan (2019), reaching as high as 0.21 mg L−1 in Saudi Arabian wastewater (2020).8 Current approaches for mitigating pharmaceutical pollutants include advanced physicochemical technologies such as nanofiltration,9 ozonation,10 UV photolysis,11 and coagulation.12 However, these methods often involve high operational costs, significant energy consumption, and the generation of secondary waste products.13 Adsorption has emerged as a promising alternative due to its operational simplicity, cost-effectiveness, minimal environmental footprint, and adaptability through a wide range of adsorbent materials.14 Recent advances in adsorbent design have produced a range of materials with promising caffeine removal performance. Activated carbons derived from agricultural waste (e.g., grape stalks, tea waste) have shown moderate capacities (0.9–19.6 mg g−1), limited by low selectivity and regeneration challenges.8,15 Biochar-based composites, including MgAl-LDH/biochar, have been reported with CFN uptake of ∼26 mg g−1 under highly alkaline conditions (pH 12), far from neutral environmental conditions, limiting practical applicability.16 Metal–organic frameworks (MOFs) offer exceptionally high surface areas but often suffer from poor aqueous stability and high synthesis costs.17 Among LDH-based adsorbents specifically, Cu–Al LDH (calcined form) achieved 153 mg g−1 and ZnFe-LDH showed 152 mg g−1, while CaO/ZnFe-LDH (eggshell-modified) reached 194.9 mg g−1.18,19 Despite this progress, two critical gaps persist in the literature: (i) most LDH-based caffeine adsorption studies rely solely on empirical isotherm and kinetic models (Langmuir, Freundlich, PSO), which provide limited insight into the molecular geometry and energetics of the adsorption interaction; (ii) functionalization of ternary LDHs with two chemically distinct organic ligands (one nitrogen-heterocyclic and one aromatic dicarboxylate) to simultaneously engineer complementary π–π stacking and hydrogen-bonding/complexation interaction sites has not yet been reported for caffeine removal. The present study was designed specifically to address these gaps. Layered double hydroxides (LDHs), also known as anionic clays, have gained considerable attention as adsorbents due to their unique layered structure, high anion exchange capacity, tunable interlayer chemistry, and large surface area.20 A key limitation of pristine LDHs, however, is their relatively low adsorption capacity and lack of specific binding sites for organic contaminants. Functionalization with organic ligands can address these limitations by introducing tailored functional groups that enhance affinity and selectivity toward target pollutants.21 In this study, the intercalation or surface modification of LDHs with nitrogen- and oxygen-rich ligands such as 3-amino-1H-1,2,4-triazole (TZ) and terephthalic acid (PDC) presents a promising strategy to improve their performance for pharmaceutical sequestration.22 This study presents a novel and facile synthesis of Mg–Zn–Fe LDH composites functionalized with TZ and PDC ligands for the efficient adsorption of caffeine from aqueous solutions. The novelty of this work lies in the simultaneous and comparative use of two chemically distinct functional ligands (a nitrogen-rich heterocyclic triazole (TZ) and an aromatic dicarboxylate (PDC)) to engineer complementary interaction sites within the Mg–Zn–Fe LDH framework. This is the first study to integrate, for this specific caffeine/ternary-LDH system, the advanced monolayer statistical physics model alongside classical kinetic, isotherm, and thermodynamic analyses, Box–Behnken RSM optimization, and a comprehensive techno-economic scalability assessment into a unified mechanistic and applied evaluation framework. The reusability of the adsorbents was evaluated through multiple adsorption–desorption cycles, and a comprehensive cost analysis was conducted to assess the economic feasibility for large-scale application. Materials and methods Materials and chemicals All chemical reagents used were of analytical grade and employed without further purification. Magnesium nitrate hexahydrate (Mg (NO3) 2·6H2O), zinc nitrate hexahydrate (Zn (NO3) 2·6H2O), 3-amino-1H-1,2,4-triazole (TZ), and terephthalic acid (PDC) were supplied by Loba Chemie (India). Ferrous chloride tetrahydrate (FeCl2·4H2O), hydrochloric acid (HCl, 0.1 M), and sodium hydroxide (NaOH, 0.1 M) for pH adjustment were procured from Adent Chembio Pvt. Ltd (India). Aluminum nitrate nonahydrate (Al (NO3) 3·9H2O) and sodium hydroxide pellets were obtained from Sigma-Aldrich (Germany). Caffeine (CFN, C8H10N4O2) was used as the model contaminant. All solutions were prepared using deionized water. Synthesis of composites The synthesis of the pristine and functionalized LDH composites was carried out using a co-precipitation method under constant pH control, as illustrated schematically in Fig. 1. Schematic illustration of the synthesis process for pristine Mg–Zn–Fe LDH and its functionalized composites via the co-precipitation method under constant pH control. Synthesis of pristine Mg–Zn–Fe LDH An aqueous solution (100 mL) containing Mg2+, Zn2+, and Fe3+ ions in a molar ratio of 2 : 2 : 1 (corresponding to masses of 2.565 g, 1.895 g, and 4.04 g, respectively) was prepared in a 250 mL beaker. Under vigorous magnetic stirring, a 2 M NaOH solution was added dropwise until the mixture reached a pH of 10.0.23 The resulting suspension was stirred continuously for 24 h at room temperature. The precipitate was collected by filtration, washed repeatedly with double-distilled water until the filtrate reached neutral pH (∼7.0), and then dried overnight at 60 °C under vacuum.24 The dried solid was ground into a fine, homogeneous powder to yield the pristine Mg–Zn–Fe LDH. Functionalization with TZ and PDC The procedure was adapted to incorporate the organic ligands. In separate reactions, 1.0 g of either 3-amino-1H-1,2,4-triazole (TZ) or terephthalic acid (PDC) was added to 100 mL of the mixed metal ion solution (2 M Mg2+, 2 M Zn2+, 1 M Fe3+). The mixtures were stirred vigorously to ensure dissolution and homogeneity. The pH was then adjusted to 10.0 using 2 M NaOH, followed by 24 h of continuous stirring. The subsequent steps of aging, filtration, washing, drying, and grinding were identical to those described for the pristine LDH, yielding the final functionalized composites designated as Mg–Zn–Fe LDH/TZ and Mg–Zn–Fe LDH/PDC, yielding the final functionalized composites designated as Mg–Zn–Fe LDH/TZ and Mg–Zn–Fe LDH/PDC, with approximate final recovered yields of 4.8 g and 4.6 g, respectively, as illustrated in Fig. 1. Characterization techniques The structural, chemical, thermal, and morphological properties of the synthesized adsorbents were characterized using a suite of analytical techniques including X-ray Diffraction (XRD) where Crystallographic analysis was performed using a PANalytical Empyrean diffractometer with Cu Kα radiation (λ = 0.154 nm) operating at 40 kV and 30 mA. Scans were recorded in the 2θ range of 5° to 80°; Fourier Transform Infrared (FTIR) Spectroscopy where Chemical functional groups were identified using a Bruker VERTEX 70 spectrometer over the wavenumber range of 400–4000 cm−1; Thermogravimetric Analysis (TGA/DTG) where Thermal stability and decomposition profiles were investigated using a Stream Instrumentation thermal analyzer. Samples were heated from 30 to 830 °C at a rate of 10 °C min−1 under a nitrogen atmosphere (50 mL min−1 flow rate); Surface Area and Porosity (BET) where Textural properties, including specific surface area, pore volume, and pore size distribution, were determined by N2 adsorption–desorption at 77 K using a Micromeritics TriStar II 3020 system; Field Emission Scanning Electron Microscopy (FESEM) where Surface morphology and microstructure were examined using a Thermo Fisher Scientific Quanta FEG 250 microscope equipped with an energy-dispersive X-ray spectroscopy (EDX) detector for elemental analysis. CHN (Elemental Analysis The elemental analysis) of the final two composites was performed using a Eu roVector (Pavia, Italy) EuroEA EA3000 Series analyzer. Batch adsorption experiments Batch adsorption studies were conducted to evaluate the performance of the LDH composites for CFN removal. A stock solution of caffeine (1000 mg L−1) was prepared and diluted to desired concentrations (20–150 mg L−1). In a typical experiment, a fixed mass of adsorbent (25 mg of either LDH/TZ or LDH/PDC) was added to 25 mL of CFN solution in a 50 mL conical flask. The pH of the solution was adjusted using 0.1 M HCl or NaOH. The flasks were agitated at 150 rpm in an SHO-2D platform shaker at controlled temperatures (25, 40, and 55 °C). After a predetermined contact time, the adsorbent was separated by centrifugation, and the residual CFN concentration in the supernatant was determined using a UV-vis spectrophotometer at its maximum absorption wavelength (λmax = 273 nm). All experiments were performed in triplicate, and the average values were reported with standard deviations below ±5%. The equilibrium adsorption capacity qe (mg g−1) was calculated using:1qe = (C0 − Ce) × V/mwhere C0 and Ce are the initial and equilibrium concentrations of CFN (mg L−1), respectively, V is the volume of the solution (L), and m is the mass of the adsorbent (g). The point of zero charge (pHpzc) of the prepared adsorbents was determined using the pH drift method. A series of 50 mL NaCl solutions (0.01 M) were prepared in separate conical flasks. The initial pH values of the solutions were adjusted between 2 and 10 using 0.1 M HCl or 0.1 M NaOH.25 Then, 0.01 g of adsorbent was added to each flask, and the suspensions were shaken at 200 rpm for 24 h at room temperature. After equilibration, the final pH of each solution was measured. The difference between initial pH (pHi) and final pH (pHf) was plotted against pHi. The pHpzc was determined as the point where pHi = pHf (or where ΔpH = 0).26 Adsorption modeling and data analysis Kinetic modeling The adsorption kinetics were analyzed using four common models including Pseudo-first-order (PFO) model; Pseudo-second-order (PSO) model; Elovich model; Intraparticle diffusion (IPD) model Pseudo-first-order (PFO) model2qt = qe(1 − e−k1t) Pseudo-second-order (PSO) model3 Elovich model4qt = β1ln(1 + αβt) Intraparticle diffusion (IPD) model5qt = kidt0.5 + Cwhere qt and qe are the adsorption capacities at time t and at equilibrium, respectively; k1, k2, α, β, and kid are the rate constants; and C is the intercept related to the boundary layer thickness. Isotherm modeling Equilibrium adsorption data were fitted to the Langmuir and Freundlich isotherm models including Langmuir model;27 Freundlich model.28 Langmuir model6 Freundlich model7qe = KFCe1/nwhere qmax is the maximum monolayer adsorption capacity (mg g−1), KL is the Langmuir constant related to adsorption affinity (L mg−1), KF is the Freundlich constant indicative of adsorption capacity, and 1/n is the heterogeneity factor. Statistical physics modeling To gain deeper mechanistic insights beyond empirical models, advanced statistical physics models (monolayer, double-layer, and multilayer) were applied. These models provide parameters such as the number of molecules per active site (n), receptor site density (NM), and saturation capacity (Qsat), which help interpret the adsorption geometry and energy.29 Thermodynamic analysis The spontaneity and energetic nature of the adsorption process were evaluated using thermodynamic parameters including Gibbs free energy change (ΔG°); enthalpy change (ΔH°); entropy change (ΔS°).308ΔG0 = −RTln(K)9ΔH° = −R × ln(KT2/KT1)/(1/T2 − 1/T1)10ΔS0 = TΔH0 − ΔG0where K is the equilibrium constant, R is the universal gas constant (8.314 J mol−1 K−1), and T is the temperature in Kelvin. RSM/Box–Behnken experimental design A three-factor, three-level Box–Behnken design (BBD) was employed to optimize the adsorption process.31,32 The variables and their coded levels are given in Table 1. Table 1Independent variables and their coded levels for the Box–Behnken designCodeVariableLevel (−1)Level (0)Level (+1) A Time (min)562.5120 B pH25.59 C Adsorbent dose (mg)21120 Independent variables and their coded levels for the Box–Behnken design A total of 17 experimental runs were conducted according to the BBD matrix. The response (CFN removal efficiency, Y) was modeled using a second-order polynomial equation:11Y = β0 + ΣβiXi + ΣβiiXi2 + ΣΣβijXiXiwhere β0 is the constant coefficient, βi are the linear coefficients, βii are the quadratic coefficients, and βij are the interaction coefficients. Analysis of variance (ANOVA) was performed to assess the statistical significance of the model and its terms. The BBD was designed to optimize the three primary operational parameters (pH, dose, time). Effects of temperature and initial CFN concentration were investigated through independent univariate experiments (Sections 3.2–3.3). A five-factor BBD incorporating all variables is recommended for future comprehensive optimization. Desorption and regeneration studies To evaluate reusability, spent adsorbents were regenerated using an eluent solution consisting of a 1 : 1 (v/v) mixture of 1% (m/v) NaOH and 4% (m/v) NaCl. A total of 0.05 g of exhausted adsorbent was contacted with 100 mL of eluent in a 250 mL conical flask and agitated at 150 rpm for 2 h at 25 °C. The regenerated adsorbent was separated by filtration, washed thoroughly with distilled water, dried, and reused in subsequent adsorption cycles. This adsorption–desorption procedure was repeated for five consecutive cycles to assess the stability and regeneration efficiency of the composites.33,34 Interference studies The influence of common water matrix constituents on CFN adsorption was investigated. Competitive adsorption experiments were conducted in the presence of Humic acid (HA) as a model natural organic matter (0–250 mg L−1);35 Inorganic salts (NaCl, Na2SO4, NaNO3, NaHCO3, Na2CO3) at a fixed concentration of 100 mg L−1 to evaluate the effect of different anions.36 The adsorption capacity under these conditions was compared to that in pure CFN solutions. Cost analysis and scalability assessment A detailed cost estimation was performed for the synthesis of 1 kg of each adsorbent, including raw materials, energy consumption (drying and stirring), and labor, with all assumptions clearly stated (Section 3.9). The cost per adsorption cycle was calculated based on reusability over five cycles.37 For scalability, a Langmuir-based mass balance was applied to design batch adsorption systems (5–100 L) targeting 80–95% removal efficiency:12m/V = (C0 − Ce) (1 + KLCe)/(Ce × qmax × KL) Results and discussion Characterization of synthesized adsorbents FTIR spectroscopy The FTIR spectra of pristine Mg–Zn–Fe LDH and the functionalized composites are shown in Fig. 2a. The spectrum of pristine LDH exhibited a broad band at ∼3429.6 cm−1, attributed to the stretching vibration of interlayer hydroxyl groups and adsorbed water molecules. A sharp band at ∼1629 cm−1 corresponds to the bending vibration of H–O–H in interlamellar water. The band at ∼858 cm−1 is characteristic of metal–oxygen (M–O, M–OH) vibrations in the brucite-like layers (M = Mg, Zn, Fe).24 Physicochemical characterization of pristine Mg–Zn–Fe LDH, Mg–Zn–Fe LDH/TZ, and Mg–Zn–Fe LDH/PDC composites: (a) FTIR spectra recorded over 400–4000 cm−1 (KBr pellet method); (b) XRD patterns recorded at 40 kV/30 mA using Cu Kα radiation (λ = 0.154 nm) over 2θ = 5–80°; (c) N2 adsorption–desorption isotherms at 77 K showing the BET surface area analysis, with the inset displaying the BJH pore size distribution; (d) TGA/DTG profiles recorded under N2 atmosphere at 10 °C min−1 from 30 to 830 °C. For the functionalized composites, significant changes were observed. In the Mg–Zn–Fe LDH/TZ spectrum, the O–H stretching band shifted to ∼3463 cm−1 and intensified, suggesting enhanced hydrogen bonding due to TZ incorporation. New bands appeared in the regions of 1500–1600 cm−1 and 1000–1200 cm−1, corresponding to C Created by potrace 1.16, written by Peter Selinger 2001-2019 C/CN stretching and C–N vibrations of the triazole ring, confirming successful functionalization.38 The Mg–Zn–Fe LDH/PDC spectrum showed the O–H stretch at ∼3456 cm−1 and distinct bands at ∼2079 cm−1 (aromatic C–H stretch), ∼1633 cm−1 (asymmetric carboxylate –COO− stretch), ∼1394 cm−1 (symmetric –COO− stretch), and ∼1109 cm−1 (C–N stretch), all characteristic of the PDC ligand.39 The increased intensity ratio of the O–H stretching band to the H–O–H bending band (from 2.10 for pristine LDH to 2.12 for both composites) quantitatively indicated stronger intramolecular hydrogen bonding within the modified structures. X-ray diffraction (XRD) The XRD patterns (Fig. 2b) confirmed the hydrotalcite-type layered structure of all materials. The pristine Mg–Zn–Fe LDH exhibited reflections at 2θ ≈ 11.1°, 22.4°, 34.4°, and 60.3°, corresponding to the (003), (006), (012), and (110) crystallographic planes (JCPDS card No. 14-0191). Applying Bragg's law (d = λ/2 sin θ, λ = 0.154 nm), the d003 basal spacing of pristine LDH was correctly calculated as 7.97 Å; a value characteristic of Mg–Zn–Fe LDH phases with carbonate anions in the interlayer gallery (typical literature range: 7.5–8.0 Å).40 An earlier version of this manuscript contained an erroneous value (2.64 Å) due to a unit-conversion error, which has been fully corrected herein. The Debye–Scherrer crystallite size was 99.35 Å. Upon functionalization, the characteristic LDH reflections were retained in both composites, confirming preservation of the layered framework. For Mg–Zn–Fe LDH/TZ displayed characteristic reflections at 2θ = 10.60°, 22.20°, 29.36°, 34.50°, 39.10°, 46.30°, 60.41°, and 61.80°, indexed to the (003), (006), (009), (012), (015), (018), (110), and (113) planes, respectively, confirming the formation of a crystalline LDH phase and successful interlayer expansion after TZ incorporation.a slight shift in the d003 basal spacing to 8.23 Å suggests minor layer expansion associated with surface-associated TZ molecules, reflecting metal–metal lateral distances within the brucite-like layer; the enhanced intensity of this reflection and the Scherrer crystallite size of 643.53 Å indicate substantially improved crystallinity and reduced stacking disorder following TZ functionalization (Fig. S1). For Mg–Zn–Fe LDH/PDC, the (110) reflection at 2θ ≈ 36.4° (d = 2.47 Å) reflects the more compact lateral arrangement induced by the PDC bridging geometry, with a crystallite size of 506.03 Å. The general increase in crystallite dimensions following functionalization is consistent with reduced lattice strain and fewer stacking faults, favorable for reproducible adsorption performance.41 BET surface area and porosity analysis The N2 adsorption–desorption isotherms (Fig. 2c) were classified as Type III with H3-type hysteresis (IUPAC), indicative of slit-shaped pores or plate-like particle aggregates typical of LDH materials.17,42 LDH/PDC exhibited higher specific surface area (44.796 m2 g−1vs. 30.723 m2 g−1 for LDH/TZ), while LDH/TZ had larger average pore diameter (34.59 nm vs. 16.92 nm) and pore volume (0.266 vs. 0.190 cm3 g−1) (Table 2). Table 2Textural properties of Mg–Zn–Fe LDH/TZ and LDH/PDC compositesAdsorbentBET surface area (m2 g−1)Pore volume (cm3 g−1)Average pore diameter (nm)Mg–Zn–Fe LDH/TZ30.7230.26634.59Mg–Zn–Fe LDH/PDC44.7960.19016.917 Textural properties of Mg–Zn–Fe LDH/TZ and LDH/PDC composites Thermogravimetric analysis (TGA/DTG) Thermal analysis (Fig. 2d) revealed three decomposition stages: (i) 50–250 °C where removal of physically adsorbed and interlayer water (mass loss: 0.578 mg LDH/TZ, 0.379 mg LDH/PDC); (ii) 250–450 °C where decomposition of organic functional groups and dehydroxylation of LDH layers; (iii) 500–650 °C where collapse of the layered structure and removal of residual stable anions.43,44 The confirmed composite formation evidenced by higher residual mass compared to pristine components indicates enhanced thermal stability of both functionalized materials. Morphological analysis (FESEM) FESEM images (Fig. 3) revealed distinct morphologies for the three materials. The pristine Mg–Zn–Fe LDH (Fig. 3a and b) exhibited typical agglomerated platelet-like structures with irregular shapes and considerable surface roughness, creating a high density of edge sites and defects. FESEM images of: Mg–Zn–Fe LDH (a and b) showing agglomerated platelet morphology; Mg–Zn–Fe LDH/TZ (c–e) showing open sponge-like architecture with loosely aggregated particles; Mg–Zn–Fe LDH/PDC (f–h) showing dense consolidated aggregates with smoother surface topography and EDS analysis for the prepared composites (i) LDH/PDC and (k) LDL/TZ respectively. The Mg–Zn–Fe LDH/TZ composite Fig. 3c–e showed a more open, sponge-like, or foam-like architecture with loosely aggregated fine particles. This morphology suggests that TZ functionalization inhibited the dense stacking of LDH layers, leading to a more porous and accessible structure with a potentially higher external surface area, favorable for rapid adsorption. The Mg–Zn–Fe LDH/PDC composite (Fig. 3f–h displayed larger, denser, and more consolidated aggregates with a smoother surface topography. The PDC ligand appears to act as a bridging or capping agent, promoting particle coalescence and reducing external micro-porosity while likely enhancing the material's mechanical cohesion. The EDS spectra of the synthesized Mg–Zn–Fe LDH/PDC and Mg–Zn–Fe LDH/TZ composites confirmed the successful incorporation of the organic ligands into the layered double hydroxide matrix (Fig. 3i–k). For LDH/PDC, the detected elements were Mg, Zn, Fe, O, and C, where the pronounced carbon signal verifies the presence of PDC molecules. In the case of LDH/TZ, the spectrum displayed Mg, Zn, Fe, O, C, and N signals. The appearance of N, which is absent in pristine LDH, provides strong evidence for the successful incorporation of the nitrogen-rich TZ molecules. In both composites, the oxygen peak is associated with OH groups and interlayer water molecules, while Mg, Zn, and Fe originate from the mixed-metal hydroxide layers.These findings confirm the successful synthesis of the hybrid LDH/PDC and LDH/TZ nanocomposites. Elemental CHN analysis of the synthesized Mg–Zn–Fe LDH/TZ composite revealed carbon, hydrogen, and nitrogen contents of 8.42, 3.15, and 16.87 wt%, respectively. The detected carbon and nitrogen percentages confirm the successful incorporation of the TZ ligand into the layered double hydroxide matrix, while the hydrogen content is attributed to structural hydroxyl groups, interlayer water molecules, and the hydrogen atoms of the organic ligand. In particular, the high nitrogen content, which is absent in pristine LDH materials, provides strong evidence for the effective functionalization of the LDH structure with nitrogen-rich triazole species. These results are in good agreement with the proposed composite formulation and support the successful synthesis of the hybrid material. However for Mg–Zn–Fe LDH/PDC composite revealed C and H contents of 14.36 and 2.94 wt%, respectively. The elevated C content confirms the successful incorporation of PDC molecules into the LDH matrix through intercalation or surface anchoring. The absence of nitrogen is consistent with the chemical structure of PDC, which contains no nitrogen atoms, thereby supporting the purity of the incorporated organic ligand. The hydrogen percentage is attributed to OH groups of the LDH layers, interlayer water molecules, and the carboxylic acid functionalities of PDC. Investigation of caffeine (CFN) adsorption performance Effect of solution pH The pH of the aqueous medium is a critical parameter influencing both the surface charge of the adsorbent and the speciation of the adsorbate. The point of zero charge (pHpzc) for both Mg–Zn–Fe LDH/TZ and LDH/PDC composites was determined to be approximately pH 7.0 (Fig. 4b). Consequently, at pH < pHpzc, the adsorbent surface is positively charged due to protonation of hydroxyl groups, while at pH > pHpzc, it becomes negatively charged due to deprotonation.45 Effect of key process variables on CFN adsorption: (a) effect of solution pH (3–9) on CFN removal efficiency for Mg–Zn–Fe LDH/TZ and LDH/PDC; conditions: dose = 0.05 g, C0 = 50 mg L−1, T = 25 °C, t = 120 min; (b) pHpzc determination by the pH-drift method; (c) effect of adsorbent dosage (0.01–0.09 g) on removal efficiency; conditions: pH = 7.0, C0 = 50 mg L−1, T = 25 °C, t = 120 min; (d) effect of contact time (0–180 min) on CFN removal efficiency (%); conditions: pH = 7.0, dose = 0.05 g, C0 = 50 mg L−1, T = 25 °C. Error bars represent ±1 SD (n = 3). As shown in Fig. 4a, the CFN removal efficiency was highly dependent on pH. Maximum adsorption occurred at neutral pH (7.0), with a sharp decline observed under highly alkaline conditions (pH 9.0). Caffeine (pKa ≈ 10.4) exists predominantly as a neutral molecule in the pH range of 3–9. Therefore, the optimal adsorption at pH 7.0 is not governed by strong electrostatic attraction but rather by other synergistic interactions. At this pH, near the pHpzc, the electrostatic repulsion is minimized, allowing other forces such as π–π interactions between the aromatic rings of CFN and the functional groups on the composite, hydrogen bonding, and complexation to dominate the adsorption process.46,47 At pH > 9, the gradual deprotonation of caffeine and the increasingly negative surface charge of the adsorbent likely introduce electrostatic repulsion, leading to reduced uptake. Based on these results, a pH of 7.0 was selected for all subsequent experiments. Effect of adsorbent dosage The influence of adsorbent dosage on CFN removal was investigated by varying the mass of Mg–Zn–Fe LDH/TZ or LDH/PDC from 0.01 to 0.09 g while keeping other parameters constant (Fig. 4c). As expected, the percentage removal of CFN increased with increasing adsorbent dosage due to the greater availability of active surface sites. However, the adsorption capacity per unit mass (qe, mg g−1) exhibited an inverse relationship with dosage. This is a common phenomenon in adsorption systems where at lower dosages, the high adsorbate-to-adsorbent ratio leads to more efficient site utilization and higher qe.48,49 At higher dosages, the constant amount of CFN is distributed over a larger number of sites, leading to lower uptake per gram and potential site overlapping or aggregation.50 A dosage of 0.05 g (2 g L−1) was identified as the optimal compromise, providing high removal efficiency (>90%) while maintaining a respectable adsorption capacity, and was used for further kinetic and isotherm studies. Effect of contact time and adsorption kinetics The temporal profile of CFN adsorption onto both composites is presented in Fig. 4d. The process was characterized by an initial rapid adsorption phase (within the first 20–30 minutes), followed by a slower phase, eventually reaching equilibrium within 120 minutes. The initial rapid uptake is attributed to the high concentration gradient and abundant vacant sites on the adsorbent surface.51 As these sites become occupied, the rate slows down due to intraparticle diffusion limitations and decreased driving force, culminating in dynamic equilibrium.52,53 The kinetic data were rigorously analyzed using four models: Pseudo-First-Order (PFO), Pseudo-Second-Order (PSO), Elovich, and Intraparticle Diffusion (IPD).54–57 The nonlinear fitting curves are shown in Fig. 5, and the derived parameters are summarized in Table 3. Kinetic modeling curves for CFN adsorption: (a) non-linear PFO, PSO, and Elovich fits for LDH/TZ; (b) multi-stage IPD plot for LDH/TZ (three linear segments shown); (c) non-linear kinetic fits for LDH/PDC; (d) multi-stage IPD plot for LDH/PDC. Conditions: C0 = 50 mg L−1, dose = 0.05 g, pH = 7.0, T = 25 °C. Kinetic parameters for CFN adsorption onto Mg–Zn–Fe LDH/TZ and LDH/PDC composites ModelsRegressionVariablesMg–Zn–Fe LDH/TZMg–Zn–Fe LDH/PDCPFO q t = qe(1 − e−k1t) K 1 0.2650.254 q e 64.268.504 R 2 0.6710.621 X 2 1.5082.138RMSE3.3324.085PSO K 2 0.00750.0066 q e 67.8972.75 R 2 0.9590.937 X 2 0.1990.378RMSE1.1711.671Elovich α 0.2070.1803 β 55 018.5224 249.146 R 2 0.9190.919 X 2 0.3590.365RMSE1.6471.742 Mg–Zn–Fe LDH/TZStep 1Step 2Step 3 K int,1 C 1 R 2 K int,2 C 2 R 2 K int,3 C 3 R 2 4.954439.4980.9721.35155.7820.9990.31863.80.991Mg–Zn–Fe LDH/PDC K int,1 C 1 R 2 K int,2 C 2 R 2 K int,3 C 3 R 2 4.7343.1340.9981.71957.6650.8270.42267.510.849 The PSO model provided the best fit to the experimental data, as evidenced by the highest R2 values (0.959 and 0.937) and the close agreement between calculated (qe, cal) and experimental equilibrium capacities. This suggests that the rate-limiting step of CFN adsorption is chemisorption, involving valence forces through sharing or exchange of electrons between the adsorbent and adsorbate. The applicability of the Elovich model (R2 ≈ 0.919) further supports the heterogeneous nature of the adsorbent surfaces. The multi-linear plots from the IPD model (Fig. 5b and d) reveal that the adsorption process occurs in three stages: (1) rapid film or boundary layer diffusion, (2) gradual intraparticle diffusion into mesopores, and (3) final equilibrium where diffusion slows significantly as sites are filled. The fact that the lines do not pass through the origin (C ≠ 0) indicates that intraparticle diffusion is not the sole rate-controlling step; boundary layer diffusion also plays a significant role. Adsorption isotherms and equilibrium studies The equilibrium adsorption data at three different temperatures (25, 40, and 55 °C) were modeled using the Langmuir and Freundlich isotherms. The nonlinear fits are displayed in Fig. 6, and the corresponding parameters are compiled in Table 4. Nonlinear isotherm fitting: Langmuir and Freundlich models Mg–Zn–Fe LDH/TZ and Mg–Zn–Fe LDH/PDC, respectively at 25 °C, 40 °C, and 55 °C; conditions: C0 range = 20–150 mg L−1; dose = 0.05 g; pH = 7.0; equilibration time = 120 min. Table 4Isotherm parameters for CFN adsorption onto Mg–Zn–Fe LDH/TZ and LDH/PDC compositesIsotherm modelVariablesLangmuir T (°C) q max (mg g−1) K L (L mg−1) R 2 X 2 RMSEMg–Zn–Fe LDH/TZ25182.740.0120.9947.1194.97040195.0550.0130.9912.2536.69455235.2970.01260.98914.3837.862Mg–Zn–Fe LDH/PDC25186.550.0150.9936.5745.49640195.3640.0180.9946.1675.64555218.4020.02210.9976.9854.620Freundlich K F 1/n Mg–Zn–Fe LDH/TZ2513.6730.3940.97434.95610.0234014.6370.3970.98231.7449.0275516.3640.4140.98622.0129.076Mg–Zn–Fe LDH/PDC2515.2250.3860.97839.2359.7174017.5390.3760.97543.34210.9835522.9850.3580.99850.97013.811 Isotherm parameters for CFN adsorption onto Mg–Zn–Fe LDH/TZ and LDH/PDC composites The Langmuir model demonstrated superior fitting across all temperatures (R2 > 0.989), suggesting that CFN adsorption occurs as a monolayer on a surface composed of homogeneous sites with uniform adsorption energy. The maximum monolayer capacity (qmax) increased with temperature for both adsorbents, confirming the endothermic nature of the process. The LDH/TZ composite showed a more pronounced increase in capacity with temperature, reaching 235.30 mg g−1 at 55 °C, compared to 218.40 mg g−1 for LDH/PDC.58,59 The Freundlich constant KF, indicative of adsorption capacity, also increased with temperature. The heterogeneity factor 1/n values were all less than 1, indicating favorable adsorption conditions and a degree of surface heterogeneity, which aligns with the Elovich kinetic findings.52,59 Statistical physics modeling: mechanistic insights To transcend the limitations of classical empirical models, advanced monolayer statistical physics models were applied. The Advanced Monolayer Model (AMM) is grounded in the grand canonical ensemble of statistical mechanics, which treats adsorption as a thermodynamic equilibrium process where adsorbate molecules occupy discrete active receptor sites at fixed temperature and chemical potential. This framework provides physically interpretable parameters that encode molecular-scale information about adsorption geometry and energetics, offering mechanistic insight that classical Langmuir and Freundlich analyses cannot deliver. The advanced monolayer statistical physics model assumes that adsorption occurs through occupation of energetically defined active sites on the adsorbent surface. Unlike classical Langmuir analysis, this approach provides steric and energetic parameters such as the number of adsorbed molecules per site (n), density of receptor sites (NM), and saturation adsorption capacity (Qsat). The adsorption takes place through discrete active receptor sites distributed on the adsorbent surface; each site may accommodate one or more adsorbate molecules depending on steric interactions; adsorption equilibrium is governed by energetic affinity between adsorbate molecules and surface sites; and saturation occurs when all accessible sites are occupied. Model 1, a monolayer model with a single energy site, provided an excellent fit to the experimental data (R2 = 0.997–0.999) and RMSE values between 2.49 and 3.82. The derived steric and energetic parameters are presented in Table 5 and Fig. 7. Table 5Parameters of the Advanced Monolayer Model (AMM) for CFN adsorptionAdsorbent T (oC) n N M (mg g−1) Q sat (mg g−1)ΔE1 (kJ mol−1) R 2 RMSEMg–Zn–Fe LDH/TZ250.78274.17212.75313.2440.9982.70400.71346.42246.4713.330.9992.49550.64559.61355.9412.370.9973.82Mg–Zn–Fe LDH/PDC250.74302.69224.2313.380.9992.70400.76301.19228.40314.680.9992.49550.81297.02240.8716.530.9973.82 Parameters of the Advanced Monolayer Model (AMM) for CFN adsorption Effect of temperature on the steric (n, NM, Qsat) and energetic (ΔE) parameters of the AMM model for CFN adsorption onto the (a and b) Mg–Zn–Fe LDH/TZ and (c and d) Mg–Zn–Fe LDH/PDC. Steric parameter (n) represents the number of CFN molecules adsorbed per active site. For both composites, n values were <1.0 across the temperature range. This indicates a multi-molecular adsorption mechanism where CFN ions bind in a mixed orientation that is partly parallel and partly non-parallel to the surface, suggesting cooperative binding involving multiple interactions per molecule. The observed values of n = 0.64–0.81 should not be interpreted as a physical impossibility of less than one molecule per site. Rather, n < 1 reflects a multi-dentate, cooperative binding mode in which a single CFN molecule simultaneously engages multiple neighboring receptor sites. Physically, caffeine possesses a planar purine bicyclic ring with four polar functional groups (two carbonyl CO and two amine C–N), enabling concurrent π–π interactions with aromatic ligand rings, hydrogen bonding with surface –OH/–NH2/–COOH groups, and Lewis acid–base coordination. This simultaneous multi-site engagement means that one molecule 'consumes' fractional portions of multiple independent sites, yielding an effective n < 1; a well-documented phenomenon for planar aromatic pollutants on functionalized adsorbents.60,61 The decrease in n at higher temperatures for LDH/TZ (0.78 → 0.64) indicates that thermal energy promotes a more parallel, flat-lying orientation of caffeine on the surface; a classical result for endothermically driven surface coverage transitions. For LDH/PDC, n remained relatively stable (0.74–0.81), reflecting a more geometrically constrained binding configuration imposed by the rigid PDC carboxylate linker geometry. Site density (NM) reflects the number of available receptor sites per gram of adsorbent. For LDH/TZ, NM increased significantly with temperature (274 to 560 mg g−1), implying that higher thermal energy activated more latent binding sites, possibly by enhancing the accessibility of intercalated TZ groups. For LDH/PDC, NM remained relatively constant, suggesting a more thermally stable site configuration. This thermal invariance of NM in LDH/PDC likely reflects the stronger and more rigid coordination of carboxylate groups to the LDH metal centers (Mg, Zn, Fe), making those binding sites energetically stable and geometrically fixed across the investigated temperature range, in contrast to the more thermally labile surface-associated TZ amino groups. Saturation capacity (Qsat = n × NM) is the theoretical maximum uptake when all receptor sites are fully occupied. The increase in Qsat with temperature for both materials corroborates the endothermic nature observed in the classical isotherm study. LDH/TZ showed a greater thermal enhancement in capacity. The Qsat values (LDH/TZ: 212.8–355.9 mg g−1; LDH/PDC: 224.2–240.9 mg g−1) expectedly exceed the Langmuir qmax values at the same temperatures. This is physically consistent: Qsat represents true thermodynamic saturation when all sites are occupied, whereas Langmuir qmax is an empirical parameter fitted to a finite experimental concentration range that may not reach true saturation conditions. The superior statistical performance of the AMM (R2 = 0.997–0.999, RMSE = 2.49–3.82) relative to the classical Langmuir model (R2 = 0.989–0.997, RMSE = 4.62–7.86), together with the physically consistent monotonic trends of all parameters with temperature, validates the mechanistic interpretations derived from this framework. A precise determination of the adsorption energy (ΔE) is critical for elucidating the interfacial mechanisms governing CFN binding to the active sites of the Mg–Zn–Fe LDH/TZ and Mg–Zn–Fe LDH/PDC composites.62 The following expression was utilized to calculate the ΔE value corresponding to Model 1:6313In this expression, R denotes the universal gas constant (8.314 J mol−1 K−1), C1/2 represents the half-saturation concentration, and CS corresponds to the solute's solubility in the aqueous phase. The endothermic character of CFN adsorption on the Mg–Zn–Fe LDH composites is substantiated by the positive adsorption energies (ΔE) detailed in Fig. 7 for the 25–55 °C interval. The recorded ΔE values were positive, all falling below the 30 kJ mol−1 threshold. This energy range is typical for physical adsorption processes dominated by electrostatic interactions, hydrogen bonding, van der Waals forces, and π–π interactions, rather than strong chemical bond formation. Specifically, the ΔE range of 12.37–16.53 kJ mol−1 is consistent with the combined contributions of π–π stacking interactions (∼8–12 kJ mol−1 per interaction), hydrogen bonding (∼10–40 kJ mol−1 depending on geometry and donor–acceptor pair strength), and Lewis acid–base complexation between the caffeine nitrogen/carbonyl groups and the composite surface. This energy profile categorizes the CFN–LDH interaction as physi-chemisorptive in nature: stronger than pure physisorption driven by van der Waals forces alone, yet weaker than true covalent bond formation, which facilitates the reversibility required for effective regeneration and reuse observed in Section 3.8. Thermodynamic analysis Thermodynamic parameters including Gibbs free energy change (ΔG∘), enthalpy change (ΔH∘), and entropy change (ΔS∘) were calculated from the temperature-dependent equilibrium constants. The evolution of these parameters with CFN concentration is depicted in Fig. 8. Thermodynamic parameters ΔG° (kJ mol−1), ΔH° (kJ mol−1), and ΔS° (J mol−1 K−1) as a function of initial CFN concentration for: (a–c) Mg–Zn–Fe LDH/TZ at 25 °C, 40 °C, 55 °C; (d–f) Mg–Zn–Fe LDH/PDC at the same temperatures. ΔG° calculated from eqn (8); ΔH° from van't Hoff plot (eqn (10)); ΔS° from eqn (9). The negative values of ΔG∘ across all temperatures and concentrations confirm the spontaneous feasibility of the CFN adsorption process. The spontaneity decreased slightly with increasing temperature. The positive values of ΔH∘ (calculated from van't Hoff plots) provide definitive evidence for the endothermic nature of adsorption, consistent with the isotherm and statistical physics results. The positive values of ΔS∘ suggest an increase in randomness at the solid–solution interface during adsorption, which could be due to the release of solvated water molecules from both the adsorbent surface and the CFN molecule upon binding, increasing the disorder of the system.64 Proposed adsorption mechanism Based on the comprehensive characterization, kinetic, isotherm, thermodynamic, and statistical physics results, a multi-mechanism adsorption pathway is proposed (Fig. 9). Post-adsorption FTIR spectra (Fig. 9a and b) provide direct spectroscopic evidence for the dominant interactions: (i) hydrogen bonding: the O–H/N–H stretching bands of both composites shifted by 8–15 cm−1 after CFN loading, and the CO stretching band of caffeine (originally at ∼1700 cm−1) shifted to ∼1685–1692 cm−1 in the loaded composites. These red-shifts are consistent with hydrogen bond formation between the carbonyl oxygen of CFN (H-bond acceptor) and the surface –OH and –NH2 groups of LDH/TZ and LDH/PDC (H-bond donors), as reported for analogous xanthine alkaloid systems by Cao et al. (2024).47 (ii) π–π Stacking Interactions: The aromatic CC/CN bands of TZ (1538 cm−1) and PDC (1585 cm−1) showed broadening and slight shifts (∼5–8 cm−1) after CFN adsorption, indicative of electronic perturbation consistent with π–π stacking between the aromatic π-systems of the ligands and the purine ring of caffeine. This mechanism is well-documented for planar N-heterocyclic compounds on aromatic adsorbent surfaces and is thermodynamically significant (∼8–12 kJ mol−1 contribution per interaction).47 (iii) Surface complexation/coordination: The M–O/M–OH lattice vibration bands (850–700 cm−1) showed intensity changes post-adsorption, suggesting involvement of metal hydroxyl groups in surface complexation. The nitrogen atoms of triazole and oxygen atoms of carboxylate groups may act as Lewis base donors, potentially coordinating with the metal centers (Mg, Zn, Fe) at the LDH surface. This is proposed cautiously, as FTIR alone cannot conclusively distinguish Lewis acid–base coordination from electrostatic contributions; XPS or EXAFS analysis in future studies would provide definitive confirmation. (iv) Electrostatic Interactions: At pH 7.0 (near pHpzc), both the adsorbent surface and caffeine (neutral molecule, pKa ≈ 10.4) carry negligible net charges. Therefore, electrostatic forces are expected to play a secondary role under optimal conditions, with non-electrostatic forces (π–π, H-bonding, complexation, pore-filling) dominating that is fully consistent with the AMM finding of n < 1 (multi-dentate, cooperative binding). (v) Pore filling: the mesoporous architecture of both composites (average pore diameters 16.9–34.6 nm) facilitates intraparticle diffusion and physical entrapment of CFN molecules, contributing to the three-stage IPD kinetic profile. Post-adsorption FTIR spectra of: (a) Mg–Zn–Fe LDH/TZ before and after CFN adsorption; (b) Mg–Zn–Fe LDH/PDC before and after CFN adsorption. (c) Schematic illustration of proposed multi-mechanism adsorption pathway including π–π stacking, hydrogen bonding, surface complexation, and pore filling. Response surface methodology (RSM) optimization and statistical validation The ANOVA results for the quadratic models derived from the Box-Behnken design are presented in Table 6. For both composites, the models were highly significant with very low p-values (<0.0001) and high F-values (154.3 for LDH/TZ, 70.97 for LDH/PDC). The high R2 values (0.98 and 0.97) and non-significant lack of fit (p > 0.05) confirm the models' accuracy and reliability. Table 6Analysis of variance (ANOVA) for CFN removal using Mg–Zn–Fe LDH/TZ and LDH/PDC compositesSourceLDH/TZLDH/PDCSSdfMS F p-valueSSdfMS F p-valueModel5955.879661.76154.3 <0.0001 6430.619714.5170.97 <0.0001 A-pH1026.0511026.05239.24<0.00011234.5511234.55122.63<0.0001B-dose2028.5312028.53472.99<0.00012054.0812054.08204.03<0.0001C-time861.331861.33200.83<0.0001884.311884.3187.84<0.0001 AB 10.66110.662.490.158910.66110.661.060.3377 AC 7.4817.481.740.228232.78132.783.260.1142 BC 51.70151.7012.050.01042.7212.720.2700.6191 A 2 767.201767.20178.89<0.0001939.431939.4393.31<0.0001 B 2 1100.3811100.38256.57<0.00011155.9911155.99114.82<0.0001 C 2 7.6617.661.790.22319.4819.480.9420.3642Residual30.0274.2970.47710.07Lack of fit23.7737.925.06 0.0755 a 59.80319.937.47 0.0408 b Pure error6.2641.5610.6742.67Cor total5985.89166501.0816a p = 0.0755: non-significant LOF, confirming LDH/TZ model adequacy.b p = 0.0408: marginally significant LOF for LDH/PDC. Analysis of variance (ANOVA) for CFN removal using Mg–Zn–Fe LDH/TZ and LDH/PDC composites p = 0.0755: non-significant LOF, confirming LDH/TZ model adequacy. p = 0.0408: marginally significant LOF for LDH/PDC. The significant model terms were identified. For LDH/TZ, pH (A), dose (B), time (C), the BC interaction, and the quadratic terms A2 and C2 were significant. For LDH/PDC, the linear terms (A, B and C) and the quadratic terms A2 and B2 were significant. This indicates that the relationship between variables and response is complex and non-linear. The final empirical models in terms of coded factors are:14aFor Mg–Zn–Fe LDH/TZ: Y = +84.5 − 34.10A + 14.09B + 11.69C − 9.87AC − 22.85A2 − 17.42C214bFor Mg–Zn–Fe LDH/PDC: Y = +79.47 + 12.42A + 16.02B + 10.51C − 14.94A2 − 16.57B2where Y is the predicted CFN removal efficiency (%). Diagnostic plots (Fig. 10) validated the models' assumptions: the normal probability plot of residuals showed a straight line, confirming normality; the plot of predicted vs. actual values showed a close fit to the 45° line; and the residuals vs. run order displayed random scatter, indicating independence.65,66 The Box–Cox plot recommended a lambda near 1, justifying the use of the untransformed data. RSM diagnostic plots for LDH/TZ (a–d) and LDH/PDC (e–h): (a and e) normal probability plots; (b and f) predicted vs. actual (%); (c and g) residuals vs. run; (d and h) Box–Cox plot with recommended λ. The 3D response surface plots (Fig. 11) visually illustrate the interactive effects of the variables. They clearly show the parabolic effect of pH (with an optimum near 7), the positive linear effect of adsorbent dose, and the positive effect of contact time until equilibrium is reached. 3D response surfaces: (a–c) LDH/TZ showing pH × dose, pH × time, dose × time interactions; (d–f) LDH/PDC. Color gradient: blue (low) → red (high) removal efficiency. Diagnostic plots (Fig. 10) validate model assumptions: normal residual distribution, predicted vs. actual near 45°-line, random residual scatter, Box–Cox λ ≈ 1.57,58 Regarding the lack-of-fit test: for LDH/TZ, p = 0.0755 (non-significant), confirming model adequacy. For LDH/PDC, the marginally significant LOF (p = 0.0408) is noted as a limitation, partially attributable to the absence of temperature and initial concentration from the BBD design variables. The present BBD was deliberately focused on the three primary operational parameters. A five-factor BBD is recommended in future work. Interfering substances and regeneration performance Humic acid (up to 250 mg L−1) caused only <20% reduction in CFN uptake (Fig. 12a), demonstrating strong selectivity.67 NaCl caused a noticeable decrease in capacity (Fig. 12b) from electrostatic screening and Cl− competition; CO32− and HCO3− exerted the strongest inhibitory effects (Fig. 12c) from anion exchange and pH elevation.68,69 Over five consecutive cycles (Fig. 12d), LDH/TZ retained ∼61% and LDH/PDC ∼64.6% of initial capacity.70,71 Interference and reusability: (a) humic acid (0–250 mg L−1) effect on removal efficiency (%); (b) NaCl ionic strength (0–250 mM) effect on qe; (c) co-existing anions (100 mg L−1 each) relative effect on removal efficiency; (d) removal efficiency (%) over 5 cycles for LDH/TZ, LDH/PDC, respectively. Error bars = ±1 SD (n = 3). The gradual capacity decline is attributed to three concurrent mechanisms: (1) incomplete desorption and progressive site blocking that is strongly chemisorbed CFN molecules engaged in multi-point π–π and H-bonding interactions resist complete desorption, progressively blocking active sites. Residual CO and CN bands are detectable in post-regeneration FTIR (Fig. 9a and b). (2) Structural degradation; alkaline desorption conditions (pH 12–13) may induce partial dissolution of LDH layers or loss of surface-associated TZ/PDC ligands over repeated cycles. The better stability of LDH/PDC (64.6% vs. 61%) likely reflects stronger carboxylate–metal coordination bonds compared to surface-associated TZ amino groups. (3) Mechanical Adsorbent Loss; inevitable mass losses during filtration/washing reduce effective adsorbent mass. These outcomes are competitive with: ZnFe-LDH (∼68% after 4 cycles);19 GO/LDH composites (∼72% after 5 cycles for ciprofloxacin);52 Ca–Mg LDH (∼58–65% after 5 cycles for phosphate),71 confirming competitive practical reusability. Cost analysis and scalability assessment A detailed cost estimation for the laboratory-scale synthesis of the adsorbents is provided in Table 7. The total cost of raw materials and energy for producing 181.59 g of each composite was calculated as $37.20 for LDH/TZ and $41.58 for LDH/PDC. Scaling this to a 1 kg basis yields a projected production cost of approximately $204.86 kg−1 for LDH/TZ and $228.98 kg−1 for LDH/PDC. Table 7Cost of the laboratory-scale synthesis of LDH/TZ and LDH/PDC compositesMaterial/processQuantity purchasedTotal procurement cost (USD)Unit cost (USD g−1 or USD kg−1)Quantity used in synthesisCost contribution (USD) Raw materials Mg (NO3) 2·6H2O1 kg47.720.0477 g51.3 g2.447Zn (NO3) 2·6H2O500 g51.770.1035 g75.8 g7.845FeCl2·4H2O1 kg70.300.0703 g40.4 g2.8283-Amino-1H-1,2,4-triazole (TZ)250 g46.750.1870 g20.0 g3.740Terephthalic acid (PDC)100 g41.500.4150 g20.0 g8.300Energy (drying, 12 h@1 kW)——0.24 kWh12 kWh13.44Energy (stirring, 24 h@1 kW)——0.24 kWh24 kWh6.72Total cost for 181.59 g of LDH/TZ37.20Total cost for 181.59 g of LDH/PDC41.58Cost per 1 kg (LDH/TZ)204.86Cost per 1 kg (LDH/PDC)228.98 Cost of the laboratory-scale synthesis of LDH/TZ and LDH/PDC composites Crucially, the demonstrated reusability over five consecutive adsorption–desorption cycles significantly reduces the effective cost per treatment cycle. Distributing the initial investment over five uses brings the operational cost down to $40.97 kg−1·cycle for LDH/TZ and $45.79 kg−1.cycle for LDH/PDC. The following key assumptions govern these calculations and are explicitly stated for transparency: (1) raw material unit costs were sourced from current supplier catalogues at time of manuscript preparation; bulk-scale procurement is estimated to reduce costs by 30–60%. (2) Energy costs were assumed at $0.24 kWh−1;72 adjustment for other regions may alter estimates by ±30%. (3) Labor costs are not included; regional skilled labor ($10–50 hr−1) would add an estimated $20–80 kg−1 (4) The synthesis yield of 181.59 g per batch represents experimentally verified recovered dry mass (∼92% of theoretical). (5) Cost amortization over 5 cycles assumes uniform per-cycle performance; the observed ∼8% per-cycle capacity decline was not incorporated, making these upper-bound (conservative) cost estimates. (6) Desorption reagent costs (NaOH, NaCl) are minor (<$0.10/cycle/batch) and were excluded; inclusion would increase per-cycle cost by <5%. (7) No capital equipment or infrastructure costs are included, as these are site- and scale-dependent. Using the Langmuir scale-up mass balance (eqn (12)), the projected operational treatment cost for 100 L at initial CFN = 150 mg L−1 and 95% removal efficiency is approximately $0.124 (LDH/TZ) and $1.421 (LDH/PDC) per batch, considering 5-cycle reuse (Fig. 13). Dosage of (a) LDH/TZ and (b) LDH/PDC composites required for targeted CFN removal efficiencies (80–95%) from aqueous solution. Comparative performance analysis Table 8 compares the CFN adsorption capacity of the synthesized composites with various adsorbents reported in the literature. The Mg–Zn–Fe LDH/TZ and LDH/PDC composites exhibit competitive to superior adsorption capacities (up to 235.3 mg g−1 and 218.4 mg g−1, respectively), especially when considering their operational advantages: effective performance at neutral pH, good kinetics, excellent reusability (5 cycles), and the use of relatively low-cost functionalizing agents. While some specialized carbons report higher capacities, the LDH-based materials offer a better balance of performance, cost, stability, and regenerative potential. Table 8Comparative the CFN adsorption capacities of reference materialsMaterialspHTime (min)DoseCycle numberTemperature Q (mg g−1)Ref.Grape stalk (GS)2.04025 g L−1—25 °C0.938 15 Modified grape stalk (MGS)2.03015 g L−1—25 °C2.300 15 Grape stalk activated carbon (GSAC)4.0301 g L−1—25 °C19.575 15 Cu-Al LDH (calcined)5.057220 mg—25 °C152.99 18 MgAl-LDH/biochar12204 g L−1—40 °C26.22 16 ZnFe-LDH7500.05 g L−1425 °C152.35 19 CaO/ZnFe-LDH (eggshell-modified)9400.05 g L−1425 °C194.87 19 Mg–Zn–Fe LDH/TZ7.01200.05 g L−1555 °C235.30This workMg–Zn–Fe LDH/PDC7.01200.05 g L−1555 °C218.40This work Comparative the CFN adsorption capacities of reference materials Conclusion This study developed and evaluated triazole (TZ)- and terephthalic acid (PDC)-functionalized Mg–Zn–Fe LDH composites as advanced, regenerable adsorbents for caffeine removal. The key quantitative outcomes are: (1) maximum Langmuir adsorption capacities of 235.30 mg g−1 (LDH/TZ) and 218.40 mg g−1 (LDH/PDC) at 55 °C, exceeding most LDH-based and biochar-based caffeine adsorbents in the literature; (2) Pseudo-second-order kinetics (R2 > 0.937) with equilibrium within 120 min, confirming chemisorption rate control; (3) spontaneous (ΔG° < 0), endothermic (ΔH° > 0), and entropy-driven (ΔS° > 0) adsorption confirmed by van't Hoff thermodynamic analysis; (4) AMM parameters n = 0.64–0.81 confirming multi-dentate adsorption geometry with physi-chemisorptive adsorption energies of 12.4–16.5 kJ mol; (5) BBD-RSM optimization yielding 84.5% (LDH/TZ) and 79.5% (LDH/PDC) removal under optimized conditions; (6) >61% adsorption capacity retention after 5 consecutive cycles; (7) projected operational cost of $0.124–$1.421 per 100 L treated water. Limitations: (i) the BBD encompassed three variables; a five-factor design including temperature and initial concentration is recommended; (ii) continuous-flow column data are not yet available; (iii) validation in authentic municipal/industrial wastewater matrices is required. Future directions: (a) pilot-scale continuous-flow column testing; (b) evaluation in real effluent matrices with complex co–contaminant profiles; (c) extension of the TZ/PDC dual-functionalization strategy to target tetracyclines, NSAIDs, and steroid hormones; (d) XPS and EXAFS characterization to provide definitive molecular confirmation of the proposed surface complexation mechanism. Ethics approval Not applicable, as the study did not apply to human or animal studies. The article does not include any studies on human participants or animals conducted by any of the authors. Consent for publication The authors confirm: this work represents original research that has not been previously published in any form; this manuscript has not been submitted for review or publication consideration elsewhere; the publication has received approval from all co-authors. Conflicts of interest All authors declare that they have no conflicts of interest to disclose. Supplementary Material