/* Shared ivory-and-gold browser controls for both parish pages. */
:root {
  --control-gold: #967640;
  --control-track: #f2ebde;
}

html { scrollbar-color: var(--control-gold) var(--control-track); }
* { scrollbar-width: auto; }

/* Rounded treatment where the browser exposes scrollbar pseudo-elements. */
@supports selector(::-webkit-scrollbar) {
  html { scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--control-track); }
  ::-webkit-scrollbar-thumb {
    background: var(--control-gold);
    border: 3px solid var(--control-track);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-thumb:hover { background: #7a6448; }
  ::-webkit-scrollbar-thumb:active { background: #3d2f1e; }
  ::-webkit-scrollbar-corner { background: var(--control-track); }
}

/* Native image cursors stay responsive without a JavaScript follower. */
@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  body {
    cursor: var(--cursor-arrow, url("images/cursor-arrow.svg") 4 3), auto;
  }
  a[href], button:not(:disabled), summary, [role="button"],
  input[type="submit"], input[type="button"], select {
    cursor: var(--cursor-hand, url("images/cursor-hand.svg") 12 3), pointer;
  }
  input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
  textarea, [contenteditable="true"] { cursor: text; }
  button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
}

@media (forced-colors: active) {
  html { scrollbar-color: auto; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: Canvas; }
  ::-webkit-scrollbar-thumb { background: ButtonText; border-color: Canvas; }
}

/* Readability and interaction accessibility. */
body { font-weight: 400; line-height: 1.65; }
:root { --muted: #6e6050; }
p { overflow-wrap: break-word; }
:where(a,button,summary,[tabindex]):focus-visible {
  outline: 3px solid #3d2f1e !important;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px #faf8f4;
}
.skip-link { position: fixed; top: -150px; left: 16px; z-index: 10001; padding: 14px 22px; background: #3d2f1e; color: #fff; }
.skip-link:focus { top: 16px; }
button, summary, .nav-links a, .footer-col a { min-height: 44px; }

html { scroll-padding-top: 120px; }
.section-label, .quick-card-label, .priest-role, .mass-type, .eyebrow, .tenure { color: #80602c; }
.footer-place, .footer-col a, .footer-col span, .footer-bottom p, .mass-card.feature .mass-type { color: #e8dfcf; }
.chapter-controls button { min-width: 44px; min-height: 44px; }
.chapter-nav strong { font-size: .875rem; }
.intro-bottom { flex-wrap: wrap; gap: 12px; }

@media (max-width: 700px) {
 .timeline-rail { position: relative; top: auto; }
 .chapter { scroll-margin-top: 24px; }
 .brand small { letter-spacing: .08em; }
 .introduction { padding-bottom: 110px; }
 .mass-row { flex-wrap: wrap; gap: 8px; }
 .contact-grid > *, .about-grid > *, .priest-layout > * { min-width: 0; }
 .contact-grid a { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto !important; }
 *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
 .rv { opacity: 1 !important; transform: none !important; }
 .cloud-layer, #saint-layer, #hero-title-top, .church-atmos-img { transform: none !important; }
}

/* Header: one aligned row, with navigation collapsing before it crowds the brand. */
.nav-inner, .site-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: nowrap; gap: 24px; min-height: 88px; height: auto;
  padding: 16px clamp(20px, 3vw, 48px);
}
.nav-inner { max-width: 1600px; margin-inline: auto; }
.nav-logo, .brand { flex: 0 1 auto; min-width: 0; gap: 12px; }
.nav-logo-text, .brand > span:last-child { min-width: 0; }
.nav-logo-main, .brand strong { font-size: 1.125rem; line-height: 1.35; letter-spacing: 0; }
.nav-logo-sub, .brand small { font-size: .75rem; line-height: 1.5; letter-spacing: .06em; margin-top: 4px; }
.nav-links { display: flex; align-items: center; gap: clamp(16px, 1.5vw, 28px); }
.nav-links a { display: inline-flex; align-items: center; font-size: .875rem; letter-spacing: .015em; text-transform: none; white-space: nowrap; }
.nav-right, .header-nav { display: flex; align-items: center; flex: 0 0 auto; gap: 20px; flex-wrap: nowrap; }

.nav-hamburger { display: none; flex: 0 0 44px; }
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-drawer { max-height: calc(100dvh - 100px); overflow-y: auto; padding-inline: clamp(20px, 3vw, 48px); }
@media (max-width: 1280px) {
 .nav-links { display: none; }
 .nav-hamburger { display: flex; }
}
@media (min-width: 1281px) { .nav-drawer.open { display: none; } }
@media (max-width: 700px) {
 .nav-inner, .site-header { min-height: 80px; padding: 12px 20px; gap: 16px; }
 .nav-right, .header-nav { gap: 8px; }
 .nav-logo-main, .brand strong { font-size: 1rem; }
 .nav-logo-sub, .brand small { font-size: .75rem; letter-spacing: .015em; }
 .header-nav > a { display: none; }
 .brand-cross { font-size: 28px; }
}
@media (max-width: 420px) {
 .nav-inner, .site-header { padding-inline: 12px; gap: 8px; }
 .nav-logo, .brand { gap: 8px; }
 .nav-logo-cross { width: 10px; }
 .nav-logo-sub, .brand small { max-width: 145px; }
 .nav-logo-main { max-width: 155px; }
 .nav-right { gap: 2px; }
}
/* Native radios retain keyboard arrow navigation and screen-reader state. */
.language-choice { display: inline-flex; flex: 0 0 auto; min-width: 0; padding: 3px; margin: 0; gap: 2px; border: 1px solid #d8cbb7; border-radius: 6px; background: #f2ebde; }
.language-choice label { position: relative; display: flex; cursor: pointer; }
.language-choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.language-choice label span { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border-radius: 3px; color: #62513c; font: 400 .875rem/1.5 'Outfit','Noto Sans Sinhala',sans-serif; white-space: nowrap; }
.language-choice input:checked + span { background: #faf8f4; color: #3d2f1e; box-shadow: 0 1px 3px #3d2f1e26; font-weight: 500; }
.language-choice input:focus-visible + span { outline: 2px solid #51412c; outline-offset: 2px; }
.language-choice label:hover span { color: #1e1810; }
.language-choice legend { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media(max-width: 420px) {
 .nav-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; }
 .nav-right { display: contents; }
 .nav-logo { grid-column: 1; grid-row: 1; }
 .nav-hamburger { grid-column: 2; grid-row: 1; }
 .nav-right .language-choice { grid-column: 1 / -1; justify-self: end; }
 .site-header { flex-wrap: wrap; }
 .site-header .header-nav { margin-left: auto; }
}
@media(forced-colors: active) { .language-choice input:checked + span { outline: 2px solid Highlight; } }

/* Footer spacing follows the three remaining content groups. */
footer:not(.site-footer) { padding-top: clamp(40px, 6vw, 80px); }
.footer-grid {
  width: min(100%, 1200px); padding: 0 clamp(20px, 4vw, 48px) clamp(32px, 5vw, 64px);
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 64px); align-items: start;
}
.footer-grid > * { min-width: 0; }
.footer-cross { margin-bottom: 20px; }
.footer-name { margin-bottom: 10px; line-height: 1.5; }
.footer-place { line-height: 1.75; letter-spacing: .06em; }
.footer-col .footer-col-title { display: block; margin: 0 0 20px; line-height: 1.7; letter-spacing: .08em; color: var(--gold-light); }
.footer-col a { display: flex; align-items: center; width: fit-content; max-width: 100%; padding-block: 8px; margin: 0; line-height: 1.7; }
.footer-col > span:not(.footer-col-title) { margin: 0 0 14px; line-height: 1.85; }
.footer-col > :last-child { margin-bottom: 0; }
.footer-bottom { padding: 24px clamp(20px, 4vw, 48px) 28px; }
.footer-bottom p { margin: 0; line-height: 1.8; letter-spacing: .015em; }
.site-footer { align-items: center; padding: 28px clamp(20px, 5vw, 72px); gap: 20px 32px; }
.site-footer > a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 601px) and (max-width: 960px) {
 .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px 48px; }
 .footer-brand-col { grid-column: 1 / -1; padding-bottom: 28px; border-bottom: 1px solid #ffffff1f; }
 .footer-cross { margin-bottom: 12px; }
}
@media (max-width: 600px) {
 .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 32px; }
 .footer-grid > .footer-col { padding-top: 28px; border-top: 1px solid #ffffff1f; }
 .footer-col .footer-col-title { margin-bottom: 12px; }
 .footer-cross { margin-bottom: 12px; }
 .footer-bottom { text-align: left; padding-top: 20px; padding-bottom: 88px; }
 .site-footer { gap: 12px 24px; padding-block: 20px; }
 .site-footer > span { padding-top: 20px; margin-top: 4px; line-height: 1.7; }
}

/* Switch native cursor assets on the site's dark surfaces. */
@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
 footer:not(.site-footer), .mass-card.feature, #lightbox, #hero-church-text,
 .about-text-col .btn-primary-dark, .skip-link {
  --cursor-arrow: url("images/cursor-arrow-light.svg") 4 3;
  --cursor-hand: url("images/cursor-hand-light.svg") 12 3;
  cursor: var(--cursor-arrow), auto;
 }
 a.skip-link, .about-text-col a.btn-primary-dark, #lightbox, #lightbox-close {
  cursor: var(--cursor-hand), pointer;
 }
 #lightbox-img { cursor: var(--cursor-arrow), default; }
}
