:root {
  --beige: #f4f0eb;
  --ink: #000;
  --muted: #525252;
  --nav-hover: #a6a6a6;
  --btn: #35322f;
  --btn-hover: #5c574a;
  --white: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--muted);
  font: 400 16px/1.5 Lato, Arial, sans-serif;
  background: var(--beige);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--nav-hover); }
a[href] { text-decoration: underline; }
a:hover { text-decoration: none; }

.header-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  box-shadow: 0 2px 3px -1px rgba(30, 30, 30, 0.1);
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 96px;
  padding: 0.75rem 2rem;
}
.logo {
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  max-width: 14rem;
}
.logo:hover { text-decoration: none; color: var(--ink); }

.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 0.5rem; }
.nav a {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 10px 14px;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--nav-hover); }

.banner {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  background: #35322f center / cover no-repeat;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
  padding: 3.5rem 1.5rem;
}
.banner.tall { min-height: 420px; }
.banner h1,
.banner h2 {
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
  color: var(--white);
  margin: 0 auto 0.4em;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  letter-spacing: 2px;
  line-height: 1.2;
}
.banner p {
  color: var(--white);
  font-size: 1.2rem;
  margin: 0;
}

.page {
  background: var(--white);
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}
.container h2 {
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 1.5rem;
  text-align: center;
  line-height: 1.4;
  margin: 0 0 1.25em;
}
.container h3 {
  font-family: Montserrat, Arial, sans-serif;
  color: var(--ink);
  font-size: 1.15rem;
  margin: 2em 0 0.75em;
}
.container p { margin: 0 0 1.4em; }
.lede { text-align: center; font-size: 1.1rem; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.map iframe {
  width: 100%;
  height: 250px;
  border: 0;
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.donate { text-align: center; }
.donate form { margin: 1.5rem 0; }

.history { max-width: 46rem; margin: 0 auto; }
.history .kicker {
  text-align: center;
  font-family: Montserrat, Arial, sans-serif;
  color: var(--ink);
  font-weight: 700;
}
.pastors { list-style: none; padding: 0; margin: 0 0 1.5em; }
.pastors li { margin: 0.35em 0; }

.site-footer {
  background: var(--beige);
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  font-size: 0.9rem;
}
.site-footer a {
  color: var(--ink);
  text-decoration: none;
  margin: 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}
.site-footer a:hover { color: var(--nav-hover); }
.site-footer p { margin: 1rem 0 0; color: #7a7a7a; }

.nav-toggle { display: none; }

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

.sermon-toolbar {
  display: grid;
  grid-template-columns: 1fr 16rem 8rem;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
}
.sermon-toolbar input,
.sermon-toolbar select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #d4cfc7;
  border-radius: 4px;
  padding: 0.7rem 0.8rem;
}
.sermon-count {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}
.podcast-box {
  max-width: 46rem;
  margin: 0 auto 2rem;
  padding: 1.25rem 1.4rem;
  background: #faf7f3;
  border: 1px solid #ece7e0;
  text-align: center;
}
.podcast-box h3 { margin-top: 0; }
.podcast-box p { margin: 0 0 0.75em; }
.apple-podcast-embed {
  display: flex;
  justify-content: center;
  margin: 1rem auto 1.25rem;
  max-width: 100%;
}
.apple-podcast-embed iframe {
  display: block;
  width: 100%;
  max-width: 660px;
  height: 450px;
  margin: 0 auto;
  border: 0;
  border-radius: 10px;
  background: #e4e4e4;
}
.podcast-url-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.podcast-url-row code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: var(--white);
  border: 1px solid #d4cfc7;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
}
.sermon-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sermon-item {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem 0;
  border-top: 1px solid #ece7e0;
}
.sermon-item:last-child { border-bottom: 1px solid #ece7e0; }
.sermon-item.is-current { background: #faf7f3; margin: 0 -0.75rem; padding-left: 0.75rem; padding-right: 0.75rem; }
.sermon-date {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: #7a7a7a;
  margin: 0 0 0.25rem;
}
.sermon-item h3 {
  font-family: Montserrat, Arial, sans-serif;
  color: var(--ink);
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
}
.sermon-preacher { margin: 0; }
.sermon-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 7.5rem;
  text-align: center;
}
.sermon-play,
.sermon-download {
  display: block;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  border-radius: 3px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}
.sermon-play {
  background: var(--btn);
  color: var(--white);
}
.sermon-play:hover { background: var(--btn-hover); }
.sermon-download {
  background: transparent;
  color: var(--ink);
  border: 1px solid #d4cfc7;
}
.sermon-download:hover { color: var(--nav-hover); }
.sermon-empty { padding: 1.5rem 0; color: var(--muted); }
.sermon-player {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid #e4ddd4;
  box-shadow: 0 -6px 16px rgba(30, 30, 30, 0.06);
}
.sermon-player-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 2rem 1rem;
}
.sermon-now {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 0.95rem;
}
.sermon-player audio { width: 100%; }
body.has-player { padding-bottom: 0; }

.preview-banner {
  text-align: center;
  background: #fff8e6;
  border: 1px solid #ecd9a8;
  padding: 0.85rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.podcast-subscribe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  background: #faf7f3;
  border: 1px solid #ece7e0;
}
.podcast-subscribe p {
  margin: 0;
  flex: 1 1 14rem;
  color: var(--muted);
}
.podcast-subscribe-btn {
  display: inline-block;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: var(--btn);
  border-radius: 3px;
  padding: 0.7rem 1.1rem;
}
.podcast-subscribe-btn:hover {
  background: var(--btn-hover);
  color: var(--white);
  text-decoration: none;
}
.sermon-help {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.sermon-db-toolbar { margin-top: 0; }

.sermon-table-wrap {
  overflow-x: auto;
  border: 1px solid #ece7e0;
  background: var(--white);
}
.sermon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.sermon-table th,
.sermon-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid #ece7e0;
  vertical-align: top;
  text-align: left;
}
.sermon-table th {
  font-family: Montserrat, Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a7a7a;
  background: #faf7f3;
}
.sermon-table tbody tr.sermon-row:hover { background: #fcfaf7; }
.sermon-table tbody tr.is-playing { background: #faf7f3; }
.sermon-table th:first-child,
.sermon-table td.sermon-table-date {
  width: 7rem;
  min-width: 7rem;
  max-width: 7rem;
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
}
.sermon-table-topic a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.sermon-table-topic a:hover { color: var(--nav-hover); text-decoration: underline; }
.sermon-table-play,
.sermon-table-download { width: 5.5rem; white-space: nowrap; }
.sermon-download-inline {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.8rem;
}
.sermon-player-row td {
  padding: 0;
  background: #faf7f3;
  border-bottom: 1px solid #e4ddd4;
}
.inline-player {
  padding: 0.9rem 1rem 1rem;
}
.inline-player-title {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-size: 0.95rem;
}
.inline-player audio { width: 100%; margin-bottom: 0.45rem; }
.inline-player-links {
  margin: 0;
  font-size: 0.85rem;
}
.inline-player-links a { margin-right: 0.35rem; }

.transcript-page { max-width: 46rem; }
.transcript-back { margin-top: 0; }
.transcript-header { margin-bottom: 1.5rem; }
.transcript-header h1 {
  font-family: Montserrat, Arial, sans-serif;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.25;
  margin: 0.35rem 0 0.5rem;
}
.transcript-meta { margin: 0; color: var(--muted); }
.transcript-audio {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.transcript-audio audio { flex: 1 1 16rem; width: 100%; }
.transcript-body p {
  margin: 0 0 1rem;
  line-height: 1.65;
  color: var(--ink);
}
.transcript-body p.transcript-line {
  margin: 0 0 0.35rem;
}

@media (max-width: 800px) {
  .header { flex-wrap: wrap; min-height: 72px; padding: 0.75rem 1rem; }
  .logo { font-size: 1.1rem; max-width: none; }
  .nav { width: 100%; justify-content: flex-start; }
  .nav a { padding: 8px 10px; font-size: 0.8rem; }
  .container { padding: 2rem 1.25rem 3rem; }
  .split { grid-template-columns: 1fr; }
  .banner { min-height: 200px; padding: 2.5rem 1rem; }
  .banner.tall { min-height: 280px; }
  .sermon-toolbar { grid-template-columns: 1fr; }
  .sermon-item { flex-direction: column; align-items: stretch; }
  .sermon-actions { flex-direction: row; min-width: 0; }
  .sermon-play, .sermon-download { flex: 1; }
  .sermon-table th:nth-child(2),
  .sermon-table td:nth-child(2) {
    display: none;
  }
}
