/* Firm Foundation Ministries
   Hand-written stylesheet. Palette and type carried over from the WordPress
   theme (steel blue #6c93af, deep navy #234567, indigo contact band, Noto
   Serif headings over Open Sans body), rebuilt for contrast and responsiveness. */

/* Self-hosted so typography costs no third-party request and swaps in on the
   first paint instead of shifting the layout. Licences in assets/fonts/. */
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-latin-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("/assets/fonts/open-sans-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("/assets/fonts/open-sans-latin-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
}

:root {
  --navy: #1c3a5c;
  --navy-deep: #142a44;
  --steel: #4d7a9b;
  --steel-deep: #3f6a8a;   /* subscribe band: keeps body copy above 4.5:1 */
  --steel-light: #6c93af;
  --steel-on-dark: #8bb3cd;  /* accent legible on the charcoal bar */
  --steel-pale: #e7eef4;
  --indigo: #2e3557;
  --indigo-deep: #1f2540;
  --ink: #1e2226;
  --ink-soft: #4a5259;
  --rule: #d6dee5;
  --paper: #ffffff;
  --paper-alt: #f5f8fa;
  --char: #262a2e;
  --focus: #b7410e;
  --caution: #7a4b00;
  --caution-bg: #fdf4e3;
  --caution-rule: #e0b45f;

  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 72rem;
  --measure: 40rem;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --radius: 4px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans);
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem); }
h4 { font-size: 1.15rem; }

p, ul, ol, blockquote, figure, table { margin: 0 0 1.25em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.35em; }

a { color: #14507e; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--navy-deep); }

strong { font-weight: 700; }

img, picture, video, iframe { max-width: 100%; }
img { height: auto; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.skip-link {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 100;
  background: var(--paper); color: var(--navy);
  padding: 0.7rem 1.1rem; font-weight: 600;
  border: 2px solid var(--navy); border-radius: var(--radius);
  transition: top 120ms ease-in;
}
.skip-link:focus { top: 0.5rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

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

.site-header {
  background: var(--char);
  color: #fff;
  position: relative;
  z-index: 20;
}

.site-header .bar {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.6rem 0;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: #fff; text-decoration: none; font-family: var(--serif);
  margin-right: auto;
}
.brand:hover { color: #fff; text-decoration: underline; }
.brand__mark {
  background: var(--steel-light); color: #10222f;
  font: 700 0.82rem/1 var(--sans); letter-spacing: 0.09em;
  padding: 0.45rem 0.5rem; border-radius: var(--radius);
}
.brand__name { font-size: 1.02rem; font-weight: 600; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--steel); color: #fff; border: 1px solid #86a9c2;
  font: 600 0.92rem/1 var(--sans);
  padding: 0.55rem 0.85rem; border-radius: var(--radius); cursor: pointer;
}
.nav-toggle:hover { background: var(--steel-on-dark); color: #10222f; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 1.05rem; height: 2px; background: currentColor; content: "";
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after { position: absolute; top: 6px; }

.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }
.site-nav__list, .site-nav__sub { list-style: none; margin: 0; padding: 0; }
.site-nav__list { border-top: 1px solid #3e444a; padding: 0.4rem 0 0.6rem; }
.site-nav a {
  display: block; color: #fff; text-decoration: none;
  padding: 0.6rem 0.2rem; font-weight: 600; font-size: 0.98rem;
}
.site-nav a:hover { color: var(--steel-on-dark); text-decoration: underline; }
/* Current page is marked by colour AND a rule, never colour alone. */
.site-nav a[aria-current="page"] { color: var(--steel-on-dark); box-shadow: inset 0 -3px 0 var(--steel-on-dark); }
.site-nav__sub a { font-weight: 400; padding-left: 1.2rem; font-size: 0.94rem; }

.site-search { display: flex; gap: 0.4rem; width: 100%; }
.site-search input {
  flex: 1 1 auto; min-width: 0;
  padding: 0.5rem 0.6rem; border: 1px solid #5c656d; border-radius: var(--radius);
  background: #fff; color: var(--ink); font: 400 0.95rem/1.4 var(--sans);
}
.site-search button {
  background: var(--steel); color: #fff; border: 1px solid #86a9c2;
  padding: 0.5rem 0.9rem; border-radius: var(--radius);
  font: 600 0.9rem/1.4 var(--sans); cursor: pointer;
}
.site-search button:hover { background: var(--steel-on-dark); color: #10222f; }

@media (min-width: 62rem) {
  .nav-toggle { display: none; }
  .site-nav { display: block; width: auto; }
  .site-nav__list { display: flex; gap: 0.35rem; border-top: 0; padding: 0; }
  .site-nav__item { position: relative; }
  .site-nav__item > a { padding: 0.7rem 0.75rem; border-radius: var(--radius); }
  .site-nav__item.has-children > a::after { content: " \25be"; }
  .site-nav__sub {
    position: absolute; left: 0; top: 100%; min-width: 12.5rem;
    background: var(--char); border: 1px solid #3e444a; border-radius: var(--radius);
    padding: 0.35rem 0; display: none; box-shadow: 0 8px 20px rgba(0,0,0,.3);
  }
  .site-nav__item:hover > .site-nav__sub,
  .site-nav__item:focus-within > .site-nav__sub { display: block; }
  .site-nav__sub a { padding: 0.5rem 0.85rem; }
  .site-search { width: auto; margin-left: 0.5rem; }
  .site-search input { width: 11rem; }
}

/* ---------- hero (home) ---------- */

.hero { position: relative; background: var(--navy-deep); color: #fff; }
.hero__media { position: relative; }
.hero__media img {
  display: block; width: 100%;
  height: clamp(15rem, 46vw, 30rem); object-fit: cover; object-position: 50% 32%;
}
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,42,68,.25) 0%, rgba(20,42,68,.55) 55%, rgba(20,42,68,.88) 100%);
}
.hero__inner {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  padding-bottom: clamp(1.25rem, 3vw, 2.5rem);
}
.hero h1 { color: #fff; margin-bottom: 0.25em; }
.hero__tagline {
  margin: 0; color: #e4edf4; font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  max-width: 34rem;
}

/* ---------- interior banner ---------- */

.page-banner { position: relative; background: var(--steel); overflow: hidden; }
.page-banner picture, .page-banner img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 35%;
}
.page-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,58,92,.72), rgba(28,58,92,.86));
}
.page-banner__inner {
  position: relative; z-index: 1;
  padding: clamp(2.25rem, 6vw, 4.25rem) 0;
  text-align: center;
}
.page-banner h1 { color: #fff; margin: 0; }
.page-banner__standfirst {
  margin: 0.85rem auto 0; max-width: 44rem; color: #e4edf4; font-size: 1.08rem;
}

/* ---------- layout ---------- */

.layout {
  display: grid; gap: var(--gap);
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  align-items: start;
}
@media (min-width: 62rem) {
  .layout { grid-template-columns: minmax(0, 1fr) 19rem; }
  .layout--full { grid-template-columns: minmax(0, 1fr); }
}
.layout__main > :last-child { margin-bottom: 0; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }

/* ---------- sidebar cards ---------- */

.sidebar { display: grid; gap: 1.25rem; }
.card {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-alt); padding: 1.1rem 1.25rem;
}
.card__title { font-size: 1.2rem; margin-bottom: 0.6rem; }
.card__list { list-style: none; margin: 0; padding: 0; }
.card__list li { margin: 0; padding: 0.4rem 0; border-top: 1px solid var(--rule); }
.card__list li:first-child { border-top: 0; padding-top: 0; }
.card__list a { font-size: 0.97rem; }
.count { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- home panels ---------- */

.panels {
  display: grid; gap: 1px; background: var(--rule);
  border-block: 1px solid var(--rule);
}
@media (min-width: 48rem) { .panels { grid-template-columns: 1fr 1fr; } }

.panel {
  background: var(--paper); padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex; gap: 1.25rem; align-items: flex-start;
}
.panel img { flex: 0 0 auto; width: 4.5rem; height: 4.5rem; object-fit: contain; }
.panel h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem); margin-bottom: 0.35em; }
.panel__body > :last-child { margin-bottom: 0; }
.panel__list { list-style: none; padding: 0; margin: 0 0 1rem; }
.panel__list li { padding: 0.4rem 0; border-top: 1px solid var(--rule); margin: 0; }
.panel__list li:first-child { border-top: 0; }

.intro { padding: clamp(2.25rem, 5vw, 3.5rem) 0; }
.intro__inner { max-width: var(--measure); }

.more-link { display: inline-block; font-weight: 600; }
.more-link::after { content: " \2192"; }

/* ---------- article lists ---------- */

.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.25rem; }
.entry { padding-bottom: 2.25rem; border-bottom: 1px solid var(--rule); margin: 0; }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.entry__title { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem); margin-bottom: 0.3rem; }
.entry__meta {
  font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 0.9rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.entry__meta a { color: inherit; }
.entry__body > :last-child { margin-bottom: 0; }
.entry__body { max-width: var(--measure); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 1.25rem 0 0; }
.tag-row li { margin: 0; }
.tag {
  display: inline-block; font-size: 0.82rem; font-weight: 600;
  background: var(--steel-pale); color: var(--navy);
  padding: 0.25rem 0.6rem; border-radius: 999px; text-decoration: none;
}
.tag:hover { background: var(--steel-light); color: #10222f; }

.post-nav {
  display: grid; gap: 1rem; margin-top: 2.5rem;
  padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
@media (min-width: 40rem) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav__item { font-size: 0.95rem; }
.post-nav__label {
  display: block; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.2rem;
}
.post-nav__next { text-align: right; }

.pagination {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  list-style: none; padding-left: 0;
}
.pagination li { margin: 0; }
.pagination a, .pagination span {
  display: inline-block; padding: 0.45rem 0.75rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none; font-size: 0.95rem; font-weight: 600;
}
.pagination [aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- media ---------- */

.video-embed { margin: 0 0 1.5rem; max-width: 46rem; }
.video-embed__btn {
  position: relative; display: block; width: 100%; padding: 0;
  border: 0; background: #000; cursor: pointer; border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16 / 9;
}
.video-embed__btn img {
  width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.82;
  transition: opacity 150ms ease;
}
.video-embed__btn:hover img { opacity: 1; }
.video-embed__play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 4.5rem; height: 3.1rem; border-radius: 0.7rem;
  background: rgba(16,16,16,.78); border: 2px solid rgba(255,255,255,.9);
}
.video-embed__play::after {
  content: ""; position: absolute; left: 52%; top: 50%; translate: -50% -50%;
  border-style: solid; border-width: 0.62rem 0 0.62rem 1.05rem;
  border-color: transparent transparent transparent #fff;
}
.video-embed__btn:hover .video-embed__play { background: #b7410e; border-color: #fff; }
.video-embed__label {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff; font: 600 0.92rem/1.35 var(--sans);
  padding: 2rem 0.9rem 0.7rem; text-align: left;
}
.video-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius); display: block; }

.sermon-audio { display: block; width: 100%; max-width: 40rem; margin: 0 0 1.5rem; }

.ext-media {
  border-left: 4px solid var(--steel-light);
  background: var(--paper-alt);
  padding: 0.85rem 1rem; margin: 0 0 1.5rem; max-width: var(--measure);
}

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--caution-rule); border-left-width: 5px;
  background: var(--caution-bg); color: var(--caution);
  padding: 0.9rem 1.1rem; border-radius: var(--radius);
  font-size: 0.95rem; max-width: 46rem;
}
.notice strong { color: inherit; }
.notice a { color: #63370a; }

.empty-state { max-width: var(--measure); }

/* ---------- contact band ---------- */

.contact-band {
  background: var(--indigo);
  background-image: linear-gradient(160deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff;
  padding: clamp(2.5rem, 6vw, 4.25rem) 0;
}
.contact-band h2 { color: #fff; }
.contact-band .notice { margin-bottom: 1.75rem; }

.contact-form { max-width: 52rem; }
.contact-form__row { display: grid; gap: 0 1.25rem; }
@media (min-width: 40rem) { .contact-form__row { grid-template-columns: 1fr 1fr; } }

.field { margin: 0 0 1.1rem; display: block; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
.field input, .field textarea {
  display: block; width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid #97a3bd; border-radius: var(--radius);
  background: #fff; color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}
.field input:hover, .field textarea:hover { border-color: #fff; }
.field textarea { resize: vertical; min-height: 8rem; }
.field__help { display: block; font-size: 0.85rem; color: #cfd7e6; margin-top: 0.3rem; }
.req { color: #ffb4a2; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { margin: 0 0 0.75rem; }

.btn {
  display: inline-block; cursor: pointer;
  background: var(--steel-light); color: #10222f;
  border: 2px solid var(--steel-light); border-radius: var(--radius);
  padding: 0.65rem 1.4rem;
  font: 700 1rem/1.4 var(--sans);
  text-decoration: none;
}
.btn:hover { background: #fff; border-color: #fff; color: var(--navy-deep); }
.btn--light { background: #fff; border-color: #fff; color: var(--navy-deep); }
.btn--light:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

.form-status { margin: 0; font-size: 0.95rem; min-height: 1.5rem; font-weight: 600; }
.form-status.is-error { color: #ffc9b8; }
.form-status.is-ok { color: #cfeccf; }

/* ---------- subscribe band ---------- */

.subscribe-band {
  background: var(--steel-deep); color: #fff;
  padding: clamp(2.25rem, 5vw, 3.25rem) 0;
  text-align: center;
}
.subscribe-band h2 { color: #fff; }
.subscribe-band__note {
  max-width: 40rem; margin: 0 auto 1.5rem; font-size: 0.95rem; color: #eaf2f8;
}
.subscribe-form { max-width: 26rem; margin-inline: auto; text-align: left; }
.subscribe-band .field label { text-align: left; }
.subscribe-band .form-status { text-align: center; }

/* ---------- footer ---------- */

.site-footer { background: var(--char); color: #d8dde2; padding: 2rem 0; font-size: 0.92rem; }
.site-footer__inner { display: grid; gap: 1rem; align-items: center; }
@media (min-width: 52rem) {
  .site-footer__inner { grid-template-columns: auto 1fr auto; }
  .site-footer__nav ul { justify-content: center; }
  .site-footer__credit { text-align: right; }
}
.site-footer p { margin: 0; }
.site-footer a { color: #b9d3e6; }
.site-footer a:hover { color: #fff; }
.site-footer__nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0; padding: 0; }
.site-footer__nav li { margin: 0; }

/* ---------- search page ---------- */

.search-page__form { display: flex; gap: 0.5rem; max-width: 34rem; margin-bottom: 2rem; }
.search-page__form input {
  flex: 1 1 auto; padding: 0.65rem 0.7rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  font: 400 1rem/1.5 var(--sans);
}
.search-page__form .btn { background: var(--navy); border-color: var(--navy); color: #fff; }
.search-page__form .btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; min-height: 60vh; align-content: start; }
#search-summary { min-height: 1.6em; }
.search-results li { margin: 0; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.search-results h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.search-results p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

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