/* ============================
   HEADER - הדר
   כחול נייבי + זהב, קבוע למעלה
   ============================ */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #001f3f; /* כחול נייבי כהה */
  color: #FFD700; /* זהב */
}

.header-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* שורה עליונה - תמיד כ-flex */
.header-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

/* לוגו מימין */
.header-logo {
  width: 60px;
  height: auto;
  flex-shrink: 0;
}

.header-logo img {
  display: block;
  height: auto;
  width: 100%;
  cursor: pointer;
}

/* תוכן מרכזי */
.header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ברכה ותאריך */
.header-greeting {
  font-size: 11px;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-greeting .date {
  margin-right: 4px;
}

/* כותרת האתר */
.header-title {
  padding: 2px 4px;
}

.header-title h1 {
  font-family: 'Yiddishkeit', serif;
  font-size: 18px;
  margin: 0;
  line-height: 1.2;
}

.header-title .subtitle {
  font-family: 'SBL Hebrew', serif;
  font-size: 11px;
  margin-top: 1px;
  line-height: 1.2;
}

.header-title .author {
  font-family: 'SBL Hebrew', serif;
  font-size: 11px;
  margin-top: 1px;
  line-height: 1.2;
}

/* כפתורי ניווט ראשיים */
.main-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 1px;
  width: 100%;
}

.main-nav button {
  flex: 1 1 0;
  min-width: 0;
  background-color: #003366;
  color: #FFD700;
  border: 0;
  padding: 10px 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  text-align: center;
}

.main-nav button:hover {
  background-color: #FFD700;
  color: #001f3f;
}

.main-nav button .nav-title {
  font-family: 'Yiddishkeit', serif;
  font-size: 13px;
  display: block;
  line-height: 1.2;
}

.main-nav button .nav-subtitle {
  font-family: 'SBL Hebrew', serif;
  font-size: 10px;
  display: block;
  margin-top: 2px;
  line-height: 1.2;
}

/* כפתורים בצד שמאל */
.header-buttons {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: 2px;
}

.header-buttons button {
  background-color: #003366;
  color: #FFD700;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.header-buttons button:hover {
  background-color: #FFD700;
  color: #001f3f;
}

/* ============================
   RESPONSIVE - מסכים ממש קטנים
   קטנים עוד יותר עבור פלאפונים ממש קטנים
   ============================ */

/* למסכים ממש קטנים (פלאפון) */
@media (max-width: 480px) {
  .header-top-row {
    padding: 6px;
    gap: 6px;
  }
  
  .header-logo {
    width: 50px;
  }
  
  .header-greeting {
    font-size: 10px;
  }
  
  .header-title h1 {
    font-size: 16px;
  }
  
  .header-title .subtitle,
  .header-title .author {
    font-size: 10px;
  }
  
  .header-buttons button {
    padding: 3px 6px;
    font-size: 10px;
  }
  
  .main-nav button {
    padding: 8px 2px;
    font-size: 11px;
  }
  
  .main-nav button .nav-title {
    font-size: 12px;
  }
  
  .main-nav button .nav-subtitle {
    font-size: 9px;
  }
}
/* ═══════════════════════════════════════════════════════════
   תפריט מחברת - מדף הספרים
   ═══════════════════════════════════════════════════════════ */

/* תפריט משנה של מחברת - שורה נוספת עם 4 כפתורי ספרים */
.mahberet-submenu {
    display: none; /* התפריט מוסתר כברירת מחדל */
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    padding: 0;
    border-top: 2px solid #FFD700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.mahberet-submenu.active {
    display: block; /* מציג כשמוסיפים את class="active" */
}

.mahberet-submenu nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 1px;
    width: 100%;
}

.mahberet-submenu button {
    flex: 1 1 0;
    min-width: 0;
    background-color: #003366;
    color: #FFD700;
    border: 0;
    padding: 12px 8px;
    cursor: pointer;
    font-family: 'SBL Hebrew', serif;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.mahberet-submenu button:hover {
    background-color: #FFD700;
    color: #001f3f;
    transform: translateY(-2px);
}

.mahberet-submenu button:active {
    transform: translateY(0);
}

/* התאמה למובייל */
@media (max-width: 480px) {
    .mahberet-submenu button {
        padding: 10px 4px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════
   פאנל כלי עבודה למאמרים (מחליף את article-toolbar)
   מופיע מתחת ל-header כשורה נוספת
   ═══════════════════════════════════════════════════════════ */

.article-toolbar {
    display: none; /* מוסתר כברירת מחדל */
    background: #003366;
    border-top: 1px solid #FFD700;
    border-bottom: 1px solid #FFD700;
    padding: 4px 8px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 99;
}

.toolbar-btn {
    background: #003366;
    color: #FFD700;
    border: none;
    border-radius: 0;
    padding: 4px 10px;
    font-size: 13px;
    font-family: 'SBL Hebrew', serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toolbar-btn:hover:not(.toolbar-disabled) {
    background: #FFD700;
    color: #003366;
}

.toolbar-btn.toolbar-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-btn.toolbar-en {
    background: #2E8B57;
    color: white;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.toolbar-btn.toolbar-en:hover {
    background: #3BA968;
}

.toolbar-separator {
    width: 1px;
    height: 18px;
    background: rgba(255, 215, 0, 0.3);
    margin: 0 4px;
}

.toolbar-label {
    color: #FFD700;
    font-size: 11px;
    font-family: 'SBL Hebrew', serif;
    opacity: 0.7;
}

/* התאמה למובייל */
@media (max-width: 480px) {
    .article-toolbar {
        padding: 3px 6px;
        gap: 6px;
    }
    
    .toolbar-btn {
        padding: 3px 8px;
        font-size: 12px;
    }
    
    .toolbar-label {
        font-size: 10px;
    }
}
