/* Shared public page parts: menu, top banner, footer. Colours and fonts come from the brand (_BrandStyles.cshtml). */
.sp-page { --sp-primary: var(--brand-primary, #1f2937); --sp-on-primary: var(--brand-on-primary, #fff); --sp-accent: var(--brand-accent, #f59e0b); --sp-on-accent: var(--brand-on-accent, #111); --sp-link: var(--brand-link, #1d4ed8); --sp-radius: 10px; --sp-button-radius: 8px; }
.sp-page.sp-c-round { --sp-radius: 16px; --sp-button-radius: 12px; }
.sp-page.sp-c-pill { --sp-radius: 14px; --sp-button-radius: 999px; }
.sp-page.sp-c-square { --sp-radius: 2px; --sp-button-radius: 2px; }
.sp-page { padding-top: 0 !important; }
.sp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.sp-menu, .sp-banner, .sp-footer { position: relative; box-sizing: border-box; }
.sp-menu *, .sp-banner *, .sp-footer * { box-sizing: border-box; }

/* Menu at the top */
.sp-menu { position: sticky; top: 0; z-index: 1030; background: var(--sp-primary); color: var(--sp-on-primary); box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.sp-menu-bar { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.sp-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: inherit !important; text-decoration: none !important; margin-right: auto; padding: 10px 0; }
.sp-logo img { height: 46px; width: auto; max-width: 120px; object-fit: contain; }
.sp-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sp-links li { position: relative; }
.sp-links a, .sp-sub-toggle { display: block; padding: 10px 12px; border-radius: 8px; color: inherit !important; font-size: 15px; font-weight: 500; text-decoration: none !important; background: none; border: 0; cursor: pointer; font-family: inherit; }
.sp-links a:hover, .sp-links a:focus-visible, .sp-sub-toggle:hover, .sp-sub-toggle:focus-visible, .sp-links li.is-active > a { background: rgba(255,255,255,.16); }
.sp-links .sp-cta a { background: var(--sp-accent); color: var(--sp-on-accent) !important; border-radius: var(--sp-button-radius); font-weight: 600; margin-left: 6px; }
.sp-links .sp-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; color: #1f2937; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px; z-index: 5; flex-direction: column; align-items: stretch !important; }
.sp-sub a { color: #1f2937 !important; }
.sp-sub a:hover, .sp-sub a:focus-visible { background: #f3f4f6; }
/* Scoped under .sp-links so the menu-row rule above cannot keep a closed dropdown visible. */
.sp-links .sp-sub-toggle[aria-expanded="true"] + .sp-sub { display: flex; }
.sp-menu-toggle { display: none; align-items: center; gap: 6px; background: rgba(255,255,255,.16); color: inherit; border: 0; border-radius: 8px; padding: 8px 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.sp-menu-white { background: #fff; color: #1f2937; border-bottom: 1px solid #e5e7eb; }
.sp-menu-white .sp-logo { color: var(--sp-primary) !important; }
.sp-menu-white .sp-links a:hover, .sp-menu-white .sp-links a:focus-visible, .sp-menu-white .sp-sub-toggle:hover, .sp-menu-white .sp-links li.is-active > a { background: #f3f4f6; color: var(--sp-link) !important; }
.sp-menu-white .sp-menu-toggle { background: #f3f4f6; }
.sp-menu-centred .sp-menu-bar { flex-direction: column; justify-content: center; gap: 0; padding-top: 8px; }
.sp-menu-centred .sp-logo { margin: 0 auto; flex-direction: column; gap: 4px; }
.sp-menu-centred .sp-links ul { justify-content: center; }

/* Top banner */
.sp-banner { background: var(--sp-primary); color: var(--sp-on-primary); }
.sp-banner-inner { display: flex; align-items: center; gap: 32px; min-height: 320px; padding-top: 48px; padding-bottom: 48px; }
.sp-banner-words { flex: 1 1 0; min-width: 0; max-width: 720px; }
.sp-banner h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.1; margin: 0 0 14px; color: inherit !important; font-weight: 700; }
.sp-banner p { font-size: clamp(16px, 2vw, 20px); line-height: 1.5; margin: 0 0 22px; color: inherit; opacity: .92; }
.sp-button { display: inline-block; background: var(--sp-accent); color: var(--sp-on-accent) !important; padding: 13px 24px; border-radius: var(--sp-button-radius); font-weight: 700; font-size: 16px; text-decoration: none !important; }
.sp-button:hover, .sp-button:focus-visible { filter: brightness(.95); box-shadow: 0 0 0 3px rgba(255,255,255,.4); }
.sp-banner-photo { position: relative; background-size: cover; background-position: center; background-color: #111; color: #fff; }
.sp-banner-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.25)); }
.sp-banner-photo .sp-banner-inner { position: relative; min-height: 460px; }
.sp-banner-photo h1, .sp-banner-photo p { text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.sp-banner-img { flex: 1 1 0; min-width: 0; border-radius: var(--sp-radius); overflow: hidden; aspect-ratio: 4 / 3; }
.sp-banner-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-banner-plain .sp-banner-inner { min-height: 260px; }

/* Bottom of the page */
.sp-footer { background: #111827; color: #e5e7eb; padding: 40px 0 20px; margin-top: 40px; font-size: 15px; }
.sp-footer p { margin: 0 0 6px; color: inherit; }
.sp-footer a { color: inherit !important; text-decoration: underline; text-underline-offset: 2px; }
.sp-footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.sp-footer-name { font-size: 18px; font-weight: 700; }
.sp-footer-label { font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; opacity: .8; }
.sp-social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sp-footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; opacity: .85; }
.sp-footer-colour { background: var(--sp-primary); color: var(--sp-on-primary); }
.sp-footer-light { background: #f3f4f6; color: #1f2937; }
.sp-footer-light .sp-footer-bottom { border-top-color: #d1d5db; }

/* Click-to-edit inside the admin preview */
.sp-editing [data-sp-edit] { cursor: pointer; }
.sp-editing [data-sp-edit]:hover { outline: 3px dashed var(--sp-accent); outline-offset: -3px; }
.sp-edit-tag { position: absolute; top: 6px; right: 6px; z-index: 6; background: #111827; color: #fff; font: 600 12px/1 system-ui, sans-serif; padding: 6px 9px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.sp-editing [data-sp-edit]:hover > .sp-edit-tag { opacity: 1; }

@media (max-width: 860px) {
    .sp-menu-toggle { display: inline-flex; }
    .sp-menu-centred .sp-menu-bar { flex-direction: row; }
    .sp-menu-centred .sp-logo { margin: 0 auto 0 0; flex-direction: row; }
    .sp-links { display: none; flex-basis: 100%; padding-bottom: 10px; }
    .sp-links.is-open { display: block; }
    .sp-links ul { flex-direction: column; align-items: stretch; }
    .sp-links .sp-cta a { margin: 6px 0 0; text-align: center; }
    .sp-sub { position: static; box-shadow: none; background: rgba(255,255,255,.1); color: inherit; }
    .sp-sub a { color: inherit !important; }
    .sp-menu-white .sp-sub { background: #f9fafb; }
    .sp-banner-inner { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 32px; padding-bottom: 32px; gap: 20px; }
    .sp-banner-photo .sp-banner-inner { min-height: 360px; justify-content: flex-end; }
}

/* The Template theme sizes every <header> to the full screen; the shared menu keeps its own height. */
header.sp-menu { height: auto; min-height: 0; }

/* Text on every part of the page follows the site's style (fonts come from _BrandStyles). */
.sp-page { background: var(--brand-bg, #fff); color: var(--brand-text, #374151); }
.sp-page :is(h1, h2, h3, h4, h5, h6, .post-title, .post-title a, .section-heading, .panel-title, .media-heading, .content-title):not(.sp-menu *):not(.sp-banner *):not(.sp-footer *) { color: var(--brand-heading, #111827) !important; letter-spacing: normal; }
.sp-page :is(p, li, td, dd, .post-subtitle, .post-subtitle *, blockquote):not(.sp-menu *):not(.sp-banner *):not(.sp-footer *) { color: var(--brand-text, #374151); }
.sp-page :is(.post-meta, .post-meta *, .meta, small):not(.sp-menu *):not(.sp-banner *):not(.sp-footer *) { color: var(--brand-muted, #6b7280); }
.sp-page .post-meta a, .sp-page .post-title a:hover, .sp-page .sidebar a:hover { color: var(--brand-link, #1d4ed8) !important; }
.sp-page .sidebar a, .sp-page .sidebar li { color: var(--brand-text, #374151) !important; }
.sp-page :is(input, select, textarea, .form-control):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) { background-color: #fff; color: #1f2937; }
/* The button colour is the 10%: only real actions (Join, Donate, Search, Send) use it. */
.sp-page .btn-default:not(.search-btn):not([type="submit"]) { background: transparent !important; border-color: var(--sp-primary) !important; color: var(--sp-primary) !important; border-radius: var(--sp-button-radius); }
.sp-page .btn-default:not(.search-btn):not([type="submit"]):is(:hover, :focus-visible) { background: var(--sp-primary) !important; color: var(--sp-on-primary) !important; }
.sp-page .nav-pills > li > a { color: var(--sp-link); border-radius: var(--sp-button-radius); }
.sp-page .nav-pills > li.active > a { background-color: var(--sp-primary); color: var(--sp-on-primary); }
/* :is() keeps these above ".sp-page .sidebar a" so a button link in the side column stays readable. */
.sp-page :is(.btn-primary, .btn-success, .btn-xl, .search-btn, .btn[type="submit"]) { background: var(--sp-accent) !important; border-color: var(--sp-accent) !important; color: var(--sp-on-accent) !important; border-radius: var(--sp-button-radius); }
.sp-page :is(input, select, textarea, .form-control):not([type="checkbox"]):not([type="radio"]) { border-radius: min(var(--sp-radius), 10px); }

/* Section labels such as "Gather. Celebrate. Connect." follow the brand instead of a fixed blue. */
.sp-page .home-events { --he-accent: var(--brand-link, #1d4ed8); }
