/* ==========================================================================
   Union Chapel — site styles
   Values taken from the current WordPress/Qi theme so the look carries over.
   ========================================================================== */

:root {
  --ink: #2d2d2d;          /* body text & headings */
  --black: #000;           /* nav text */
  --gold: #c1a87d;         /* active / hover accent */
  --line: #555;            /* outline buttons */
  --footer-bg: #f7f5f5;
  --white: #fff;
  --soft-border: #e2e2e2;

  --font-display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Open Sans", "Helvetica Neue", Arial, sans-serif;

  --wide: 1090px;          /* home photo arch */
  --grid: 962px;           /* home tiles */
  --text: 870px;           /* reading column on inner pages */
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: underline; }
a:hover, a:focus-visible { color: #d6b231; text-decoration: none; }
a.plain { text-decoration: none; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2, h3, h4, h5 { font-family: var(--font-display); color: var(--ink); font-weight: 300; margin: 24px 0 18px; }
h1 { font-size: 32px; line-height: 1.4; }
h2 { font-size: 22px; line-height: 33px; letter-spacing: 2px; }
h3 { font-size: 20px; line-height: 30px; letter-spacing: 2px; }
h4 { font-size: 18px; line-height: 35px; letter-spacing: 1.5px; font-weight: 200; }
p { margin: 0 0 14px; }

.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: 8px; top: -60px; z-index: 100;
  background: var(--white); padding: 10px 16px; border: 1px solid var(--soft-border);
  font-family: var(--font-display); font-size: 14px;
}
.skip-link:focus { top: 8px; }

/* ---------- Outline button ---------- */

.btn {
  display: inline-block;
  max-width: 100%;
  padding: 11px 30px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  letter-spacing: 1px;
  text-align: center;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.btn:hover, .btn:focus-visible { color: var(--gold); border-color: var(--gold); }

/* ---------- Header ---------- */

.site-header {
  position: relative;
  text-align: center;
  padding: 54px 20px 0;
  height: 250px;
}

.site-logo { display: inline-block; text-decoration: none; }
.site-logo img { height: 96px; width: auto; }
.site-logo-text {
  font-family: var(--font-display); font-size: 40px; letter-spacing: 6px; text-transform: uppercase;
}

.nav-list, .submenu { list-style: none; margin: 0; padding: 0; }

.nav-list { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 31px; }

.nav-item { position: relative; }

.nav-item > a,
.submenu a {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
}
.nav-item > a { padding: 0 25px; }
.nav-item > a:hover, .nav-item > a:focus-visible,
.nav-item.is-active > a { color: var(--gold); }

/* Desktop dropdowns */
.submenu {
  position: absolute; left: 0; top: 100%;
  min-width: 220px;
  padding: 14px 0;
  background: var(--white);
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 20;
}
.nav-item.has-children > a { padding-bottom: 14px; margin-bottom: -14px; } /* hover bridge */
.nav-item:hover > .submenu,
.nav-item:focus-within > .submenu { opacity: 1; visibility: visible; transform: none; }

.submenu a { padding: 7px 25px; color: var(--ink); }
.submenu a:hover, .submenu a:focus-visible,
.submenu .is-active > a { color: var(--gold); }

.nav-toggle, .submenu-toggle { display: none; }

/* ---------- Home: photo arch ---------- */

.home-hero { padding: 18px 20px 0; }

.arch {
  --gap: 2.2%;
  max-width: var(--wide);
  margin: 0 auto;
  aspect-ratio: 1090 / 533;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 0 var(--gap);
  /* One large circle trims the top of all the photos into a single arch. */
  clip-path: circle(128% at 50% 206%);
}
.arch-col { overflow: hidden; height: 100%; }
.arch-col img { width: 100%; height: 100%; object-fit: cover; }

/* Phones: eight photos in two rows under one arch, like a window.
   The square frame and circle radius match the current site. */
.arch--window {
  display: none;
  aspect-ratio: 1;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2.25%;
  clip-path: circle(100% at 50% 100%);
}

/* ---------- Home: buttons ---------- */

.home-buttons {
  display: flex; flex-direction: column; align-items: center; gap: 21px;
  padding: 92px 20px 0;
}

/* ---------- Home: link tiles ---------- */

.home-tiles {
  max-width: calc(var(--grid) + 40px);
  margin: 0 auto;
  padding: 95px 20px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.tile { position: relative; display: block; text-decoration: none; color: var(--ink); }
.tile-image { display: block; aspect-ratio: 1; overflow: hidden; background: #eee; }
.tile-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tile:hover .tile-image img, .tile:focus-visible .tile-image img { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .tile-image img { transition: none; } }

.tile-label {
  position: absolute; left: 15%; right: 15%; bottom: 14.6%;
  padding: 7px 10px;
  background: var(--white);
  font-family: var(--font-display);
  font-size: 16px; line-height: 22px; font-weight: 300;
  letter-spacing: 1.5px; text-transform: uppercase; text-align: center;
}
.tile:hover .tile-label, .tile:focus-visible .tile-label { color: var(--gold); }

/* ---------- Home: closing ---------- */

.home-closing { text-align: center; padding: 92px 20px 100px; }
.home-tagline { margin: 0 0 22px; font-size: 20px; line-height: 30px; letter-spacing: 2px; }

/* ---------- Inner pages ---------- */

.page-hero {
  position: relative;
  width: calc(100% - 40px);
  max-width: 1086px;
  margin: 8px auto 0;
  aspect-ratio: 1086 / 323.5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--footer-bg);
}
.page-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.page-title {
  position: relative;
  margin: 0;
  max-width: calc(100% - 40px);
  font-size: 18px;
  line-height: 24px;
  font-weight: 300;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-align: center;
}
.page-title span {
  display: inline-block;
  padding: 18px 26px 18px 31px; /* extra left padding balances the letter-spacing */
  background: var(--white);
}

.page-body {
  max-width: 920px;          /* 880px of text + 20px padding each side */
  margin: 0 auto;
  padding: 64px 20px 0;
}
.page-body > :first-child { margin-top: 0; }
.page-body p, .page-body ul, .page-body ol { margin: 0 0 14px; }
.page-body ul, .page-body ol { padding-left: 26px; }
.page-body li { margin: 0 0 6px; }
.page-body a:not(.btn) {
  text-decoration-color: rgba(193, 168, 125, .8);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.page-body img { display: inline-block; vertical-align: middle; }
.page-body blockquote {
  margin: 24px 0; padding: 4px 0 4px 22px;
  border-left: 2px solid var(--gold);
  font-style: italic;
}
.page-body hr { border: 0; border-top: 1px solid var(--soft-border); margin: 36px 0; }
.page-body .align-center { text-align: center; }
.page-body .btn-row { text-align: center; margin: 46px 0 0; }

.page-map { margin: 40px 0 0; aspect-ratio: 3 / 2; background: var(--footer-bg); }
.page-map iframe { display: block; width: 100%; height: 100%; border: 0; }

.page-tagline {
  margin: 72px 20px 72px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #5d5d5d;
}

.preview-note {
  position: sticky; top: 0; z-index: 40;
  margin: 0; padding: 8px 20px;
  background: var(--gold); color: var(--white);
  font-family: var(--font-display); font-size: 14px; text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  text-align: center;
  padding: 72px 20px 72px;
  font-family: var(--font-display);
  font-weight: 300;
}
.footer-top { max-width: 500px; margin: 0 auto; letter-spacing: 1px; font-size: 16px; }
.footer-top p { margin: 0 0 9px; }
.footer-top a.plain:hover { color: var(--gold); }

.social-links {
  list-style: none; margin: 56px 0 48px; padding: 0;
  display: flex; justify-content: center; gap: 22px;
}
.social-links a { display: block; transition: transform .1s ease; }
.social-links a:hover { transform: scale(1.1); }
.social-links svg { display: block; }

.footer-bottom p { font-size: 12px; line-height: 20px; margin: 0 0 16px; }
.footer-bottom p:last-child { margin: 25px 0 0; }

/* ---------- Back to top ---------- */

.back-to-top {
  position: fixed; right: 25px; bottom: 25px; z-index: 30;
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--soft-border); color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s, color .2s, border-color .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; }
.back-to-top:hover, .back-to-top:focus-visible { color: var(--gold); border-color: var(--gold); }

/* ==========================================================================
   Tablet & mobile (≤ 1024px): hamburger menu, as on the current site
   ========================================================================== */

@media (max-width: 1024px) {
  .site-header { height: auto; padding: 50px 20px 0; }
  .site-logo img { height: 90px; }

  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 1rem; right: 1rem;
    width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink);
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 1px; background: currentColor; transition: transform .25s, opacity .25s;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    margin: 20px -20px 0;
    border-bottom: 1px solid var(--gold);
    text-align: left;
  }
  /* Hidden until the menu button is tapped (stays visible if JavaScript is off). */
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }

  .nav-list { display: block; margin: 0; padding: 6px 0 14px; }
  .nav-item { display: flex; flex-wrap: wrap; align-items: center; }
  .nav-item > a { flex: 1; padding: 11px 30px; margin: 0; font-weight: 300; letter-spacing: 2px; color: var(--ink); }
  .nav-item.has-children > a { padding-bottom: 11px; margin-bottom: 0; }

  .submenu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 42px; margin-right: 14px; padding: 0;
    border: 0; background: none; cursor: pointer; color: var(--ink);
  }
  .submenu-toggle::before {
    content: ""; width: 7px; height: 7px;
    border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
    transform: rotate(-45deg); transition: transform .2s;
  }
  .submenu-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }

  .submenu {
    position: static; flex-basis: 100%;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none; padding: 0 0 8px; min-width: 0;
  }
  .js .submenu { display: none; }
  .js .submenu.is-open { display: block; }
  .nav-item:hover > .submenu, .nav-item:focus-within > .submenu { transform: none; }
  .submenu a { padding: 8px 30px 8px 50px; font-weight: 300; letter-spacing: 2px; text-transform: none; }

  .home-hero { padding-top: 30px; }
  .page-hero { margin-top: 30px; }
}

/* Phones (same breakpoint as the current site): window of eight photos,
   one tile per row at about three-quarters of the screen width. */
@media (max-width: 767px) {
  .home-hero { padding: 38px 16px 0; }
  .home-hero.has-window .arch--wide { display: none; }
  .home-hero.has-window .arch--window { display: grid; }
  .home-hero:not(.has-window) .arch--wide { --gap: 2.5%; aspect-ratio: 1.25; clip-path: circle(111.3% at 50% 126%); }

  .home-buttons { padding: 80px 14px 0; gap: 20px; }
  .home-tiles { grid-template-columns: 1fr; gap: 46px; padding: 77px 0 0; max-width: none; }
  .tile { width: 74%; max-width: 440px; margin: 0 auto; }
  .tile-label { left: 17%; right: 17%; bottom: 17%; padding: 7px 6px; }
  .home-closing { padding: 110px 30px 80px; }
}

/* Phones: inner-page header photos become squares with the title on top. */
@media (max-width: 600px) {
  .page-hero { aspect-ratio: 1; }
  .page-title { font-size: 16px; letter-spacing: 4px; }
  .page-title span { padding: 14px 18px 14px 22px; }
  .page-body { padding-top: 44px; }
  .page-tagline { margin: 56px 20px 64px; letter-spacing: 3px; }
}

@media (max-width: 480px) {
  .btn { padding: 12px 1.5rem; }
  .home-tagline { font-size: 18px; letter-spacing: 1.5px; }
  .site-footer { padding: 56px 20px; }
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
