/* Bryn-Weirglodd — slate, moss and lichen */
:root {
  --slate: #2f3a40;
  --slate-mid: #56646b;
  --moss: #4f6b3a;
  --moss-dark: #3d5429;
  --lichen: #e8ece4;
  --stone: #f7f8f5;
  --line: #cfd6cc;
  --white: #ffffff;

  --font-head: "Bitter", Georgia, "Times New Roman", serif;
  --font-body: "Karla", "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gap: clamp(1rem, 3vw, 2rem);
  --section-pad: clamp(3rem, 8vw, 5.5rem);
  --header-h: 3.75rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--slate);
  background: var(--stone);
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--slate);
}
h2 { font-size: clamp(1.75rem, 4vw, 2.375rem); font-weight: 700; }
h3 { font-size: 1.1875rem; font-weight: 600; }
p { margin: 0 0 1rem; }

a { color: var(--moss-dark); }
a:hover { color: var(--moss); }
:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(var(--gap), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gap), env(safe-area-inset-right, 0px));
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--white); padding: 0.5rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--slate);
  color: var(--white);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--header-h);
}
.brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.25rem;
  color: var(--white); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--lichen); }
.nav-list {
  display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  color: var(--lichen); text-decoration: none; font-weight: 600; font-size: 0.975rem;
  padding: 0.5rem 0; display: inline-block;
}
.nav-list a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 760px) {
  :root { --header-h: 6rem; }
  .header-inner { flex-direction: column; align-items: stretch; gap: 0; padding-top: 0.5rem; }
  .brand { font-size: 1.125rem; }
  nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 calc(-1 * var(--gap)); }
  nav::-webkit-scrollbar { display: none; }
  .nav-list { gap: 0; padding: 0 calc(var(--gap) - 0.5rem); white-space: nowrap; justify-content: space-between; }
  .nav-list a { padding: 0.6rem 0.5rem; min-height: 44px; display: inline-flex; align-items: center; font-size: 0.9375rem; }
}

/* Hero */
.hero {
  position: relative;
  min-height: min(82vh, 44rem);
  display: flex; align-items: flex-end;
  background: var(--slate-mid) linear-gradient(160deg, #6f7f6a, #3c4a45);
  color: var(--white);
  overflow: hidden;
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 6%;
}
.hero-img.missing { display: none; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 28, 32, 0.82) 0%, rgba(20, 28, 32, 0.35) 45%, rgba(20, 28, 32, 0) 75%);
}
.hero-text { position: relative; z-index: 1; padding-top: 6rem; padding-bottom: clamp(2rem, 6vw, 3.5rem); }
.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 6vw, 3.75rem);
  font-weight: 700;
  max-width: 17ch;
  margin-bottom: 1rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.hero-welsh { font-family: var(--font-head); font-style: italic; font-weight: 500; font-size: 1.125rem; margin-bottom: 0.5rem; color: var(--lichen); }
.hero-sub { max-width: 42ch; font-size: 1.1875rem; margin: 0; }

/* Facts strip */
.facts { background: var(--moss-dark); color: var(--white); }
.facts-list {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin-top: 0; margin-bottom: 0;
}
.facts-list > div { padding: 1.25rem 1.25rem 1.25rem 0; border-right: 1px solid rgba(255, 255, 255, 0.2); }
.facts-list > div + div { padding-left: 1.25rem; }
.facts-list > div:last-child { border-right: 0; }
.facts dt { font-size: 0.875rem; color: #cfdcc3; margin-bottom: 0.2rem; }
.facts dd { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; line-height: 1.35; }
@media (max-width: 900px) {
  .facts-list { grid-template-columns: 1fr 1fr; }
  .facts-list > div, .facts-list > div + div { padding: 1rem 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
  .facts-list > div:nth-child(odd) { padding-right: 1rem; }
  .facts-list > div:last-child { border-bottom: 0; grid-column: 1 / -1; }
}

/* Sections */
.section { padding: var(--section-pad) 0; }
.section-alt { background: var(--lichen); }
.section-intro { color: var(--slate-mid); margin-bottom: 2rem; max-width: 60ch; }
.prose { max-width: 62ch; }

.split {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); } }
.split > * { min-width: 0; }

.rooms {
  background: var(--white);
  border-left: 4px solid var(--moss);
  padding: 1.5rem 1.75rem;
}
.rooms h3 + ul { margin-bottom: 1.5rem; }
.rooms ul:last-child { margin-bottom: 0; }
.rooms ul, .facility-group ul { margin: 0; padding-left: 1.2rem; }
.rooms li, .facility-group li { margin-bottom: 0.4rem; }
.rooms li::marker, .facility-group li::marker { color: var(--moss); }

/* Gallery */
.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(3, 1fr);
}
.gallery li:first-child { grid-column: span 2; grid-row: span 2; }
.gallery button {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--slate-mid) linear-gradient(160deg, #8b9a88, #56646b);
  aspect-ratio: 4 / 3; overflow: hidden; position: relative;
}
.gallery li:first-child button { aspect-ratio: auto; min-height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery button:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .gallery img { transition: none; } .gallery button:hover img { transform: none; } }
.gallery .missing img { display: none; }
.gallery .missing { cursor: default; }
.gallery .missing::after {
  content: attr(data-label);
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 1rem; text-align: center; color: var(--white); font-size: 0.9375rem;
}
@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .gallery li:first-child { grid-row: auto; }
  .gallery li:first-child button { aspect-ratio: 4 / 3; }
}

/* Facilities */
.access-panel {
  background: var(--white); border-left: 4px solid var(--moss);
  padding: 1.5rem 1.75rem; margin-bottom: 2.75rem;
}
.access-panel h3 { font-size: 1.375rem; }
.access-panel p { max-width: 60ch; }
.access-panel ul { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 3rem; }
.access-panel li { margin-bottom: 0.4rem; break-inside: avoid; }
.access-panel li::marker { color: var(--moss); }
@media (max-width: 700px) { .access-panel ul { columns: 1; } }

.facility-groups { columns: 3; column-gap: clamp(1.5rem, 4vw, 3rem); }
.facility-group { break-inside: avoid; margin-bottom: 2.25rem; }
.facility-group h3 { padding-bottom: 0.5rem; border-bottom: 2px solid var(--line); }
@media (max-width: 900px) { .facility-groups { columns: 2; } }
@media (max-width: 560px) { .facility-groups { columns: 1; } }

/* Location */
address { font-style: normal; font-family: var(--font-head); font-weight: 500; font-size: 1.125rem; line-height: 1.5; margin-bottom: 1.25rem; }
.distances { list-style: none; padding: 0; margin: 0 0 1.25rem; border-top: 1px solid var(--line); }
.distances li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
}
.distances li span:last-child { color: var(--slate-mid); text-align: right; white-space: nowrap; }
@media (max-width: 420px) {
  .distances li { flex-direction: column; gap: 0; }
  .distances li span:last-child { text-align: left; white-space: normal; }
}
.split-map { grid-template-columns: 1fr 1.1fr; }
@media (max-width: 820px) { .split-map { grid-template-columns: minmax(0, 1fr); } }
.map-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 5; min-height: 20rem;
  background: var(--line); border: 1px solid var(--line);
}
@media (max-width: 820px) { .map-frame { aspect-ratio: 4 / 3; } }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0.75rem 1.5rem; background: var(--moss-dark); color: var(--white);
  font-weight: 600; text-decoration: none; border-radius: 3px;
}
.button:hover { background: var(--moss); color: var(--white); }

/* Find us */
.find-us { background: var(--slate); color: var(--lichen); }
.find-us h2 { color: var(--white); }
.find-us .section-intro { color: #c3ccc8; }
.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; max-width: 44rem; }
.partner {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 1.25rem 1.5rem; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 3px;
  color: var(--white); text-decoration: none;
}
.partner:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--lichen); color: var(--white); }
.partner-name { font-family: var(--font-head); font-weight: 600; font-size: 1.1875rem; }
.partner-url { color: #c3ccc8; font-size: 0.9375rem; }

/* Footer */
.site-footer {
  background: #232c31; color: #aab5b0; font-size: 0.9375rem;
  padding: 1.75rem 0 calc(1.75rem + env(safe-area-inset-bottom, 0px));
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-footer p { margin: 0; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
  margin: 0; padding: 0; border: 0;
  background: rgba(15, 20, 23, 0.95); color: var(--white);
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(15, 20, 23, 0.95); }
.lightbox img { max-width: calc(100vw - 2rem); max-height: calc(100vh - 7rem); object-fit: contain; }
.lightbox p { margin: 0.75rem 1rem 0; text-align: center; color: var(--lichen); }
.lb-btn {
  position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: var(--white); font-size: 2rem; line-height: 1; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.25); }
.lb-close { top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lb-prev, .lb-next { top: auto; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: none; }
}
