/* Wycliffe Presbytery — site styles.
   Palette and type follow crechurches.org: a Garamond serif for headings (CREC uses Jannon),
   Public Sans for text, tracked capitals for labels, CREC crimson and blue as accents. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/assets/fonts/public-sans.woff2") format("woff2");
}

:root {
  --ink: #23292e;
  --text: #3a4046;
  --muted: #666d74;
  --white: #ffffff;
  --paper: #fbf8f1;
  --stone: #f2ede3;
  --rule: #e3dccf;
  --night: #1b2127;
  --crimson: #a5192e;
  --crimson-dark: #861425;
  --blue: #295ea1;

  --serif: "EB Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --wrap: 72rem;
  --gutter: max(1.25rem, env(safe-area-inset-left), env(safe-area-inset-right));
  --section: clamp(4rem, 9vw, 7.5rem);
  color-scheme: light;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  font-weight: 350;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--crimson);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--crimson-dark); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--ink);
  font-size: 0.875rem;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: calc(44rem + 2 * var(--gutter)); }
.narrow-wide { max-width: calc(56rem + 2 * var(--gutter)); }
.center { text-align: center; }

/* Shared type ------------------------------------------------------------ */

.eyebrow {
  margin: 0 0 1rem;
  color: var(--blue);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  line-height: 1.5;
  text-transform: uppercase;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.eyebrow--light { color: rgba(255, 255, 255, 0.85); }

.section-title {
  font-size: clamp(2.1rem, 1.6rem + 2vw, 3.1rem);
}
.section-title--small {
  font-size: clamp(1.6rem, 1.35rem + 1vw, 2.1rem);
}

.minor-heading {
  margin-bottom: 1rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lead {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.55rem);
  line-height: 1.5;
}

.rule {
  display: block;
  width: 3.5rem;
  height: 1px;
  margin: 1.5rem auto 1.75rem;
  background: var(--crimson);
}
.rule--left { margin-left: 0; }
.rule--light { background: rgba(255, 255, 255, 0.6); }

.quiet { color: var(--muted); }

.count {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.text-link {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}
.text-link::after { content: " \2192"; }
.text-link:hover { text-decoration: underline; }

/* Buttons ---------------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--crimson);
  background: var(--crimson);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.button:hover { background: var(--crimson-dark); border-color: var(--crimson-dark); color: var(--white); }
.button--ghost { background: transparent; border-color: rgba(255, 255, 255, 0.7); }
.button--ghost:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.button--dark { background: var(--ink); border-color: var(--ink); }
.button--dark:hover { background: var(--crimson); border-color: var(--crimson); }

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

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  padding-top: max(1.5rem, env(safe-area-inset-top));
  color: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--white);
  text-decoration: none;
}
.brand:hover { color: var(--white); }
.brand-mark { width: 30px; height: 36px; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.1;
}
.brand-sub {
  margin-top: 0.3rem;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.3;
  opacity: 0.8;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.25rem;
}
.site-nav a {
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover { border-bottom-color: rgba(255, 255, 255, 0.6); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--white); }

/* Hero and page banners -------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--night);
  color: var(--white);
  isolation: isolate;
}
.hero--home { min-height: min(94vh, 58rem); }
@supports (min-height: 1svh) { .hero--home { min-height: min(94svh, 58rem); } }
.hero--banner { min-height: clamp(24rem, 58vh, 34rem); }
.hero--short { min-height: clamp(30rem, 80vh, 40rem); }

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.72) 0%, rgba(16, 20, 24, 0.38) 38%, rgba(16, 20, 24, 0.5) 70%, rgba(16, 20, 24, 0.82) 100%);
}

.hero--banner::after {
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.78) 0%, rgba(16, 20, 24, 0.6) 45%, rgba(16, 20, 24, 0.84) 100%);
}

.hero-content {
  padding-block: 9.5rem 5rem;
  text-align: center;
}
.hero--banner .hero-content { padding-block: 9rem 4rem; }

.hero-title {
  color: var(--white);
  font-size: clamp(3rem, 1.8rem + 6vw, 6.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero--banner .hero-title { font-size: clamp(2.75rem, 1.9rem + 4vw, 4.75rem); }

.hero-lede {
  max-width: 38rem;
  margin-inline: auto;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

/* Sections --------------------------------------------------------------- */

.section { padding-block: var(--section); }
.section--paper { background: var(--paper); }

.split {
  display: grid;
  gap: 3rem 5rem;
  align-items: start;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
}

/* Namesake */
.namesake-grid {
  display: grid;
  gap: 3rem 5rem;
  align-items: center;
}
@media (min-width: 860px) {
  .namesake-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.portrait {
  max-width: 26rem;
  margin: 0 auto;
}
.portrait picture {
  display: block;
  padding: 0.7rem;
  background: var(--white);
  border: 1px solid var(--rule);
  box-shadow: 0 1.5rem 3rem -1.5rem rgba(35, 41, 46, 0.35);
}
.portrait img { width: 100%; }
.portrait figcaption {
  margin-top: 1rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
}

.scripture {
  margin: 2rem 0 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 2px solid var(--crimson);
}
.scripture p {
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.55rem);
  font-style: italic;
  line-height: 1.4;
}
.scripture cite {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Region summary on the home page */
.region-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.region-summary li { border-bottom: 1px solid var(--rule); }
.region-summary a {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 1.1rem 0.25rem;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}
.region-summary a:hover { color: var(--crimson); }
.region-count {
  min-width: 2ch;
  color: var(--crimson);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

/* CREC band */
.crec-band {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.crec-inner {
  display: grid;
  gap: 2rem 4rem;
  align-items: center;
  justify-items: center;
  text-align: center;
}
.crec-inner > div { max-width: 40rem; }
.crec-inner .section-title { margin-bottom: 1rem; }
.crec-logo img { width: 150px; }
@media (min-width: 760px) {
  .crec-inner {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
  }
  .crec-logo img { width: 180px; }
}

/* Jump navigation (churches by state, document categories) --------------- */

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.jump-nav a {
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}
.jump-nav a:hover { border-color: var(--crimson); color: var(--crimson); }
.jump-nav .count { margin-left: 0.35rem; color: var(--crimson); }

.group-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin: 3.5rem 0 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.4rem);
}

/* Churches --------------------------------------------------------------- */

.church-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.church {
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.6rem 1.4rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--rule);
  transition: border-color 0.2s;
}
.church:hover { border-top-color: var(--crimson); }

.church-place {
  margin-bottom: 0.5rem;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.church-name {
  margin-bottom: 0.75rem;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.2;
}
.church-name a { color: var(--ink); text-decoration: none; }
.church-name a:hover { color: var(--crimson); text-decoration: underline; }

.church-note {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.4;
}
.church-since,
.church-people {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.church-since { color: var(--muted); }
.church-people .label {
  display: inline-block;
  min-width: 4.4rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.church-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: auto;
  padding-top: 1.1rem;
}
.church-links a {
  padding-block: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}
.church-links a:hover { text-decoration: underline; }

.source-note {
  max-width: 44rem;
  margin: 3.5rem auto 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

/* Documents -------------------------------------------------------------- */

.doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.doc {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 1rem 0.25rem;
  border-bottom: 1px solid var(--rule);
}
.doc:hover { background: rgba(255, 255, 255, 0.7); }
@media (min-width: 700px) {
  .doc-group .doc {
    grid-template-columns: 11.5rem 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding-inline: 0.5rem;
  }
}

.doc-date {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.doc-date--none { color: var(--muted); }

.doc-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.35;
  text-decoration: none;
}
.doc-title::after {
  content: "";
  position: absolute;
  inset: 0;
}
.doc:hover .doc-title { color: var(--crimson); text-decoration: underline; }

.doc-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.doc-group:first-of-type .group-heading { margin-top: 2.5rem; }
.group-heading + .doc-list { border-top: 0; }

.empty-state {
  padding: 3rem 1.5rem;
  border: 1px solid var(--rule);
  background: var(--white);
  text-align: center;
}
.empty-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
}

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

.site-footer {
  padding-top: clamp(3rem, 6vw, 4.5rem);
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  background: var(--stone);
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem 4rem;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 2fr 1.3fr 1fr; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.footer-logo { flex: none; }
.footer-logo img { width: 96px; }
.footer-name {
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
}
.footer-sub { color: var(--muted); line-height: 1.5; }

.footer-heading {
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer-email {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}
.footer-email:hover { color: var(--crimson); }

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--crimson); text-decoration: underline; }

.footer-base {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8rem;
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    gap: 1.1rem;
  }
  .brand { text-align: left; }
  .site-nav {
    justify-content: center;
    gap: 0.25rem 1.5rem;
  }
  .site-nav a { font-size: 0.7rem; letter-spacing: 0.18em; }
  .hero-content { padding-block: 11rem 4rem; }
  .hero--banner .hero-content { padding-block: 10.5rem 3.5rem; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 1.3rem; }
  .brand-sub { font-size: 0.52rem; letter-spacing: 0.16em; }
  .site-nav { gap: 0.25rem 1.1rem; }
  .hero-actions .button { flex: 1 1 100%; }
  .footer-brand { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .site-header, .skip-link, .hero-media, .hero::after, .jump-nav, .crec-band { display: none; }
  .hero { min-height: 0; background: none; color: var(--ink); }
  .hero-title, .hero-lede, .eyebrow--light { color: var(--ink); }
  .hero-content { padding-block: 1rem; }
  .section { padding-block: 1.5rem; }
}
