/*
 * New Hope Fellowship — site styles.
 *
 * Mobile-first, designed at 375px and allowed to grow.
 *
 * Self-hosted and system fonts only. No font CDN, no @import, no url()
 * pointing anywhere but our own origin — a stylesheet is a loading surface,
 * and the no-third-party-origin rule covers it as much as it covers scripts.
 *
 * There is no photography on this site, so structure and type carry it: deep
 * full-width bands, alternating tone, and a large display scale. Navy rather
 * than red because the church's own phrase is "Anchored in Christ" and its sign
 * carries an anchor — the palette can make that connection without an image.
 *
 * Every text pairing is checked for WCAG 2.1 AA (4.5:1 body, 3:1 large text
 * and interface boundaries); the ratios are noted beside each value.
 */

:root {
  /* Deep navy ground for the bands. White on it is 15.3:1 */
  --navy: #14243f;
  --navy-deep: #0e1a2e;
  --navy-soft: #24395c;

  /* #1b1f26 on --stone = 14.4:1 */
  --ink: #1b1f26;
  /* #545a63 on --stone = 6.6:1 */
  --ink-muted: #545a63;

  --page: #ffffff;
  /* Warm stone, so the light bands are not clinical white */
  --stone: #f7f4ef;
  --stone-deep: #ece6dc;
  --line: #ddd5c8;

  /* On navy: #dbe3ef = 11.6:1, #aab6c9 = 6.8:1 */
  --on-navy: #dbe3ef;
  --on-navy-muted: #aab6c9;

  /* Warm brass. #8a6410 on --stone = 5.4:1; --navy on --sand = 11.1:1 */
  --brass: #8a6410;
  --sand: #e8dcc3;

  /* #1f3f73 on --stone = 8.4:1 */
  --link: #1f3f73;
  --focus: #b8862b;

  --font-display: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --measure: 64rem;
  --measure-narrow: 40rem;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--sand);
  color: var(--navy);
  font-weight: 700;
}

.skip:focus {
  left: 0;
}

/* --- Bands: full width, text held to a readable measure --- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/*
 * Long-form text is held to a readable measure by constraining the text
 * itself, not the container. Narrowing the container moved the left edge in
 * and out between bands, which reads as a mistake rather than a rhythm — the
 * single biggest thing making the page look unconsidered.
 */
.wrap.narrow > p,
.wrap.narrow > ul,
.wrap.narrow > dl,
.wrap.narrow > .faq {
  max-width: var(--measure-narrow);
}

.band {
  padding: 2.75rem 0;
}

.band-deep {
  background: var(--navy);
  color: var(--on-navy);
}

.band-deep h1,
.band-deep h2,
.band-deep h3 {
  color: #ffffff;
}

.band-deep a {
  color: var(--sand);
}

.band-stone {
  background: var(--stone);
}

.band-plain {
  background: var(--page);
}

/* --- Masthead --- */

.masthead {
  background: var(--navy-deep);
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
}

/*
 * The mark carries nothing the name beside it does not already say, so its alt
 * text is empty on purpose - announcing it would read the church's name twice
 * to anyone listening rather than looking. Width and height are in the markup
 * as well, so the header does not jolt sideways as the image arrives.
 */
.wordmark-logo {
  flex-shrink: 0;
  width: 2.875rem;
  height: auto;
}

.wordmark-text {
  display: block;
}

.wordmark-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.wordmark-tagline {
  display: block;
  margin-top: 0.1875rem;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand);
}

/*
 * No hamburger toggle: that needs JavaScript, which the security policy
 * forbids outright. The links wrap instead, and each stays one Tab apart.
 */
.masthead nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

.masthead nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.masthead nav a {
  display: block;
  padding: 0.5rem 0.625rem;
  color: var(--on-navy);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.25rem;
}

.masthead nav a:hover {
  background: var(--navy-soft);
  color: #ffffff;
}

.masthead nav a[aria-current='page'] {
  color: #ffffff;
  box-shadow: inset 0 -2px 0 var(--sand);
}

.nav-give {
  /*
   * Pushed to the end of whatever line it lands on.
   *
   * On a phone the five links fill the row and Give wraps beneath them, where
   * left-aligned it sat under "Home" looking like a link someone forgot to
   * finish rather than the page's main action. Held to the right it reads as
   * deliberate on a narrow screen and stays separated from the ordinary links
   * on a wide one — no media query, and the same rule does both.
   */
  margin-left: auto;
  padding: 0.5rem 1.125rem;
  border-radius: 0.3125rem;
  background: var(--sand);
  color: var(--navy) !important;
  font-weight: 700;
}

.nav-give:hover {
  background: #ffffff;
}

.nav-give[aria-current='page'] {
  box-shadow: none;
}

/* --- Hero and page heads --- */

.hero {
  padding: 3.5rem 0 3.25rem;
}

.hero h1 {
  font-size: clamp(2.125rem, 7vw, 3.25rem);
  max-width: 18ch;
}

.band-head {
  padding: 2.5rem 0 2.25rem;
}

.band-head h1 {
  font-size: clamp(1.875rem, 5vw, 2.5rem);
}

.lede {
  font-size: 1.0625rem;
  max-width: 46ch;
  margin-bottom: 1.25rem;
}

.band-deep .lede {
  color: var(--on-navy);
}

.verse {
  max-width: 46ch;
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--sand);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.125rem;
  color: #ffffff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* --- Latest message, on the home page --- */

.latest-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  line-height: 1.2;
  max-width: 30ch;
}

.latest-date {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
}

/* --- Buttons --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border-radius: 0.375rem;
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.button.primary {
  background: var(--sand);
  color: var(--navy) !important;
  border: 2px solid var(--sand);
}

.button.primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.button.ghost {
  background: transparent;
  color: #ffffff !important;
  border: 2px solid var(--on-navy-muted);
}

.button.ghost:hover {
  border-color: #ffffff;
  background: var(--navy-soft);
}

/* On light bands the ghost button needs the opposite treatment. */
.button.ghost.dark {
  color: var(--link) !important;
  border-color: var(--link);
}

.button.ghost.dark:hover {
  background: var(--stone-deep);
}

.band-stone .button.primary,
.band-plain .button.primary {
  background: var(--navy);
  color: #ffffff !important;
  border-color: var(--navy);
}

.band-stone .button.primary:hover,
.band-plain .button.primary:hover {
  background: var(--navy-soft);
  border-color: var(--navy-soft);
}

.button.give {
  min-height: 3.75rem;
  width: 100%;
  font-size: 1.1875rem;
  margin-bottom: 0.75rem;
}

.handoff {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.handoff {
  max-width: var(--measure-narrow);
}

/* --- Service times --- */

.hero-times h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.service-times {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.service-times li {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}

.service-times .when {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--navy);
}

.service-times .what {
  font-weight: 600;
}

.service-times .note {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.hero-where {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* --- Highlights --- */

.highlights ul {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.highlights li {
  padding: 1.5rem 1.375rem;
  background: var(--stone);
  border-top: 3px solid var(--brass);
  border-radius: 0 0 0.5rem 0.5rem;
}

.highlights h3 {
  font-size: 1.125rem;
}

.highlights p {
  margin: 0;
  color: var(--ink-muted);
}

/* --- Questions and answers --- */

.faq {
  margin: 1.5rem 0 0;
}

.faq dt {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.faq dd {
  margin: 0.375rem 0 0;
  color: var(--ink-muted);
}

/* --- Sermon list --- */

.sermons {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.sermons li {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}

.sermons a {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.sermon-date {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* --- Copy the church has not supplied yet --- */

mark.todo {
  background: #fff3cd;
  color: #5c4708;
  padding: 0.0625rem 0.25rem;
  border-radius: 0.1875rem;
  font-size: 0.9375em;
}

/* --- Footer --- */

footer {
  background: var(--navy-deep);
  color: var(--on-navy);
  padding: 2.75rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

footer h2 {
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 0.625rem;
}

footer p,
footer li {
  color: var(--on-navy-muted);
  font-size: 0.9375rem;
}

footer p {
  margin: 0 0 0.625rem;
}

footer a {
  color: var(--sand);
}

.services,
.social {
  margin: 0;
  padding: 0;
  list-style: none;
}

.services li {
  margin-bottom: 0.625rem;
}

.service-label {
  display: block;
  font-weight: 600;
  color: #ffffff;
}

.service-time,
.service-note {
  display: block;
}

.social {
  display: flex;
  gap: 1.25rem;
}

.colophon {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--navy-soft);
  color: var(--on-navy-muted);
  font-size: 0.875rem;
}

/* --- Wider screens --- */

@media (min-width: 34rem) {
  .service-times li {
    flex-direction: row;
    align-items: baseline;
    gap: 1rem;
  }

  .service-times .when {
    min-width: 11rem;
  }

  .service-times .note {
    color: var(--ink-muted);
  }

  .button.give {
    width: auto;
    min-width: 16rem;
  }
}

@media (min-width: 48rem) {
  .band {
    padding: 3.5rem 0;
  }

  .hero {
    padding: 5rem 0 4.5rem;
  }

  .band-head {
    padding: 3.5rem 0 3rem;
  }

  .wordmark-name {
    font-size: 1.5rem;
  }

  .highlights ul {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
