/* Federation of Reformed Churches - site styles (plain CSS, no framework) */

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-wght.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-wght-italic.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
}

:root {
  --navy: #1f2f4d;
  --navy-dark: #15213a;
  --burgundy: #7a1f2b;
  --burgundy-dark: #5e1620;
  --paper: #fbf8f2;
  --paper-2: #f3eee3;
  --ink: #23262b;
  --muted: #5a5f68;
  --rule: #ddd5c5;
  --white: #ffffff;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 76rem;
  --measure: 44rem;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.7;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; outline: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--burgundy); text-underline-offset: 0.15em; }
a:hover { color: var(--burgundy-dark); }
:focus-visible { outline: 3px solid #c58b1c; outline-offset: 2px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); color: var(--navy); line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.3rem; margin: 1.8rem 0 0.6rem; }
h4 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: var(--measure); padding-top: 2.5rem; padding-bottom: 3rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--navy); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 100; font-family: var(--sans); }
.skip-link:focus { top: 1rem; color: #fff; }
.eyebrow { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--burgundy); font-weight: 600; margin: 0 0 0.5rem; }

/* Buttons */
.button {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem; line-height: 1.2;
  background: var(--navy); color: #fff; text-decoration: none; padding: 0.75rem 1.4rem;
  border-radius: var(--radius); border: 2px solid var(--navy); transition: background .15s, border-color .15s;
}
.button:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.button--ghost { background: transparent; color: var(--navy); }
.button--ghost:hover { background: var(--navy); color: #fff; }
.button--large { font-size: 1.1rem; padding: 0.95rem 1.7rem; }

/* Header + navigation */
.site-header { background: var(--white); border-top: 4px solid var(--burgundy); border-bottom: 1px solid var(--rule); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 5.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.8rem; min-width: 0; text-decoration: none; color: var(--navy); margin-right: auto; padding: 0.6rem 0; }
.brand__mark { width: auto; height: 4rem; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; color: var(--navy); }
.brand__tag { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.brand:hover .brand__name { color: var(--burgundy); }

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.15rem; font-family: var(--sans); }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.55rem 0.6rem; border-radius: var(--radius);
  color: var(--navy); text-decoration: none; font: 600 0.93rem/1.2 var(--sans); background: none; border: 0; cursor: pointer;
}
.nav-link:hover, .has-sub.open > .nav-link { background: var(--paper-2); color: var(--burgundy); }
.nav-link[aria-current="page"], .has-sub.is-current > .nav-link { color: var(--burgundy); box-shadow: inset 0 -2px 0 var(--burgundy); border-radius: 0; }
.caret { width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.has-sub { position: relative; }
.has-sub.open .caret { transform: rotate(-135deg) translate(-2px, -1px); }
.submenu {
  list-style: none; margin: 0; padding: 0.5rem; position: absolute; left: 0; top: calc(100% + 0.3rem); min-width: 21rem;
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(21,33,58,.14);
  display: none;
}
.has-sub:nth-last-child(-n+4) .submenu { left: auto; right: 0; }
.submenu a { display: block; padding: 0.5rem 0.75rem; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.submenu a:hover { background: var(--paper-2); color: var(--burgundy); }
.submenu a[aria-current="page"] { color: var(--burgundy); font-weight: 600; }
.has-sub.open > .submenu { display: block; }
.no-js .has-sub:hover > .submenu, .no-js .has-sub:focus-within > .submenu { display: block; }
.nav-link--search svg { margin-right: 0.1rem; }

.menu-button {
  display: none; align-items: center; gap: 0.5rem; font: 600 0.95rem var(--sans); color: var(--navy);
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.55rem 0.8rem; cursor: pointer;
}
.menu-button__icon, .menu-button__icon::before, .menu-button__icon::after { display: block; width: 1.1rem; height: 2px; background: currentColor; position: relative; transition: transform .2s; }
.menu-button__icon::before, .menu-button__icon::after { content: ""; position: absolute; left: 0; }
.menu-button__icon::before { top: -6px; } .menu-button__icon::after { top: 6px; }
.menu-button[aria-expanded="true"] .menu-button__icon { background: transparent; }
.menu-button[aria-expanded="true"] .menu-button__icon::before { transform: translateY(6px) rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-button__icon::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1200px) {
  .js .menu-button { display: inline-flex; }
  .brand__mark { height: 3.2rem; }
  .brand__name { font-size: 1.1rem; }
  .brand { flex: 1 1 0; }
  .site-nav { width: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; padding: 0.25rem 0 1rem; border-top: 1px solid var(--rule); }
  .nav-link { width: 100%; padding: 0.8rem 0.25rem; justify-content: space-between; border-radius: 0; border-bottom: 1px solid var(--paper-2); }
  .nav-link[aria-current="page"], .has-sub.is-current > .nav-link { box-shadow: none; }
  .submenu, .has-sub:nth-last-child(-n+4) .submenu { position: static; display: none; box-shadow: none; border: 0; min-width: 0; padding: 0.25rem 0 0.5rem 0.75rem; }
  .no-js .submenu, .has-sub.open > .submenu, .has-sub.open:nth-last-child(n) > .submenu { display: block; }
  .nav-link--search { justify-content: flex-start; }
}
@media (max-width: 420px) { .brand__tag { display: none; } }

/* Home */
.hero { background: linear-gradient(180deg, var(--white) 0%, var(--paper) 100%); border-bottom: 1px solid var(--rule); }
.hero__inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; padding-top: 3rem; padding-bottom: 3rem; }
.hero h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); margin-bottom: 0.6rem; }
.hero__tagline { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem); color: var(--muted); font-style: italic; margin: 0 0 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
.hero__emblem { margin: 0; }
.hero__emblem img { width: 15rem; }
@media (max-width: 760px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; padding-top: 2rem; }
  .hero__emblem { order: -1; }
  .hero__emblem img { width: 10rem; margin: 0 auto; }
  .hero__actions { justify-content: center; }
}
.intro { padding-top: 3rem; padding-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; }
.card { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--navy); border-radius: var(--radius); padding: 1.4rem 1.5rem 1rem; }
.card__title { margin: 0 0 0.5rem; font-size: 1.35rem; }
.card p { margin: 0 0 0.8rem; }
.card__link { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; }
.section-title { margin-top: 0; }
.bco-band {
  display: grid; grid-template-columns: 11rem 1fr; gap: 2rem; align-items: center; margin-top: 2.5rem;
  background: var(--navy); color: #eef1f6; border-radius: var(--radius); padding: 1.75rem; max-width: calc(var(--wrap) - 2.5rem);
}
.bco-band .section-title { color: #fff; margin-bottom: 0.3rem; }
.bco-band p { margin: 0 0 1rem; }
.bco-band__img img { border-radius: 4px; }
.bco-band .button { background: var(--paper); color: var(--navy); border-color: var(--paper); }
.bco-band .button:hover { background: #fff; }
@media (max-width: 560px) { .bco-band { grid-template-columns: 7rem 1fr; gap: 1.1rem; padding: 1.2rem; } }
.gallery-section { padding-top: 3rem; }
.gallery-caption { color: var(--muted); margin-top: -0.3rem; }
.gallery { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }
.book-promo { display: grid; grid-template-columns: 12rem 1fr; gap: 2rem; align-items: start; margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.book-promo__cover img { border-radius: 3px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.book-promo__title { margin: 0 0 0.25rem; font-size: 1.5rem; }
.book-promo__byline { color: var(--muted); margin-top: 0; font-style: italic; }
@media (max-width: 600px) { .book-promo { grid-template-columns: 1fr; } .book-promo__cover { max-width: 10rem; } }

/* Upcoming events */
.upcoming { margin-top: 2.5rem; }
.upcoming__card { display: grid; grid-template-columns: auto 1fr auto; gap: 0.4rem 1.75rem; align-items: center; background: var(--white);
  border: 1px solid var(--rule); border-left: 5px solid var(--burgundy); border-radius: var(--radius); padding: 1.2rem 1.5rem; }
.upcoming__label { font: 700 0.8rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--burgundy); margin: 0; }
.upcoming__event p, .upcoming__none, .upcoming__more { margin: 0; }
.upcoming__title { font-size: 1.3rem; font-weight: 600; color: var(--navy); line-height: 1.3; }
.upcoming__when { color: var(--muted); }
@media (max-width: 700px) { .upcoming__card { grid-template-columns: 1fr; } .upcoming__more { margin-top: 0.6rem; } }
.events { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; }
.event { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--navy); border-radius: var(--radius); padding: 1.4rem 1.6rem 0.9rem; }
.event p { margin: 0 0 0.8rem; }
.event__title { margin: 0 0 0.4rem; font-size: 1.45rem; }
.event__when { font-weight: 600; color: var(--burgundy); font-family: var(--sans); font-size: 1.05rem; }
.event__link { font-size: 0.95rem; overflow-wrap: anywhere; }
.events-past__heading { margin-top: 3rem; }
.events-past { padding-left: 1.2rem; color: var(--muted); }
[hidden] { display: none !important; }

/* Document pages */
.page-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) 16rem; gap: 3.5rem; justify-content: space-between; padding-top: 2rem; padding-bottom: 3rem; }
@media (max-width: 1000px) { .page-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.prose .breadcrumb ol { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; font: 0.85rem/1.4 var(--sans); color: var(--muted); }
.prose .breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--rule); }
.breadcrumb a { color: var(--muted); }
.side-nav { font-family: var(--sans); align-self: start; position: sticky; top: 1.5rem; border-left: 3px solid var(--rule); padding-left: 1.1rem; }
.side-nav__heading { font: 700 0.8rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--burgundy); margin: 0.3rem 0 0.8rem; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: block; padding: 0.35rem 0; color: var(--ink); text-decoration: none; font-size: 0.93rem; line-height: 1.35; }
.side-nav a:hover { color: var(--burgundy); text-decoration: underline; }
.side-nav a[aria-current="page"] { color: var(--burgundy); font-weight: 700; }
@media (max-width: 1000px) { .side-nav { position: static; border-left: 0; border-top: 1px solid var(--rule); padding: 1.5rem 0 0; } }

.prose { overflow-wrap: break-word; }
.prose > h1:first-of-type + h2, .prose h1 + h4, .prose h1 + h2 + h4 { margin-top: 0; }
.prose h4 { font-style: italic; font-weight: 500; color: var(--muted); }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.6rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li > p { margin-bottom: 0.6rem; }
.prose blockquote { border-left: 3px solid var(--burgundy); margin-left: 0; padding: 0.2rem 0 0.2rem 1.2rem; color: #3b3f46; font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.prose table { border-collapse: collapse; width: 100%; margin-bottom: 1.2rem; font-size: 1rem; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 0.4rem 0.6rem; text-align: left; }
.lettered .prose ol ul, .lettered .prose ul ul { list-style: none; padding-left: 1rem; }
.prose sup { line-height: 0; }
.prose .footnote-ref a { text-decoration: none; font-family: var(--sans); font-size: 0.75em; font-weight: 600; padding: 0 0.1em; }
.prose .footnotes-sep { margin-top: 3rem; }
.prose .footnotes { font-size: 0.95rem; line-height: 1.6; color: #3b3f46; }
.prose .footnotes-list { padding-left: 1.6rem; }
.prose .footnote-backref { text-decoration: none; font-family: var(--sans); }
.doc-download { margin: 1.2rem 0 1.8rem; }

.callout { background: var(--white); border: 1px solid var(--rule); border-left: 5px solid var(--burgundy); border-radius: var(--radius); padding: 1.5rem 1.75rem; margin: 1.5rem 0 2rem; }
.callout p { margin: 0 0 0.6rem; }
.callout__label { font: 700 0.78rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--burgundy); }
.callout__title { font-size: 1.4rem; font-weight: 600; color: var(--navy); line-height: 1.3; }
.callout__meta { color: var(--muted); font-style: italic; }
.callout .button { margin-top: 0.6rem; }
.callout__note { font: 0.85rem var(--sans); color: var(--muted); }

.church-list { display: grid; gap: 1rem; margin-top: 1rem; }
.church { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.4rem; }
.church p { margin: 0 0 0.2rem; }
.church__name { margin: 0 0 0.15rem; font-size: 1.25rem; }
.church__place { color: var(--muted); }
.church__tag { font-weight: 600; color: var(--burgundy); }

.notfound ul { font-family: var(--sans); }
.search-box { --pagefind-ui-primary: #1f2f4d; --pagefind-ui-text: #23262b; --pagefind-ui-background: #ffffff; --pagefind-ui-border: #ddd5c5; --pagefind-ui-tag: #f3eee3; --pagefind-ui-font: var(--sans); margin-top: 1.5rem; }

/* Footer */
.site-footer { background: var(--navy-dark); color: #d9deE8; margin-top: 3rem; font-family: var(--sans); font-size: 0.95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #f1d9a8; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 1.5rem; }
.site-footer p { margin: 0 0 0.6rem; }
.site-footer__name { font: 600 1.2rem var(--serif); color: #fff; }
.site-footer__heading { font: 700 0.8rem var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: #f1d9a8; margin: 0 0 0.7rem; }
.site-footer__links { list-style: none; margin: 0; padding: 0; }
.site-footer__links li { margin-bottom: 0.4rem; }
.site-footer__legal { border-top: 1px solid rgba(255,255,255,.15); padding-top: 1rem; padding-bottom: 1.5rem; font-size: 0.85rem; color: #b9c1d0; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; gap: 1.2rem; } }

@media print {
  .site-header, .site-footer, .side-nav, .breadcrumb, .skip-link { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .page-grid { display: block; }
  a { color: inherit; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
