/* nesiim-styles.css — visual layer for the נשיאים comparative viewer.
 * Typography: Assistant everywhere (display + body + labels).
 */

:root {
  --bg: #f6f1e4;
  --bg-card: #fdfaf2;
  --bg-card-translucent: rgba(253, 250, 242, 0.92);
  --bg-translucent: rgba(246, 241, 228, 0.92);
  --ink: #2a1f17;
  --ink-soft: #5c4a3c;
  --ink-muted: #8a7560;
  --accent: #7a1e2c;
  --accent-soft: #a64558;
  --border: #d9cdb5;
  --border-strong: #b8a487;
  --divider: #e3d6bd;
  --hover: #efe6d0;
  --serif: 'Assistant', system-ui, sans-serif;
  --sans: 'Assistant', system-ui, sans-serif;

  /* Sticky offsets — JS measures tabs height at runtime
     and overrides --tabs-height. Defaults below are fallbacks. */
  --tabs-height: 70px;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 10% 10%, rgba(122, 30, 44, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(122, 30, 44, 0.03) 0%, transparent 50%);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* Header */
header {
  text-align: center;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.subtitle {
  font-family: var(--serif);
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--ink-muted);
  margin-top: 8px;
  font-weight: 400;
}

/* Tabs (sticky top) */
.tabs-container {
  position: sticky;
  top: 0;
  background: var(--bg-translucent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 0 12px;
  margin: 0 -16px 24px;
  padding-right: 16px;
  padding-left: 16px;
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-track { background: transparent; }
.tabs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.tab {
  flex: 0 0 auto;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

.tab:hover {
  background: var(--hover);
  color: var(--ink);
}

.tab.active {
  background: var(--accent);
  color: #fdfaf2;
  border-color: var(--accent);
  font-weight: 700;
}

/* Theme banner — sticky below the tabs */
.theme-banner {
  position: sticky;
  top: var(--tabs-height);
  background: var(--bg-card-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-right: 4px solid var(--accent);
  border-radius: 6px;
  padding: 16px 22px;
  margin-bottom: 28px;
  box-shadow: 0 4px 12px -6px rgba(42, 31, 23, 0.12),
              0 1px 0 rgba(122, 30, 44, 0.04);
  z-index: 15;
  transition: padding 0.18s ease;
}

.theme-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.theme-title {
  font-family: var(--serif);
  font-size: clamp(19px, 3.3vw, 25px);
  font-weight: 450;
  color: var(--ink);
  line-height: 1.3;
}

.nasi-name {
  font-family: var(--serif);
  font-size: clamp(14px, 2.3vw, 16px);
  color: var(--ink-muted);
  margin-top: 6px;
  font-style: italic;
}

/* Sub-tabs (Naftali) */
.sub-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.sub-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.sub-tab:hover {
  color: var(--ink);
}

.sub-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

/* Items table */
.items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) 2fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--divider);
}

.item-row:last-child {
  border-bottom: none;
}

.item-name {
  font-family: var(--serif);
  font-size: clamp(17px, 2.6vw, 20px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.4;
  padding-top: 2px;
}

.item-meaning {
  font-family: var(--serif);
  font-size: clamp(16px, 2.4vw, 18px);
  color: var(--ink);
  line-height: 1.7;
}

.meaning-block + .meaning-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  position: relative;
}

.meaning-block + .meaning-block::before {
  content: "ד״א";
  position: absolute;
  top: -10px;
  right: 0;
  background: var(--bg);
  padding: 0 8px 0 0;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 1px;
}

/* Conclusion (זה קרבן) row */
.item-row.is-conclusion {
  margin-top: 24px;
  padding: 22px;
  background: rgba(122, 30, 44, 0.045);
  border-radius: 8px;
  border: 1px solid rgba(122, 30, 44, 0.12);
  border-bottom: 1px solid rgba(122, 30, 44, 0.12);
  position: relative;
}

.item-row.is-conclusion::before {
  position: absolute;
  top: -10px;
  right: 18px;
  background: var(--bg);
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-soft);
  letter-spacing: 1.5px;
}

.item-row.is-conclusion .item-name {
  color: var(--accent-soft);
  font-style: italic;
}

.item-row.is-conclusion .meaning-block + .meaning-block::before {
  background: rgba(247, 233, 226, 1);
}

/* Mobile */
@media (max-width: 600px) {
  .container {
    padding: 16px 12px 60px;
  }
  .item-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }
  .item-row.is-conclusion {
    padding: 18px 16px;
    gap: 8px;
  }
  .item-name {
    font-size: 18px;
  }
  .tab {
    padding: 8px 16px;
    font-size: 16px;
  }
  .theme-banner {
    padding: 14px 18px;
  }
  .theme-label {
    margin-bottom: 4px;
  }
}

/* Fade transition */
.content-area {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer note */
.source-note {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-muted);
  font-style: italic;
}