/*
Theme Name: St Marys Astra Child
Theme URI: https://www.stmaryscathedralaberdeen.org/
Description: Astra child theme for St. Mary’s Cathedral Aberdeen, migrated from the Phase 2 static site.
Author: St. Mary’s Cathedral Aberdeen
Template: astra
Version: 1.4.2
Text Domain: stmarys
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #1a2a3a;
  --gold: #c9a84c;
  --cream: #f8f4ec;
  --crimson: #8f2633;
  --white: #ffffff;
  --ink: #20272e;
  --muted: #66717b;
  --line: #ddd4c5;

  --bg-color: #f8f4ec;
  --surface: #ffffff;
  --surface-2: #f1eadf;
  --text-color: #20272e;
  --muted-color: #66717b;
  --heading-color: #1a2a3a;
  --border-color: #ddd4c5;
  --header-bg: rgba(248,244,236,.94);
  --footer-bg: #13202d;
  --footer-text: #eef1f3;
  --overlay: rgba(9,20,31,.62);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow: 0 12px 36px rgba(20,32,45,.09);
  --container: 1180px;
}

html[data-theme="dark"] {
  --bg-color: #101922;
  --surface: #182532;
  --surface-2: #21313f;
  --text-color: #f3f0ea;
  --muted-color: #c2c9cf;
  --heading-color: #fff7e5;
  --border-color: #3a4b59;
  --header-bg: rgba(16,25,34,.95);
  --footer-bg: #0a1118;
  --footer-text: #f5f1e9;
  --overlay: rgba(4,11,17,.69);
  --shadow: 0 12px 36px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  transition: background-color .25s ease, color .25s ease;
}
body.menu-open { overflow: hidden; }

a { color: var(--crimson); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  background: var(--gold);
  color: #111b24;
  padding: 12px 16px;
  z-index: 3000;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}
.narrow { max-width: 800px; margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1500;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Optional Home-page announcement ------------------------------------------ */
.home-announcement {
  position: sticky;
  top: 72px;
  z-index: 1400;
  max-height: 144px;
  padding: 0;
  overflow-y: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 8px 22px rgba(7, 16, 24, .08);
}
.home-announcement__inner {
  min-height: 72px;
  max-height: 144px;
  padding-block: 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
}
.home-announcement__image {
  flex: 0 1 auto;
  width: auto;
  max-width: min(24vw, 220px);
  max-height: 120px;
  object-fit: contain;
}
.home-announcement__text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text-color);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow-wrap: anywhere;
}
.home-announcement__button {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  color: var(--heading-color);
  text-decoration: none;
  line-height: 1;
}
.brand strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  letter-spacing: .01em;
}
.brand small {
  margin-top: 5px;
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-weight: 700;
  color: var(--muted-color);
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  color: var(--heading-color);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--gold); }

.menu-toggle { position: relative; }
.hamburger, .hamburger::before, .hamburger::after {
  width: 21px;
  height: 2px;
  background: currentColor;
  position: absolute;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger::before, .hamburger::after { content: ""; left: 0; }
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.menu-toggle[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger::after { top: 0; transform: rotate(-45deg); }

.site-nav {
  position: fixed;
  inset: 73px 0 0 auto;
  width: min(88vw, 390px);
  background: var(--surface);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  transform: translateX(105%);
  transition: transform .3s ease;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.site-nav.open { transform: translateX(0); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list > li { border-bottom: 1px solid var(--border-color); }
.nav-list a {
  min-height: 52px;
  display: flex;
  align-items: center;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
}
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--crimson); }
.nav-label {
  margin-top: 18px;
  color: var(--muted-color);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}
.nav-sublist { list-style: none; padding: 0 0 8px 16px; }
.nav-sublist li { border: 0; }
.nav-sublist a { min-height: 40px; font-weight: 500; }

.hero {
  min-height: 610px;
  display: grid;
  align-items: end;
  color: #fff;
  background:
    linear-gradient(var(--overlay), var(--overlay)),
    var(--stmarys-hero-image, url("assets/altar_and_cross.jpg")) center 38% / cover no-repeat;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; padding: 72px 0; max-width: 860px; }
.hero-copy-panel {
  width: min(100%, 820px);
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 24px;
  background: rgba(8, 20, 31, .46);
  box-shadow: 0 24px 60px rgba(4, 10, 16, .24);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
}
.hero .eyebrow { color: #f3d989; }
.hero h1 { color: #fff; max-width: 760px; }
.hero p { color: #eff2f4; font-size: 1.05rem; max-width: 670px; }

.page-hero {
  background:
    linear-gradient(rgba(12,25,37,.70), rgba(12,25,37,.70)),
    radial-gradient(circle at 80% 10%, rgba(201,168,76,.32), transparent 30%),
    linear-gradient(130deg, #39556c, #122131);
  color: #fff;
  padding: 88px 0 72px;
}
.page-hero h1, .page-hero p { color: #fff; }
.page-hero p { max-width: 720px; }

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--crimson);
  text-transform: uppercase;
  letter-spacing: .17em;
  font-size: .75rem;
  font-weight: 800;
}
h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--heading-color);
  line-height: 1.08;
  margin: 0 0 16px;
}
h1 { font-size: clamp(3rem, 8vw, 6.2rem); font-weight: 600; }
h2 { font-size: clamp(2.3rem, 5vw, 4.1rem); font-weight: 600; }
h3 { font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 600; }
h4 { font-size: 1.4rem; }
p { margin: 0 0 16px; }
.lead { font-size: 1.1rem; color: var(--muted-color); max-width: 760px; }

section { padding: 72px 0; }
.section-tight { padding-block: 48px; }
.section-surface { background: var(--surface); }
.section-dark { background: var(--navy); color: #f2f3f4; }
.section-dark h2, .section-dark h3, .section-dark p { color: inherit; }
.section-heading { margin-bottom: 32px; }
.section-heading::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  background: var(--gold);
  margin-top: 18px;
}

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 19px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--gold); color: #14202a; }
.btn-primary:hover { background: #dfc267; }
.btn-secondary {
  border-color: currentColor;
  color: inherit;
  background: transparent;
}
.hero .btn-secondary {
  border-color: #fff;
  color: #fff;
}
.btn-outline {
  border-color: var(--border-color);
  color: var(--heading-color);
  background: var(--surface);
}
.btn-crimson { background: var(--crimson); color: #fff; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.grid { display: grid; gap: 20px; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.card-hover { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--shadow); }
.card-icon {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); color: var(--crimson);
  margin-bottom: 18px; font-size: 1.1rem;
}
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

.quick-link { color: inherit; text-decoration: none; display: block; height: 100%; }
.quick-link .arrow { color: var(--crimson); font-weight: 700; }

.info-strip {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.info-strip > div { padding: 22px; border-bottom: 1px solid var(--border-color); }
.info-strip > div:last-child { border-bottom: 0; }
.info-strip strong { display: block; color: var(--heading-color); }
.info-strip span { color: var(--muted-color); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 610px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: var(--surface-2); color: var(--heading-color); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }

.timeline { position: relative; display: grid; gap: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  top: 10px; bottom: 10px; left: 14px;
  width: 2px; background: var(--border-color);
}
.timeline-item { position: relative; padding-left: 48px; }
.timeline-item::before {
  content: "";
  position: absolute; left: 8px; top: 10px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg-color);
  box-shadow: 0 0 0 1px var(--gold);
}
.timeline-item .date {
  display: inline-block; color: var(--crimson); font-weight: 800;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
}

.feature {
  display: grid; gap: 28px; align-items: center;
}
.feature-image {
  width: 100%;
  min-height: 310px;
  height: 100%;
  max-height: 540px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.placeholder-image {
  min-height: 310px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(20,33,45,.22), rgba(20,33,45,.22)),
    radial-gradient(circle at 70% 25%, rgba(201,168,76,.55), transparent 25%),
    linear-gradient(135deg, #516d80, #182b3b);
  border: 1px solid rgba(255,255,255,.12);
  position: relative;
  overflow: hidden;
}
.placeholder-image::after {
  content: "Cathedral image placeholder";
  position: absolute;
  left: 20px; bottom: 18px;
  color: #fff; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
}

.callout {
  border-left: 4px solid var(--gold);
  padding: 20px 22px;
  background: var(--surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.callout strong { color: var(--heading-color); }

.bank-details {
  margin: 0;
  padding: 0;
  list-style: none;
}
.bank-details li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.bank-details li:last-child { border: 0; }
.bank-details span:first-child { color: var(--muted-color); font-size: .86rem; }
.bank-details span:last-child { color: var(--heading-color); font-weight: 650; word-break: break-word; }

.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.accordion details { border-bottom: 1px solid var(--border-color); }
.accordion details:last-child { border: 0; }
.accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 20px;
  color: var(--heading-color);
  font-weight: 750;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; float: right; color: var(--crimson); font-size: 1.2rem; }
.accordion details[open] summary::after { content: "−"; }
.accordion-content { padding: 0 20px 20px; color: var(--text-color); }
.accordion-content-with-image { display: grid; gap: 18px; }
.accordion-content-with-image p { margin: 0; }
.accordion-content-with-image > p:only-child { grid-column: 1 / -1; }
.accordion-feature-image {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 420px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.accordion-placeholder-image {
  min-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background:
    linear-gradient(rgba(20,33,45,.18), rgba(20,33,45,.18)),
    radial-gradient(circle at 72% 25%, rgba(201,168,76,.48), transparent 24%),
    linear-gradient(135deg, #657d8e, #223849);
  position: relative;
  overflow: hidden;
}
.accordion-placeholder-image::after {
  content: "Image placeholder";
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.text-giving-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid var(--border-color);
}
.text-giving-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-color);
}
.text-giving-list span { color: var(--crimson); font-weight: 800; }

.contact-grid { display: grid; gap: 28px; }
.form-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--heading-color); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-color);
  min-height: 48px;
  padding: 11px 13px;
}
textarea { min-height: 150px; resize: vertical; }
.form-note { font-size: .85rem; color: var(--muted-color); }

.chip {
  display: inline-flex; gap: 7px; align-items: center;
  padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 999px;
  font-size: .78rem; font-weight: 700; color: var(--muted-color); background: var(--surface);
}

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 64px 0 24px;
}
.site-footer h3 { color: #fff; font-size: 1.5rem; }
.site-footer a { color: #f1d77f; }
.footer-grid { display: grid; gap: 30px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 7px 0; }
.social-links { display: flex; gap: 10px; margin-top: 18px; }
.social-links a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.25); border-radius: 50%; text-decoration: none;
}
.footer-bottom {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .82rem; color: #c9d0d5;
}

.back-to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: var(--gold); color: #12202b;
  box-shadow: var(--shadow); cursor: pointer; z-index: 1200;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: .22s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 699px) {
  .table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }
  .table-wrap table { min-width: 0; }
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .table-wrap tbody { display: grid; gap: 12px; }
  .table-wrap tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
  }
  .table-wrap td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    padding: 6px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .table-wrap td::before {
    color: var(--muted-color);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .table-wrap td:nth-child(1)::before { content: "Day"; }
  .table-wrap td:nth-child(2)::before { content: "Time"; }
  .table-wrap td:nth-child(3)::before { content: "Notes"; }
}

@media (min-width: 700px) {
  .container { width: min(calc(100% - 48px), var(--container)); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .feature { grid-template-columns: 1fr 1fr; gap: 48px; }
  .feature.reverse .placeholder-image { order: 2; }
  .info-strip { grid-template-columns: repeat(3, 1fr); }
  .info-strip > div { border-bottom: 0; border-right: 1px solid var(--border-color); }
  .info-strip > div:last-child { border-right: 0; }
  .bank-details li { grid-template-columns: 140px 1fr; }
  .contact-grid { grid-template-columns: .8fr 1.2fr; }
  .accordion-content-with-image { grid-template-columns: minmax(220px, .7fr) 1.3fr; align-items: start; }
  .accordion-placeholder-image { min-height: 210px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

@media (min-width: 1050px) {
  .menu-toggle { display: none; }
  .site-nav {
    position: static; transform: none; width: auto; padding: 0;
    border: 0; box-shadow: none; overflow: visible; background: transparent;
  }
  .nav-list { display: flex; align-items: center; gap: 24px; }
  .nav-list > li { border: 0; position: relative; }
  .nav-list a { min-height: 72px; font-size: .9rem; }
  .nav-label { display: none; }
  .nav-about .nav-sublist {
    position: absolute; display: none; top: 62px; left: -16px;
    min-width: 220px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
  }
  .nav-about:hover .nav-sublist, .nav-about:focus-within .nav-sublist { display: block; }
  .nav-sublist a { min-height: 40px; padding: 0 10px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 760px) {
  .home-announcement__inner { gap: 10px; padding-block: 10px; }
  .home-announcement__image { max-width: 22vw; max-height: 112px; }
  .home-announcement__text { font-size: .9rem; line-height: 1.35; -webkit-line-clamp: 5; line-clamp: 5; }
  .home-announcement__button { min-height: 40px; padding-inline: 12px; font-size: .84rem; }
  .hero { min-height: 560px; }
  .hero-content { padding: 40px 0; }
  .hero-copy-panel { border-radius: 18px; }
}

/* About / clergy people cards ---------------------------------------------- */
.people-grid { align-items: stretch; }
.person-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.person-card img {
  width: 112px;
  height: 112px;
  max-width: 112px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  justify-self: start;
}
.person-card h3 { margin-top: 0; }
.person-avatar {
  width: 112px;
  height: 112px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  justify-self: start;
  color: var(--crimson);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.person-note { font-size: .92rem; color: var(--muted-color); }

@media (max-width: 520px) {
  .person-card { grid-template-columns: 112px minmax(0, 1fr); text-align: left; }
  .person-card img,
  .person-avatar { margin-inline: 0; justify-self: start; }
}

@media (max-width: 420px) {
  .person-card { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; }
  .person-card img,
  .person-avatar { width: 88px; height: 88px; }
}

/* WordPress/Astra integration ------------------------------------------------ */
/* Astra can paint its own page/section canvas with its global light palette.
   Pin the custom templates to the same theme variables used by the static site
   so changing data-theme updates both foreground and background together. */
html[data-theme] body,
html[data-theme] #page,
html[data-theme] .site,
html[data-theme] .site-content,
html[data-theme] main#main {
  background-color: var(--bg-color);
  color: var(--text-color);
}

html[data-theme] main#main > section:not(.page-hero):not(.section-surface):not(.section-dark) {
  background-color: var(--bg-color);
  color: var(--text-color);
}

html[data-theme] main#main > .section-surface {
  background-color: var(--surface);
  color: var(--text-color);
}

.site-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 16px;
}
.site-nav .sub-menu li { border: 0; }
.site-nav .sub-menu a { min-height: 40px; font-weight: 500; }
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a { color: var(--crimson); }

/* Astra applies generic button sizing/padding. Keep the three circular UI
   controls dimensionally identical to the static site. */
body .theme-toggle,
body .menu-toggle,
body .back-to-top {
  box-sizing: border-box;
  flex: 0 0 auto;
  padding: 0 !important;
  line-height: 1;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}
body .theme-toggle,
body .menu-toggle {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
}
body .back-to-top {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
}

/* WordPress menu markup uses .menu-item-has-children/.sub-menu. On phones and
   tablets the navigation is a viewport-height off-canvas panel. Its contents
   scroll independently while the page behind it remains locked. */
@media (max-width: 1049px) {
  /* Keep the off-canvas menu viewport-sized. backdrop-filter on an ancestor
     can otherwise turn the sticky header into the containing block for this
     fixed element in some browsers. */
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body .menu-toggle { display: inline-grid; }
  .site-nav {
    position: fixed;
    top: 72px;
    right: 0;
    bottom: auto;
    left: auto;
    width: min(88vw, 390px);
    height: calc(100dvh - 72px);
    max-height: none;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    background: var(--surface);
  }
  .site-nav .nav-list > li > a { min-height: 44px; }
  .site-nav .sub-menu {
    display: grid;
    gap: 0;
    padding: 0 0 6px 14px;
  }
  .site-nav .sub-menu a { min-height: 36px; }
}

/* Desktop dropdown behaviour for WordPress menu markup. */
@media (min-width: 1050px) {
  body .menu-toggle { display: none !important; }
  .site-nav .menu-item-has-children > a { gap: 7px; }
  .site-nav .menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;
  }
  .site-nav .menu-item-has-children > .sub-menu {
    position: absolute;
    display: none;
    top: calc(100% - 6px);
    left: -16px;
    z-index: 20;
    min-width: 220px;
    margin: 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
  }
  .site-nav .menu-item-has-children:hover > .sub-menu,
  .site-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
  .site-nav .sub-menu a {
    min-height: 40px;
    padding: 0 10px;
    white-space: nowrap;
  }
}

.admin-bar .site-header { top: 32px; }
.admin-bar .home-announcement { top: 104px; }
@media (max-width: 1049px) {
  .admin-bar .site-nav {
    top: 104px;
    height: calc(100dvh - 104px);
    max-height: none;
  }
}
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .admin-bar .home-announcement { top: 118px; }
  .admin-bar .site-nav {
    top: 118px;
    height: calc(100dvh - 118px);
    max-height: none;
  }
}
.stmarys-plugin-notice { border: 1px dashed var(--border-color); padding: 18px; border-radius: var(--radius-md); background: var(--surface-2); }
.stmarys-event-date { color: var(--muted-color); font-weight: 600; font-size: .9rem; }
.give-form-wrap, .ff-el-group, .fluentform { color: var(--text-color); }


/* Primary navigation search -------------------------------------------------- */
.nav-search {
  margin: 16px 0 0;
}
.nav-search-control {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nav-search-control:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}
body .nav-search-input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text-color);
  box-shadow: none;
}
body .nav-search-input::placeholder { color: var(--muted-color); opacity: 1; }
body .nav-search-submit {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border-color);
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--heading-color);
  cursor: pointer;
}
body .nav-search-submit:hover,
body .nav-search-submit:focus-visible {
  background: var(--surface-2);
  color: var(--crimson);
}

@media (max-width: 1049px) {
  .nav-search {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
  }
}

@media (min-width: 1050px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .nav-search {
    width: clamp(150px, 14vw, 210px);
    margin: 0;
  }
  body .nav-search-input {
    min-height: 40px;
    padding-block: 7px;
  }
  body .nav-search-submit {
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* ChurchSuite ministry-directory embeds. Structural dimensions are theme-controlled. */
.ministry-embed-section { padding-block: 48px 72px; }
.ministry-embed {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  background: var(--surface);
}

/* Feature slider ----------------------------------------------------------- */
.feature-slider-section { padding: 64px 0 68px; }
.feature-slider { overflow: hidden; }
.feature-slider-viewport { width: 100%; overflow: hidden; }
.feature-slider-track {
  display: flex;
  width: 100%;
  transition: transform .45s ease;
  will-change: transform;
}
.feature-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.feature-slide-copy,
.feature-media { min-width: 0; }
.feature-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0d1821;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
}
.feature-media .feature-image,
.feature-media .feature-video,
.feature-media iframe,
.feature-media .wp-video,
.feature-media .wp-video-shortcode {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.feature-media .feature-video-embed,
.feature-media iframe { aspect-ratio: 16 / 9; min-height: 0; max-height: none; }
.feature-media .wp-video { max-width: 100%; }

/* Astra has global button rules. Reset the carousel controls locally so they
   retain the circular treatment from the approved static design. */
body .feature-slider-controls {
  position: static;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
}
body .feature-slider-button,
body .feature-slider-dot {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0 !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
}
body .feature-slider-button {
  flex: 0 0 42px;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  line-height: 1;
  border-radius: 50% !important;
  display: inline-grid;
  place-items: center;
}
body .feature-slider-button i { margin: 0; line-height: 1; }
.feature-slider-dots { display: flex; align-items: center; gap: 9px; }
body .feature-slider-dot {
  flex: 0 0 10px;
  width: 10px !important;
  min-width: 10px !important;
  max-width: 10px !important;
  height: 10px !important;
  min-height: 10px !important;
  max-height: 10px !important;
  border-radius: 50% !important;
}
body .feature-slider-dot.active {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
}
body .feature-slider-button:hover,
body .feature-slider-button:focus-visible {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  background: transparent !important;
}

@media (min-width: 700px) {
  /* Use a defensive selector and !important here because Astra/Gutenberg can
     contribute article/block display rules after the child-theme stylesheet. */
  body .feature-slider-section .feature-slide {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 48px;
    row-gap: 28px;
    align-items: center;
  }
}
@media (max-width: 699px) {
  .feature-slider-section { padding-block: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .feature-slider-track { transition: none; }
}

/* Home hero content visibility toggle */
.hero-content { width: 100%; }
.hero-content-toggle {
  position: absolute;
  top: 20px;
  right: 0;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(8,20,31,.28);
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hero-content-toggle:hover { background: rgba(8,20,31,.48); }
.hero-content-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.hero.hero-content-hidden::after { display: none; }
.hero.hero-content-hidden {
  background: var(--stmarys-hero-image, url("assets/altar_and_cross.jpg")) center 38% / cover no-repeat;
}
.hero-copy-panel[hidden] { display: none; }

@media (max-width: 900px) {
  .hero-content-toggle { right: 20px; }
}

/* Sacrament/service image widgets and new content pages */
.sacrament-services-heading { margin-top: 52px; }
.sacrament-service-widgets { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 20px 12px; }
.sacrament-service-widget { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-color); text-decoration: none; text-align: center; font-family: var(--font-heading); }
.sacrament-service-widget img { display: block; width: 100%; max-width: 146px; height: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); transition: transform .18s ease, box-shadow .18s ease; }
.sacrament-service-widget:hover img, .sacrament-service-widget:focus-visible img { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.narrow { max-width: 880px; }
.embed-frame { width: 100%; margin: 22px 0 36px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.embed-frame iframe { display:block; border:0; }
.resource-link { margin-top: 8px; }
.content-accordion { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin: 28px 0; }
.content-accordion summary { cursor: pointer; font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; }
.content-accordion .accordion-content { padding-top: 14px; }
.adoration-feature { margin-top: 12px; }
@media (max-width: 1050px) { .sacrament-service-widgets { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 600px) { .sacrament-service-widgets { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Editor-safe rich text inside locked page sections */
.stmarys-prose > :first-child { margin-top: 0; }
.stmarys-prose > :last-child { margin-bottom: 0; }
.stmarys-prose h1, .stmarys-prose h2, .stmarys-prose h3, .stmarys-prose h4, .stmarys-prose h5, .stmarys-prose h6 { margin-top: 1.5em; margin-bottom: .55em; }
.stmarys-prose ul, .stmarys-prose ol { padding-left: 1.4rem; margin: 1rem 0 1.25rem; }
.stmarys-prose li + li { margin-top: .35rem; }
.stmarys-prose blockquote { margin: 1.25rem 0; padding: .9rem 1.1rem; border-left: 4px solid var(--gold); background: var(--surface-2); }
.stmarys-prose pre { overflow-x: auto; padding: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--surface-2); }
.stmarys-prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.stmarys-prose mark { padding: .05em .18em; }
.service-note { margin-top: 14px; }

/* Page section navigation -------------------------------------------------- */
.page-section-target {
  scroll-margin-top: 104px;
}

.page-section-nav {
  position: fixed;
  top: 50%;
  right: 16px;
  z-index: 1200;
  width: min(240px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  padding: 14px;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.page-section-nav__label {
  padding: 2px 8px 7px;
  color: var(--muted-color);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page-section-nav a {
  display: block;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--heading-color);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.page-section-nav a:hover,
.page-section-nav a:focus-visible {
  background: var(--surface-2);
  color: var(--crimson);
}

.marriage-guide-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.marriage-guide-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.marriage-guide-link i {
  margin-top: .35em;
  flex: 0 0 auto;
}

@media (max-width: 1049px) {
  .page-section-target {
    scroll-margin-top: 148px;
  }

  .page-section-nav {
    position: sticky;
    top: 72px;
    right: auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px max(16px, calc((100vw - var(--container)) / 2));
    overflow-x: auto;
    transform: none;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: 0 8px 22px rgba(7, 16, 24, .08);
    scrollbar-width: thin;
  }

  body.admin-bar .page-section-nav {
    top: 104px;
  }

  .page-section-nav__label,
  .page-section-nav a {
    flex: 0 0 auto;
  }

  .page-section-nav__label {
    padding: 6px 4px;
  }

  .page-section-nav a {
    padding: 7px 10px;
    background: var(--surface-2);
    white-space: nowrap;
  }
}

@media screen and (max-width: 782px) {
  body.admin-bar .page-section-nav {
    top: 118px;
  }
}

/* Virtual Candle */
.virtual-candle-steps { display: grid; gap: 1rem; margin: 1.5rem 0; padding-left: 1.25rem; }
.virtual-candle-form { display: grid; gap: .8rem; margin: 1.5rem 0 2rem; }
.virtual-candle-form textarea { width: 100%; min-height: 9rem; resize: vertical; }
.virtual-candle-form .btn { justify-self: start; }
.virtual-candle-honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.virtual-candle-list { display: grid; gap: 1rem; }
.virtual-candle-entry { display: grid; grid-template-columns: 84px 1fr; gap: 1rem; align-items: start; padding: 1rem; border: 1px solid var(--border, #ddd); border-radius: 12px; background: var(--surface, #fff); }
.virtual-candle-entry img { width: 84px; height: 84px; object-fit: contain; }
.virtual-candle-entry time { display: block; font-weight: 700; margin-bottom: .35rem; }
.virtual-candle-entry p { margin: 0; }
@media (max-width: 520px) { .virtual-candle-entry { grid-template-columns: 64px 1fr; } .virtual-candle-entry img { width: 64px; height: 64px; } }

/* Cathedral in Pictures */
.cathedral-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem}
.cathedral-gallery-item{margin:0;min-width:0}
.cathedral-gallery-open{display:block;width:100%;padding:0;border:0;background:transparent;border-radius:18px;overflow:hidden;cursor:zoom-in;box-shadow:0 14px 34px rgba(22,18,12,.08)}
.cathedral-gallery-open img,.cathedral-gallery-video{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;background:#111}
.cathedral-gallery-video-wrap{border-radius:18px;overflow:hidden;background:#111;box-shadow:0 14px 34px rgba(22,18,12,.08)}
.cathedral-gallery-video-wrap iframe{border:0}
.cathedral-gallery-modal[hidden]{display:none}
.cathedral-gallery-modal{position:fixed;inset:0;z-index:10000;background:rgba(10,10,10,.93);display:grid;place-items:center;padding:2rem}
.cathedral-gallery-dialog{position:relative;width:min(1160px,94vw);max-height:92vh;border-radius:20px;overflow:hidden;background:var(--surface,#fff);box-shadow:0 28px 80px rgba(0,0,0,.45)}
.cathedral-gallery-modal-figure{margin:0;display:flex;flex-direction:column;max-height:92vh}
.cathedral-gallery-modal-figure img{display:block;width:100%;max-height:calc(92vh - 58px);object-fit:contain;background:#111}
.cathedral-gallery-modal-figure figcaption{padding:1rem 1.25rem;text-align:center;background:var(--surface,#fff);color:var(--text-color,#20272e)}
.cathedral-gallery-close,.cathedral-gallery-nav{position:absolute;z-index:2;box-sizing:border-box;width:46px;height:46px;min-width:46px;min-height:46px;max-width:46px;max-height:46px;padding:0!important;margin:0;border:0!important;border-radius:50%!important;display:grid;place-items:center;line-height:1;cursor:pointer;appearance:none;-webkit-appearance:none;background:rgba(255,255,255,.94)!important;color:#333!important;box-shadow:0 6px 20px rgba(0,0,0,.18)}
.cathedral-gallery-close{right:14px;top:14px}.cathedral-gallery-prev{left:14px;top:50%;transform:translateY(-50%)}.cathedral-gallery-next{right:14px;top:50%;transform:translateY(-50%)}
body.gallery-modal-open{overflow:hidden}
.virtual-tour-content{text-align:center}.virtual-tour-content .section-heading{justify-items:center}
@media(max-width:900px){.cathedral-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.cathedral-gallery-grid{grid-template-columns:1fr}.cathedral-gallery-modal{padding:.5rem}.cathedral-gallery-dialog{width:100%;border-radius:14px}.cathedral-gallery-nav{width:40px;height:40px;min-width:40px;min-height:40px;max-width:40px;max-height:40px}.cathedral-gallery-prev{left:8px}.cathedral-gallery-next{right:8px}}