/**
 * CCOP Sermon Notes - Frontend styles
 * All selectors namespaced under .ccop-sn to avoid theme conflicts.
 *
 * Brand-faithful: uses Figtree exclusively per Calvary Prescott
 * Visual Identity Guidelines v1 (August 2024). Weight contrast
 * (Light 300 - ExtraBold 800) replaces serif/italic emphasis.
 */

.ccop-sn {
  --ccop-almond: #FAF5F0;
  --ccop-almond-warm: #F4ECE2;
  --ccop-calvary: #34608A;
  --ccop-calvary-deep: #1F3A52;
  --ccop-mesa: #B8997C;
  --ccop-mesa-light: #D4BBA0;
  --ccop-cellar: #704339;
  --ccop-ink: #212B36;       /* Charcoal Black per brand guide */
  --ccop-ink-soft: #4A4F57;
  --ccop-ink-mute: #7A7F87;
  --ccop-line: rgba(33, 43, 54, 0.14);
  --ccop-line-soft: rgba(33, 43, 54, 0.06);

  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  color: var(--ccop-ink);
  font-size: 16px;
  line-height: 1.6;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  -webkit-font-smoothing: antialiased;
}

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

/* === HERO === */
.ccop-sn__hero {
  padding: 56px 0 40px;
}

.ccop-sn__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.ccop-sn__line { width: 32px; height: 1px; background: var(--ccop-mesa); display: inline-block; }
.ccop-sn__eyebrow > span:last-child {
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ccop-mesa);
  font-weight: 700;
}

.ccop-sn__title {
  font-family: 'Figtree', sans-serif;
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ccop-ink);
  margin: 0 0 12px;
  position: relative;
  display: inline-block;
}
.ccop-sn__title em {
  font-style: normal;
  color: var(--ccop-calvary);
  font-weight: 800;
}

/* Brand-signature arch underline (per Visual Identity Guidelines p.7) */
.ccop-sn__title::after {
  content: '';
  display: block;
  width: 56%;
  max-width: 280px;
  height: 8px;
  margin-top: 6px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M2 8 Q100 0 198 8' stroke='%23B8997C' stroke-width='3' stroke-linecap='round' fill='none'/></svg>") no-repeat center / 100% 100%;
}

.ccop-sn__subtitle {
  font-family: 'Figtree', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--ccop-ink-soft);
  max-width: 860px;
  line-height: 1.6;
  margin: 24px 0 0;
}

/* === SMS opt-in callout === */
.ccop-sn__sms {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--ccop-almond-warm);
  border: 1px solid var(--ccop-line);
  border-radius: 12px;
  max-width: 860px;
  position: relative;
  overflow: hidden;
}
.ccop-sn__sms::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--ccop-mesa);
}
.ccop-sn__sms-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ccop-calvary);
  color: var(--ccop-almond);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ccop-sn__sms-body { flex: 1; min-width: 0; }
.ccop-sn__sms-eyebrow {
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ccop-mesa);
  font-weight: 700;
  margin: 0 0 4px;
}
.ccop-sn__sms-text {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ccop-ink-soft);
  margin: 0;
}
.ccop-sn__sms-text strong {
  font-weight: 700;
  color: var(--ccop-ink);
}
.ccop-sn__sms-link {
  color: var(--ccop-calvary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.ccop-sn__sms-link:hover {
  color: var(--ccop-calvary-deep);
}
.ccop-sn__sms-disclaimer {
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ccop-ink-mute);
  margin: 8px 0 0;
  letter-spacing: 0.01em;
}

/* === SEARCH BAR === */
.ccop-sn__search-wrap {
  padding-top: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ccop-almond);
  margin: 0 -32px;
  padding-left: 32px;
  padding-right: 32px;
}

.ccop-sn__search-bar {
  position: relative;
  margin-bottom: 18px;
}

.ccop-sn__input {
  width: 100%;
  padding: 20px 56px;
  font-size: 17px;
  font-family: 'Figtree', sans-serif;
  font-weight: 400;
  background: #fff;
  border: 1px solid var(--ccop-line);
  border-radius: 12px;
  color: var(--ccop-ink);
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(33, 43, 54, 0.04);
}
.ccop-sn__input::placeholder { color: var(--ccop-ink-mute); font-weight: 400; }
.ccop-sn__input:focus {
  outline: none;
  border-color: var(--ccop-calvary);
  box-shadow: 0 0 0 4px rgba(52, 96, 138, 0.1), 0 8px 24px -8px rgba(52, 96, 138, 0.18);
}

.ccop-sn__search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ccop-mesa);
  pointer-events: none;
}

.ccop-sn__clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ccop-almond-warm);
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--ccop-ink-soft);
  transition: all 0.2s ease;
}
.ccop-sn__clear:hover { background: var(--ccop-cellar); color: var(--ccop-almond); }
.ccop-sn__clear.is-visible { display: flex; }

/* === FILTERS === */
.ccop-sn__filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 18px;
}

.ccop-sn__filter { position: relative; }

.ccop-sn__select {
  appearance: none;
  -webkit-appearance: none;
  padding: 11px 40px 11px 18px;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--ccop-line-soft);
  border-radius: 999px;
  color: var(--ccop-ink-soft);
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}
.ccop-sn__select:hover { border-color: var(--ccop-mesa); color: var(--ccop-ink); }
.ccop-sn__select:focus { outline: none; border-color: var(--ccop-calvary); }
.ccop-sn__select.is-active {
  background: var(--ccop-calvary);
  color: var(--ccop-almond);
  border-color: var(--ccop-calvary);
  font-weight: 600;
}

.ccop-sn__filter::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  color: var(--ccop-ink-mute);
  transition: color 0.25s ease;
}
.ccop-sn__filter.is-active::after { color: var(--ccop-almond); }

.ccop-sn__clear-filters {
  background: none;
  border: none;
  color: var(--ccop-ink-mute);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.25s ease;
  display: none;
  align-items: center;
  gap: 6px;
  font-family: 'Figtree', sans-serif;
}
.ccop-sn__clear-filters:hover { color: var(--ccop-cellar); }
.ccop-sn__clear-filters.is-visible { display: inline-flex; }

/* === META ROW === */
.ccop-sn__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0 8px;
  border-bottom: 1px solid var(--ccop-line-soft);
}
.ccop-sn__count {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ccop-ink);
  letter-spacing: -0.005em;
}
.ccop-sn__count strong {
  font-weight: 700;
  color: var(--ccop-calvary);
}
.ccop-sn__sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ccop-ink-mute);
  font-family: 'Figtree', sans-serif;
}
.ccop-sn__sort label { color: var(--ccop-ink-mute); font-weight: 400; }
.ccop-sn__sort select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font-family: 'Figtree', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ccop-calvary);
  cursor: pointer;
  padding: 4px 18px 4px 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4l3 3 3-3' stroke='%2334608A' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
}

/* === RESULTS GRID === */
.ccop-sn__results { padding: 28px 0 80px; }
.ccop-sn__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* === CARDS === */
.ccop-sn__card {
  background: #fff;
  border: 1px solid var(--ccop-line-soft);
  border-radius: 12px;
  padding: 30px;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: ccop-sn-fade 0.4s ease both;
}
.ccop-sn__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--ccop-mesa);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ccop-sn__card:hover {
  border-color: var(--ccop-calvary);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -16px rgba(52, 96, 138, 0.22);
}
.ccop-sn__card:hover::before { transform: scaleY(1); background: var(--ccop-calvary); }

.ccop-sn__card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 14px;
}
.ccop-sn__card-date {
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ccop-ink-mute);
  flex-shrink: 0;
  margin-top: 4px;
}
.ccop-sn__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.ccop-sn__tag {
  font-family: 'Figtree', sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ccop-almond-warm);
  color: var(--ccop-cellar);
  border: 1px solid var(--ccop-line-soft);
}
.ccop-sn__tag--book {
  background: var(--ccop-calvary);
  color: var(--ccop-almond);
  border-color: var(--ccop-calvary);
}

.ccop-sn__card-title {
  font-family: 'Figtree', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ccop-ink);
  margin: 0 0 8px;
}
.ccop-sn__card-passage {
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ccop-calvary);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}
.ccop-sn__card-speaker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  color: var(--ccop-ink-soft);
  font-weight: 500;
  margin-bottom: 22px;
}
.ccop-sn__card-speaker svg { color: var(--ccop-mesa); }

.ccop-sn__card-actions {
  display: flex;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--ccop-line-soft);
}
.ccop-sn__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid var(--ccop-line);
  color: var(--ccop-ink-soft);
  background: var(--ccop-almond);
  cursor: pointer;
}
.ccop-sn__btn:hover {
  background: var(--ccop-calvary);
  color: var(--ccop-almond);
  border-color: var(--ccop-calvary);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -8px rgba(52, 96, 138, 0.4);
}
.ccop-sn__btn--primary {
  background: var(--ccop-calvary);
  color: var(--ccop-almond);
  border-color: var(--ccop-calvary);
}
.ccop-sn__btn--primary:hover { background: var(--ccop-calvary-deep); border-color: var(--ccop-calvary-deep); color: var(--ccop-almond); }
.ccop-sn__btn--disabled {
  opacity: 0.4;
  pointer-events: none;
}
.ccop-sn__btn svg { width: 14px; height: 14px; }

/* === HIGHLIGHT === */
.ccop-sn__highlight {
  background: var(--ccop-mesa-light);
  color: var(--ccop-ink);
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 700;
}

/* === EMPTY STATE === */
.ccop-sn__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 24px;
  background: #fff;
  border: 1px dashed var(--ccop-line);
  border-radius: 12px;
}
.ccop-sn__empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--ccop-almond-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ccop-mesa);
}
.ccop-sn__empty h3 {
  font-family: 'Figtree', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ccop-ink);
  margin: 0 0 10px;
}
.ccop-sn__empty h3 em {
  font-style: normal;
  color: var(--ccop-calvary);
  font-weight: 700;
}
.ccop-sn__empty p {
  font-family: 'Figtree', sans-serif;
  color: var(--ccop-ink-mute);
  max-width: 420px;
  margin: 0 auto 22px;
  font-size: 15px;
  font-weight: 400;
}
.ccop-sn__empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--ccop-calvary);
  color: var(--ccop-almond);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Figtree', sans-serif;
}
.ccop-sn__empty-cta:hover { background: var(--ccop-calvary-deep); transform: translateY(-1px); }

/* === LOADING === */
.ccop-sn__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 80px 0;
}
.ccop-sn__loading span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ccop-mesa);
  animation: ccop-sn-bounce 1.2s infinite ease-in-out both;
}
.ccop-sn__loading span:nth-child(1) { animation-delay: -0.32s; }
.ccop-sn__loading span:nth-child(2) { animation-delay: -0.16s; }
@keyframes ccop-sn-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes ccop-sn-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .ccop-sn__grid { grid-template-columns: 1fr; }
  .ccop-sn__meta { flex-direction: column; gap: 12px; align-items: flex-start; }
}
@media (max-width: 640px) {
  .ccop-sn { padding: 0 20px; }
  .ccop-sn__search-wrap { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
  .ccop-sn__hero { padding: 40px 0 24px; }
  .ccop-sn__title::after { width: 70%; }
  .ccop-sn__input { padding: 16px 50px; font-size: 16px; }
  .ccop-sn__search-icon { left: 18px; }
  .ccop-sn__card { padding: 22px; }
  .ccop-sn__card-top { flex-direction: column; }
  .ccop-sn__card-tags { justify-content: flex-start; }
  .ccop-sn__card-actions { flex-direction: column; }
  .ccop-sn__sms { padding: 18px 20px; gap: 14px; margin-top: 24px; }
  .ccop-sn__sms-icon { width: 38px; height: 38px; }
  .ccop-sn__sms-text { font-size: 14px; }
}
