/* Blau Dictionary — Shared Styles */

/* Note: Noto Sans Arabic is loaded via Google Fonts <link> tags in HTML */

/* ===== Font classes ===== */
.font-miriam { font-family: 'Miriam Libre', 'Miriam', 'Noto Sans Hebrew', sans-serif; }
.font-miriam-bold { font-family: 'Miriam Libre', 'Miriam', 'Noto Sans Hebrew', sans-serif; font-weight: 700; }
.font-frankruehl { font-family: 'Frank Ruhl Libre', 'Frank Ruehl', 'Noto Serif Hebrew', serif; }
.font-frankruehl-italic { font-family: 'Frank Ruhl Libre', 'Frank Ruehl', 'Noto Serif Hebrew', serif; font-style: italic; }
.font-arabic {
  font-family: 'Scheherazade New', 'Amiri', 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Sakkal Majalla', 'Traditional Arabic', 'Arabic Typesetting', 'Simplified Arabic', 'Tahoma', serif;
  font-feature-settings: 'liga' 1, 'calt' 1, 'rlig' 1;
  text-rendering: optimizeLegibility;
}
.font-arabic-bold {
  font-family: 'Scheherazade New', 'Amiri', 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Sakkal Majalla', 'Traditional Arabic', 'Arabic Typesetting', 'Simplified Arabic', 'Tahoma', serif;
  font-weight: 700;
  font-feature-settings: 'liga' 1, 'calt' 1, 'rlig' 1;
  text-rendering: optimizeLegibility;
}
.font-arabic-pf {
  font-family: 'Noto Sans Arabic', 'Noto Naskh Arabic', 'Sakkal Majalla', 'Scheherazade New', 'Amiri', 'Traditional Arabic', 'Arabic Typesetting', 'Simplified Arabic', 'Tahoma', 'Segoe UI', serif;
  font-feature-settings: 'liga' 1, 'calt' 1, 'rlig' 1;
  text-rendering: optimizeLegibility;
  unicode-bidi: isolate;
}
.font-english { font-family: 'Times New Roman', 'Georgia', serif; }
.font-english-italic { font-family: 'Times New Roman', 'Georgia', serif; font-style: italic; }
.font-symbols { font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'Apple Symbols', sans-serif; }
.font-judeo { font-family: 'Frank Ruhl Libre', 'Noto Serif Hebrew', serif; }

/* ===== Bidi / layout ===== */
.rtl-flow { direction: rtl; text-align: right; unicode-bidi: embed; }
.text-segment { unicode-bidi: isolate; display: inline; }

/* Ensure English text within RTL is properly isolated */
.font-english, .font-english-italic {
  unicode-bidi: isolate;
}
/* Ensure Arabic segments nested in Hebrew are isolated */
.font-arabic, .font-arabic-bold, .font-arabic-pf {
  unicode-bidi: isolate;
}
/* Punctuation between bidi segments: use neutral isolation */
.tt-punctuation { unicode-bidi: isolate; }

/* ===== Text type styling ===== */
.tt-headword_arabic { font-size: 1.5rem; font-weight: 600; color: #065f46; }
.tt-headword_ja { font-size: 1.25rem; font-weight: 600; color: #1f2937; }
.tt-binyan { color: #7c3aed; font-weight: 700; background: #f3e8ff; padding: 0.1rem 0.4rem; border-radius: 0.25rem; }
.tt-binyan_shift { color: #6d28d9; font-style: italic; }
.tt-government { color: #1d4ed8; background: #dbeafe; padding: 0.1rem 0.3rem; border-radius: 0.25rem; }
.tt-complement_arabic { color: #0d9488; }
.tt-complement_ja { color: #0f766e; }
.tt-classical { color: #b45309; font-style: italic; background: #fef3c7; padding: 0.1rem 0.3rem; border-radius: 0.25rem; }
.classical-span {
  background: #fef3c7;
  border-inline-start: 3px solid #f59e0b;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  display: inline;
}
.erroneous-span {
  background: #fee2e2;
  border-inline-start: 3px solid #ef4444;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  display: inline;
}
.tt-definition_hebrew { color: #1f2937; }
.tt-definition_english { color: #4b5563; }
.tt-grammar_citation { color: #4f46e5; font-size: 0.9em; }
.tt-cross_reference { color: #0891b2; text-decoration: underline; text-decoration-style: dotted; }
.tt-plural_marker { color: #be185d; font-weight: 500; }
.tt-morph_note { color: #6b7280; font-size: 0.9em; }
.tt-freeform_note { color: #6b7280; }
.tt-hebrew_in_ja { color: #7c2d12; font-weight: 700; }
.tt-variant_arabic { color: #065f46; font-weight: 500; }
.tt-variant_ja { color: #1f2937; font-weight: 500; }
.tt-erroneous_form { color: #dc2626; font-weight: 600; background: #fee2e2; padding: 0.1rem 0.3rem; border-radius: 0.25rem; }
.tt-reconstructed { color: #7c3aed; font-style: italic; }

/* ===== Animations ===== */
@keyframes searchHighlight {
  0% { background-color: #fde047; }
  100% { background-color: transparent; }
}
.search-highlight {
  background-color: #fde047;
  border-radius: 2px;
  animation: searchHighlight 3s ease-out 1s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }

/* ===== Match highlighting (search) ===== */
.match-highlight { background-color: #fef08a; padding: 0 2px; border-radius: 2px; }

/* ===== Custom scrollbars ===== */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f1f1; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #999; }

/* ===== Nav bar ===== */
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-link { color: #a7f3d0; text-decoration: none; padding: 0.25rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; transition: all 0.15s; }
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { color: white; background: rgba(255,255,255,0.15); font-weight: 600; }

/* Mobile nav chevron */
.nav-toggle { display: none; background: none; border: none; color: white; cursor: pointer; padding: 0.25rem; }
.nav-toggle svg { width: 1.5rem; height: 1.5rem; transition: transform 0.2s ease; }
.nav-toggle.nav-open svg { transform: rotate(180deg); }

@media (max-width: 639px) {
  .nav-toggle { display: flex; align-items: center; }
  .nav-links {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: #065f46; padding: 0.5rem 1rem 0.75rem;
    flex-direction: column; gap: 0.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15); z-index: 40;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 0.5rem 0.75rem; display: block; }
  .nav-logo { display: none; }
}

/* Close nav dropdown on link click + outside click (shared JS) */
