@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@400;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --border: #e0d9ce;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #5c3d1e;
  --accent-light: #f0e8dc;
  --nav-bg: #3b2a1a;
  --nav-text: #f5ede0;
  --radius: 6px;
  --max-width: 900px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Top nav ── */
.site-nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav .site-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--nav-text);
  text-decoration: none;
  flex: 1;
}

.site-nav a {
  color: #d4b896;
  text-decoration: none;
  font-size: 0.9rem;
}

.site-nav a:hover { color: var(--nav-text); text-decoration: underline; }

/* ── Page wrapper ── */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Landing page ── */
.landing-header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.landing-header h1 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.landing-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 0.5rem;
}

.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.section-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  border-color: var(--accent);
}

.section-card .he-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.8rem;
  direction: rtl;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.section-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.section-card .count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── TOC page ── */
.toc-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

.toc-header h1 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.9rem;
  color: var(--accent);
}

.toc-header .he-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.4rem;
  direction: rtl;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}

.toc-entry {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
  border: 1px solid transparent;
}

.toc-entry:hover {
  background: var(--accent-light);
  border-color: var(--border);
}

.toc-entry .num {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 2rem;
  font-variant-numeric: tabular-nums;
}

.toc-entry .title {
  font-size: 0.95rem;
  line-height: 1.35;
}

/* ── Siman page ── */
.siman-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.siman-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.siman-header .breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.siman-header .breadcrumb a:hover { text-decoration: underline; }

.siman-header h1 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.75rem;
  color: var(--accent);
  line-height: 1.3;
}

.siman-header .siman-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-style: italic;
}

.siman-header .siman-topic {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.siman-header .topic-en {
  font-size: 1.15rem;
  font-family: 'Crimson Text', serif;
  color: var(--accent);
  font-weight: 600;
}

.siman-header .topic-he {
  font-size: 1.15rem;
  font-family: 'Frank Ruhl Libre', serif;
  color: var(--accent);
  direction: rtl;
  text-align: right;
}

/* ── Navigation bar ── */
.siman-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover { background: var(--accent-light); border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover { background: #4a2f12; border-color: #4a2f12; }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.jump-select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  max-width: 260px;
}

.jump-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Content ── */
.seif {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.seif:last-child { border-bottom: none; }

.seif-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

/* Two-column Hebrew / English layout — 60% English / 40% Hebrew */
.seif-columns {
  display: grid;
  grid-template-columns: 60fr 40fr;
  gap: 1.5rem;
  align-items: start;
}

.seif-he {
  direction: rtl;
  text-align: right;
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.1rem;
  line-height: 1.9;
  color: #2a1a0a;
}

.seif-en {
  direction: ltr;
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}


/* Collapse to stacked on mobile */
@media (max-width: 700px) {
  .seif-columns,
  .seif-intro-columns {
    grid-template-columns: 1fr;
  }
  .seif-he { order: 1; }
  .seif-en { order: 2; }
}

/* ── Disclaimer ── */
.disclaimer {
  margin-top: 2.5rem;
  padding: 0.9rem 1.1rem;
  background: #fff8e6;
  border: 1px solid #e8d5a0;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: #6b5b2e;
  line-height: 1.55;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── About page ── */
.about h1 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.9rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.about h2 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.3rem;
  color: var(--accent);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.about p {
  margin-bottom: 1rem;
}

.about ul {
  margin: 0.5rem 0 1rem 1.5rem;
}

.about li {
  margin-bottom: 0.5rem;
}

.about a { color: var(--accent); }
.about a:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 600px) {
  .page { padding: 1.25rem 1rem 3rem; }
  .landing-header h1 { font-size: 1.8rem; }
  .siman-header h1 { font-size: 1.4rem; }
  .jump-select { max-width: 100%; width: 100%; }
  .siman-nav { gap: 0.5rem; }
}
