/* ==========================================================
   Grace Community Church — shared stylesheet
   Colors come from the logo; crimson comes from the sanctuary.
   ========================================================== */

:root {
  --navy: #1F2B43;       /* logo lettering */
  --cream: #FBF8F3;      /* logo background */
  --paper: #F3EDE2;      /* slightly deeper cream for alternate sections */
  --sage: #6B7A4F;       /* logo leaves */
  --crimson: #8C2338;    /* sanctuary curtain and aisle runner */
  --crimson-dark: #6F1B2C;
  --sky: #4C78C6;        /* sky in the exterior photo */
  --rule: #D8CFBF;

  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-body: "EB Garamond", Garamond, "Georgia", "Times New Roman", serif;

  --measure: 38rem;
  --wide: 68rem;
  --space: clamp(2.5rem, 1.75rem + 2.5vw, 4rem);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 1.1875rem;          /* about 19px */
  line-height: 1.65;
}

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

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h2 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); }
h3 { font-size: 1.4rem; }
p  { margin: 0 0 1em; }

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

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

/* Times and addresses read better with lining figures */
.nums, address { font-variant-numeric: lining-nums; }
address { font-style: normal; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--navy);
  color: var(--cream);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* ---------- Site header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}
.site-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--navy);
}
.brand img {
  width: 60px;
  height: 60px;
}
.brand-name {
  font-family: var(--font-display);
  line-height: 1.05;
}
.brand-name span { display: block; }
.brand-grace { font-size: 1.6rem; letter-spacing: 0.12em; }
.brand-rest  { font-size: 0.72rem; letter-spacing: 0.14em; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-nav a {
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--sage); color: var(--navy); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--crimson); }

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  background: var(--sky);
  grid-template-areas:
    "title"
    "photo"
    "service";
}
.hero-title {
  grid-area: title;
  background: var(--sky);
  color: #fff;
  text-align: center;
  padding: 1.75rem 1.25rem 0.25rem;
}
.hero-title h1 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 0.75rem;
  text-shadow: 0 1px 2px rgba(20, 35, 70, 0.35);
}
.hero-title h1 span { display: block; }
.h1-grace {
  font-size: clamp(3.2rem, 2rem + 6vw, 5.5rem);
  letter-spacing: 0.14em;
  line-height: 1;
  margin-right: -0.14em;  /* balances the trailing letter-space */
}
.h1-rest {
  font-size: clamp(1rem, 0.8rem + 1vw, 1.45rem);
  letter-spacing: 0.16em;
  margin-top: 0.4rem;
}
.tagline {
  font-style: italic;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  margin: 0 0 0.35rem;
}
.accord {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  margin: 0;
  opacity: 0.92;
}

.hero-photo {
  grid-area: photo;
  margin: 0;
  --pos: center 25%;
  /* fade the top edge into the matching sky color above */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 7%);
}
.hero-photo img {
  width: 100%;
  /* on phones, trim a little sky and grass so the service time
     still shows on the first screen */
  height: clamp(260px, 46vh, 520px);
  object-fit: cover;
  object-position: var(--pos);
}

.hero-service {
  grid-area: service;
  background: var(--navy);
  color: var(--cream);
  text-align: center;
  padding: 1.5rem 1.25rem 2.25rem;
}
.hero-service h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  font-weight: 400;
  margin: 0 0 0.3rem;
}
.service-time {
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 0.4rem;
}
.service-note { font-style: italic; margin: 0 0 1.1rem; }
.hero-service address { font-size: 1.25rem; line-height: 1.45; }
.hero-service a { color: var(--cream); }
.hero-service a:hover { color: #fff; text-decoration-thickness: 2px; }

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "title photo"
      "service photo";
    /* leave the top of the next section showing so visitors see there is more */
    min-height: min(calc(100vh - 11rem), 760px);
    background: linear-gradient(to bottom, var(--sky) 0%, #3E64AB 45%, var(--navy) 100%);
  }
  .hero-title,
  .hero-service {
    background: transparent;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .hero-title {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 2rem;
    padding-bottom: 1.5rem;
  }
  .hero-service { padding-bottom: 2.5rem; }
  .hero-photo {
    --pos: center 45%;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero .hero-photo img {
    position: absolute;
    inset: 0;
    height: 100%;
  }
}

/* ---------- Blur-up photos ----------
   A small preview (about 10 KB) is built into the page and shows
   right away; the full photo fades in over it once it arrives. */

.blur-up {
  position: relative;
  overflow: hidden;
}
.blur-up::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ph) no-repeat;
  background-size: cover;
  background-position: var(--pos, center);
  filter: blur(3px);
  transform: scale(1.03);
}
.blur-up picture { display: block; }
.blur-up img {
  position: relative;
  z-index: 1;
}
.js .blur-up img {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.js .blur-up img.is-loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .blur-up img { transition: none; }
}

/* ---------- Ornament (leaves and cross, from the logo) ---------- */

.ornament {
  display: block;
  width: 220px;
  max-width: 70%;
  height: auto;
  margin: 0 auto 1.75rem;
}

/* ---------- General sections ---------- */

.section {
  padding: var(--space) 1.25rem;
}
.section--paper { background: var(--paper); }
.section-inner {
  max-width: var(--measure);
  margin: 0 auto;
}
.section-inner--wide { max-width: var(--wide); }
.center { text-align: center; }

.more-link { font-style: italic; }

.button {
  display: inline-block;
  background: var(--crimson);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.15rem;
  text-decoration: none;
  padding: 0.65em 1.5em;
  border-radius: 3px;
  margin-top: 0.5rem;
}
.button:hover { background: var(--crimson-dark); color: #fff; }

/* When / Where — framed with a double rule, echoing the logo's double circle */
.gather {
  display: grid;
  gap: 1.5rem;
}
.gather-box {
  border: 3px double var(--navy);
  padding: 1.75rem 1.5rem;
  text-align: center;
  background: var(--cream);
}
.gather-box h2 { font-size: 1.9rem; }
.gather-big {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
@media (min-width: 48rem) {
  .gather { grid-template-columns: 1fr 1fr; }
}

/* Mission statement */
.mission {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-style: italic;
  line-height: 1.35;
  margin-bottom: 1.25rem;
}

/* How we live out our faith */
.practices {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0;
  font-size: 1.4rem;
}
.practices li { display: flex; align-items: center; }
.practices li + li::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  background: var(--sage);
  transform: rotate(45deg);
  margin: 0 0.9rem;
}

/* Photo beside text */
.split {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.split .blur-up { border-radius: 2px; }
@media (min-width: 52rem) {
  .split { grid-template-columns: 0.85fr 1fr; gap: 3.5rem; }
}

.plain-list {
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
}
.plain-list li { margin-bottom: 0.3rem; }
.plain-list li::marker { color: var(--sage); }

.two-col-list { columns: 2 14rem; column-gap: 2.5rem; }
.two-col-list li { break-inside: avoid; }

/* Scripture */
.scripture {
  margin: 0;
  text-align: center;
}
.scripture p {
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.scripture footer {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}
.scripture cite { font-style: normal; }

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

.page-banner {
  text-align: center;
  padding: 1.75rem 1.25rem 0;
}
.page-banner img {
  width: min(400px, 85%);
  margin: 0 auto;
}
.page-title {
  text-align: center;
  padding: 1.25rem 1.25rem 0;
}
.page-title h1 {
  font-size: clamp(2.2rem, 1.7rem + 2vw, 3.2rem);
  margin-bottom: 1rem;
}
.page-verse p { margin-bottom: 0.5rem; }

/* tighter gap where a section follows the hero or a page title */
.hero + .section,
.page-title + .section { padding-top: 2.25rem; }
.page-verse {
  max-width: 34rem;
  margin: 0 auto;
}
.page-verse p { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem); line-height: 1.45; }

.content h2 { margin-top: 2rem; }
.content h2:first-child { margin-top: 0; }

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

.site-footer {
  background: var(--navy);
  color: var(--cream);
  padding: 3rem 1.25rem 2rem;
  text-align: center;
}
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: #fff; }
.footer-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.2rem;
}
.footer-tagline { font-style: italic; margin-bottom: 1.25rem; }
.footer-links {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
}
.footer-accord {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  opacity: 0.8;
  margin: 0;
}

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