/*
 * Ein Yaakov Heritage Website - Main Style System
 * Designed with a warm "Earth & Nature" aesthetic evoking a 1950s Israeli rural moshav.
 * Uses OKLCH color spaces, fluid typography, and premium micro-interactions.
 * Documented in English as requested.
 */

:root {
  --radius: 0.625rem; /* 10px */
  
  /* OKLCH Color Tokens - Earth & Nature Palette */
  --background: oklch(0.962 0.012 85); /* Warm Cream */
  --foreground: oklch(0.25 0.025 145); /* Deep Greenish Black */
  --card: oklch(0.985 0.008 85); /* Near-white cream */
  --primary: oklch(0.42 0.06 145); /* Earthy Green */
  --primary-foreground: oklch(0.97 0.012 85); /* Off-white for text on primary */
  --secondary: oklch(0.9 0.025 135); /* Light Sage */
  --secondary-foreground: oklch(0.3 0.04 145);
  --muted: oklch(0.92 0.02 100); /* Warm Gray */
  --muted-foreground: oklch(0.45 0.03 145);
  --accent: oklch(0.78 0.05 135); /* Soft Green */
  --accent-foreground: oklch(0.25 0.04 145);
  --destructive: oklch(0.577 0.245 27.325); /* Earthy Rust Red */
  --border: oklch(0.85 0.025 120); /* Muted Olive Border */
  --input: oklch(0.88 0.02 120);
  --ring: oklch(0.55 0.06 145);
}

/* --- Base & Reset Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Heebo', 'Assistant', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Frank Ruhl Libre', 'Heebo', serif;
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

main {
  flex: 1;
}

/* --- Global Layout Utilities --- */
.container {
  max-width: 72rem; /* 1152px */
  margin-inline: auto;
  padding-inline: 1rem;
}

/* --- Page Headers (.ph) --- */
.ph {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.ph .kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.ph h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary);
  line-height: 1.2;
}

.ph .sub {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin-inline: auto;
}

/* --- Card Primitive --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  border-color: oklch(0.42 0.06 145 / 0.4);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.06);
  transform: translateY(-2px);
}

/* --- Buttons --- */
.bp { /* Primary Button */
  display: inline-block;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.bp:hover {
  opacity: 0.9;
}

.bp:active {
  transform: scale(0.98);
}

.bo { /* Outline Button */
  display: inline-block;
  border: 1px solid oklch(0.42 0.06 145 / 0.3);
  background: oklch(0.962 0.012 85 / 0.7);
  color: var(--foreground);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
  cursor: pointer;
}

.bo:hover {
  background: var(--secondary);
  border-color: oklch(0.42 0.06 145 / 0.5);
}

.bo:active {
  transform: scale(0.98);
}

/* --- Form Fields --- */
.fi { /* Text inputs / Textareas */
  width: 100%;
  border: 1px solid var(--input);
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  transition: border-color 0.15s;
}

.fi:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.fe { /* Form error */
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--destructive);
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

/* --- Sticky Site Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: oklch(0.962 0.012 85 / 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-block {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.logo-name {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.125rem;
  color: var(--primary);
  font-weight: 700;
}

.logo-tag {
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

.dnav {
  display: none;
  gap: 0.25rem;
  align-items: center;
}

@media (min-width: 768px) {
  .dnav {
    display: flex;
  }
  .hamburger {
    display: none !important;
  }
}

.dnav a, .mnav a {
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: oklch(0.25 0.025 145 / 0.8);
  transition: background 0.15s, color 0.15s;
  display: block;
}

.dnav a:hover, .mnav a:hover, .dnav a.active, .mnav a.active {
  background: var(--secondary);
  color: var(--foreground);
}

.dnav a.active, .mnav a.active {
  font-weight: 600;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius);
  color: var(--foreground);
}

.mnav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 0.5rem 1rem;
}

.mnav.open {
  display: flex;
}

.mnav a {
  padding: 0.65rem 0.75rem;
}

/* --- Footer --- */
footer {
  margin-top: 6rem;
  border-top: 1px solid var(--border);
  background: oklch(0.9 0.025 135 / 0.4);
}

.fi-wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.fn {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* --- Chips (Filter Badges) --- */
.chip {
  display: inline-block;
  padding: 0.35rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.chip-active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.chip-idle {
  background: var(--muted);
  color: var(--muted-foreground);
}

.chip-idle:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* --- Timeline Styling --- */
.timeline-list {
  position: relative;
  border-inline-end: 2px solid oklch(0.42 0.06 145 / 0.3);
  padding-inline-end: 1.5rem;
  list-style: none;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-dot {
  position: absolute;
  inset-inline-end: -1.875rem; /* -30px matching padding and border width */
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--background);
  display: block;
}

/* --- Profile Details Page (Founder & Story View) --- */
.profile-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 768px) {
  .profile-grid {
    grid-template-columns: 280px 1fr;
  }
  .profile-sidebar {
    position: sticky;
    top: 5rem;
  }
}

.quote-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: oklch(0.9 0.025 135 / 0.25);
  border-right: 4px solid var(--primary);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--primary);
  font-family: 'Frank Ruhl Libre', serif;
}

.tiptap-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.tiptap-content p {
  margin-bottom: 1.25rem;
}

.tiptap-content h2, .tiptap-content h3 {
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.tiptap-content ul, .tiptap-content ol {
  margin-bottom: 1.25rem;
  padding-right: 1.5rem; /* RTL indentation */
}

.tiptap-content li {
  margin-bottom: 0.5rem;
}

.tiptap-content blockquote {
  border-right: 3px solid var(--accent);
  padding-right: 1rem;
  margin-bottom: 1.25rem;
  font-style: italic;
  color: var(--muted-foreground);
}

.story-title-link {
  color: var(--foreground);
  transition: color 0.2s ease;
}

.story-title-link:hover {
  color: var(--primary);
}
