/* HopeCC Small Group Studies — front-end styles.
   All selectors namespaced .hope-studies / .hs-* to avoid Divi collisions. */

.hope-studies {
  --hs-bg: #fafaf7;
  --hs-card: #ffffff;
  --hs-ink: #1a1a1a;
  --hs-ink-2: #4a4a4a;
  --hs-muted: #7a7a7a;
  --hs-line: #ebe8e1;
  --hs-line-2: #d9d5cb;
  --hs-accent: #7a0019;
  --hs-accent-soft: #f3e7e9;
  --hs-ot: #8a5a00;   --hs-ot-bg: #fbf2df;
  --hs-nt: #1d4e89;   --hs-nt-bg: #e2ecf7;
  --hs-topical: #2f6b3e; --hs-topical-bg: #e3efe5;
  --hs-radius: 14px;
  --hs-cols: 4;

  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--hs-ink);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 56px;
  box-sizing: border-box;
}
.hope-studies *, .hope-studies *::before, .hope-studies *::after { box-sizing: border-box; }
.hope-studies h1, .hope-studies h2, .hope-studies h3, .hope-studies h4 {
  font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; letter-spacing: -0.01em; margin: 0;
}
.hope-studies a { text-decoration: none; color: inherit; }
.hope-studies button { font: inherit; cursor: pointer; }

/* Hero */
.hs-hero { padding: 24px 0 12px; }
.hs-hero h1 { font-size: 32px; line-height: 1.15; margin-bottom: 8px; }
.hs-hero p { margin: 0; color: var(--hs-muted); max-width: 64ch; font-size: 15px; line-height: 1.55; }

/* Search */
.hs-search-row { position: sticky; top: 0; z-index: 20; background: var(--hs-bg); padding: 10px 0 6px; }
.hs-search {
  width: 100%; height: 46px; border: 1px solid var(--hs-line-2); background: var(--hs-card);
  border-radius: 999px; padding: 0 16px 0 44px; font: inherit; color: var(--hs-ink);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat; background-position: 14px center;
  transition: border-color .15s, box-shadow .15s;
}
.hs-search:focus { outline: 0; border-color: var(--hs-accent); box-shadow: 0 0 0 3px var(--hs-accent-soft); }

/* Filters */
.hs-filter-bar { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 14px; }
.hs-chip-label { font-size: 11px; font-weight: 600; color: var(--hs-muted); text-transform: uppercase; letter-spacing: .08em; }
.hs-chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.hs-chip-row::-webkit-scrollbar { display: none; }
.hs-chip {
  flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--hs-line-2); background: var(--hs-card);
  font-size: 14px; font-weight: 500; color: var(--hs-ink-2); transition: all .15s ease;
}
.hs-chip:hover { border-color: var(--hs-ink); color: var(--hs-ink); }
.hs-chip.is-active { background: var(--hs-ink); border-color: var(--hs-ink); color: #fff; }

.hs-result-count { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--hs-muted); padding: 0 2px 14px; }
.hs-clear { color: var(--hs-accent); font-weight: 500; font-size: 13px; background: none; border: 0; }
.hs-clear:hover { text-decoration: underline; }

/* Grid */
.hs-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hs-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 960px) { .hs-grid { grid-template-columns: repeat(min(3, var(--hs-cols)), 1fr); } }
@media (min-width: 1200px) { .hs-grid { grid-template-columns: repeat(var(--hs-cols), 1fr); } }

.hs-card {
  background: var(--hs-card); border: 1px solid var(--hs-line); border-radius: var(--hs-radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.hs-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 12px 28px rgba(0,0,0,.08); border-color: var(--hs-line-2); }
.hs-card[hidden] { display: none; }
.hs-card-image { position: relative; aspect-ratio: 16/9; background: #f0eee9; overflow: hidden; }
.hs-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.hs-card:hover .hs-card-image img { transform: scale(1.03); }
.hs-fallback { position: absolute; inset: 0; background: linear-gradient(135deg, #7a0019 0%, #4a000f 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.hs-fallback span { font-family: 'Source Serif 4', serif; font-size: 22px; font-weight: 600; line-height: 1.1; color: rgba(255,255,255,.95); text-align: center; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.hs-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.hs-card h3 { font-size: 20px; line-height: 1.2; }
.hs-card p { margin: 0; font-size: 14px; color: var(--hs-ink-2); line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* Badges */
.hs-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.hs-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; font-size: 11px; font-weight: 600; border-radius: 999px; letter-spacing: .02em; }
.hs-badge.hs-ot { background: var(--hs-ot-bg); color: var(--hs-ot); }
.hs-badge.hs-nt { background: var(--hs-nt-bg); color: var(--hs-nt); }
.hs-badge.hs-topical { background: var(--hs-topical-bg); color: var(--hs-topical); }
.hs-badge.hs-len { background: #f0eee9; color: var(--hs-ink-2); }

.hs-empty { text-align: center; padding: 60px 20px; color: var(--hs-muted); }
.hs-empty h3 { font-size: 18px; margin-bottom: 4px; color: var(--hs-ink); }

/* ---------------- Single series page ---------------- */
.hs-single .hs-wrap { max-width: 820px; margin: 0 auto; }
.hs-back { display: inline-flex; align-items: center; gap: 6px; color: var(--hs-ink-2); font-weight: 500; font-size: 15px; padding: 20px 0 4px; }
.hs-back svg { width: 18px; height: 18px; }
.hs-back:hover { color: var(--hs-ink); }

.hs-detail-hero { padding: 12px 0 8px; }
.hs-detail-hero .hs-badges { margin-bottom: 14px; }
.hs-detail-hero h1 { font-size: 34px; line-height: 1.1; margin-bottom: 12px; }
.hs-detail-hero p { margin: 0; font-size: 16px; color: var(--hs-ink-2); line-height: 1.55; }
.hs-series-cover { aspect-ratio: 21/9; background: #f0eee9; overflow: hidden; border-radius: var(--hs-radius); margin-top: 16px; }
.hs-series-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 480px) { .hs-series-cover { aspect-ratio: 16/9; } .hs-detail-hero h1 { font-size: 28px; } }

.hs-action-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 0 8px; }
.hs-btn { height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--hs-line-2); background: var(--hs-card); font-size: 15px; font-weight: 600; color: var(--hs-ink); display: inline-flex; align-items: center; gap: 8px; transition: all .15s ease; }
.hs-btn svg { width: 18px; height: 18px; }
.hs-btn:hover { border-color: var(--hs-ink); }
.hs-btn.hs-primary { background: var(--hs-accent); color: #fff; border-color: var(--hs-accent); }
.hs-btn.hs-primary:hover { background: #5a0013; border-color: #5a0013; }

.hs-sermon-card { display: flex; align-items: center; gap: 14px; background: var(--hs-card); border: 1px solid var(--hs-line); border-radius: var(--hs-radius); padding: 14px 16px; margin: 10px 0; transition: border-color .15s, box-shadow .15s; }
.hs-sermon-card:hover { border-color: var(--hs-ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.hs-sermon-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--hs-accent-soft); color: var(--hs-accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hs-sermon-icon svg { width: 20px; height: 20px; }
.hs-sermon-text { flex: 1; }
.hs-sermon-text small { display: block; font-size: 12px; color: var(--hs-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.hs-sermon-text strong { display: block; font-size: 15px; font-weight: 500; margin-top: 2px; }
.hs-sermon-chev { color: var(--hs-muted); }
.hs-sermon-chev svg { width: 18px; height: 18px; }

.hs-week-list { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; }
.hs-week { background: var(--hs-card); border: 1px solid var(--hs-line); border-radius: var(--hs-radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.hs-week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hs-eyebrow { font-size: 12px; color: var(--hs-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.hs-week-head h3 { font-size: 19px; margin-top: 2px; line-height: 1.2; }
.hs-week-num { font-size: 13px; color: var(--hs-muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.hs-week-dl { display: flex; gap: 8px; flex-wrap: wrap; }
.hs-dl { flex: 1 1 calc(50% - 4px); min-width: 140px; height: 42px; padding: 0 14px; border-radius: 10px; background: #f4f2ec; border: 1px solid transparent; font-size: 14px; font-weight: 500; color: var(--hs-ink); display: inline-flex; align-items: center; justify-content: space-between; transition: all .12s ease; }
.hs-dl:hover { background: #ece9df; }
.hs-dl.hs-leader { background: #fff; border-color: var(--hs-line-2); }
.hs-dl-icon { color: var(--hs-muted); }
.hs-dl-icon svg { width: 16px; height: 16px; }

:focus-visible { outline: 2px solid var(--hs-accent); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 480px) {
  .hs-hero h1 { font-size: 26px; }
  .hs-card h3 { font-size: 18px; }
}
