/* ══════════════════════════════════════════════════
   LIBBEH v1.4 – Main Stylesheet (RTL / Hebrew)
   Frank Ruhl Libre + 4 Figma-exact palettes
   ══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300;400;500;700;900&display=swap');

/* ─── Theme: Blue / פלטה 4 (אדום-כתום-צהוב) ─────── */
:root {
  --c1:           #f65272;
  --c2:           #f78955;
  --c3:           #f5d754;
  --primary:      #c23a54;
  --primary-light:#fde8ec;
  --accent:       #f65272;
  --accent-soft:  #fff1f3;
  --bg:           #fff8f5;
  --surface:      #ffffff;
  --surface-tint: rgba(255,255,255,0.75);
  --text:         #2d1a1a;
  --text-muted:   #7a5a5a;
  --border:       #f5c8d0;
  --btn-text:     #c23a54;
  --btn-bg:       #fde8ec;
  --btn-hover:    #fbd0d8;
  --radius:       10px;
  --shadow:       0 1px 6px rgba(0,0,0,0.07);
  --shadow-hover: 0 4px 18px rgba(0,0,0,0.12);
  --transition:   0.2s ease;
}

/* ─── Theme: Cream / פלטה 1 (זהב-צהוב-ירוק-זית) ─── */
.theme-cream {
  --c1:           #eca760;
  --c2:           #eae95d;
  --c3:           #a6e860;
  --primary:      #a0620a;
  --primary-light:#fdefd8;
  --accent:       #eca760;
  --accent-soft:  #fffbf0;
  --bg:           #fefdf5;
  --surface:      #ffffff;
  --surface-tint: rgba(255,255,255,0.75);
  --text:         #2a1f0a;
  --text-muted:   #7a6a3a;
  --border:       #e8d9b0;
  --btn-text:     #a0620a;
  --btn-bg:       #fdefd8;
  --btn-hover:    #fce0b8;
}

/* ─── Theme: Purple / פלטה 2 (כחול-סגול-ורוד) ──── */
.theme-purple {
  --c1:           #5b57f6;
  --c2:           #a957f7;
  --c3:           #f459ef;
  --primary:      #4340c4;
  --primary-light:#e8e7fd;
  --accent:       #5b57f6;
  --accent-soft:  #f2f1ff;
  --bg:           #f5f4ff;
  --surface:      #ffffff;
  --surface-tint: rgba(255,255,255,0.75);
  --text:         #12103a;
  --text-muted:   #5a5880;
  --border:       #c9c7f8;
  --btn-text:     #4340c4;
  --btn-bg:       #e8e7fd;
  --btn-hover:    #d4d2fb;
}

/* ─── Theme: Green / פלטה 3 (ירוק-טיל-כחול) ───── */
.theme-green {
  --c1:           #5af2a3;
  --c2:           #54f2ef;
  --c3:           #5cabf2;
  --primary:      #0a7a5a;
  --primary-light:#d0fbed;
  --accent:       #5af2a3;
  --accent-soft:  #f0fdf8;
  --bg:           #f0fdf8;
  --surface:      #ffffff;
  --surface-tint: rgba(255,255,255,0.75);
  --text:         #0a2a1f;
  --text-muted:   #3a6a5a;
  --border:       #a8ecd4;
  --btn-text:     #0a7a5a;
  --btn-bg:       #d0fbed;
  --btn-hover:    #a8f5d8;
}

/* ─── Reset & Base ──────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Frank Ruhl Libre', 'David', serif;
  font-size: 16px;
  line-height: 1.75;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ─── Container ─────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Header ────────────────────────────────────── */
.site-header {
  background: var(--surface-tint);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.logo { height: 82px; }
.header-title { display: none; }

/* ─── Hero ──────────────────────────────────────── */
.hero {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--primary);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.btn-hero {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1.5px solid var(--border);
  padding: 0.8rem 2.2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
}
.btn-hero:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

/* ─── Section Title ─────────────────────────────── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin: 2.5rem 0 1.75rem;
}

/* ─── Rabbis Grid ───────────────────────────────── */
.rabbis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding-bottom: 4rem;
}
@media (max-width: 480px)  { .rabbis-grid { grid-template-columns: 1fr; } }
@media (min-width: 481px)  and (max-width: 767px)  { .rabbis-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  and (max-width: 1023px) { .rabbis-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rabbis-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .rabbis-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─── Rabbi Card ────────────────────────────────── */
.rabbi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.rabbi-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
}
.rabbi-card-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--accent-soft);
}
.rabbi-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.rabbi-card:hover .rabbi-card-img { transform: scale(1.04); }
.rabbi-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rabbi-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}
.rabbi-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-card {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  transition: background var(--transition);
  margin-top: auto;
  font-family: inherit;
}
.btn-card:hover { background: var(--btn-hover); }

/* ─── Empty State ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

/* ─── Video Hero (rabbi page) ───────────────────── */
.video-hero {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  height: 50vw;
  max-height: 630px;
  min-height: 320px;
  overflow: hidden;
  background: #000;
}
.video-hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}
.video-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-hero-title {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
  text-align: center;
  padding: 0 1rem;
}

/* ─── Rabbi Profile Page ────────────────────────── */
.rabbi-profile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  margin: 2rem auto;
  max-width: 860px;
  text-align: center;
}
.rabbi-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.rabbi-photo, .rabbi-logo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin: 0 auto;
}
.rabbi-logo { object-fit: contain; }
.rabbi-info { width: 100%; }
.rabbi-info h1 { font-size: 1.85rem; font-weight: 900; color: var(--primary); margin-bottom: 0.65rem; }
.rabbi-info .description { color: var(--text); line-height: 1.8; font-size: 1rem; }
.rabbi-info .email { color: var(--text-muted); margin-top: 0.65rem; font-size: 0.92rem; }

@media (max-width: 600px) {
  .rabbi-profile { padding: 1.5rem; }
  .rabbi-photo, .rabbi-logo { width: 120px; height: 120px; }
  .video-hero { height: 220px; }
}

/* ─── Subscription Section ──────────────────────── */
.subscription-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}
.subscription-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.subscription-section > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.97rem;
}

/* ─── Forms ─────────────────────────────────────── */
.subscribe-form, .unsubscribe-form, .login-form {
  max-width: 420px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.form-group label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  text-align: center;
  width: 100%;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.97rem;
  font-family: inherit;
  direction: rtl;
  text-align: center;
  text-align-last: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.85);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ─── Buttons ───────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border: 1.5px solid var(--border);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.97rem;
  font-family: inherit;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  text-align: center;
  background: var(--btn-bg);
  color: var(--btn-text);
}
.btn:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn-primary  { background: var(--btn-bg); color: var(--btn-text); border-color: var(--border); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-secondary{ background: var(--surface); color: var(--text-muted); border-color: var(--border); }
.btn-danger   { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }

/* ─── Messages ──────────────────────────────────── */
.success-message {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 2rem 0;
}
.success-icon { font-size: 3rem; margin-bottom: 1rem; }
.success-message h1 { font-size: 1.6rem; font-weight: 900; color: var(--primary); margin-bottom: 0.85rem; }
.success-message p  { color: var(--text-muted); margin-bottom: 0.65rem; font-size: 0.97rem; }

.error-message {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
}
.info-message {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--primary);
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
}
.action-buttons { margin-top: 1.5rem; }
.action-buttons .btn { margin: 0 0.35rem; }

/* ─── Unsubscribe page ──────────────────────────── */
.unsubscribe-page {
  max-width: 560px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.unsubscribe-page h1 { color: var(--primary); margin-bottom: 1.1rem; font-size: 1.4rem; font-weight: 900; }
.subscription-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.unsubscribe-all { margin-top: 1.5rem; }

/* ─── Footer ────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  padding: 1.75rem;
  margin-top: 4rem;
  font-size: 0.88rem;
}
