/* ================================================================
   Hanley Baptist Church – Public Stylesheet
   Design: Refined editorial, warm cream/navy palette
   Fonts: Playfair Display (headings) + Source Sans 3 (body)
================================================================ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1a2744;
  --navy-light:  #243259;
  --gold:        #b8902a;
  --gold-light:  #d4aa4a;
  --cream:       #f8f4ee;
  --cream-dark:  #ede8df;
  --white:       #ffffff;
  --text:        #2c2c2c;
  --text-muted:  #6b6b6b;
  --text-light:  #9a9a9a;
  --border:      #ddd8cf;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 2px 12px rgba(26,39,68,.08);
  --shadow-md:   0 4px 24px rgba(26,39,68,.13);
  --shadow-lg:   0 8px 40px rgba(26,39,68,.18);
  --trans:       0.2s ease;
  --font-display:'Playfair Display', Georgia, serif;
  --font-body:   'Source Sans 3', system-ui, sans-serif;
  --container:   1200px;
  --header-h:    72px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }

main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--navy); transition: color var(--trans); }
a:hover { color: var(--gold); }

/* ── Accessibility ──────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Header / Nav ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--navy);
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--white);
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 40px;
  color: var(--gold-light);
  flex-shrink: 0;
}
.logo-icon.small { width: 28px; height: 31px; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.2; letter-spacing: .01em; }
.logo-sub  { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-light); opacity: .85; }

.main-nav {}
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border-radius: 6px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .01em;
  transition: background var(--trans), color var(--trans);
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
}
.nav-admin {
  background: rgba(184,144,42,.18);
  color: var(--gold-light) !important;
}
.nav-admin:hover { background: rgba(184,144,42,.3) !important; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: .5rem;
  color: var(--white);
}
.hamburger { display: flex; flex-direction: column; gap: 5px; }
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: clamp(3.5rem, 10vw, 6rem) 0 clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.hero-cross {
  position: absolute;
  right: clamp(2rem, 10vw, 8rem);
  top: 50%; transform: translateY(-50%);
  width: clamp(120px, 20vw, 240px);
  height: clamp(140px, 24vw, 280px);
  opacity: .05;
  background: none;
}
.hero-cross::before, .hero-cross::after {
  content: '';
  position: absolute;
  background: var(--white);
  border-radius: 4px;
}
.hero-cross::before { width: 30%; height: 100%; left: 35%; }
.hero-cross::after  { width: 100%; height: 30%; top: 25%; }

.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--gold-light);
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.hero-title em {
  font-style: italic; color: var(--gold-light);
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,.75);
  max-width: 500px;
  line-height: 1.65;
}

/* ── Filters ─────────────────────────────────────────────── */
.filters-section {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}
.filter-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.filter-search-icon {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; font-size: .9rem;
}
.filter-search input {
  width: 100%;
  padding: .65rem .9rem .65rem 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.filter-search input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,39,68,.1);
  background: var(--white);
}
.filter-controls {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.filter-controls select {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem; font-family: var(--font-body);
  background: var(--cream); color: var(--text);
  cursor: pointer;
  transition: border-color var(--trans);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.2rem;
}
.filter-controls select:focus { outline: none; border-color: var(--navy); }
.btn-clear {
  padding: .6rem 1rem;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .85rem;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; gap: .4rem;
  transition: all var(--trans); white-space: nowrap;
}
.btn-clear:hover { border-color: var(--navy); color: var(--navy); }

/* ── Sermons Section ─────────────────────────────────────── */
.sermons-section { padding: 2.5rem 0 4rem; }
.sermons-meta {
  font-size: .88rem; color: var(--text-muted);
  margin-bottom: 1.5rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

/* Grid */
.sermons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  min-height: 200px;
}

/* Loading */
.loading-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem; padding: 4rem 0;
  color: var(--text-muted);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sermon Card */
.sermon-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.sermon-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--cream-dark);
}
.sermon-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  flex-wrap: wrap;
}
.sermon-type-badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: .25rem .65rem;
  border-radius: 20px; white-space: nowrap;
}
.badge-sunday   { background: rgba(26,39,68,.1);  color: var(--navy); }
.badge-bible    { background: rgba(34,139,34,.1);  color: #1a6e1a; }
.badge-prayer   { background: rgba(184,144,42,.12); color: #7a5e10; }
.badge-special  { background: rgba(139,0,139,.1);  color: #6b006b; }

.sermon-date { font-size: .82rem; color: var(--text-muted); }
.sermon-title {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 600; line-height: 1.35;
  color: var(--navy);
}
.sermon-preacher {
  display: flex; align-items: center; gap: .4rem;
  font-size: .88rem; color: var(--text-muted);
}
.sermon-card-meta {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--text-light);
  padding-top: .5rem; border-top: 1px solid var(--cream-dark);
}
.sermon-card-meta span { display: flex; align-items: center; gap: .3rem; }
.sermon-card-notes {
  font-size: .85rem; color: var(--text-muted);
  background: var(--cream); border-radius: 8px;
  padding: .65rem .85rem; line-height: 1.5;
  border-left: 3px solid var(--gold);
}
.sermon-card-actions { margin-top: auto; padding-top: .5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.2rem; border-radius: 8px;
  font-size: .9rem; font-weight: 600; font-family: var(--font-body);
  cursor: pointer; text-decoration: none; border: none;
  transition: all var(--trans); white-space: nowrap;
}
.btn-download {
  width: 100%;
  justify-content: center;
  background: var(--navy); color: var(--white);
  padding: .7rem 1rem;
}
.btn-download:hover { background: var(--navy-light); color: var(--white); transform: none; }
.btn-download:active { transform: scale(.98); }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* Empty State */
.empty-state {
  text-align: center; padding: 5rem 1rem; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.empty-state i { font-size: 3rem; opacity: .3; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; flex-wrap: wrap;
  margin-top: 2.5rem;
}
.page-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .88rem; color: var(--text);
  cursor: pointer; transition: all var(--trans); font-family: var(--font-body);
}
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn.prev, .page-btn.next { width: auto; padding: 0 .85rem; gap: .35rem; font-size: .82rem; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.8);
  padding: 3.5rem 0 0;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-logo {
  display: flex; align-items: center; gap: .7rem;
  color: var(--white); text-decoration: none;
  font-family: var(--font-display); font-size: 1.1rem;
  margin-bottom: .75rem;
}
.footer-logo .logo-icon { color: var(--gold-light); }
.footer-tagline { font-size: .88rem; line-height: 1.6; opacity: .75; max-width: 280px; }
.footer-heading { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-light); margin-bottom: .85rem; }
.footer-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.footer-list li { display: flex; align-items: flex-start; gap: .6rem; font-size: .88rem; }
.footer-list i { margin-top: .15rem; color: var(--gold-light); flex-shrink: 0; width: 14px; }
.footer-list a { color: rgba(255,255,255,.8); text-decoration: none; }
.footer-list a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.1rem 0;
  font-size: .8rem; opacity: .55; text-align: center;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: flex; z-index: 101; }

  .main-nav {
    position: fixed; inset: 0; top: var(--header-h);
    background: var(--navy-light);
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 100;
    flex-direction: column;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: .25rem; }
  .nav-link { padding: .9rem 1rem; font-size: 1rem; }

  .filters-form { flex-direction: column; align-items: stretch; }
  .filter-controls { flex-wrap: wrap; }
  .filter-controls select { flex: 1; min-width: 140px; }

  .sermons-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.4rem; }
  .sermon-card { padding: 1.1rem; }
}
