/* =============================================
   SERMON LIBRARY — Shared Styles
   ============================================= */

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

:root {
  --sand:         #f5f0e8;
  --sand2:        #ede8df;
  --sand3:        #ddd7cc;
  --ink:          #1a1814;
  --ink2:         #5a5750;
  --ink3:         #9b9690;
  --warm:         #b5824a;
  --warm-bg:      #fdf6ec;
  --warm-border:  #e8d5b8;
  --white:        #ffffff;
  --r:            14px;
  --r-sm:         9px;
  --shadow:       0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --shadow-hover: 0 2px 8px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.08);
}

html {
  background: var(--sand);
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

/* ── NAV ── */
.nav {
  background: rgba(245, 240, 232, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sand3);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm);
  flex-shrink: 0;
}

/* Search */
.search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 15px;
  height: 15px;
  color: var(--ink3);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 38px;
  background: var(--white);
  border: 1.5px solid var(--sand3);
  border-radius: 50px;
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  padding: 0 36px 0 38px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--ink3); }

.search-input:focus {
  border-color: var(--warm);
  box-shadow: 0 0 0 3px rgba(181, 130, 74, 0.12);
}

.clear-btn {
  position: absolute;
  right: 11px;
  background: none;
  border: none;
  color: var(--ink3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.clear-btn:hover { background: var(--sand2); color: var(--ink); }
.clear-btn.on { display: flex; }

.nav-count {
  font-size: 0.78rem;
  color: var(--ink3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── HERO ── */
.hero {
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(1.5rem, 3vw, 2rem);
}

.hero-inner { max-width: 1080px; margin: 0 auto; }

.hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.hero h1 em { font-style: italic; color: var(--warm); }

.hero p {
  font-size: 0.95rem;
  color: var(--ink2);
  font-weight: 300;
  max-width: 520px;
  line-height: 1.7;
}

/* ── FILTER BAR ── */
.filter-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 1.5rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.filter-row::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  height: 34px;
  padding: 0 15px;
  border-radius: 50px;
  border: 1.5px solid var(--sand3);
  background: var(--white);
  color: var(--ink2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.pill:hover { border-color: var(--warm); color: var(--warm); }

.pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  font-weight: 500;
}

.sort-select {
  margin-left: auto;
  flex-shrink: 0;
  height: 34px;
  padding: 0 28px 0 12px;
  border-radius: 50px;
  border: 1.5px solid var(--sand3);
  background: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239b9690' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--ink2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.sort-select:focus { border-color: var(--warm); }

/* ── GRID ── */
.grid {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 1rem;
}

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--r);
  border: 1.5px solid var(--sand3);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  animation: rise 0.3s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--sand2);
}

.card-top { padding: 1.2rem 1.2rem 1rem; flex: 1; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.tag-year {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm);
  background: var(--warm-bg);
  border: 1px solid var(--warm-border);
  border-radius: 50px;
  padding: 0.2rem 0.65rem;
}

.tag-date { font-size: 0.74rem; color: var(--ink3); }

.card-title {
  font-family: 'Lora', serif;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.card-loc {
  font-size: 0.76rem;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-loc svg { flex-shrink: 0; }

/* ── VERSIONS IN CARD ── */
.card-versions {
  border-top: 1px solid var(--sand2);
  padding: 0.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ver {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background: var(--sand);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.ver:hover {
  background: var(--sand2);
  border-color: var(--sand3);
}

.ver-lang {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink2);
  background: var(--white);
  border: 1px solid var(--sand3);
  border-radius: 5px;
  padding: 0.12rem 0.4rem;
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
}

.ver-label {
  font-size: 0.82rem;
  color: var(--ink2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ver-read {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--warm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

.ver:hover .ver-read { opacity: 1; }

/* ── EMPTY STATE ── */
.empty {
  max-width: 1080px;
  margin: 4rem auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  text-align: center;
  color: var(--ink3);
}

.empty-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sand2);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
}

.empty h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink2);
  margin-bottom: 0.35rem;
}

.empty p { font-size: 0.85rem; margin-bottom: 1.25rem; }

.empty button, .empty .back-link {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  background: var(--ink);
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-block;
}

.empty button:hover, .empty .back-link:hover { background: #2d2a25; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--sand3);
  padding: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink3);
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .nav-count { display: none; }
  .search-wrap { max-width: none; }
  .hero h1 { font-size: 1.8rem; }
  .grid { grid-template-columns: 1fr; }
  .sort-select { display: none; }
}
