/* Sermons — gospelcenter.net
   Own design, deliberately not a copy of the Cornerstone CMS layout.
   Brand colour #2E6C68 is taken from .lang-inline-card in
   deepl-translator/widget.html, so the two sites still read as one church. */

:root {
  --brand: #2E6C68;
  --brand-dark: #1F4B48;
  --brand-tint: #EAF2F1;
  --ink: #1B2321;
  --ink-soft: #5A6764;
  --line: #DCE4E2;
  --bg: #FFFFFF;
  --bg-soft: #F7FAF9;
  --radius: 12px;
  --focus: #B8860B;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

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

/* Keyboard users must be able to jump past the header. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 10;
}
.skip-link:focus { left: 0; }

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

/* --- Header --- */

.site-header {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 40px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-header h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.2;
  color: var(--brand-dark);
}
.lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 16px;
}

/* --- Filters --- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 32px 0 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; }
.field--year { flex: 0 1 160px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input,
.field select {
  font: inherit;
  font-size: 16px; /* 16px stops iOS Safari zooming on focus */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
}
.field input:hover,
.field select:hover { border-color: var(--brand); }

.count {
  margin: 8px 0 24px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* --- Grid --- */

.grid {
  list-style: none;
  margin: 0 0 56px;
  padding: 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* Click-to-load facade: no iframe exists until the visitor asks for one, so
   opening the page does not hand YouTube a request per video. */
.facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--brand-dark);
  overflow: hidden;
}
.facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}
.facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.15s;
}
.facade:hover::after { background: rgba(0, 0, 0, 0.05); }

.facade .play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  z-index: 1;
  transition: transform 0.15s;
}
.facade:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.facade .play svg { width: 24px; height: 24px; fill: var(--brand-dark); margin-left: 3px; }

.card .player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.card-body { padding: 16px 18px 20px; }
.card-title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
}
.card-meta {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.card-meta .sep { opacity: 0.5; padding: 0 6px; }

.badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
}

/* --- Notices (empty state, load failure) --- */

.notice {
  margin: 8px 0 56px;
  padding: 20px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  color: var(--ink-soft);
}
.notice strong { color: var(--ink); display: block; margin-bottom: 4px; }

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 28px 0 40px;
  font-size: 14px;
}
.site-footer p { margin: 0 0 6px; }
.muted { color: var(--ink-soft); max-width: 62ch; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
