/* Shared layout for the rebuilt static sites. Brand colours and fonts are set
   per site in brand.css (loaded first). No inline styles anywhere: the server's
   Content-Security-Policy forbids them. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.7;
  color: var(--text); background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); line-height: 1.25; color: var(--heading); margin: 1.6em 0 .6em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ── Top bar ── */
.topbar { background: var(--primary-dark); color: #fff; font-size: .85rem; }
.topbar .container { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; padding: 7px 0; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar .items { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* ── Header & navigation ── */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0; }
.brand { text-decoration: none; flex-shrink: 0; }
.brand img { height: var(--logo-h); width: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 8px 11px; cursor: pointer; color: var(--heading); font: inherit; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.main-nav li { position: relative; }
/* buttons (menus with a drop-down) don't inherit font or line-height: set both so they line up with the links */
.main-nav a, .main-nav .group { display: block; margin: 0; padding: 9px 10px; color: var(--nav-text); text-decoration: none; font-weight: 600; font-size: .9rem; font-family: var(--font-head); line-height: 1.5; border-radius: 6px; cursor: pointer; background: none; border: 0; }
.main-nav a:hover, .main-nav .group:hover, .main-nav .current > a { color: var(--accent-dark); background: var(--soft); }
.main-nav .group::after { content: " ▾"; font-size: .75em; }
.main-nav ul ul { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: #fff; list-style: none; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.main-nav li:hover > ul, .main-nav li:focus-within > ul { display: block; }
.main-nav ul ul a { font-weight: 500; }
/* third level (e.g. Project > Theme > Study) opens to the side */
.main-nav ul ul ul { top: -9px; left: 100%; min-width: 280px; }
.main-nav ul ul .group { width: 100%; text-align: left; font-weight: 600; }
.main-nav ul ul .group::after { content: " ▸"; }
/* menus near the right end of the bar open leftwards so they stay on screen */
.main-nav > ul > li:nth-last-child(-n+4) > ul { left: auto; right: 0; }
.main-nav > ul > li:nth-last-child(-n+4) ul ul { left: auto; right: 100%; }
.main-nav > ul > li:nth-last-child(-n+4) ul ul .group::after { content: ""; }
.main-nav > ul > li:nth-last-child(-n+4) ul ul .group::before { content: "◂ "; }

@media (max-width: 1200px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--border); max-height: calc(100vh - 80px); overflow-y: auto; }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; padding: 8px 16px 16px; }
  .main-nav ul ul { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; }
  .main-nav .group::after, .main-nav ul ul .group::after { content: ""; }
  .main-nav ul ul ul { padding-left: 14px; }
  .main-nav > ul > li:nth-last-child(-n+4) > ul, .main-nav > ul > li:nth-last-child(-n+4) ul ul { right: auto; }
  .main-nav > ul > li:nth-last-child(-n+4) ul ul .group::before { content: ""; }
}

/* ── Page banner ── */
.banner { background: var(--banner-bg); color: #fff; padding: 56px 0 46px; position: relative; overflow: hidden; }
.banner .bg, .hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner.has-image::before { content: ""; position: absolute; inset: 0; background: var(--banner-overlay); z-index: 1; }
.banner .container { position: relative; z-index: 2; }
.banner h1 { color: #fff; margin: 0 0 .3em; }
.banner p { margin: 0; opacity: .92; max-width: 760px; }
.crumbs { font-size: .85rem; margin-bottom: .8em; opacity: .9; }
.crumbs a { color: #fff; }

/* ── Content ── */
main { display: block; }
.content { padding: 48px 0 64px; }
.content > .container > :first-child { margin-top: 0; }
.prose { max-width: 860px; }
.prose img { margin: 1.2em 0; border-radius: 8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 1.4em 0; padding: .8em 1.2em; border-left: 4px solid var(--accent); background: var(--soft); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; margin: 1em 0; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
td, th { border: 1px solid var(--border); padding: 8px 10px; vertical-align: top; text-align: left; }
td p, th p { margin: 0 0 .3em; }
tr:nth-child(even) td { background: var(--soft); }
.btn, a.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; font-family: var(--font-head); border: 2px solid var(--accent); }
.btn:hover, a.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-dark); }
.btn.ghost:hover { background: var(--accent); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }
.muted { color: var(--muted); }
.lead { font-size: 1.12rem; }

/* gallery of images inside page content / photo galleries */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 1.4em 0; }
.gallery a { display: block; border-radius: 8px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 .4em; font-size: 1.12rem; }
.card h3 a { color: var(--heading); text-decoration: none; }
.card h3 a:hover { color: var(--accent-dark); }
.card p { color: var(--muted); font-size: .94rem; }
.card .more { margin-top: auto; font-weight: 600; text-decoration: none; }
.date { font-size: .82rem; color: var(--accent-dark); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* sections on home pages */
.section { padding: 64px 0; }
.section.alt { background: var(--soft); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 36px; }
.section-head h2 { margin-top: 0; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; }
.split img { border-radius: 12px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 1.5em 0; }
.fact { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.fact strong { display: block; font-family: var(--font-head); color: var(--heading); font-size: 1.05rem; }
.fact span { color: var(--muted); font-size: .9rem; }
.logos { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: center; }
.logos img { height: 64px; width: auto; object-fit: contain; filter: grayscale(.3); }

/* hero */
.hero { position: relative; color: #fff; background: var(--primary-dark); padding: clamp(90px, 14vw, 170px) 0; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); z-index: 1; }
.hero .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; margin: 0 0 .4em; max-width: 820px; }
.hero p { font-size: 1.15rem; max-width: 680px; }
.hero .btn.ghost { color: #fff; border-color: #fff; }
.hero .btn.ghost:hover { background: #fff; color: var(--heading); }

/* ── Footer ── */
.site-footer { background: var(--footer-bg); color: var(--footer-text); font-size: .93rem; padding: 54px 0 0; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; margin: 0 0 .8em; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .35em; }
.footer-logo { height: 70px; width: auto; background: #fff; border-radius: 8px; padding: 6px; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 40px; padding: 16px 0; font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* lightbox (site.js) */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 92vw; border-radius: 6px; }
.lightbox button { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer; }

iframe.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 12px; display: block; }

/* click-to-play video (render.video + site.js) */
.video-wrap { margin: 1.2em 0; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #1b2533, #3a4a5e); }
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; opacity: .85; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; margin: 0; aspect-ratio: auto; border-radius: 0; }
.video .play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; }
.video .play span { position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; transform: translate(-50%, -50%); border-radius: 14px;
  background: #e62117; box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: transform .2s; }
.video .play span::after { content: ""; position: absolute; left: 31px; top: 15px; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; }
.video .play:hover span, .video .play:focus-visible span { transform: translate(-50%, -50%) scale(1.08); }
.video-wrap figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.video-wrap figcaption span { color: var(--heading); font-weight: 600; }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.videos .video-wrap { margin: 0; }

/* notice box (e.g. "files will appear here") */
.notice { background: var(--soft); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 10px; padding: 22px 24px; }
.notice h2, .notice h3 { margin-top: 0; }
.notice > :last-child { margin-bottom: 0; }

/* slideshow (site.js): slides stacked, one visible, cross-fade */
.slideshow { position: relative; border-radius: 14px; overflow: hidden; background: var(--primary-dark); aspect-ratio: 4 / 3; box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.slideshow .slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .8s ease; }
.slideshow .slide.active { opacity: 1; }
.slideshow .slide img { width: 100%; height: 100%; object-fit: cover; }
.slideshow figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 40px; color: #fff; font-weight: 600; font-family: var(--font-head);
  background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.slideshow .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.85); color: #111; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.slideshow .nav-btn:hover, .slideshow .nav-btn:focus-visible { background: #fff; }
.slideshow .prev { left: 12px; }
.slideshow .next { right: 12px; }
.slideshow .dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.slideshow .dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; }
.slideshow .dots button[aria-current="true"] { background: #fff; }
@media (prefers-reduced-motion: reduce) { .slideshow .slide { transition: none; } }

/* split hero: text on the left, slideshow on the right (photos stay near their real size) */
.hero-split { background: var(--banner-bg); color: #fff; padding: clamp(40px, 6vw, 72px) 0; }
.hero-split .container { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: center; }
.hero-split h1 { color: #fff; margin: 0 0 .4em; }
.hero-split p { font-size: 1.1rem; }
.hero-split .kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; opacity: .85; margin: 0; }
.hero-split .btn.ghost { color: #fff; border-color: #fff; }
.hero-split .btn.ghost:hover { background: #fff; color: var(--heading); }
@media (max-width: 900px) { .hero-split .container { grid-template-columns: 1fr; } }

/* photo + text rows */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin: 0 0 48px; }
.feature:last-child { margin-bottom: 0; }
.feature.reverse > .feature-img { order: 2; }
.feature.top { align-items: start; }
.feature .prose > :first-child { margin-top: 0; }
.feature-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.feature h2, .feature h3 { margin-top: 0; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; gap: 20px; } .feature.reverse > .feature-img { order: 0; } }

/* small cards with an icon-like number or heading, for values, objectives, inclusions */
.tiles.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; margin: 1.4em 0; padding: 0; list-style: none; }
.tile { background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 10px; padding: 18px 20px; }
.tile h3 { margin: 0 0 .4em; font-size: 1.08rem; }
.tile p, .tile ul { margin: 0; color: var(--text); font-size: .95rem; }
.tile ul { padding-left: 1.1em; }
.tile li { margin-bottom: .25em; }
.tile .num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--soft);
  color: var(--accent-dark); font-weight: 700; font-family: var(--font-head); margin-bottom: 8px; }
.statement { font-size: 1.15rem; font-family: var(--font-head); color: var(--heading); border-left: 4px solid var(--accent); padding: 4px 0 4px 18px; margin: 0 0 1.4em; }

/* price / fee tables */
.price-table { width: 100%; }
.price-table thead th { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.price-table tbody th { font-weight: 600; color: var(--heading); background: #fff; }
.price-table tbody tr:nth-child(even) th { background: var(--soft); }
.price-table td.amount, .price-table th.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-table td.amount { font-weight: 600; color: var(--heading); }
.price-table caption { caption-side: top; text-align: left; font-weight: 600; color: var(--muted); padding-bottom: 6px; }
.fee-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; margin: 0 0 22px; scroll-margin-top: 110px; }
.fee-section h2 { margin: 0 0 .5em; font-size: 1.3rem; display: flex; gap: 12px; align-items: baseline; }
.fee-section h2 .num { color: var(--muted); font-size: .95rem; }
.fee-section .table-wrap { margin: .6em 0; }
.fee-section .note { margin: .8em 0 0; padding: 10px 14px; background: var(--soft); border-radius: 8px; font-size: .94rem; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: .9rem; background: #fff; }
.toc a:hover { background: var(--soft); }
.toc a[aria-current="page"] { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.with-aside > aside { position: sticky; top: 100px; }
@media (max-width: 960px) { .with-aside { grid-template-columns: 1fr; } .with-aside > aside { position: static; } }

/* 404 */
.notfound { text-align: center; padding: 90px 0; }
.notfound .code { font-family: var(--font-head); font-size: 6rem; font-weight: 800; color: var(--accent); line-height: 1; }
