/* pebmarsh.com — one stylesheet for every page. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf7f0;
  --paper-deep: #f1ece0;
  --ink: #1f2a1e;
  --ink-soft: #55604f;
  --rule: #ddd5c3;
  --green: #2e4a2c;
  --green-deep: #223822;
  --cream: #f6efdc;
  --gold: #d9b45a;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --width: 1040px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
}

a { color: var(--green); text-decoration-color: color-mix(in srgb, var(--green) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

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

.wrap { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  font-variation-settings: "opsz" 72;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}

.eyebrow {
  font: 600 0.78rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

/* Header */

.site-header { position: relative; z-index: 2; }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.site-title {
  font: 600 1.45rem/1 var(--serif);
  font-variation-settings: "opsz" 48;
  color: inherit;
  text-decoration: none;
}

.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.site-nav a { color: inherit; opacity: 0.85; text-decoration: none; padding: 4px 0; border-bottom: 1.5px solid transparent; }
.site-nav a:hover { opacity: 1; }
.site-nav a[aria-current="page"] { opacity: 1; border-bottom-color: currentColor; }

/* Inner pages: solid green header with the page title */

.page-head { background: var(--green); color: var(--cream); }
.page-head .title { padding-top: 36px; padding-bottom: 56px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }

/* Home: photo header */

.hero {
  position: relative;
  color: #fff;
  background: var(--green-deep) url("/img/pebmarsh-church-1000.jpg") center 40% / cover no-repeat;
  min-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
}

@media (min-width: 1000px) {
  .hero { background-image: url("/img/pebmarsh-church.jpg"); }
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 24, 14, 0.55) 0%, rgba(15, 24, 14, 0) 28%),
    linear-gradient(0deg, rgba(15, 24, 14, 0.78) 0%, rgba(15, 24, 14, 0.25) 45%, rgba(15, 24, 14, 0) 70%);
}

.hero .site-header { color: #fff; }

.hero-body { position: relative; margin-top: auto; padding-bottom: 56px; }

.hero h1 {
  font-size: clamp(3.2rem, 11vw, 7rem);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.hero p { font-size: clamp(1.05rem, 2.2vw, 1.3rem); margin: 10px 0 0; max-width: 34em; opacity: 0.95; }

/* Sections */

main section { padding: 72px 0; }
main section + section { border-top: 1px solid var(--rule); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }

/* Mailing list band */

.band { background: var(--green); color: var(--cream); }
main section.band { border-top: 0; }

.band .wrap { display: grid; gap: 28px 64px; grid-template-columns: 1.3fr 1fr; align-items: center; }
.band .eyebrow { color: var(--gold); }
.band h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.band p { margin: 14px 0 0; color: color-mix(in srgb, var(--cream) 88%, transparent); max-width: 32em; }
.band a:not(.button) { color: var(--cream); text-decoration-color: color-mix(in srgb, var(--cream) 45%, transparent); }
.band a:not(.button):hover { text-decoration-color: currentColor; }

.band-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.button {
  display: inline-block;
  background: var(--gold);
  color: var(--green-deep);
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { background: #e6c46d; transform: translateY(-1px); }

@media (max-width: 760px) {
  .band .wrap { grid-template-columns: 1fr; }
}

/* Village directory */

.directory {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
  border-top: 1px solid var(--rule);
}

.directory li { border-bottom: 1px solid var(--rule); }

.directory a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 16px;
  padding: 18px 2px;
  color: inherit;
  text-decoration: none;
}

.directory strong { font: 560 1.3rem/1.2 var(--serif); font-variation-settings: "opsz" 36; }
.directory span { grid-column: 1; color: var(--ink-soft); font-size: 0.95rem; }
.directory a::after {
  content: "→";
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--ink-soft);
  transition: transform 0.15s ease, color 0.15s ease;
}
.directory a:hover strong { color: var(--green); }
.directory a:hover::after { color: var(--green); transform: translateX(4px); }

@media (max-width: 700px) {
  .directory { grid-template-columns: 1fr; }
}

/* Map */

.map { border-radius: 6px; overflow: hidden; background: var(--paper-deep); box-shadow: 0 0 0 1px var(--rule); }
.map iframe { display: block; width: 100%; height: 420px; border: 0; }

/* Inner page text */

.prose { padding-top: 56px; padding-bottom: 80px; }
.prose > * { max-width: 38rem; }
.prose h2 { font-size: 1.7rem; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose .button { margin: 8px 18px 8px 0; }
.prose .note { color: var(--ink-soft); font-style: italic; }

/* Footer */

.site-footer { background: var(--green-deep); color: color-mix(in srgb, var(--cream) 80%, transparent); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; padding-top: 36px; padding-bottom: 40px; }
.site-footer a { color: inherit; }
.site-footer .credit { flex-basis: 100%; font-size: 0.8rem; opacity: 0.75; }
