:root {
  color-scheme: light;
  --paper: #f6f9fc;
  --white: #fff;
  --stone: #dbe5ed;
  --ink: #192b3e;
  --muted: #485c6e;
  --saltire-blue: #0065ad;
  --loch: #064984;
  --deep-loch: #123457;
  --heather: #654778;
  --moss: #dce8e1;
  --line: #bacbd8;
  --tartan:
    repeating-linear-gradient(0deg, #4a2d6799 0 12px, transparent 12px 27px, #deefff8f 27px 29px, transparent 29px 46px),
    repeating-linear-gradient(90deg, #6b549895 0 12px, transparent 12px 27px, #deefffa3 27px 29px, transparent 29px 46px),
    #075a9c;
  --serif: Georgia, "Times New Roman", serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; }
main { min-height: 68vh; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible, .outbound-link:focus-visible { outline: .18rem solid #9767b0; outline-offset: .22rem; }
.outbound-link { padding: 0; border: 0; font: inherit; color: inherit; background: none; text-align: inherit; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; }
.outbound-link:disabled { text-decoration: none; cursor: default; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.07; }
h1 { font-size: clamp(3rem, 7vw, 6.5rem); letter-spacing: -.055em; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.04em; }
h3 { font-size: clamp(1.65rem, 3vw, 2.4rem); letter-spacing: -.03em; }

.shell { width: min(100% - 3rem, 73rem); margin-inline: auto; }
.skip { position: fixed; left: 1rem; top: 1rem; padding: .5rem 1rem; background: var(--paper); z-index: 2; transform: translateY(-200%); }
.skip:focus { transform: none; }
.masthead { position: relative; border-bottom: 1px solid var(--line); }
.masthead::after { content: ""; display: block; height: .45rem; background: var(--tartan); }
.masthead-inner { display: flex; justify-content: space-between; gap: .75rem 2rem; align-items: center; flex-wrap: wrap; min-height: 4.75rem; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 1.65rem); letter-spacing: -.04em; white-space: nowrap; text-decoration: none; }
.saltire {
  width: 1.65rem;
  aspect-ratio: 5 / 3;
  flex: none;
  background:
    linear-gradient(31deg, transparent 42%, #fffaf0 43% 57%, transparent 58%),
    linear-gradient(-31deg, transparent 42%, #fffaf0 43% 57%, transparent 58%),
    var(--saltire-blue);
}
nav { display: flex; gap: 1.5rem; }
nav a { display: grid; align-items: center; min-height: 2.75rem; font-size: .94rem; text-decoration: none; }
nav a:hover, nav a[aria-current] { text-decoration: underline; }
nav a[aria-current] { color: var(--loch); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
  min-height: clamp(29rem, 45vw, 42rem);
  background: var(--loch);
  color: var(--paper);
}
.hero-copy {
  align-self: center;
  padding: clamp(2.4rem, 5vw, 5rem) 1.5rem clamp(2.4rem, 5vw, 5rem) max(1.5rem, (100vw - 73rem) / 2);
}
.hero-copy::before {
  content: "";
  display: block;
  width: 5.75rem;
  height: .65rem;
  margin-bottom: 1.4rem;
  background: var(--tartan);
  box-shadow: 0 1px 0 #d9eaff;
}
.hero h1 { font-size: clamp(3.35rem, 7.1vw, 7.2rem); line-height: .92; }
.hero p { max-width: 26rem; margin-top: 1.35rem; font-size: clamp(1rem, 1.5vw, 1.16rem); }
.hero-image { position: relative; background: var(--stone); }
.hero-image img { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: 49% center; }
.hero .button { background: var(--white); color: var(--deep-loch); }
.hero .button:hover { background: #e3f0ff; }
.button { display: inline-flex; min-height: 2.85rem; align-items: center; padding: .65rem 1.1rem; margin-top: 1.5rem; background: var(--paper); color: var(--ink); font-weight: 650; text-decoration: none; }
.button:hover { background: var(--stone); }
.button-dark { background: var(--loch); color: var(--white); }
.button-dark:hover { background: var(--deep-loch); }
.hero-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; padding-block: .65rem; border-bottom: 1px solid var(--line); }
.hero-caption, figcaption, .card-credit, small { font-size: .83rem; color: var(--muted); }
.section { padding-block: clamp(2.8rem, 7vw, 5.6rem); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.text-link { font-weight: 600; }
.cards, .gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.card { min-width: 0; border: 1px solid var(--line); background: var(--white); }
.card-link { display: block; text-decoration: none; }
.card-link:hover h3 { text-decoration: underline; }
.card img { aspect-ratio: 16 / 9; object-fit: cover; object-position: center 48%; }
.card-copy { padding: 1.2rem 1.25rem .5rem; }
.card-copy p + h3 { margin-top: .35rem; }
.card-copy h3 + p { margin-top: .6rem; color: var(--muted); }
.eyebrow { font-size: .88rem; font-weight: 650; color: var(--heather); }
.card-credit { padding: 0 1.25rem 1rem; }
.photo-feature { background: var(--stone); }
.gallery-grid { margin-top: 1.4rem; }
.gallery-figure { min-width: 0; background: var(--white); border: 1px solid var(--line); }
.gallery-figure img { aspect-ratio: 3 / 2; object-fit: cover; }
.gallery-caption { padding: 1.05rem 1.15rem; }
.gallery-caption h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--deep-loch); }
.gallery-caption h3 + p { margin-top: .55rem; font-size: 1rem; }
.gallery-credit { margin-top: .65rem; overflow-wrap: anywhere; }
.regions { background: var(--moss); color: var(--ink); }
.site-footer { background: var(--deep-loch); color: var(--paper); }
.region-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.region-links a { display: block; padding: 1rem 0; border-block: 1px solid #879e95; font-family: var(--serif); font-size: 1.4rem; }
.site-footer { padding-block: 1.7rem; border-top: 1px solid #55738d; }

.subpage { padding-block: clamp(2.5rem, 6vw, 5rem); }
.intro { max-width: 45rem; margin-top: .9rem; font-size: clamp(1.1rem, 2vw, 1.38rem); color: var(--muted); }
.index-groups { margin-top: 2.4rem; }
.index-group + .index-group, .region-castles { margin-top: 2.5rem; }
.index-group { scroll-margin-top: 1rem; }
.index-group > h2 { font-size: clamp(1.65rem, 3.1vw, 2.5rem); }
.index-group > .cards, .region-castles > .cards { margin-top: .85rem; }
.travel-note, .guide-stop { max-width: 46rem; margin-top: 1.5rem; }
.travel-note { padding: 1.05rem 1.2rem; background: var(--moss); border-left: .2rem solid var(--loch); }
.guide-stop > h2, .travel-note > h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin-bottom: .45rem; }
.guide-photo { margin-top: 1.5rem; }
.breadcrumb { margin-bottom: 1.25rem; color: var(--muted); font-size: .95rem; }
.detail-heading { margin-bottom: 1.6rem; }
.detail-photo img { max-height: 34rem; object-fit: cover; }
.detail-photo::before { content: ""; display: block; height: .45rem; background: var(--tartan); }
figcaption { padding-top: .65rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 5.5rem); margin-top: 2.5rem; align-items: start; }
.visit { background: #eae3f0; border-top: .2rem solid var(--heather); padding: clamp(1rem, 3vw, 2rem); }
.visit h2, .editorial h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.place, .editorial section p { margin-top: .7rem; }
dt { font-weight: 700; margin-top: 1.15rem; }
dd a, .editorial section a { display: inline-block; }
.checked { margin-top: 1.1rem; font-size: .88rem; color: var(--muted); }
.editorial section + section { margin-top: 1.75rem; }
.more { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.castle-gallery { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 3.75rem; gap: .2rem 1rem; }
  nav { gap: .9rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-image { grid-row: 1; aspect-ratio: 16 / 9; }
  .hero-copy { padding: 1.75rem 1rem 2rem; }
  .hero-copy::before { margin-bottom: 1.05rem; }
  .cards, .gallery-grid, .region-links, .detail-grid { grid-template-columns: 1fr; }
}
