/* Legacy Church - profile + directory overlay.
   Mobile-first, uses the app's brand variables from style.css. */

.lch-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: linear-gradient(165deg, var(--color-navy, #0d1b33), var(--color-navy-light, #16294d));
  display: none;
}
.lch-overlay.open { display: block; }
body.lch-open { overflow: hidden; }

.lch-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--color-cream, #f7efe0);
}

/* ── Header ─────────────────────────────────────────────── */
.lch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-top, 0px));
  background: linear-gradient(135deg, var(--color-navy, #0d1b33), var(--color-navy-light, #16294d));
  color: var(--color-gold-light, #e8c98a);
  flex-shrink: 0;
}
.lch-head-title { display: flex; flex-direction: column; min-width: 0; }
.lch-head-main { font-size: 1.05rem; font-weight: 800; }
.lch-head-sub { font-size: 0.75rem; color: rgba(232,201,138,0.75); }
.lch-icon-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px; border: none; background: transparent;
  color: var(--color-gold-light, #e8c98a);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease;
}
.lch-icon-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Tabs ───────────────────────────────────────────────── */
.lch-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--color-navy, #0d1b33);
  flex-shrink: 0;
}
.lch-tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(232,201,138,0.75);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lch-tab.on {
  background: var(--color-gold, #c9963b);
  color: var(--color-navy, #0d1b33);
}

/* ── Body ───────────────────────────────────────────────── */
.lch-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom, 0px));
}

.lch-loading, .lch-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 48px 20px; text-align: center;
  color: var(--color-text-mid, #6b5d43);
  font-size: 0.9rem;
}
.lch-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--color-gold-pale, #efe2c6);
  border-top-color: var(--color-gold, #c9963b);
  animation: lch-spin 0.8s linear infinite;
}
@keyframes lch-spin { to { transform: rotate(360deg); } }

/* ── Profile card ───────────────────────────────────────── */
.lch-profile {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-gold, #c9963b);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(20,33,54,0.06);
}
.lch-profile-top { display: flex; gap: 16px; align-items: flex-start; }
.lch-logo {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 16px; object-fit: cover;
  border: 1px solid var(--color-border, #e4d9ba);
}
.lch-logo-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-navy, #0d1b33), var(--color-navy-light, #16294d));
  color: var(--color-gold-light, #e8c98a);
  font-size: 1.8rem; font-weight: 800;
}
.lch-profile-head { min-width: 0; flex: 1; }
.lch-name { font-size: 1.3rem; font-weight: 800; color: var(--color-navy, #0d1b33); margin: 0; line-height: 1.2; }
.lch-tagline { font-size: 0.9rem; color: var(--color-text-mid, #6b5d43); margin: 4px 0 0; line-height: 1.4; }
.lch-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lch-chip {
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  background: var(--color-gold-pale, #efe2c6);
  color: var(--color-gold-dark, #8a5a1a);
}
.lch-chip-soft { background: var(--color-cream, #f7efe0); color: var(--color-text-mid, #6b5d43); }

.lch-detail-rows { margin-top: 16px; border-top: 1px solid var(--color-border, #e4d9ba); padding-top: 14px; }
.lch-drow { display: flex; gap: 12px; padding: 6px 0; font-size: 0.88rem; }
.lch-drow-label { flex: 0 0 110px; font-weight: 700; color: var(--color-text-mid, #6b5d43); }
.lch-drow-value { color: var(--color-text-dark, #2a2417); word-break: break-word; min-width: 0; }
.lch-drow-value a { color: var(--color-gold-dark, #8a5a1a); font-weight: 700; }

.lch-about { margin-top: 16px; border-top: 1px solid var(--color-border, #e4d9ba); padding-top: 14px; }
.lch-about h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-mid, #6b5d43); margin: 0 0 6px; }
.lch-about p { font-size: 0.92rem; line-height: 1.6; color: var(--color-text-dark, #2a2417); margin: 0; }

.lch-profile-actions { margin-top: 18px; }
.lch-view-note { margin-top: 14px; font-size: 0.8rem; color: var(--color-text-soft, #9a8c6f); font-style: italic; }

/* ── Buttons ────────────────────────────────────────────── */
.lch-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 800; font-size: 0.85rem;
  border-radius: 10px; padding: 11px 16px;
  cursor: pointer; border: 1px solid transparent;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.lch-btn:active { transform: scale(0.98); }
.lch-btn:disabled { opacity: 0.6; cursor: default; }
.lch-btn-gold {
  width: 100%;
  background: linear-gradient(135deg, var(--color-gold, #c9963b), var(--color-gold-light, #e8c98a));
  color: var(--color-navy, #0d1b33);
}
.lch-btn-gold:hover:not(:disabled) { filter: brightness(1.08); }
.lch-btn-ghost { background: transparent; color: var(--color-text-mid, #6b5d43); border-color: var(--color-border, #e4d9ba); }

/* ── Edit form ──────────────────────────────────────────── */
.lch-form {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e4d9ba);
  border-radius: 18px;
  padding: 20px;
}
.lch-form-title { font-size: 1.15rem; font-weight: 800; color: var(--color-navy, #0d1b33); margin: 0; }
.lch-form-sub { font-size: 0.85rem; color: var(--color-text-mid, #6b5d43); margin: 4px 0 16px; }
.lch-field { display: block; margin-bottom: 14px; }
.lch-field-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--color-text-mid, #6b5d43); margin-bottom: 5px; }
.lch-input {
  width: 100%;
  border: 1px solid var(--color-border, #e4d9ba);
  border-radius: 10px;
  background: var(--color-cream, #f7efe0);
  color: var(--color-text-dark, #2a2417);
  font-family: 'Nunito', sans-serif;
  font-size: 16px; /* prevents iOS zoom */
  padding: 11px 13px;
  outline: none;
}
.lch-input:focus { border-color: var(--color-gold, #c9963b); background: var(--color-white, #fff); }
.lch-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.lch-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px; margin-top: 4px;
  border: 1px solid var(--color-border, #e4d9ba); border-radius: 12px;
  background: var(--color-cream, #f7efe0);
}
.lch-toggle-row strong { display: block; font-size: 0.88rem; color: var(--color-text-dark, #2a2417); }
.lch-toggle-desc { display: block; font-size: 0.78rem; color: var(--color-text-mid, #6b5d43); margin-top: 2px; }
.lch-toggle-row input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--color-gold, #c9963b); }

.lch-form-actions { display: flex; gap: 10px; margin-top: 18px; }
.lch-form-actions .lch-btn { flex: 1; }

/* ── Directory ──────────────────────────────────────────── */
.lch-dir-intro { font-size: 0.85rem; color: rgba(42,36,23,0.7); margin: 0 0 12px; }
.lch-cards { display: flex; flex-direction: column; gap: 10px; }
.lch-card {
  display: flex; align-items: center; gap: 13px;
  width: 100%; text-align: left;
  padding: 13px;
  border: 1px solid var(--color-border, #e4d9ba);
  border-radius: 14px;
  background: var(--color-white, #fff);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lch-card:hover { border-color: var(--color-gold, #c9963b); box-shadow: 0 3px 10px rgba(20,33,54,0.07); }
.lch-card-logo {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 12px; object-fit: cover;
  font-size: 1.3rem;
}
.lch-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lch-card-name {
  font-weight: 800; font-size: 0.98rem; color: var(--color-navy, #0d1b33);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lch-mine-badge {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 8px; border-radius: 20px;
  background: var(--color-gold, #c9963b); color: var(--color-navy, #0d1b33);
}
.lch-card-tag { font-size: 0.82rem; color: var(--color-text-mid, #6b5d43); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lch-card-meta { font-size: 0.75rem; color: var(--color-text-soft, #9a8c6f); }
.lch-chevron { font-size: 1.4rem; color: var(--color-text-soft, #9a8c6f); flex-shrink: 0; }

.lch-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; cursor: pointer;
  color: var(--color-gold-dark, #8a5a1a); font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.85rem; padding: 4px 0; margin-bottom: 12px;
}

/* ── Toast fallback ─────────────────────────────────────── */
.lch-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: 1600; max-width: 90%;
  background: var(--color-navy, #0d1b33); color: var(--color-gold-light, #e8c98a);
  border: 1px solid var(--color-gold, #c9963b); border-radius: 12px;
  padding: 12px 18px; font-size: 0.88rem; font-weight: 600;
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
}
.lch-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 720px) {
  .lch-shell { border-left: 1px solid var(--color-gold, #c9963b); border-right: 1px solid var(--color-gold, #c9963b); }
}
