Question: what medieval Scottish castle was build during the same period as the chapel Dedicated to the Virgin Mary?

full_context: Document 1: Castle of Rattray: The Castle of Rattray was a medieval Scottish castle, with multiple variations on its structure over approximately six centuries. Originally built as a ""late 12th- or early 13th century defensive motte"" it provided protection for Starny Keppie harbour and Rattray village. Sometime between 1214 and 1233 it was upgraded by William Comyn, jure uxoris Earl of Buchan before being destroyed in the 1308 Harrying of Buchan. After Comyn's timber castle was burned down it was replaced by a stronger stone castle which was engulfed during a 1720 sand storm along with nearby Rattray village. After the storm, the castle was not dug out and remains covered to this day. The castle was described by W. Douglas Simpson as one of the nine castles of the Knuckle, referring to the rocky headland of north-east Aberdeenshire.
Document 2: St Mary's, Dublin (chapel of ease): St Mary's Chapel of Ease, also known as "The Black Church", is a former chapel in Dublin, Ireland. Now deconsecrated, it was a church of the Church of Ireland located on St Mary's Place, Broadstone, Dublin. It is constructed from local calp limestone which takes on a dark hue when wet. This is the origin of the building's nickname. A chapel of ease is a church building, other than a parish church, that is located within the bounds of a parish for the convenience of those who cannot conveniently reach the main church. The parish's main church, now also deconsecrated, was St Mary's on Mary Street.
Document 3: St Brendan's Chapel, Skipness: St Brendan's Chapel ("Kilbrannan Chapel, Skipness Chapel") is a medieval chapel near Skipness, Argyll and Bute, Scotland. The chapel was built in the late 13th or early 14th century by Clann Somhairle and was dedicated to St. Brendan. The chapel replaced an earlier chapel dedicated to St. Columba, which had been incorporated into nearby Skipness Castle.
Document 4: Rattray, Aberdeenshire: Rattray (historic: Rettre; occasionally: Rattery; Scottish Gaelic: "Raitear"), "(found at grid reference [ NK088578] )" had been settled as far back as 4000 BC and was named a Royal Burgh in 1563 by Mary, Queen of Scots, "to put an end to the disputes about superiority over it between William Keith, 4th Earl Marischal and George Hay, 7th Earl of Erroll". The ancient burgh was located near to Crimond, Scotland, but the village was largely destroyed and never recovered after a storm in the 18th century that covered it in shifting sands from the nearby dunes at Rattray Head. However, there is still a small modern settlement in the area.
Document 5: St. Katherine's Chapel: St. Katherine's Chapel, also known as St. Katherine's Episcopal Chapel, is an historic Episcopal church building located at 4650 North Meridian Road in Williamston Township, near Williamston, Michigan. It was built 1n 1887 in the Carpenter Gothic style of architecture by John Harris Forster in memory of his daughter Kittie (real name Katherine) who had died in 1864 at the age of six. In 1888 Forster gave the chapel to Episcopal Diocese of Michigan and it was named "St. Katherine's Chapel" in memory of Kitty. On February 23, 1969, the chapel was designated a Michigan State Historic Site and on July 8, 1970, it was listed on the National Register of Historic Places.
Document 6: Dundarg Castle: Dundarg Castle is a ruined castle about 2 km north-northeast of New Aberdour, Aberdeenshire, Scotland, built within the ramparts of an earlier iron age promontory fort. It was described by W. Douglas Simpson as one of the nine castles of the Knuckle, referring to the rocky headland of north-east Aberdeenshire.
Document 7: St Mary's Chapel, Arley: St Mary's Chapel is the private chapel to Arley Hall, near the village of Arley, Cheshire, England. It is recorded in the National Heritage List for England as a designated Grade II* listed building. The chapel is situated to the northeast of the hall.
Document 8: St Mary's Chapel, Rattray: St Mary's Chapel (known also as "the Chapel of the Blessed Virgin") is a late 12th/early 13th century chapel found in Rattray, Aberdeenshire, Scotland. It was built by William Comyn, jure uxoris Earl of Buchan during the same period as the Castle of Rattray and was ""private chapel for the castle"" and its residents. ""Dedicated to the Virgin Mary"" it was possibly constructed after the ""drowning of a"..." [unknown] ""son of Comyn in the well near by.""
Document 9: Lady chapel: A Lady chapel or lady chapel is a traditional British term for a chapel dedicated to "Our Lady", the Blessed Virgin Mary, particularly those inside a cathedral or other large church. The chapels are also known as a Mary chapel or a Marian chapel, and they were traditionally the largest side chapel of a cathedral, placed eastward from the high altar and forming a projection from the main building as in Winchester Cathedral. Most Roman Catholic and many Anglican cathedrals still have such chapels, while mid-sized churches have smaller side-altars dedicated to the Virgin.
Document 10: Forres Castle: Forres Castle was a fort and castle built near Forres, Scotland. The fort was destroyed in 850 by Vikings. Forres was created a royal burgh by King David I of Scotland in 1140. The castle, once a royal castle, was built as a motte and bailey castle and was strengthened in the 14th century. It was demolished in 1297 by the adherents of Wallace. King William the Lion and King Alexander II of Scotland visited and stayed at the castle. King David II of Scotland stayed at the castle in 1346. It was burned by Alexander Stewart, Earl of Buchan in 1390. Held by the Dunbars of Westfield until the 17th century, it fell into ruins. Nothing now remains above ground.
Document 11: Ardrossan Castle: Ardrossan Castle is situated on the west coast of Scotland in the town of Ardrossan, Ayrshire. The castle, defended by a moat, stands on a ridge above the town. There is a keep dating from the fifteenth century, and a vaulted range containing a kitchen and cellars. In a deep passageway there is a well. Part of the keep remains up to the corbels of the parapet, but it is in ruins. The original castle, owned by Clan Barclay, was partly destroyed during the Wars of Scottish Independence. This event, in which the English garrison were slaughtered, became known as "Wallace's Larder," a name which is still applied to the remaining vaults. Rebuilt by Clan Montgomery in the 15th century, Ardrossan later fell into disuse and was partially demolished by the soldiers of Oliver Cromwell in the 17th century who used the stones to help construct the Ayr Citadel.
Document 12: Findlater Castle: Findlater Castle is the old seat of the Earls of Findlater and Seafield, sitting on a 50 ft -high cliff overlooking the Moray Firth on the coast of Banff and Buchan, Aberdeenshire, Scotland. It lies about 15 km west of Banff, near the village of Sandend, between Cullen and Portsoy. The cliffs here contain quartz; the name "Findlater" is derived not from Norse as earlier stated here, but from the Scots Gaelic words "fionn" ("white") and "leitir" ("cliff or steep slope"). The first historical reference to the castle is from 1246. King Alexander III of Scotland repaired this castle in the 1260s in preparation for an invasion by King Haakon IV of Norway. The Vikings took and held the castle for some time. The castle remains that are still there are from the 14th-century rebuilding, when the castle was redesigned based on the Roslyn Castle model.
Document 13: Hospital Chantry: During the period 1100 to 1600 the western Latin Church developed a comprehensive theology of charity and what came to be known as Purgatory. In Scotland together with England and Wales, different traditions developed in the provision of care for the elderly, the sick and the dying In Scotland hospitals provided a number of functions: Travellers rest, Care homes for elderly men and women; and sub-monastic prayer communities. Hospitals such as Bishop Dunbar’s Hospital in Old Aberdeen were in part prayer communities and in part care homes. Most Hospitals or Maison Dieu had a place or room set aside as a Chantry Chapel, or an Oratory. In the Kincardine O’Neil Hospital, the situation on a drove road offered a travellers rest as well as a care and prayer community. Cowan et al. provide details of some 165 hospitals that offered all or some of these functions. In England, similar conditions from the early to late medieval period applied. In addition to care for the elderly, the church in Scotland and England became dominated by what might be called a theology care for the elderly, The theology and practice of Purgatory came to dominate the church and the country as a whole. Across the Western world Charity and Purgatory became the two themes that were often in conflict. Bedehouses and Hospitals were founded to meet the requirements of Charity and Purgatory. In response to this theology individuals often made provision for their after-life by endowing priests and others to say what became known as the Requiem Mass. The Chantry became the place where such masses where said. Chantries owe their name and function of providing an endowment or place for the maintenance of priests to sing daily mass for the souls of founders. In some cases alters or chapels in churches were endowed in this fashion. In Scotland Bishop Dunbar, in the months before he died in 1532, founded a "chantry" or chapel in Elgin Cathedral in memory of his father and mother. The mortification records his wishes and obligations as follows ""…in honorem Sanctse Trinitatis et fanctorum Columbae et Thomae martyris, et pro falute animarum Regis ejufque predeceflbrum et fucceflbrum, Alexandri Dunbar de Weftfeld militis et dominse Elizabethie Suthirland ejus fponfse ..."" Howard Colvin provides a definitive account of the origins of chantries in England. Further evidence of their Anglo-Norman origins is provided by David Crouch. Colvin summarizes the situation as follows:
Document 14: Douglas Castle: Douglas Castle was a stronghold of the Douglas family from medieval times to the 20th century. The first castle, erected in the 13th century, was destroyed and replaced several times until the 18th century when a large mansion house was built in its place. This too was demolished in 1938, and today only a single corner tower of the 17th-century castle remains. The castle was the former family seat of the Prime Minister, Sir Alec Douglas-Home. The castle was located around 1 km north-east of the village of Douglas, South Lanarkshire, in south-west Scotland. The remains are protected as a category C listed building.
Document 15: Świny Castle: Świny Castle (Polish: "Zamek Świny"; formerly "Schweinhausburg" in German) - formerly a gord, as a stronghold existed in its location already in the fifth century - securing the Lubawecki mountain pass, the site was recorded in Cosmas' documents from 1108, where the gord is recorded as "Suini in Poloniae". Possibly, soon after, the gord had been expanded into a military stronghold, at which time it was the seat of the castellans. The castle was mentioned in Pope Adrian IV's Papal bull. After the Bolków Castle was constructed, the castle began to lose its significance, this continued up to the nineteenth century, when the castle suffered severe damage due to hurricanes (1762, 1840, 1848, and 1868). The castle suffered further devastation - it was not until 1931 when the authorities had engaged in securing the castle's ruins. Currently the castle is privately owned.
ground_truth: The Castle of Rattray