:root {
  --bg: #f3efe8;
  --bg-alt: #f9f5ef;
  --card-bg: #ffffff;
  --accent: #c67c3d;
  --accent-soft: rgba(198, 124, 61, 0.1);
  --accent-dark: #8b4f1f;
  --text-main: #262322;
  --text-muted: #6e645f;
  --border-subtle: #e0d5c8;
  --border-strong: #d0c2b3;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-soft: 0 18px 45px rgba(32, 20, 8, 0.16);
  --shadow-subtle: 0 10px 24px rgba(20, 10, 0, 0.08);
  --max-width: 1120px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, #fdf7f0 0, #f0e2d1 42%, #e0d2c1 100%);
  min-height: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
}

/* Layout shell */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: linear-gradient(
      to bottom,
      rgba(248, 241, 232, 0.92),
      rgba(248, 241, 232, 0.86),
      rgba(248, 241, 232, 0.82),
      transparent
    );
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffe7c6, #c67c3d);
  box-shadow: 0 8px 18px rgba(102, 59, 17, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fffaf3;
  box-shadow: 0 0 0 2px rgba(255, 244, 228, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-title {
  font-family: "Crimson Text", "Georgia", serif;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Header navigation */
.site-nav {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.16rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(40, 28, 16, 0.18);
}

.nav-link {
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.nav-link:hover {
  background: rgba(198, 124, 61, 0.06);
  color: var(--accent-dark);
}

.nav-link.active {
  background: var(--accent);
  color: #fffaf6;
  transform: translateY(0.5px);
}

/* Main layout */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 1.2rem 2.5rem;
}

.content-shell {
  width: 100%;
  max-width: var(--max-width);
}

/* Views */
.view {
  display: none;
}

.view.active-view {
  display: block;
}

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 45;
}

.progress-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width 0.12s ease-out;
}

/* HOME / INDEX LAYOUT */
.welcome-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.2fr);
  gap: 1.6rem;
  margin-top: 1.4rem;
}

/* Left column: hero + list */
.welcome-main {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.welcome-hero {
  background: linear-gradient(135deg, #fdf6ec 0%, #f2e3d1 50%, #f7efe5 100%);
  border-radius: 22px;
  padding: 1.4rem 1.6rem 1.1rem;
  border: 1px solid rgba(206, 182, 150, 0.6);
  box-shadow: var(--shadow-subtle);
}

.welcome-hero h1 {
  margin: 0 0 0.35rem;
  font-family: "Crimson Text", "Georgia", serif;
  font-size: 1.8rem;
}

.welcome-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 36rem;
}

.welcome-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.85);
  padding: 0.15rem 0.55rem;
}

.pill-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
}

/* Welcome card containing search + list */
.welcome-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.6rem 1.6rem;
  border: 1px solid rgba(222, 205, 185, 0.9);
}

/* Search + filters */
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

#searchInput {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.95rem 0.55rem 2rem;
  font-size: 0.94rem;
  outline: none;
  box-shadow: var(--shadow-subtle);
  background: #fdfaf6;
}

#searchInput:focus {
  border-color: var(--accent);
  background: #ffffff;
}

/* Filters row */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-field label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

#yearFilter {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  font-size: 0.92rem;
  appearance: none;
  background: #faf6f0;
}

.index-actions {
  display: flex;
  gap: 0.5rem;
}

/* Sermon list header */
.sermon-list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.sermon-list-title-main {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sermon-list-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sermon list */
.sermon-list {
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 58vh;
  overflow: auto;
  padding-right: 0.35rem;
}

.sermon-list-item {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.08s ease,
    box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sermon-list-item:hover {
  background: var(--accent-soft);
  border-color: rgba(198, 124, 61, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(35, 20, 4, 0.12);
}

.sermon-list-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.sermon-list-title {
  font-size: 0.96rem;
}

.sermon-list-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sermon-list-tags {
  font-size: 0.75rem;
  color: var(--accent-dark);
}

/* Right column: aside */
.welcome-aside {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.aside-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.1rem 1.25rem 1.15rem;
  border: 1px solid rgba(222, 205, 185, 0.9);
  box-shadow: var(--shadow-subtle);
}

.aside-card.muted {
  background: var(--bg-alt);
  box-shadow: none;
}

.aside-card h2,
.aside-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-family: "Crimson Text", "Georgia", serif;
  font-size: 1.15rem;
}

.aside-card ol,
.aside-card ul {
  margin: 0.2rem 0 0.6rem 1.1rem;
  padding: 0;
  font-size: 0.9rem;
}

.aside-note {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Info pages (About / Contact) */
.info-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 1.9rem 2.1rem 2.1rem;
  margin-top: 1.4rem;
  border: 1px solid rgba(222, 205, 185, 0.9);
}

.info-card h1 {
  margin-top: 0;
  font-family: "Crimson Text", "Georgia", serif;
  font-size: 1.7rem;
}

.info-card p {
  margin: 0 0 0.9rem;
  font-size: 0.96rem;
  color: var(--text-main);
}

.info-card ul {
  margin: 0.6rem 0 1rem 1.2rem;
  padding: 0;
  font-size: 0.94rem;
}

/* Buttons */
.btn {
  border-radius: 999px;
  border: none;
  font-size: 0.86rem;
  padding: 0.36rem 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f2e3d3;
  color: var(--accent-dark);
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.08s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fffaf5;
  box-shadow: 0 12px 24px rgba(111, 64, 14, 0.3);
}

.btn.primary:hover {
  box-shadow: 0 10px 20px rgba(111, 64, 14, 0.28);
}

.btn.outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
}

.btn.ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.btn.small {
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
}

.btn:active {
  transform: translateY(1px);
}

/* SERMON READER */
.sermon-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 2.2rem 2.4rem 2.4rem;
  margin-top: 1.6rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(222, 205, 185, 0.9);
}

.corner-ribbon {
  position: absolute;
  inset: 0 auto auto 0;
  width: 130px;
  height: 130px;
  background: conic-gradient(from 230deg, #fdf7ec, #f5d9a8, #f1b95e, #fdf7ec);
  opacity: 0.24;
  pointer-events: none;
}

.sermon-header {
  position: relative;
  z-index: 1;
  margin-bottom: 1.3rem;
}

.back-btn {
  margin-bottom: 0.6rem;
}

.sermon-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--accent-dark);
  background: rgba(246, 232, 210, 0.9);
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
}

.sermon-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.sermon-title {
  font-family: "Crimson Text", "Georgia", serif;
  font-size: 1.8rem;
  margin: 0.6rem 0 0.3rem;
}

.sermon-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sermon-meta-tag {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(198, 124, 61, 0.08);
}

.sermon-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
}

/* Sermon body */
.sermon-body {
  position: relative;
  z-index: 1;
  margin-top: 1.2rem;
  font-family: "Crimson Text", "Georgia", serif;
  font-size: 1.08rem;
  line-height: 1.7;
}

.sermon-body p {
  margin: 0 0 1.1rem;
}

.sermon-body p + p {
  text-indent: 1.15em;
}

/* Sermon footer */
.sermon-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.3rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* FOOTER */
.site-footer {
  padding: 0.85rem 1.5rem 1.1rem;
  font-size: 0.8rem;
  color: #f4ece4;
  background: linear-gradient(90deg, #3a2515, #2a1a10);
  border-top: 1px solid #533220;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer > div {
  max-width: var(--max-width);
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left,
.footer-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer-brand {
  font-weight: 600;
}

.footer-text {
  opacity: 0.9;
}

.footer-divider {
  opacity: 0.55;
}

.footer-link {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-size: 0.8rem;
  color: #f4ece4;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .welcome-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .welcome-aside {
    order: -1;
  }
}

@media (max-width: 720px) {
  .site-header-inner {
    padding: 0.75rem 1rem 0.65rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    align-self: stretch;
    justify-content: center;
  }

  main {
    padding: 0 0.9rem 2.1rem;
  }

  .welcome-card,
  .info-card,
  .sermon-card {
    border-radius: 18px;
    padding: 1.5rem 1.4rem 1.6rem;
  }

  .sermon-title {
    font-size: 1.5rem;
  }

  .sermon-body {
    font-size: 1.02rem;
  }

  .sermon-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}
