/* =========================================================
   CAPGHAN redesign
   Layout inspired by the University of Edinburgh / Usher Institute
   sites: utility bar, brand row with search, site banner, flat
   navigation, text-led intro, card grids and a dark footer.
   ========================================================= */

:root {
  --navy: #041e42;
  --navy-2: #0c2d5a;
  --blue: #0b71a1;          /* CAPGHAN brand blue */
  --link: #00609c;
  --accent: #ffda2b;        /* CAPGHAN brand yellow */
  --grey-50: #f5f6f8;
  --grey-100: #eceef1;
  --border: #d4d8de;
  --text: #1d2433;
  --muted: #535c6b;
  --white: #ffffff;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(4, 30, 66, .08), 0 4px 16px rgba(4, 30, 66, .06);
  --font: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Source Serif 4", Georgia, serif;
  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

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

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

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--navy); }

h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 .6em; }
h1 { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.85rem); }
h2 { font-family: var(--font-head); font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 1000;
  background: var(--accent); color: var(--navy); padding: 10px 16px; font-weight: 700;
}
.skip-link:focus { top: 8px; }

main:focus { outline: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7em 1.3em; border: 2px solid transparent; border-radius: var(--radius);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); color: var(--white); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-accent { background: var(--accent); color: var(--navy); }
.btn-accent:hover { background: #ffe666; color: var(--navy); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--accent); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5em; }

/* ---------- Utility bar ---------- */
.utility-bar { background: var(--navy); color: #c9d3e3; font-size: .875rem; }
.utility-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.utility-bar a { color: #e4eaf3; text-decoration: none; }
.utility-bar a:hover { color: var(--white); text-decoration: underline; }
.utility-parent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utility-links { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; flex-shrink: 0; }

/* ---------- Brand row ---------- */
.brand-row { background: var(--white); border-bottom: 1px solid var(--grey-100); }
.brand-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
.brand-logo img { width: 360px; max-width: 100%; }

.header-search { position: relative; display: flex; width: 100%; max-width: 380px; }
.header-search input {
  flex: 1; min-width: 0; padding: .65em .9em; font: inherit; font-size: 1rem;
  border: 2px solid var(--navy); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text); background: var(--white);
}
.header-search input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.header-search button {
  border: 0; padding: 0 18px; background: var(--navy); color: var(--white); cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.05rem;
}
.header-search button:hover { background: var(--blue); }

.search-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  list-style: none; margin: 0; padding: 6px 0; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search-suggestions a {
  display: flex; gap: 10px; align-items: baseline; padding: 8px 14px;
  color: var(--text); text-decoration: none; line-height: 1.35;
}
.search-suggestions a .s-type { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.search-suggestions li[aria-selected="true"] a,
.search-suggestions a:hover { background: var(--grey-100); }
.search-suggestions .s-all a { border-top: 1px solid var(--grey-100); font-weight: 600; color: var(--link); }
.search-suggestions .s-empty { padding: 8px 14px; color: var(--muted); }

.brand-toggles { display: none; gap: 8px; }
.toggle-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; color: var(--navy); font: inherit; font-size: .75rem; font-weight: 600;
  padding: 6px 10px; cursor: pointer; border-radius: var(--radius);
}
.toggle-btn i { font-size: 1.25rem; }
.toggle-btn[aria-expanded="true"] { background: var(--grey-100); }

/* ---------- Site banner ---------- */
.site-banner {
  position: relative; background-size: cover; background-position: center 40%;
  min-height: 110px; display: flex; align-items: flex-end;
}
.site-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,30,66,.85), rgba(4,30,66,.35)); }
.site-banner .container { position: relative; padding-top: 24px; padding-bottom: 20px; }
.site-banner-name { margin: 0; font-family: var(--font-head); font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 700; max-width: 820px; line-height: 1.25; }
.site-banner-name a { color: var(--white); text-decoration: none; }
.site-banner-name a:hover { text-decoration: underline; }

/* ---------- Main navigation ---------- */
.main-nav { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; display: flex; align-items: stretch; }
.nav-link {
  display: block; padding: 16px 14px; color: var(--navy); font-weight: 600; text-decoration: none;
  border-bottom: 4px solid transparent;
}
.nav-item.has-children .nav-link { padding-right: 4px; }
.nav-link:hover, .nav-item:hover > .nav-link { background: var(--grey-50); color: var(--navy); }
.nav-item.is-active > .nav-link { border-bottom-color: var(--accent); }
.submenu-toggle {
  background: none; border: 0; padding: 0 12px 0 4px; color: var(--navy); cursor: pointer;
  font-size: .75rem; border-bottom: 4px solid transparent;
}
.nav-item.is-active > .submenu-toggle { border-bottom-color: var(--accent); }
.submenu-toggle i { transition: transform .15s; }
.submenu-toggle[aria-expanded="true"] i { transform: rotate(180deg); }

.submenu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 240px; z-index: 55;
  list-style: none; margin: 0; padding: 8px 0; background: var(--navy); box-shadow: var(--shadow);
}
.submenu a { display: block; padding: 9px 18px; color: var(--white); text-decoration: none; }
.submenu a:hover, .submenu a:focus { background: var(--navy-2); color: var(--accent); }
.nav-item.is-open > .submenu { display: block; }
@media (hover: hover) and (min-width: 992px) {
  .nav-item.has-children:hover > .submenu { display: block; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { background: var(--grey-50); font-size: .9rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 12px 0; }
.breadcrumb li + li::before { content: "\203A"; margin: 0 10px; color: var(--muted); }
.breadcrumb a { color: var(--link); }
.breadcrumb [aria-current] { color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-grey { background: var(--grey-50); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.section-head h2 { margin: 0; }
.view-all { font-weight: 600; text-decoration: none; white-space: nowrap; }
.view-all:hover { text-decoration: underline; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; font-weight: 700; color: var(--blue); margin-bottom: .5em; }
.lead { font-size: 1.25rem; color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.hero-image { margin: 0; position: relative; isolation: isolate; }
.hero-image::after { content: ""; position: absolute; left: -14px; bottom: -14px; width: 40%; height: 40%; background: var(--accent); z-index: -1; }

.parent-org a {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-top: 8px;
  background: var(--grey-50); border-left: 4px solid var(--blue); text-decoration: none; color: var(--text);
}
.parent-org a:hover { background: var(--grey-100); }
.parent-org img { height: 52px; width: auto; flex-shrink: 0; }
.parent-org span { font-weight: 600; }

/* ---------- Quick links ---------- */
.quick-links { background: var(--navy); }
.quick-grid { display: grid; grid-template-columns: repeat(var(--quick-cols, 5), 1fr); }
.quick-grid a {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px 12px;
  color: var(--white); text-decoration: none; font-weight: 600; border-right: 1px solid rgba(255,255,255,.12);
}
.quick-grid a:first-child { border-left: 1px solid rgba(255,255,255,.12); }
.quick-grid a i { color: var(--accent); font-size: 1.3rem; }
.quick-grid a:hover { background: var(--navy-2); color: var(--accent); }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 28px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--grey-100); border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--grey-100); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-image img { transform: scale(1.04); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-meta { font-size: .875rem; color: var(--muted); display: flex; gap: 10px; align-items: center; margin-bottom: .6em; }
.tag { background: var(--grey-100); color: var(--navy); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 2px; }
.card-title { font-size: 1.2rem; margin-bottom: .5em; }
.card-title a { color: var(--navy); text-decoration: none; }
.card-title a:hover { text-decoration: underline; color: var(--link); }
.link-list { list-style: none; margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--grey-100); }
.link-list li { padding: 4px 0; }
.link-list a { font-weight: 600; text-decoration: none; }
.link-list a::before { content: "\203A"; margin-right: 8px; color: var(--blue); font-weight: 700; }
.link-list a:hover { text-decoration: underline; }
.card-cta { background: var(--navy); color: #dbe3ef; border: 0; }
.card-cta .card-body { justify-content: center; padding: 32px; }
.card-cta .card-title { color: var(--white); font-family: var(--font-head); font-size: 1.5rem; }
.card-cta .btn { align-self: flex-start; }

/* ---------- Feature band ---------- */
.feature-band { background: var(--blue); color: var(--white); }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.feature-image { margin: 0; height: 100%; }
.feature-image img { width: 100%; height: 100%; max-height: 460px; object-fit: cover; }
.feature-text { padding: 48px; }
.feature-text h2 { color: var(--white); }
.feature-text .eyebrow { color: var(--accent); }
.feature-meta { display: flex; flex-wrap: wrap; gap: 20px; font-weight: 600; }
.feature-meta i { color: var(--accent); margin-right: 6px; }

/* ---------- Split / events / newsletter ---------- */
.split-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--grey-100); }
.event-date {
  flex-shrink: 0; width: 74px; text-align: center; background: var(--grey-50);
  border-top: 4px solid var(--accent); padding: 8px 4px;
}
.event-date .day { display: block; font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.event-date .month { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; }
.event-list h3 { font-size: 1.1rem; margin-bottom: .3em; }
.event-list h3 a { color: var(--navy); text-decoration: none; }
.event-list h3 a:hover { text-decoration: underline; }
.event-list p { margin: 0; color: var(--muted); }

.newsletter { background: var(--navy); color: #dbe3ef; padding: 32px; border-radius: var(--radius); }
.newsletter h2 { color: var(--white); }
.newsletter-icon { font-size: 2rem; color: var(--accent); margin-bottom: 12px; }

/* ---------- Reach ---------- */
.reach { align-items: center; grid-template-columns: 1fr 1.2fr; }
.reach figure { margin: 0; }
.stats { list-style: none; margin: 8px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats li { border-left: 4px solid var(--accent); padding-left: 14px; }
.stats strong { display: block; font-size: 2rem; color: var(--navy); line-height: 1.1; }
.stats span { font-size: .9rem; color: var(--muted); }

/* ---------- Inner pages ---------- */
.page-intro { background: var(--grey-50); padding: 40px 0 32px; border-bottom: 1px solid var(--grey-100); }
.page-intro .lead { max-width: 820px; margin: 0; }
.with-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; }
.side-nav { border-top: 4px solid var(--navy); background: var(--grey-50); position: sticky; top: 80px; }
.side-nav-title { font-family: var(--font); font-size: 1rem; padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--border); }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: block; padding: 11px 18px; text-decoration: none; color: var(--link); border-bottom: 1px solid var(--grey-100); }
.side-nav a:hover { background: var(--grey-100); }
.side-nav a[aria-current] { color: var(--navy); font-weight: 700; border-left: 4px solid var(--accent); padding-left: 14px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.bullets { padding-left: 1.2em; }
.bullets li { margin-bottom: .5em; }
.callout { background: var(--grey-50); border-left: 6px solid var(--accent); padding: 20px 24px; margin: 2em 0; }
.callout p { margin: 0; }
.people-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: var(--radius); background: var(--grey-100); margin-bottom: 12px; }
.person h3 { margin-bottom: .2em; font-size: 1.05rem; }
.person p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Search page ---------- */
.search-page-form { display: flex; gap: 12px; max-width: 760px; }
.search-page-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.15rem; padding: .7em 1em;
  border: 2px solid var(--navy); border-radius: var(--radius);
}
.search-page-form input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent); }
.search-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
.search-layout > .search-empty:only-child { grid-column: 1 / -1; }
.filters-title { font-family: var(--font); font-size: 1rem; margin-bottom: 10px; }
.search-filters ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.search-filters a { display: flex; justify-content: space-between; padding: 10px 12px; text-decoration: none; border-bottom: 1px solid var(--grey-100); }
.search-filters a:hover { background: var(--grey-50); }
.search-filters a.is-active { background: var(--navy); color: var(--white); font-weight: 600; }
.search-filters .count { background: var(--grey-100); color: var(--navy); border-radius: 10px; padding: 0 8px; font-size: .85rem; }
.results-summary { color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.result-list { list-style: none; margin: 0; padding: 0; }
.result { padding: 22px 0; border-bottom: 1px solid var(--grey-100); }
.result-type { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.result-type.document { color: #a4262c; }
.result-title { font-family: var(--font); font-size: 1.25rem; margin: 4px 0 6px; }
.result-title a { text-decoration: none; }
.result-title a:hover { text-decoration: underline; }
.result-snippet { margin: 0 0 4px; }
.result-url { font-size: .85rem; color: #1b6e3a; margin: 0; word-break: break-all; }
mark { background: #fff1a8; color: inherit; padding: 0 1px; }
.search-empty { background: var(--grey-50); padding: 28px 32px; border-radius: var(--radius); }
.search-try a { display: inline-block; margin: 6px 6px 0 0; padding: 4px 12px; background: var(--white); border: 1px solid var(--border); border-radius: 20px; text-decoration: none; }
.search-try a:hover { border-color: var(--navy); }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; }
.pagination span[aria-current] { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ---------- Partners ---------- */
.partners { border-top: 1px solid var(--grey-100); padding: 32px 0; }
.partners-inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.partners-title { font-family: var(--font); font-size: 1rem; color: var(--muted); margin: 0; font-weight: 600; }
.partner-logo img { height: 64px; width: auto; max-width: 220px; object-fit: contain; }
.partner-names { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 28px; list-style: none; margin: 0; padding: 0; font-weight: 700; color: var(--navy); letter-spacing: .04em; }
.partner-names li { max-width: 100%; overflow-wrap: anywhere; }
.partner-names a, .partner-names span { display: inline-block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c9d3e3; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(var(--footer-cols, 3), minmax(0, 1fr)); gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.footer-heading { font-family: var(--font); font-size: 1rem; color: var(--white); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #e4eaf3; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer i { width: 18px; color: var(--accent); }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.legal-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.legal-inner ul { display: flex; flex-wrap: wrap; gap: 20px; }
.legal-inner li { margin: 0; }
.legal-inner p { margin: 0; }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 46px; height: 46px;
  border: 0; border-radius: 50%; background: var(--navy); color: var(--white); cursor: pointer; box-shadow: var(--shadow);
}
.back-to-top:hover { background: var(--blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-link { padding: 16px 10px; }
  .brand-logo img { width: 300px; }
}

@media (max-width: 991px) {
  .container { padding: 0 16px; }
  .utility-parent { display: none; }
  .utility-inner { justify-content: flex-end; }

  .brand-toggles { display: flex; }
  .brand-inner { flex-wrap: wrap; }
  .brand-logo img { width: 240px; }
  .header-search { display: none; order: 3; max-width: none; flex-basis: 100%; }
  .header-search.is-open { display: flex; }

  .main-nav { display: none; position: static; }
  .main-nav.is-open { display: block; }
  .nav-list { flex-direction: column; padding: 8px 0; }
  .nav-item { flex-wrap: wrap; border-bottom: 1px solid var(--grey-100); }
  .nav-link { flex: 1; padding: 14px 4px; border-bottom: 0; }
  .nav-item.is-active > .nav-link { border-left: 4px solid var(--accent); padding-left: 10px; }
  .submenu-toggle { padding: 0 16px; border: 0; border-left: 1px solid var(--grey-100); }
  .submenu { position: static; flex-basis: 100%; box-shadow: none; padding: 4px 0 8px; background: var(--grey-50); }
  .submenu a { color: var(--link); padding: 10px 20px; }
  .submenu a:hover, .submenu a:focus { background: var(--grey-100); color: var(--navy); }

  .hero-grid, .feature-grid, .split-grid, .reach, .with-sidebar, .search-layout { grid-template-columns: 1fr; gap: 32px; }
  .hero-image { order: -1; }
  .hero-image::after { display: none; }
  .feature-text { padding: 32px 16px; }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid a { border: 0; border-bottom: 1px solid rgba(255,255,255,.12); justify-content: flex-start; }
  .quick-grid a:first-child { border-left: 0; }
  .side-nav { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 48px 0; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .utility-links { gap: 14px; }
  .brand-logo img { width: 190px; }
  .cols-3, .people-grid, .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .stats strong { font-size: 1.5rem; }
  .search-page-form { flex-direction: column; }
  .site-banner { min-height: 80px; }
  .parent-org a { flex-direction: column; align-items: flex-start; }
}

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

/* ---------- Membership / utility pages ---------- */
.confirmation { max-width: 720px; }
.confirmation-icon { font-size: 3.5rem; color: #2e7d32; margin-bottom: 12px; }
.membership-number { font-size: 1.5rem; font-weight: 700; letter-spacing: .06em; color: var(--navy); }
.payment { grid-template-columns: 1.3fr 1fr; }
.payment-card { border-top: 4px solid var(--accent) !important; }
.payment table th { width: 45%; }
.role-form { max-width: 640px; }
.not-found .search-page-form { margin: 24px 0 40px; }

@media (max-width: 991px) {
  /* Content first on small screens; section links follow it. */
  .with-sidebar .side-nav { order: 2; }
}

/* ---------- CMS pages: event details and automatic listings ---------- */
.btn-outline-light { border-color: rgba(255,255,255,.7); color: var(--white); background: transparent; margin-left: 8px; }
.btn-outline-light:hover { background: var(--white); color: var(--navy); }

.event-info { background: var(--grey-50); border-left: 6px solid var(--accent); padding: 18px 22px; margin: 0 0 28px; border-radius: var(--radius); }
.event-info dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; margin: 0; }
.event-info dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.event-info dt i { color: var(--blue); width: 16px; }
.event-info dd { margin: 2px 0 0; font-weight: 600; color: var(--navy); }
.event-info.is-past { border-left-color: var(--border); }
.event-past-note { margin: 0 0 12px; color: var(--muted); font-weight: 600; }

.listing { margin: 8px 0 28px; }
.listing > h2 { margin-top: 0; }
.listing-more { margin-top: 12px; font-weight: 600; }
.event-kind { margin: 0 0 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.event-list .event-summary { color: var(--text); margin-top: 6px; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--grey-100); }
.news-thumb { flex: 0 0 180px; }
.news-thumb img { width: 180px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.news-list h3 { font-size: 1.15rem; margin: 0 0 .3em; }
.news-list h3 a { color: var(--navy); text-decoration: none; }
.news-list h3 a:hover { text-decoration: underline; }
.news-list p { margin: 0 0 .4em; }
@media (max-width: 600px) {
  .news-list li { flex-direction: column; gap: 10px; }
  .news-thumb, .news-thumb img { width: 100%; }
}

.footer-heading a { color: var(--white); text-decoration: none; }
.footer-heading a:hover { color: var(--accent); text-decoration: underline; }
.nav-link i, .submenu a i { margin-right: 4px; }

/* ---------- Photo gallery ---------- */
.album-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.album-card a { display: block; height: 100%; text-decoration: none; color: var(--text); background: var(--white); border: 1px solid var(--grey-100); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.album-card a:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.album-card-image { display: block; aspect-ratio: 4 / 3; background: var(--grey-100); overflow: hidden; }
.album-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.album-card a:hover .album-card-image img { transform: scale(1.04); }
.album-card-body { display: block; padding: 14px 16px 16px; border-top: 4px solid var(--accent); }
.album-card-title { display: block; font-weight: 700; color: var(--navy); font-size: 1.1rem; line-height: 1.3; }
.album-card a:hover .album-card-title { text-decoration: underline; }
.album-card-meta { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }

.gallery-back { margin: 0 0 8px; font-weight: 600; }
.gallery-back a { text-decoration: none; }
.gallery-grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery-grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--grey-100); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, opacity .2s; }
.gallery-grid a:hover img, .gallery-grid a:focus img { transform: scale(1.05); }

.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(2, 12, 28, .94); display: flex; align-items: center; justify-content: center; padding: 56px 72px; }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lb-img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; border-radius: 2px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-caption { color: #e4eaf3; margin-top: 12px; text-align: center; max-width: 900px; }
.lb-count { position: absolute; top: 14px; left: 20px; margin: 0; color: #c9d3e3; font-size: .9rem; }
.lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: var(--white); font-size: 1.3rem; cursor: pointer; }
.lightbox button:hover { background: var(--accent); color: var(--navy); }
.lb-close { top: 10px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lightbox { padding: 56px 8px 72px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
}

/* ---------- Home page sections (CMS) ---------- */
.hero-grid.no-image { grid-template-columns: 1fr; max-width: 860px; }
.photo-strip { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-strip a { display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--grey-100); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-strip a:hover img { transform: scale(1.05); }
.home-text { max-width: 820px; }
.cta-band { padding: 48px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-inner h2 { margin-bottom: .3em; }
.cta-inner p { margin: 0; max-width: 680px; }
.cta-navy { background: var(--navy); color: #dbe3ef; }
.cta-navy h2 { color: var(--white); }
.cta-blue { background: var(--blue); color: var(--white); }
.cta-blue h2 { color: var(--white); }
.cta-yellow { background: var(--accent); color: var(--navy); }

/* Image slider: slides share one grid cell and cross-fade. */
.slider { position: relative; background: var(--navy); color: var(--white); }
.slider-standard { --slider-h: clamp(300px, 42vw, 560px); }
.slider-tall { --slider-h: clamp(360px, 56vw, 720px); }
.slider-short { --slider-h: clamp(220px, 28vw, 380px); }
.slider-track { display: grid; }
.slide { grid-area: 1 / 1; position: relative; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
.slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s ease; }
.slide img { display: block; width: 100%; height: var(--slider-h); object-fit: cover; }
.slider-contain .slide img { object-fit: contain; }
.slide-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 96px 0 72px; background: linear-gradient(to top, rgba(4, 30, 66, .9), rgba(4, 30, 66, .55) 60%, rgba(4, 30, 66, 0)); }
.slider-contain .slide-caption { position: static; padding: 24px 0 72px; background: var(--navy); }
.slide-text { max-width: 680px; }
.slide-text h2 { color: var(--white); margin-bottom: .3em; }
.slide-text p { color: #e6ecf5; font-size: 1.125rem; }
.slide-text .btn { margin-top: 4px; }
.slider-controls { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; }
.slider-controls[hidden] { display: none; }
.slider-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(4, 30, 66, .75); color: var(--white); font-size: 1rem; cursor: pointer; }
.slider-btn:hover { background: var(--accent); color: var(--navy); }
.slider-dots { display: flex; gap: 2px; padding: 0 4px; }
.slider-dot { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.slider-dot::before { content: ""; position: absolute; top: 7px; left: 7px; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px var(--navy); transition: background .2s; }
.slider-dot:hover::before { background: var(--white); }
.slider-dot[aria-current="true"]::before { background: var(--accent); }
.slider-btn:focus-visible, .slider-dot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .slide-caption { position: static; padding: 20px 0 68px; background: var(--navy); }
  .slide-text p { font-size: 1rem; }
  .slider-btn { width: 36px; height: 36px; }
}

/* ---------- Form spam protection ---------- */
/* Honeypot fields: off-screen (not display:none, which some bots check for). */
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.captcha-box { margin: 8px 0 16px; }
.captcha-note { color: var(--muted); font-size: .95rem; }
.form-message { padding: 14px 18px; border-radius: var(--radius); margin: 0 0 16px; border-left: 5px solid #a4262c; background: #fbeeee; color: var(--text); }
