/* ==========================================================================
   The Brunel Way — site stylesheet
   Mobile-first. Colours and fonts follow the original Nicepage theme
   (Roboto headings, Open Sans body, blue accent, light-grey bands, dark footer).
   ========================================================================== */

:root {
  --accent: #478ac9;          /* original palette-1 blue */
  --accent-dark: #2f6ea8;
  --accent-soft: #e8f1fa;
  --ink: #111111;
  --ink-muted: #555b63;
  --line: #dde1e6;
  --bg: #ffffff;
  --bg-alt: #f2f2f2;          /* original grey-5 bands */
  --footer: #333333;          /* original grey-80 footer */
  --footer-ink: #c7c7c7;
  --badge: #1f0a0a;           /* route badge dark brown */
  --ok: #2e7d32;
  --warn: #b26a00;
  --danger: #c62828;

  --font-head: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1140px;
  --gutter: 16px;
  --radius: 10px;
  --header-h: 76px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

@media (min-width: 768px) { body { font-size: 1.0625rem; } }

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

a { color: var(--accent-dark); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .6em;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h4 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 60px; height: 60px; }
.brand span { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; }
@media (min-width: 1024px) {
  :root { --header-h: 92px; }
  .brand img { width: 76px; height: 76px; }
  .brand span { font-size: 1.35rem; }
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border: 0; background: none; color: var(--ink);
  border-radius: 8px; cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; text-decoration: none; color: var(--ink);
  font-family: var(--font-head); font-weight: 500;
}
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a:hover { color: var(--accent); }

/* Mobile menu: full-width drop-down panel */
@media (max-width: 1023px) {
  .site-nav {
    position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0;
    z-index: 60;
    background: #111;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-open .site-nav { display: block; }
  .site-nav ul { padding: 12px var(--gutter) 32px; }
  .site-nav a { color: #fff; font-size: 1.25rem; padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
  .site-nav a[aria-current="page"] { color: #8cbcea; }
  body.nav-open { overflow: hidden; }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .site-nav ul { display: flex; gap: 2px; }
  .site-nav a { padding: 8px 12px; border-radius: 6px; font-size: .98rem; }
}

/* ---------- Generic sections ---------- */

.section { padding: 48px 0; }
.section.alt { background: var(--bg-alt); }
@media (min-width: 768px) { .section { padding: 72px 0; } }

.page-head { padding: 40px 0 8px; }
.page-head h1 { margin-bottom: .3em; }
.lead { font-size: 1.12rem; color: var(--ink-muted); max-width: 70ch; }
@media (min-width: 768px) { .lead { font-size: 1.25rem; } }

.prose { max-width: 75ch; }
.muted { color: var(--ink-muted); }
.small { font-size: .9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px;
  border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff;
  font-family: var(--font-head); font-weight: 500; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: #fff; }
.btn.ghost:hover { background: #fff; color: var(--ink); }
.btn.outline { background: transparent; color: var(--accent-dark); }
.btn.outline:hover { background: var(--accent); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Home: hero ---------- */

.hero {
  position: relative; color: #fff;
  min-height: min(78vh, 640px);
  display: flex; align-items: flex-start; /* phones: text over the canopy, above the bridge */
  background: #2b3a22 center / cover no-repeat;
  background-image: url("/images/hero-800.webp");
}
@media (min-width: 900px), (min-resolution: 2.5dppx) {
  .hero { background-image: url("/images/hero-1600.webp"); }
}
@media (min-width: 900px) {
  .hero { background-image: url("/images/hero-1600.webp"); align-items: center; }
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  /* phones: darken the top (where the text sits) and fade out before the bridge */
  background: linear-gradient(180deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 70%);
}
@media (min-width: 900px) {
  .hero::before { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,.65) 100%); }
}
.hero .wrap { position: relative; padding-top: 32px; padding-bottom: 56px; }
@media (min-width: 900px) { .hero .wrap { padding-top: 64px; } }
.hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.5); margin-bottom: .25em; }
.hero p { font-size: clamp(1.1rem, 2.6vw, 1.45rem); max-width: 34ch; text-shadow: 0 1px 10px rgba(0,0,0,.6); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
@media (max-width: 479px) {
  .hero .actions { gap: 10px; margin-top: 16px; }
  .hero .btn { padding: 8px 16px; min-height: 44px; font-size: .95rem; }
}

/* ---------- Home: feature grid ---------- */

.features { display: grid; gap: 28px; margin-top: 32px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); gap: 40px 32px; } }

.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature .icon {
  flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.feature .icon svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1.3rem; margin: 4px 0 6px; }
.feature p { margin: 0; color: var(--ink-muted); }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.stats li {
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .95rem;
}

/* ---------- Two-column media blocks ---------- */

.split { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .split.media-wide { grid-template-columns: 1.25fr 1fr; }
  .split.reverse > :first-child { order: 2; }
}

figure { margin: 0; }
figure img { border-radius: var(--radius); background: #e9ecef; }
figcaption { font-size: .88rem; color: var(--ink-muted); margin-top: 8px; }

a.zoom { display: block; position: relative; cursor: zoom-in; }
a.zoom::after {
  content: "Tap to enlarge"; position: absolute; right: 10px; bottom: 10px;
  background: rgba(0,0,0,.65); color: #fff; font-size: .78rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; pointer-events: none;
}
@media (hover: hover) { a.zoom::after { content: "Click to enlarge"; opacity: 0; transition: opacity .15s; } a.zoom:hover::after { opacity: 1; } }

/* ---------- Route page ---------- */

.stage-index {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  list-style: none; margin: 0;
}
.stage-index a {
  display: inline-block; white-space: nowrap; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: .92rem;
}
.stage-index a:hover { border-color: var(--accent); color: var(--accent-dark); }

.stage-num {
  display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: .85rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 6px;
}
.distance {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem;
}
.distance svg { width: 18px; height: 18px; }

/* ---------- Horizontal photo strip (replaces the Nicepage carousels) ---------- */

.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: 82%;
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 0 14px; margin-top: 28px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.gallery > figure { scroll-snap-align: start; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
@media (min-width: 640px) { .gallery { grid-auto-columns: 45%; } }
@media (min-width: 1000px) { .gallery { grid-auto-columns: calc((100% - 28px) / 3); } }
.gallery-hint { font-size: .85rem; color: var(--ink-muted); margin: 6px 0 0; }
@media (min-width: 1000px) { .gallery-hint.few { display: none; } }

/* ---------- Local Brunel sites ---------- */

.site-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.site-list li:last-child { border-bottom: 0; }
.site-list a { font-weight: 600; }
.site-list .note { display: block; font-size: .9rem; color: var(--ink-muted); }
.area-grid { display: grid; gap: 24px; }
@media (min-width: 800px) { .area-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; } }
.area-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.area-card h2 { font-size: 1.6rem; }

/* ---------- IKB article ---------- */

.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; }
.toc a {
  display: inline-block; text-decoration: none; padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .9rem;
}
.toc a:hover { border-color: var(--accent); color: var(--accent-dark); }

.article { max-width: 78ch; }
.article h3 { margin-top: 1.8em; padding-top: .6em; border-top: 1px solid var(--line); }
.article h3:first-of-type { border-top: 0; margin-top: .4em; }
.article figure { margin: 1.4em 0; }
@media (min-width: 900px) {
  .article { max-width: none; }
  .article .float { float: right; width: 44%; margin: .3em 0 1em 32px; }
  .article .clear { clear: both; }
}

.quotes { display: grid; gap: 20px; }
@media (min-width: 900px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
.quotes blockquote {
  margin: 0; padding: 26px 24px; background: #fff; border-radius: var(--radius);
  border-left: 5px solid var(--accent); font-family: var(--font-head);
  font-size: 1.12rem; line-height: 1.5; font-style: italic;
}
.quotes cite { display: block; margin-top: 14px; font-style: normal; font-size: .92rem; color: var(--ink-muted); }

/* ---------- Amenities map ---------- */

.map-frame {
  position: relative; width: 100%; height: 72vh; min-height: 420px; max-height: 860px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #e9ecef;
}
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 20px; }
.legend li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .92rem; }
.map-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* ---------- Downloads ---------- */

.downloads { display: grid; gap: 18px; }
@media (min-width: 720px) { .downloads { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
.download {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff;
}
.download h2 { font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.download h2 svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.download p { margin: 0; color: var(--ink-muted); }
.download .meta { font-size: .85rem; color: var(--ink-muted); }
.download .btn { align-self: flex-start; margin-top: 10px; }

/* ---------- News & feedback ---------- */

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack { display: grid; gap: 16px; }

.news-item h3 { font-size: 1.3rem; margin-bottom: .2em; }
.news-item time, .fb-meta { font-size: .85rem; color: var(--ink-muted); }
.news-item .body p:last-child { margin-bottom: 0; }

.fb-item .fb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.fb-item .fb-name { font-weight: 700; }
.tag {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent-dark); padding: 2px 10px; border-radius: 999px;
}
.fb-item .fb-msg { white-space: pre-line; margin: 0; }
.reply {
  margin-top: 14px; padding: 14px 16px; background: var(--bg-alt); border-radius: 8px;
  border-left: 4px solid var(--accent);
}
.reply .who { font-weight: 700; font-size: .9rem; margin-bottom: 4px; display: block; }
.reply p { white-space: pre-line; margin: 0; }

.empty { color: var(--ink-muted); font-style: italic; }

/* Forms */
.form { display: grid; gap: 16px; }
.form .row { display: grid; gap: 16px; }
@media (min-width: 640px) { .form .row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field .hint { font-weight: 400; color: var(--ink-muted); font-size: .85rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; /* 16px stops iOS zoom */
  padding: 11px 12px; border: 1px solid #b9c1cc; border-radius: 8px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.notice.ok { background: #e8f5e9; color: var(--ok); }
.notice.err { background: #fdecea; color: var(--danger); }
[hidden] { display: none !important; }

.two-col { display: grid; gap: 40px; }
@media (min-width: 960px) { .two-col { grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; } }

/* ---------- Footer ---------- */

.site-footer { background: var(--footer); color: var(--footer-ink); padding: 48px 0 28px; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr auto; align-items: start; } }
.footer-title { font-family: var(--font-head); font-size: 1.5rem; color: #fff; margin: 0 0 10px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.footer-ikb { width: 120px; opacity: .9; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: .85rem; }

/* ---------- Lightbox ---------- */

dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
dialog.lightbox::backdrop { background: rgba(0,0,0,.88); }
.lightbox-inner { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; padding: 56px 8px 16px; }
.lightbox-inner img { max-width: none; width: min(1600px, 100%); height: auto; border-radius: 4px; }
.lightbox-close {
  position: fixed; top: 10px; right: 10px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.95); color: #111; font-size: 26px; line-height: 1; cursor: pointer;
}
.lightbox-open-full { position: fixed; top: 16px; left: 14px; color: #fff; font-size: .9rem; }

/* ---------- Admin ---------- */

.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-tabs button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.admin-item .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.status { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 4px; }
.status.pending { background: #fff4e5; color: var(--warn); }
.status.approved { background: #e8f5e9; color: var(--ok); }
.status.hidden { background: #eceff1; color: #546e7a; }
.private { font-size: .85rem; background: #fffbe6; padding: 6px 10px; border-radius: 6px; margin-top: 8px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
